(()=>{var e,t,n={98090:(e,t,n)=>{"use strict";var s={};n.r(s),n.d(s,{Type:()=>yn,clear:()=>An,fetch:()=>bn,remove:()=>vn,save:()=>wn});var a={};n.r(a),n.d(a,{acceptBotUrlAuth:()=>$i,acceptCall:()=>yo,acceptLinkUrlAuth:()=>Qi,acceptPhoneCall:()=>Qr,addChatMembers:()=>Bs,answerCallbackButton:()=>xi,blockContact:()=>Wo,changeSessionSettings:()=>Do,changeSessionTtl:()=>Eo,checkChatUsername:()=>ui,checkPassword:()=>Ri,checkUsername:()=>qo,clearDraft:()=>Yn,clearPassword:()=>Bi,clearRecentStickers:()=>Xa,closePoll:()=>ua,confirmCall:()=>bo,confirmPhoneCall:()=>Jr,createChannel:()=>es,createGroupCall:()=>co,createGroupChat:()=>os,createPhoneCallState:()=>zr,decodePhoneCallData:()=>$r,deleteChannel:()=>is,deleteChat:()=>ss,deleteChatFolder:()=>ps,deleteChatMember:()=>Us,deleteChatUser:()=>ns,deleteContact:()=>Ha,deleteExportedChatInvite:()=>_i,deleteHistory:()=>ta,deleteMessages:()=>Zs,deleteRevokedExportedChatInvites:()=>yi,deleteScheduledMessages:()=>ea,destroy:()=>Un,destroyPhoneCallState:()=>Wr,discardCall:()=>fo,discardGroupCall:()=>to,disconnect:()=>Dn,downloadMedia:()=>Nn,editChatFolder:()=>gs,editChatPhoto:()=>rs,editExportedChatInvite:()=>hi,editGroupCallParticipant:()=>no,editGroupCallTitle:()=>so,editMessage:()=>$s,encodePhoneCallData:()=>jr,exportChatInvite:()=>mi,exportGroupCallInvite:()=>ao,faveSticker:()=>Ja,fetchAnimatedEmojiEffects:()=>ei,fetchAnimatedEmojis:()=>Za,fetchAppConfig:()=>fr,fetchAuthorizations:()=>$o,fetchBlockedContacts:()=>zo,fetchChannelStatistics:()=>Rr,fetchChat:()=>Jn,fetchChatFolders:()=>ds,fetchChatInviteImporters:()=>bi,fetchChatSettings:()=>jn,fetchChats:()=>zn,fetchCommonChats:()=>Ta,fetchContactList:()=>Na,fetchContentSettings:()=>gr,fetchCountryList:()=>mr,fetchCurrentUser:()=>Ln,fetchEmojiKeywords:()=>ci,fetchExportedChatInvites:()=>fi,fetchFavoriteStickers:()=>ja,fetchFeaturedStickers:()=>$a,fetchFullChat:()=>Wn,fetchFullUser:()=>Ea,fetchGlobalPrivacySettings:()=>_r,fetchGroupCallParticipants:()=>io,fetchGroupStatistics:()=>Br,fetchGroupsForDiscussion:()=>Ps,fetchInlineBot:()=>Ni,fetchInlineBotResults:()=>Fi,fetchLangPack:()=>ir,fetchLangStrings:()=>or,fetchLanguages:()=>ar,fetchMembers:()=>Cs,fetchMessage:()=>Ks,fetchMessagePublicForwards:()=>Dr,fetchMessageReactions:()=>Ir,fetchMessageReactionsList:()=>Sr,fetchMessageStatistics:()=>Ur,fetchMessages:()=>Gs,fetchNearestCountry:()=>xa,fetchNotificationExceptions:()=>er,fetchNotificationSettings:()=>tr,fetchPinnedMessages:()=>ya,fetchPremiumPromo:()=>Ro,fetchPrivacySettings:()=>rr,fetchProfilePhotos:()=>Oa,fetchRecentStickers:()=>Wa,fetchRecommendedChatFolders:()=>us,fetchSavedGifs:()=>ni,fetchScheduledHistory:()=>ha,fetchSeenBy:()=>ba,fetchSendAs:()=>wa,fetchSponsoredMessages:()=>Aa,fetchStatisticsAsyncGraph:()=>Er,fetchStickerSets:()=>za,fetchStickers:()=>Ya,fetchStickersForEmoji:()=>ri,fetchTopInlineBots:()=>Vi,fetchTopUsers:()=>Va,fetchUnreadMentions:()=>Pa,fetchUnreadReactions:()=>Ma,fetchUsers:()=>Fa,fetchWallpapers:()=>Go,fetchWebAuthorizations:()=>Xo,fetchWebPagePreview:()=>la,findFirstMessageIdAfterDate:()=>fa,forwardMessages:()=>pa,getAvailableReactions:()=>vr,getChatByPhoneNumber:()=>hs,getChatByUsername:()=>ms,getDhConfig:()=>po,getGroupCall:()=>eo,getPasswordInfo:()=>Mi,getPaymentForm:()=>Mo,getReceipt:()=>ko,hideAllChatJoinRequests:()=>vi,hideChatJoinRequest:()=>wi,hideChatReportPanel:()=>Ai,importChatInvite:()=>Vs,importContact:()=>qa,installStickerSet:()=>ai,joinChannel:()=>ts,joinGroupCall:()=>ro,joinGroupCallPresentation:()=>lo,leaveChannel:()=>as,leaveGroupCall:()=>oo,leaveGroupCallPresentation:()=>go,loadAttachMenuBots:()=>zi,loadPollOptionResults:()=>ga,markMessageListRead:()=>aa,markMessagesRead:()=>ia,migrateChat:()=>ks,openChatByInvite:()=>Rs,pinMessage:()=>Xs,prolongWebView:()=>Gi,provideAuthCode:()=>ln,provideAuthPassword:()=>dn,provideAuthPhoneNumber:()=>cn,provideAuthRegistration:()=>un,provideRecoveryEmailCode:()=>Ei,readAllMentions:()=>Sa,readAllReactions:()=>Ca,receivedCall:()=>_o,registerDevice:()=>cr,removeRecentSticker:()=>Qa,repairFileReference:()=>On,reportMessages:()=>na,reportPeer:()=>Bo,reportProfilePhoto:()=>Uo,reportSpam:()=>Ga,requestBotUrlAuth:()=>ji,requestCall:()=>ho,requestChatUpdate:()=>Qn,requestLinkUrlAuth:()=>Ji,requestPhoneCall:()=>Xr,requestSimpleWebView:()=>Oi,requestThreadInfoUpdate:()=>oa,requestWebView:()=>Hi,rescheduleMessage:()=>Js,restartAuth:()=>gn,restartAuthWithQr:()=>pn,saveDefaultSendAs:()=>va,saveDraft:()=>Xn,saveGif:()=>si,searchChats:()=>$n,searchGifs:()=>oi,searchMessagesGlobal:()=>ca,searchMessagesLocal:()=>ra,searchStickers:()=>ti,sendEmojiInteraction:()=>wr,sendInlineBotResult:()=>qi,sendMessage:()=>Ws,sendMessageAction:()=>sa,sendPaymentForm:()=>Po,sendPollVote:()=>da,sendReaction:()=>Ar,sendScheduledMessages:()=>ma,sendSignalingData:()=>wo,sendWatchingEmojiInteraction:()=>br,sendWebViewData:()=>Ki,setCallRating:()=>mo,setChatEnabledReactions:()=>Ns,setChatUsername:()=>gi,setDefaultReaction:()=>Cr,setDiscussionGroup:()=>Ms,setPrivacySettings:()=>dr,startBot:()=>Li,terminateAllAuthorizations:()=>Qo,terminateAllWebAuthorizations:()=>Zo,terminateAuthorization:()=>Jo,terminateWebAuthorization:()=>Yo,toggleBotInAttachMenu:()=>Wi,toggleChatArchived:()=>ls,toggleChatPinned:()=>cs,toggleDialogUnread:()=>fs,toggleGroupCallStartSubscription:()=>uo,toggleIsProtected:()=>Fs,toggleJoinRequest:()=>Es,toggleJoinToSend:()=>Ds,togglePreHistoryHidden:()=>ys,toggleSignatures:()=>Ss,transcribeAudio:()=>ka,unblockContact:()=>jo,uninstallStickerSet:()=>ii,unpinAllMessages:()=>Ys,unregisterDevice:()=>lr,updateChatAbout:()=>Is,updateChatAdmin:()=>vs,updateChatDefaultBannedRights:()=>bs,updateChatMemberBannedRights:()=>ws,updateChatMutedState:()=>Zn,updateChatTitle:()=>As,updateContact:()=>La,updateContactSignUpNotification:()=>nr,updateContentSettings:()=>pr,updateGlobalPrivacySettings:()=>yr,updateIsOnline:()=>ur,updateNotificationSettings:()=>sr,updatePassword:()=>Ui,updatePrivateLink:()=>pi,updateProfile:()=>Fo,updateProfilePhoto:()=>Ho,updateRecoveryEmail:()=>Di,updateUsername:()=>Lo,uploadProfilePhoto:()=>Oo,uploadWallpaper:()=>Ko,validateRequestedInfo:()=>Co,viewSponsoredMessage:()=>Ia});const i=("undefined"!=typeof window&&window.innerHeight,Math.round(425)),o=new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),r="video/quicktime",c=new Set(["image/png","image/gif","image/jpeg"]),l=new Set(["video/mp4"]),d=new Set(["audio/mp3","audio/ogg","audio/wav","audio/mpeg","audio/flac","audio/aac","audio/m4a","audio/mp4","audio/x-m4a"]),u=(new Set([...c,...l]),new Set(["AU","BD","CA","CO","EG","HN","IE","IN","JO","MX","MY","NI","NZ","PH","PK","SA","SV","US"]),"777000"),g={uploadMaxFileparts:[4e3,8e3],stickersFaved:[5,10],savedGifs:[200,400],dialogFiltersChats:[100,200],dialogFilters:[10,20],dialogFolderPinned:[5,10],captionLength:[1024,2048],channels:[500,1e3],channelsPublic:[10,20],aboutLength:[70,140]};let p,f;var h=n(13522);function m(e,t){return e.reduce(((e,n)=>(e[n[t]]=n,e)),{})}function _(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}var y=n(48960);function b(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/jpeg";const s=t?"":`data:${n};base64,`;return`${s}${btoa(String.fromCharCode(...e))}`}function w(e){const{flags:t,CONSTRUCTOR_ID:n,SUBCLASS_OF_ID:s,className:a,classType:i,getBytes:o,...r}=e;return r}function v(e,t,n){return''.replace("{{path}}",function(e){let t="M";const n=e.length;for(let s=0;s=192?t+="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"[n-128-64]:(n>=128?t+=",":n>=64&&(t+="-"),t+=String(63&n))}return t+="z",t}(e)).replace("{{width}}",String(t)).replace("{{height}}",String(n))}const A={w:100,h:100};function I(e,t){if(!e||!e.length)return;const n=e.find((e=>e instanceof h.Api.PhotoStrippedSize));if(!n)return;const s=e.filter((e=>e instanceof h.Api.PhotoSize)),{w:a,h:i}=s.length?s[s.length-1]:A,{bytes:o}=n;return{dataUri:b(t&&"image/jpeg"!==t?o:(0,y.strippedPhotoToJpg)(o),void 0,t),width:a,height:i}}function S(e){const t=e.sizes.filter((e=>e instanceof h.Api.PhotoSize||e instanceof h.Api.PhotoSizeProgressive)).map(P);return{id:String(e.id),thumbnail:I(e.sizes),sizes:t,...e.videoSizes&&{videoSizes:e.videoSizes.map(C),isVideo:!0}}}function C(e){const{videoStartTs:t,size:n,h:s,w:a,type:i}=e;return{videoStartTs:t,size:n,height:s,width:a,type:i}}function P(e){const{w:t,h:n,type:s}=e;return{width:t,height:n,type:s}}const M={localMessages:{},chats:{},users:{},messages:{},documents:{},stickerSets:{},photos:{},webDocuments:{}},k=M,R=k;function B(){Object.assign(k,M)}const U="application/x-tgsticker",D="video/webm";function E(e,t){if(e instanceof h.Api.DocumentEmpty)return;const{mimeType:n,videoThumbs:s}=e,a=e.attributes.find((e=>e instanceof h.Api.DocumentAttributeSticker)),i=(n===U||n===D)&&e.attributes.find((e=>e instanceof h.Api.DocumentAttributeFilename));if(!a&&!i)return;const o=n===U,r=n===D,c=e.attributes.find((e=>e instanceof h.Api.DocumentAttributeImageSize)),l=e.attributes.find((e=>e instanceof h.Api.DocumentAttributeVideo)),d=c||l,u=a&&a.stickerset instanceof h.Api.InputStickerSetID?a.stickerset:void 0,g=null==a?void 0:a.alt,p=e.thumbs&&e.thumbs.find((e=>e instanceof h.Api.PhotoCachedSize));if(!(n!==D||self.isWebmSupported||p||e.thumbs&&e.thumbs.find((e=>e instanceof h.Api.PhotoSize))))return;const f=e.thumbs&&e.thumbs.find((e=>e instanceof h.Api.PhotoPathSize)),m=p?function(e){const{w:t,h:n,bytes:s}=e;return{dataUri:b(s,void 0,"image/webp"),width:t,height:n}}(p):f&&d?function(e,t){const{w:n,h:s}=t;return{dataUri:`data:image/svg+xml;utf8,${v(e.bytes,n,s)}`,width:n,height:s}}(f,d):void 0,{w:_,h:y}=p||d||{},w=!t&&(null==s?void 0:s.some((e=>{let{type:t}=e;return"f"===t})));return{id:String(e.id),stickerSetId:u?String(u.id):"NO_STICKER_SET",stickerSetAccessHash:u&&String(u.accessHash),emoji:g,isLottie:o,isVideo:r,width:_,height:y,thumbnail:m,hasEffect:w}}function T(e){const{archived:t,animated:n,installedDate:s,videos:a,id:i,accessHash:o,title:r,thumbs:c,count:l,shortName:d}=e;return{archived:t,isLottie:n,isVideos:a,installedDate:s,id:String(i),accessHash:String(o),title:r,hasThumbnail:Boolean(null==c?void 0:c.length),count:l,shortName:d}}function x(e){const t=T(e.set),n=e instanceof h.Api.StickerSetMultiCovered?e.covers:[e.cover];return t.covers=[],n.forEach((e=>{if(e instanceof h.Api.Document){const n=E(e);n&&(t.covers.push(n),R.documents[String(e.id)]=e)}})),t}function V(e,t){let n=0;const s=new Array(t),a=e.length/t,i=e[0],o=e[e.length-1];for(let d=0;d1&&void 0!==arguments[1]&&arguments[1];const n=z(e.id,"user");!t&&R.users[n]||(R.users[n]=e)}function Y(e){e.forEach((e=>{e instanceof h.Api.User&&e.photo?X(e):(e instanceof h.Api.Chat||e instanceof h.Api.Channel)&&e.photo&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=z(e.id,e instanceof h.Api.Chat?"chat":"channel");t&&R.chats[n]||(R.chats[n]=e)}(e)}))}function Z(e){return String.fromCharCode(...e)}function ee(e){return j.from(e,"binary")}function te(e){return"number"==typeof e?function(e){return e>0?"user":e<=-1e9?"channel":"chat"}(e):e.startsWith("-")?e.length>=11?"channel":"chat":"user"}function ne(e){const t=te(e);return"user"===t?new h.Api.PeerUser({userId:Ae(e,"user")}):"channel"===t?new h.Api.PeerChannel({channelId:Ae(e,"channel")}):new h.Api.PeerChat({chatId:Ae(e,"chat")})}function se(e,t){const n=te(e);return"user"===n?new h.Api.InputPeerUser({userId:Ae(e,"user"),accessHash:F()(t)}):"channel"===n?new h.Api.InputPeerChannel({channelId:Ae(e,"channel"),accessHash:F()(t)}):new h.Api.InputPeerChat({chatId:Ae(e,"chat")})}function ae(e){const t=te(e);let n;var s;if("user"===t){if(n=null===(s=R.users[e])||void 0===s?void 0:s.accessHash,!n)return}else if("channel"===t){var a;if(n=null===(a=R.chats[e])||void 0===a?void 0:a.accessHash,!n)return}return se(e,String(n))}function ie(e,t){const n=te(e);return"user"===n?new h.Api.InputUser({userId:Ae(e,"user"),accessHash:F()(t)}):"channel"===n?new h.Api.InputChannel({channelId:Ae(e,"channel"),accessHash:F()(t)}):Ae(e,"chat")}function oe(e,t){return new h.Api.InputStickerSetID({id:F()(e),accessHash:F()(t)})}function re(e){const t=R.documents[e.id];if(t)return new h.Api.InputDocument(_(t,["id","accessHash","fileReference"]))}function ce(e){const t=re(e);if(t)return new h.Api.InputMediaDocument({id:t})}function le(e){var t,n;let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new h.Api.InputMediaPoll({poll:new h.Api.Poll({id:F()(e.id),publicVoters:e.summary.isPublic,question:e.summary.question,answers:e.summary.answers.map((e=>{let{text:t,option:n}=e;return new h.Api.PollAnswer({text:t,option:ee(n)})})),quiz:e.summary.quiz,multipleChoice:e.summary.multipleChoice,closeDate:e.summary.closeDate,closePeriod:e.summary.closePeriod,closed:!!s||e.summary.closed}),correctAnswers:null===(t=e.results.results)||void 0===t?void 0:t.filter((e=>e.isCorrect)).map((e=>ee(e.option))),solution:e.results.solution,solutionEntities:null===(n=e.results.solutionEntities)||void 0===n?void 0:n.map(pe)})}function de(){return(0,q.readBigIntFromBuffer)((0,q.generateRandomBytes)(8),!0,!0)}function ue(){return(0,q.readBigIntFromBuffer)((0,q.generateRandomBytes)(4),!0,!0).toJSNumber()}function ge(e,t,n){return new h.Api.Message({id:e,peerId:ne(t),fromId:ne(t),media:n.media})}function pe(e){const{type:t,offset:n,length:s,url:a,userId:i,language:o}=e,r=i?R.users[i]:void 0;switch(t){case H.Bold:return new h.Api.MessageEntityBold({offset:n,length:s});case H.Italic:return new h.Api.MessageEntityItalic({offset:n,length:s});case H.Underline:return new h.Api.MessageEntityUnderline({offset:n,length:s});case H.Strike:return new h.Api.MessageEntityStrike({offset:n,length:s});case H.Code:return new h.Api.MessageEntityCode({offset:n,length:s});case H.Pre:return new h.Api.MessageEntityPre({offset:n,length:s,language:o||""});case H.Blockquote:return new h.Api.MessageEntityBlockquote({offset:n,length:s});case H.TextUrl:return new h.Api.MessageEntityTextUrl({offset:n,length:s,url:a});case H.Url:return new h.Api.MessageEntityUrl({offset:n,length:s});case H.Hashtag:return new h.Api.MessageEntityHashtag({offset:n,length:s});case H.MentionName:return new h.Api.InputMessageEntityMentionName({offset:n,length:s,userId:new h.Api.InputUser({userId:F()(i),accessHash:r.accessHash})});case H.Spoiler:return new h.Api.MessageEntitySpoiler({offset:n,length:s});default:return new h.Api.MessageEntityUnknown({offset:n,length:s})}}function fe(e){const{media:t}=e;return!!t&&(t instanceof h.Api.MessageMediaPhoto||t instanceof h.Api.MessageMediaDocument||t instanceof h.Api.MessageMediaWebPage&&t.webpage instanceof h.Api.WebPage&&(t.webpage.photo instanceof h.Api.Photo||t.webpage.document instanceof h.Api.Document&&t.webpage.document.mimeType.startsWith("video"))||t instanceof h.Api.MessageMediaGame&&(t.game.document instanceof h.Api.Document||t.game.photo instanceof h.Api.Photo)||t instanceof h.Api.MessageMediaInvoice&&t.photo)}function he(e){let{phone:t,firstName:n,lastName:s}=e;return new h.Api.InputPhoneContact({clientId:F()(1),phone:t,firstName:n,lastName:s})}function me(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new h.Api.ChatBannedRights({...e,untilDate:t})}function _e(e){return new h.Api.ChatAdminRights(e)}function ye(e){const{shippingAddress:t}=e;return new h.Api.PaymentRequestedInfo({...e,shippingAddress:t?new h.Api.PostAddress(t):void 0})}function be(e){switch(e){case"phoneNumber":return new h.Api.InputPrivacyKeyPhoneNumber;case"lastSeen":return new h.Api.InputPrivacyKeyStatusTimestamp;case"profilePhoto":return new h.Api.InputPrivacyKeyProfilePhoto;case"forwards":return new h.Api.InputPrivacyKeyForwards;case"chatInvite":return new h.Api.InputPrivacyKeyChatInvite;case"phoneCall":return new h.Api.InputPrivacyKeyPhoneCall;case"phoneP2P":return new h.Api.InputPrivacyKeyPhoneP2P}}function we(e){switch(e){case"spam":return new h.Api.InputReportReasonSpam;case"violence":return new h.Api.InputReportReasonViolence;case"childAbuse":return new h.Api.InputReportReasonChildAbuse;case"pornography":return new h.Api.InputReportReasonPornography;case"copyright":return new h.Api.InputReportReasonCopyright;case"fake":return new h.Api.InputReportReasonFake;case"geoIrrelevant":return new h.Api.InputReportReasonGeoIrrelevant;case"illegalDrugs":return new h.Api.InputReportReasonIllegalDrugs;case"personalDetails":return new h.Api.InputReportReasonPersonalDetails;case"other":return new h.Api.InputReportReasonOther}}function ve(e){return new h.Api.DataJSON({data:JSON.stringify(e)})}function Ae(e,t){return"number"==typeof e?F()(Math.abs(e)):"user"===t?F()(e):F()(e.slice(1))}function Ie(e){return new h.Api.InputGroupCall({id:F()(e.id),accessHash:F()(e.accessHash)})}function Se(e){let{id:t,accessHash:n}=e;return new h.Api.InputPhoneCall({id:F()(t),accessHash:F()(n)})}function Ce(e){return"slug"in e?new h.Api.InputInvoiceSlug({slug:e.slug}):new h.Api.InputInvoiceMessage({peer:se(e.chat.id,e.chat.accessHash),msgId:e.messageId})}function Pe(e){const{self:t,min:n,about:s,date:a,versioned:i,canSelfUnmute:o,justJoined:r,left:c,muted:l,mutedByYou:d,source:u,volume:g,volumeByAdmin:p,videoJoined:f,peer:h,video:m,presentation:_,raiseHandRating:y}=e;return{isSelf:t,isMin:n,canSelfUnmute:o,isLeft:c,isMuted:l,isMutedByMe:d,hasJustJoined:r,isVolumeByAdmin:p,isVersioned:i,isVideoJoined:f,about:s,source:u,raiseHandRating:null==y?void 0:y.toString(),volume:g,date:new Date(a),isUser:G(h),id:W(h),video:m?Me(m):void 0,presentation:_?Me(_):void 0}}function Me(e){const{audioSource:t,endpoint:n,paused:s,sourceGroups:a}=e;return{audioSource:t,endpoint:n,isPaused:s,sourceGroups:a.map(ke)}}function ke(e){return{semantics:e.semantics,sources:e.sources}}function Re(e){const{id:t,accessHash:n}=e;if(e instanceof h.Api.GroupCallDiscarded)return{connectionState:"discarded",id:t.toString(),accessHash:n.toString(),participantsCount:0,version:0,participants:{}};const{version:s,participantsCount:a,streamDcId:i,scheduleDate:o,canChangeJoinMuted:r,joinMuted:c,canStartVideo:l,scheduleStartSubscribed:d}=e;return{connectionState:"disconnected",isLoaded:!0,id:t.toString(),accessHash:n.toString(),version:s,participantsCount:a,streamDcId:i,scheduleDate:o,canChangeJoinMuted:r,joinMuted:c,canStartVideo:l,scheduleStartSubscribed:d,participants:{}}}function Be(e){const{id:t}=e;let n={id:t.toString()};if(e instanceof h.Api.PhoneCallAccepted||e instanceof h.Api.PhoneCallWaiting||e instanceof h.Api.PhoneCall||e instanceof h.Api.PhoneCallRequested){const{accessHash:t,adminId:s,date:a,video:i,participantId:o,protocol:r}=e;n={...n,accessHash:t.toString(),adminId:s.toString(),participantId:o.toString(),date:a,isVideo:i,protocol:Ee(r)}}if(e instanceof h.Api.PhoneCall){const{p2pAllowed:t,gAOrB:s,keyFingerprint:a,connections:i,startDate:o}=e;n={...n,state:"active",gAOrB:Array.from(s),keyFingerprint:a.toString(),startDate:o,p2pAllowed:t,connections:i.map(De).filter(Boolean)}}return e instanceof h.Api.PhoneCallDiscarded&&(n={...n,state:"discarded",duration:e.duration,reason:Ue(e.reason),needRating:e.needRating,needDebug:e.needDebug}),e instanceof h.Api.PhoneCallWaiting&&(n={...n,state:"waiting",receiveDate:e.receiveDate}),e instanceof h.Api.PhoneCallAccepted&&(n={...n,state:"accepted",gB:Array.from(e.gB)}),e instanceof h.Api.PhoneCallRequested&&(n={...n,state:"requested",gAHash:Array.from(e.gAHash)}),n}function Ue(e){return e instanceof h.Api.PhoneCallDiscardReasonMissed?"missed":e instanceof h.Api.PhoneCallDiscardReasonBusy?"busy":e instanceof h.Api.PhoneCallDiscardReasonHangup?"hangup":"disconnect"}function De(e){if(e instanceof h.Api.PhoneConnectionWebrtc){const{username:t,password:n,turn:s,stun:a,ip:i,ipv6:o,port:r}=e;return{username:t,password:n,isTurn:s,isStun:a,ip:i,ipv6:o,port:r}}}function Ee(e){const{libraryVersions:t,minLayer:n,maxLayer:s,udpP2p:a,udpReflector:i}=e;return{libraryVersions:t,minLayer:n,maxLayer:s,isUdpP2p:a,isUdpReflector:i}}function Te(){return new h.Api.PhoneCallProtocol({libraryVersions:["4.0.0"],minLayer:92,maxLayer:92,udpReflector:!0,udpP2p:!0})}const xe="temp";let Ve=0;const Ne=()=>parseFloat(`${Date.now()}.${Ve++}`);let Fe;function qe(e){const{fromId:t,message:n,entities:s,startParam:a,channelPost:i,chatInvite:o,chatInviteHash:r,randomId:c,recommended:l}=e,d=t?W(t):void 0,u=o?o instanceof h.Api.ChatInvite?o.title:o.chat instanceof h.Api.ChatEmpty?void 0:o.chat.title:void 0;return{randomId:Z(c),isBot:!!t&&G(t),text:je(n,s),expiresAt:Math.round(Date.now()/1e3)+3e5,isRecommended:Boolean(l),...d&&{chatId:d},...r&&{chatInviteHash:r},...o&&{chatInviteTitle:u},...a&&{startParam:a},...i&&{channelPostId:i}}}function Le(e){const t=$(e);if(t&&(e instanceof h.Api.Message||e instanceof h.Api.MessageService))return He(t,e)}function He(e,t){const n=t.fromId?W(t.fromId):void 0,s=t.peerId?W(t.peerId):void 0,a=!n&&e===Fe,i=t.out&&!t.post||a&&!t.fwdFrom,o=We(t),r=t.action&&function(e,t,n,s,a){if(e instanceof h.Api.MessageActionEmpty)return;let i,o,r,c,l;const d=[];let u,g,p="other";const f="users"in e?e.users&&e.users.map((e=>z(e,"user"))):"userId"in e&&[z(e.userId,"user")]||[];let m;if(e instanceof h.Api.MessageActionChatCreate)l="Notification.CreatedChatWithTitle",d.push("%action_origin%",e.title),p="chatCreate";else if(e instanceof h.Api.MessageActionChatEditTitle)s?(l="Channel.MessageTitleUpdated",d.push(e.title)):(l="Notification.ChangedGroupName",d.push("%action_origin%",e.title));else if(e instanceof h.Api.MessageActionChatEditPhoto)s?l="Channel.MessagePhotoUpdated":(l="Notification.ChangedGroupPhoto",d.push("%action_origin%"));else if(e instanceof h.Api.MessageActionChatDeletePhoto)l=s?"Channel.MessagePhotoRemoved":"Group.MessagePhotoRemoved";else if(e instanceof h.Api.MessageActionChatAddUser)!t||f.includes(t)?(l="Notification.JoinedChat",d.push("%target_user%")):(l="Notification.Invited",d.push("%action_origin%","%target_user%"));else if(e instanceof h.Api.MessageActionChatDeleteUser)!t||f.includes(t)?(l="Notification.LeftChat",d.push("%target_user%")):(l="Notification.Kicked",d.push("%action_origin%","%target_user%"));else if(e instanceof h.Api.MessageActionChatJoinedByLink)l="Notification.JoinedGroupByLink",d.push("%action_origin%");else if(e instanceof h.Api.MessageActionChannelCreate)l="Notification.CreatedChannel";else if(e instanceof h.Api.MessageActionChatMigrateTo)m=W(e),l="Migrated to %target_chat%",d.push("%target_chat%");else if(e instanceof h.Api.MessageActionChannelMigrateFrom)m=W(e),l="Migrated from %target_chat%",d.push("%target_chat%");else if(e instanceof h.Api.MessageActionPinMessage)l="Chat.Service.Group.UpdatedPinnedMessage1",d.push("%action_origin%","%message%");else if(e instanceof h.Api.MessageActionHistoryClear)l="HistoryCleared",p="historyClear";else if(e instanceof h.Api.MessageActionPhoneCall){const t=Boolean(e.duration);if(l=[t?"ChatList.Service":"Chat",e.video?"VideoCall":"Call",a?t?"outgoing":"Outgoing":t?"incoming":"Incoming"].join("."),t){const t=Math.max(Math.round(e.duration/60),1);d.push(`${t} min${t>1?"s":""}`)}i={isOutgoing:a,isVideo:e.video,duration:e.duration,reason:Ue(e.reason)}}else if(e instanceof h.Api.MessageActionInviteToGroupCall)l="Notification.VoiceChatInvitation",o={id:e.call.id.toString(),accessHash:e.call.accessHash.toString()},d.push("%action_origin%","%target_user%");else if(e instanceof h.Api.MessageActionContactSignUp)l="Notification.Joined",d.push("%action_origin%"),p="contactSignUp";else if(e instanceof h.Api.MessageActionPaymentSent)r=Number(e.totalAmount),c=e.currency,l="PaymentSuccessfullyPaid",n&&f.push(n),d.push("%payment_amount%","%target_user%","%product%");else if(e instanceof h.Api.MessageActionGroupCall)if(e.duration){const t=Math.max(Math.round(e.duration/60),1);l="Notification.VoiceChatEnded",d.push(`${t} min${t>1?"s":""}`)}else l="Notification.VoiceChatStartedChannel",o={id:e.call.id.toString(),accessHash:e.call.accessHash.toString()};else e instanceof h.Api.MessageActionBotAllowed?(l="Chat.Service.BotPermissionAllowed",d.push(e.domain)):e instanceof h.Api.MessageActionCustomAction?l=e.message:e instanceof h.Api.MessageActionChatJoinedByRequest?(l="ChatService.UserJoinedGroupByRequest",d.push("%action_origin%")):e instanceof h.Api.MessageActionGameScore?(l=t===Fe?"ActionYouScoredInGame":"ActionUserScoredInGame",d.push("%score%"),g=e.score):e instanceof h.Api.MessageActionWebViewDataSent?(l="Notification.WebAppSentData",d.push(e.text)):l="ChatList.UnsupportedMessage";return"photo"in e&&e.photo instanceof h.Api.Photo&&(Q(e.photo),u=S(e.photo)),{text:l,type:p,targetUserIds:f,targetChatId:m,photo:u,amount:r,currency:c,translationValues:d,call:o,phoneCall:i,score:g}}(t.action,n,s,Boolean(t.post),i);r&&(o.action=r);const{replyToMsgId:c,replyToTopId:l,replyToPeerId:d}=t.replyTo||{},u=t.editDate&&!t.editHide,{inlineButtons:g,keyboardButtons:p,keyboardPlaceholder:f,isKeyboardSingleUse:m}=function(e){const{replyMarkup:t,media:n}=e;if(!t)return n instanceof h.Api.MessageMediaWebPage&&n.webpage instanceof h.Api.WebPage&&"telegram_message"===n.webpage.type?{inlineButtons:[[{type:"url",text:"Show Message",url:n.webpage.url}]]}:void 0;if(!(t instanceof h.Api.ReplyKeyboardMarkup||t instanceof h.Api.ReplyInlineMarkup))return;const s=t.rows.map((e=>{let{buttons:t}=e;return t.map((e=>{const{text:t}=e;return e instanceof h.Api.KeyboardButton?{type:"command",text:t}:e instanceof h.Api.KeyboardButtonUrl?e.url.includes("?startgroup=")?{type:"unsupported",text:t}:{type:"url",text:t,url:e.url}:e instanceof h.Api.KeyboardButtonCallback?e.requiresPassword?{type:"unsupported",text:t}:{type:"callback",text:t,data:Z(e.data)}:e instanceof h.Api.KeyboardButtonRequestPoll?{type:"requestPoll",text:t,isQuiz:e.quiz}:e instanceof h.Api.KeyboardButtonRequestPhone?{type:"requestPhone",text:t}:e instanceof h.Api.KeyboardButtonBuy?n instanceof h.Api.MessageMediaInvoice&&n.receiptMsgId?{type:"receipt",text:"PaymentReceipt",receiptMessageId:n.receiptMsgId}:{type:"buy",text:t}:e instanceof h.Api.KeyboardButtonGame?{type:"game",text:t}:e instanceof h.Api.KeyboardButtonSwitchInline?{type:"switchBotInline",text:t,query:e.query,isSamePeer:e.samePeer}:e instanceof h.Api.KeyboardButtonUserProfile?{type:"userProfile",text:t,userId:e.userId.toString()}:e instanceof h.Api.KeyboardButtonSimpleWebView?{type:"simpleWebView",text:t,url:e.url}:e instanceof h.Api.KeyboardButtonWebView?{type:"webView",text:t,url:e.url}:e instanceof h.Api.KeyboardButtonUrlAuth?{type:"urlAuth",text:t,url:e.url,buttonId:e.buttonId}:{type:"unsupported",text:t}}))}));return{[t instanceof h.Api.ReplyKeyboardMarkup?"keyboardButtons":"inlineButtons"]:s,...t instanceof h.Api.ReplyKeyboardMarkup&&{keyboardPlaceholder:t.placeholder,isKeyboardSingleUse:t.singleUse}}}(t)||{},_=t.fwdFrom&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.savedFromPeer&&W(e.savedFromPeer),s=e.fromId&&W(e.fromId);return{date:e.date,isChannelPost:Boolean(e.channelPost),channelPostId:e.channelPost,isLinkedChannelPost:Boolean(e.channelPost&&n&&!t),fromChatId:n||s,fromMessageId:e.savedFromMsgId||e.channelPost,senderUserId:s,hiddenUserName:e.fromName,adminTitle:e.postAuthor}}(t.fwdFrom,a),{replies:y,mediaUnread:b,postAuthor:w}=t,v=t.groupedId&&String(t.groupedId),A=Boolean(v)&&!(o.document||o.audio||o.sticker),I=t.replyMarkup instanceof h.Api.ReplyKeyboardHide;return{id:t.id,chatId:e,isOutgoing:i,content:o,date:t.date,senderId:n||t.out&&t.post&&Fe||e,views:t.views,forwards:t.forwards,isFromScheduled:t.fromScheduled,reactions:t.reactions&&Oe(t.reactions),...c&&{replyToMessageId:c},...d&&{replyToChatId:W(d)},...l&&{replyToTopMessageId:l},..._&&{forwardInfo:_},...u&&{isEdited:u},...t.editDate&&{editDate:t.editDate},...b&&{isMediaUnread:b},...t.mentioned&&b&&{hasUnreadMention:!0},...t.mentioned&&{isMentioned:!0},...v&&{groupedId:v,isInAlbum:A},inlineButtons:g,...p&&{keyboardButtons:p,keyboardPlaceholder:f,isKeyboardSingleUse:m},...I&&{shouldHideKeyboardButtons:I},...t.viaBotId&&{viaBotId:z(t.viaBotId,"user")},...(null==y?void 0:y.comments)&&{threadInfo:rt(y,t.id,e)},...w&&{adminTitle:w},...t.noforwards&&{isProtected:!0}}}function Oe(e){const{recentReactions:t,results:n,canSeeList:s}=e;return{canSeeList:s,results:n.map(Ge),recentReactions:null==t?void 0:t.map(Ke)}}function Ge(e){const{chosen:t,count:n,reaction:s}=e;return{isChosen:t,count:n,reaction:s}}function Ke(e){const{peerId:t,reaction:n,big:s,unread:a}=e;return{userId:W(t),reaction:n,isUnread:a,isBig:s}}function ze(e){const{selectAnimation:t,staticIcon:n,reaction:s,title:a,inactive:i,aroundAnimation:o,centerIcon:r,effectAnimation:c,activateAnimation:l,premium:d}=e;return{selectAnimation:Xe(t),activateAnimation:Xe(l),effectAnimation:Xe(c),staticIcon:Xe(n),aroundAnimation:o?Xe(o):void 0,centerIcon:r?Xe(r):void 0,reaction:s,title:a,isInactive:i,isPremium:d}}function We(e){var t;let n={};e.media&&(n={...Je(e.media)});const s=e.media instanceof h.Api.MessageMediaUnsupported;return!e.message||s||n.sticker||n.poll||n.contact||null!==(t=n.video)&&void 0!==t&&t.isRound||(n={...n,text:je(e.message,e.entities)}),n}function je(e,t){return{text:e,...t&&{entities:t.map(ot)}}}function $e(e){if(e instanceof h.Api.DraftMessageEmpty)return;const{message:t,entities:n,replyToMsgId:s,date:a}=e;return{formattedText:t?je(t,n):void 0,replyingToId:s,date:a}}function Je(e){if("ttlSeconds"in e&&e.ttlSeconds)return;const t=function(e){if(e instanceof h.Api.MessageMediaDocument&&e.document&&e.document instanceof h.Api.Document)return E(e.document,e.nopremium)}(e);if(t)return{sticker:t};const n=function(e){if(e instanceof h.Api.MessageMediaPhoto&&e.photo&&e.photo instanceof h.Api.Photo)return S(e.photo)}(e);if(n)return{photo:n};const s=function(e){if(e instanceof h.Api.MessageMediaDocument&&e.document instanceof h.Api.Document&&e.document.mimeType.startsWith("video"))return Qe(e.document)}(e);if(s)return{video:s};const a=function(e){if(!(e instanceof h.Api.MessageMediaDocument&&e.document&&e.document instanceof h.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof h.Api.DocumentAttributeAudio));if(!t||t.voice)return;const n=e.document.thumbs&&e.document.thumbs.filter((e=>e instanceof h.Api.PhotoSize)).map((e=>P(e)));return{id:String(e.document.id),fileName:nt(e.document,"audio"),thumbnailSizes:n,size:e.document.size.toJSNumber(),..._(e.document,["mimeType"]),..._(t,["duration","performer","title"])}}(e);if(a)return{audio:a};const i=function(e){if(!(e instanceof h.Api.MessageMediaDocument&&e.document&&e.document instanceof h.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof h.Api.DocumentAttributeAudio));if(!t||!t.voice)return;const{duration:n,waveform:s}=t;return{id:String(e.document.id),duration:n,waveform:s?Array.from(s):void 0}}(e);if(i)return{voice:i};const o=function(e){if(e instanceof h.Api.MessageMediaDocument&&e.document)return Xe(e.document)}(e);if(o)return{document:o};const r=function(e){if(!(e instanceof h.Api.MessageMediaContact))return;const{firstName:t,lastName:n,phoneNumber:s,userId:a}=e;return{firstName:t,lastName:n,phoneNumber:s,userId:z(a,"user")}}(e);if(r)return{contact:r};const c=function(e){if(e instanceof h.Api.MessageMediaPoll)return Ze(e.poll,e.results)}(e);if(c)return{poll:c};const l=tt(e);if(l)return{webPage:l};const d=function(e){if(e instanceof h.Api.MessageMediaInvoice)return function(e){const{description:t,title:n,photo:s,test:a,totalAmount:i,currency:o,receiptMsgId:r}=e;return{text:t,title:n,photo:at(s),receiptMsgId:r,amount:Number(i),currency:o,isTest:a}}(e)}(e);if(d)return{invoice:d};const u=function(e){return e instanceof h.Api.MessageMediaGeo?function(e){const t=Ye(e.geo);return t&&{type:"geo",geo:t}}(e):e instanceof h.Api.MessageMediaVenue?function(e){const{geo:t,title:n,provider:s,address:a,venueId:i,venueType:o}=e,r=Ye(t);return r&&{type:"venue",geo:r,title:n,provider:s,address:a,venueId:i,venueType:o}}(e):e instanceof h.Api.MessageMediaGeoLive?function(e){const{geo:t,period:n,heading:s}=e,a=Ye(t);return a&&{type:"geoLive",geo:a,period:n,heading:s}}(e):void 0}(e);if(u)return{location:u};const g=function(e){if(e instanceof h.Api.MessageMediaGame)return function(e){const{id:t,accessHash:n,shortName:s,title:a,description:i,photo:o,document:r}=e.game,c=o instanceof h.Api.Photo?S(o):void 0,l=r instanceof h.Api.Document?Xe(r):void 0;return{id:t.toString(),accessHash:n.toString(),shortName:s,title:a,description:i,photo:c,document:l}}(e)}(e);return g?{game:g}:void 0}function Qe(e){if(e instanceof h.Api.DocumentEmpty)return;const{id:t,mimeType:n,thumbs:s,size:a,attributes:i}=e;if("video/webm"===n&&!self.isWebmSupported)return;if(n===r&&!self.isMovSupported)return;const o=i.find((e=>e instanceof h.Api.DocumentAttributeVideo));if(!o)return;const c=i.find((e=>e instanceof h.Api.DocumentAttributeAnimated)),{duration:l,w:d,h:u,supportsStreaming:g=!1,roundMessage:p=!1}=o;return{id:String(t),mimeType:n,duration:l,fileName:nt(e,"video"),width:d,height:u,supportsStreaming:g,isRound:p,isGif:Boolean(c),thumbnail:I(s),size:a.toJSNumber()}}function Xe(e){if(!(e instanceof h.Api.Document))return;const{id:t,size:n,mimeType:s,date:a,thumbs:i,attributes:o}=e,r=i&&I(i);let d,u;const g=i&&i.find((e=>e instanceof h.Api.PhotoSize));if(g)if(u={width:g.w,height:g.h},c.has(s)){d="photo";const e=o.find((e=>e instanceof h.Api.DocumentAttributeImageSize));if(e){const{w:t,h:n}=e;u={width:t,height:n}}}else if(l.has(s)){d="video";const e=o.find((e=>e instanceof h.Api.DocumentAttributeVideo));if(e){const{w:t,h:n}=e;u={width:t,height:n}}}return{id:String(t),size:n.toJSNumber(),mimeType:s,timestamp:a,fileName:nt(e),thumbnail:r,mediaType:d,mediaSize:u}}function Ye(e){if(e instanceof h.Api.GeoPointEmpty)return;const{long:t,lat:n,accuracyRadius:s,accessHash:a}=e;return{long:t,lat:n,accessHash:a.toString(),accuracyRadius:s}}function Ze(e,t){const{id:n,answers:s}=e,a=s.map((e=>({text:e.text,option:Z(e.option)})));return{id:String(n),summary:{isPublic:e.publicVoters,..._(e,["closed","multipleChoice","quiz","question","closePeriod","closeDate"]),answers:a},results:et(t)}}function et(e){const{results:t,totalVoters:n,recentVoters:s,solution:a,solutionEntities:i,min:o}=e,r=t&&t.map((e=>{let{option:t,chosen:n,correct:s,voters:a}=e;return{isChosen:n,isCorrect:s,option:Z(t),votersCount:a}}));return{isMin:o,totalVoters:n,recentVoterIds:null==s?void 0:s.map((e=>z(e,"user"))),results:r,solution:a,...i&&{solutionEntities:i.map(ot)}}}function tt(e){if(!(e instanceof h.Api.MessageMediaWebPage&&e.webpage instanceof h.Api.WebPage))return;const{id:t,photo:n,document:s}=e.webpage;let a;return s instanceof h.Api.Document&&s.mimeType.startsWith("video/")&&(a=Qe(s)),{id:Number(t),..._(e.webpage,["url","displayUrl","type","siteName","title","description","duration"]),photo:n instanceof h.Api.Photo?S(n):void 0,document:!a&&s?Xe(s):void 0,video:a}}function nt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file";const{mimeType:n,attributes:s}=e,a=s.find((e=>e instanceof h.Api.DocumentAttributeFilename));if(a)return a.fileName;const i=n.split("/")[1];return`${t}${String(e.id)}.${i}`}function st(e){const{filename:t,blobUrl:n,previewBlobUrl:s,mimeType:a,size:i}=e;if(e.quick){if(c.has(a)){const{width:t,height:s}=e.quick;return{photo:{id:xe,sizes:[],thumbnail:{width:t,height:s,dataUri:""},blobUrl:n}}}if(l.has(a)){const{width:o,height:r,duration:c}=e.quick;return{video:{id:xe,mimeType:a,duration:c||0,fileName:t,width:o,height:r,blobUrl:n,...s&&{thumbnail:{width:o,height:r,dataUri:s}},size:i}}}}if(e.voice){const{duration:t,waveform:n}=e.voice,{data:s}=V(n,63);return{voice:{id:xe,duration:t,waveform:s}}}if(d.has(a)){const{duration:n,performer:s,title:o}=e.audio||{};return{audio:{id:xe,mimeType:a,fileName:t,size:i,duration:n||0,title:o,performer:s}}}return{document:{mimeType:a,fileName:t,size:i,...s&&{previewBlobUrl:s}}}}function at(e){if(!e)return;const{url:t,size:n,mimeType:s}=e,a=e instanceof h.Api.WebDocument?e.accessHash.toString():void 0,i=e.attributes.find((e=>e instanceof h.Api.DocumentAttributeImageSize));return{url:t,accessHash:a,size:n,mimeType:s,dimensions:i&&{width:i.w,height:i.h}}}function it(e,t){return{poll:{id:String(t),summary:_(e.summary,["question","answers"]),results:{}}}}function ot(e){const{className:t,offset:n,length:s}=e;return{type:t,offset:n,length:s,...e instanceof h.Api.MessageEntityMentionName&&{userId:z(e.userId,"user")},..."url"in e&&{url:e.url},..."language"in e&&{language:e.language}}}function rt(e,t,n){const{channelId:s,replies:a,maxId:i,readMaxId:o,recentRepliers:r}=e;if(!s)return;const c=z(s,"channel");return"-777"!==c?{threadId:t,...n!==c?{chatId:c,originChannelId:n}:{chatId:n},messagesCount:a,lastMessageId:i,lastReadInboxMessageId:o,...r&&{recentReplierIds:r.map(W)}}:void 0}const ct=e=>Math.floor(Date.now()/1e3)+e;function lt(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Boolean("min"in e&&e.min),s="accessHash"in e&&String(e.accessHash),a="photo"in e&&e.photo&&"hasVideo"in e.photo&&e.photo.hasVideo,i="photo"in e&&e.photo&&bt(e.photo),o=Boolean("signatures"in e&&e.signatures),r=Boolean("hasLink"in e&&e.hasLink),c=Boolean("scam"in e&&e.scam),l=Boolean("fake"in e&&e.fake),d=Boolean("joinToSend"in e&&e.joinToSend),u=Boolean("joinRequest"in e&&e.joinRequest);return{isMin:n,hasPrivateLink:r,isSignaturesShown:o,...s&&{accessHash:s},hasVideoAvatar:a,...i&&{avatarHash:i},...(e instanceof h.Api.Channel||e instanceof h.Api.User)&&{username:e.username},..."verified"in e&&{isVerified:e.verified},..."callActive"in e&&{isCallActive:e.callActive},..."callNotEmpty"in e&&{isCallNotEmpty:e.callNotEmpty},...(e instanceof h.Api.Chat||e instanceof h.Api.Channel)&&{...e.participantsCount&&{membersCount:e.participantsCount},joinDate:e.date},...(e instanceof h.Api.Chat||e instanceof h.Api.Channel)&&{isProtected:Boolean("noforwards"in e&&e.noforwards)},...t&&{isSupport:!0},...ut(e),..."creator"in e&&{isCreator:e.creator},...gt(e),...pt(e),fakeType:c?"scam":l?"fake":void 0,isJoinToSend:d,isJoinRequest:u}}function dt(e,t,n){const{peer:s,folderId:a,unreadMark:i,unreadCount:o,unreadMentionsCount:r,unreadReactionsCount:c,notifySettings:{silent:l,muteUntil:d},readOutboxMaxId:u,readInboxMaxId:g,draft:p}=e,f=l||"number"==typeof d&&ct(n){let{platform:t}=e;return"all"===t}));return t?_(t,["reason","text"]):void 0}(e.restrictionReason):void 0;n&&Object.assign(t,{isRestricted:!0,restrictionReason:n})}return e instanceof h.Api.Chat&&Object.assign(t,{isNotJoined:e.left}),e instanceof h.Api.Channel&&Object.assign(t,{isNotJoined:e.left}),t}function pt(e){return e instanceof h.Api.Chat&&e.migratedTo&&!(e.migratedTo instanceof h.Api.InputChannelEmpty)?{migratedTo:{chatId:W(e.migratedTo),...e.migratedTo instanceof h.Api.InputChannel&&{accessHash:String(e.migratedTo.accessHash)}}}:{}}function ft(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e instanceof h.Api.Chat||e instanceof h.Api.Channel||e instanceof h.Api.User||n&&(e instanceof h.Api.ChatForbidden||e instanceof h.Api.ChannelForbidden))return{id:z(e.id,e instanceof h.Api.User?"user":"chat"),type:ht(e),title:e instanceof h.Api.User?yt(e):e.title,...lt(e,t)}}function ht(e){return e instanceof h.Api.User||e instanceof h.Api.UserEmpty?"chatTypePrivate":e instanceof h.Api.Chat||e instanceof h.Api.ChatForbidden||e instanceof h.Api.ChatEmpty?"chatTypeBasicGroup":e.megagroup?"chatTypeSuperGroup":"chatTypeChannel"}function mt(e){return G(e)?`user${e.userId}`:K(e)?`chat${e.chatId}`:`chat${e.channelId}`}function _t(e,t){return G(e)?yt(t):t.title}function yt(e){return e.firstName?`${e.firstName}${e.lastName?` ${e.lastName}`:""}`:e.lastName||void 0}function bt(e){if("photoId"in e)return String(e.photoId)}function wt(e){return{userId:e instanceof h.Api.ChannelParticipantBanned||e instanceof h.Api.ChannelParticipantLeft?W(e.peer):z(e.userId,"user"),inviterId:"inviterId"in e?z(e.inviterId,"user"):void 0,joinedDate:"date"in e?e.date:void 0,kickedByUserId:"kickedBy"in e?z(e.kickedBy,"user"):void 0,promotedByUserId:"promotedBy"in e?z(e.promotedBy,"user"):void 0,bannedRights:"bannedRights"in e?w(e.bannedRights):void 0,adminRights:"adminRights"in e?w(e.adminRights):void 0,customTitle:"rank"in e?e.rank:void 0,...(e instanceof h.Api.ChannelParticipantAdmin||e instanceof h.Api.ChatParticipantAdmin)&&{isAdmin:!0},...(e instanceof h.Api.ChannelParticipantCreator||e instanceof h.Api.ChatParticipantCreator)&&{isOwner:!0}}}function vt(e){return e instanceof h.Api.ChatParticipants||e instanceof h.Api.channels.ChannelParticipants?e.participants.map(wt).filter(Boolean):void 0}function At(e,t){let n,s="";if(!(e.action instanceof h.Api.SendMessageCancelAction)){if(e.action instanceof h.Api.SendMessageTypingAction)s="lng_user_typing";else if(e.action instanceof h.Api.SendMessageRecordVideoAction)s="lng_send_action_record_video";else if(e.action instanceof h.Api.SendMessageUploadVideoAction)s="lng_send_action_upload_video";else if(e.action instanceof h.Api.SendMessageRecordAudioAction)s="lng_send_action_record_audio";else if(e.action instanceof h.Api.SendMessageUploadAudioAction)s="lng_send_action_upload_audio";else if(e.action instanceof h.Api.SendMessageUploadPhotoAction)s="lng_send_action_upload_photo";else if(e.action instanceof h.Api.SendMessageUploadDocumentAction)s="lng_send_action_upload_file";else if(e.action instanceof h.Api.SendMessageGeoLocationAction)s="selecting a location to share";else if(e.action instanceof h.Api.SendMessageChooseContactAction)s="selecting a contact to share";else if(e.action instanceof h.Api.SendMessageGamePlayAction)s="lng_playing_game";else if(e.action instanceof h.Api.SendMessageRecordRoundAction)s="lng_send_action_record_round";else if(e.action instanceof h.Api.SendMessageUploadRoundAction)s="lng_send_action_upload_round";else if(e.action instanceof h.Api.SendMessageChooseStickerAction)s="lng_send_action_choose_sticker";else{if(e.action instanceof h.Api.SpeakingInGroupCallAction)return;if(e.action instanceof h.Api.SendMessageEmojiInteractionSeen)s="lng_user_action_watching_animations",n=e.action.emoticon;else if(e.action instanceof h.Api.SendMessageEmojiInteraction)return}return{action:s,...n&&{emoji:n},...!(e instanceof h.Api.UpdateUserTyping)&&{userId:W(e.fromId)},timestamp:Date.now()+1e3*t}}}function It(e){return{...(t=e,n=["id","title","emoticon","contacts","nonContacts","groups","bots","excludeMuted","excludeRead","excludeArchived"],n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{})),channels:e.broadcasts,pinnedChatIds:e.pinnedPeers.map(W).filter(Boolean),includedChatIds:e.includePeers.map(W).filter(Boolean),excludedChatIds:e.excludePeers.map(W).filter(Boolean)};var t,n}function St(e){let{filter:t,description:n}=e;if(t instanceof h.Api.DialogFilter)return{...It(t),description:n}}function Ct(e){return e.reduce(((e,t)=>{const n=z(t.userId,"user");return t.commands&&(e=e.concat(t.commands.map((e=>({botId:n,...w(e)}))))),e}),[])}function Pt(e){const{revoked:t,date:n,expireDate:s,link:a,permanent:i,startDate:o,usage:r,usageLimit:c,requested:l,requestNeeded:d,title:u,adminId:g}=e;return{isRevoked:t,date:n,expireDate:s,link:a,isPermanent:i,startDate:o,usage:r,usageLimit:c,isRequestNeeded:d,requested:l,title:u,adminId:z(g,"user")}}function Mt(e){let{autoarchived:t,reportSpam:n,addContact:s,blockContact:a}=e;return{isAutoArchived:Boolean(t),canReportSpam:Boolean(n),canAddContact:Boolean(s),canBlockContact:Boolean(a)}}function kt(e){return{id:e.botId.toString(),hasSettings:e.hasSettings,shortName:e.shortName,peerTypes:e.peerTypes.map(Rt),icons:e.icons.map(Bt).filter(Boolean)}}function Rt(e){return e instanceof h.Api.AttachMenuPeerTypeBotPM?"bot":e instanceof h.Api.AttachMenuPeerTypePM?"private":e instanceof h.Api.AttachMenuPeerTypeChat?"chat":e instanceof h.Api.AttachMenuPeerTypeBroadcast?"channel":e instanceof h.Api.AttachMenuPeerTypeSameBotPM?"self":void 0}function Bt(e){if(!(e.icon instanceof h.Api.Document))return;const t=Xe(e.icon);return t?(R.documents[String(e.icon.id)]=e.icon,{name:e.name,document:t}):void 0}function Ut(e,t){const{description:n,descriptionPhoto:s,descriptionDocument:a,userId:i,commands:o,menuButton:r}=e,c=i&&z(i,"user"),l=s instanceof h.Api.Photo?S(s):void 0,d=a instanceof h.Api.Document?Qe(a):void 0,u=null==o?void 0:o.map((e=>function(e,t){return{botId:e,...w(t)}}(c||t,e)));return{botId:c||t,description:n,gif:d,photo:l,menuButton:Dt(r),commands:null!=u&&u.length?u:void 0}}function Dt(e){return e instanceof h.Api.BotMenuButton?{type:"webApp",text:e.text,url:e.url}:{type:"commands"}}function Et(e){const{fullUser:{about:t,commonChatsCount:n,pinnedMsgId:s,botInfo:a,blocked:i,profilePhoto:o},users:r}=e,c=Tt(r[0]);return{...c,fullInfo:{...o instanceof h.Api.Photo&&{profilePhoto:S(o)},bio:t,commonChatsCount:n,pinnedMessageId:s,isBlocked:Boolean(i),...a&&{botInfo:Ut(a,c.id)}}}}function Tt(e){if(!(e instanceof h.Api.User))return;const{id:t,firstName:n,lastName:s,fake:a,scam:i}=e,o=e.photo instanceof h.Api.UserProfilePhoto?Boolean(e.photo.hasVideo):void 0,r=e.photo instanceof h.Api.UserProfilePhoto?String(e.photo.photoId):void 0,c=(l=e).bot?"userTypeBot":l.deleted?"userTypeDeleted":"userTypeRegular";var l;return{id:z(t,"user"),isMin:Boolean(e.min),fakeType:i?"scam":a?"fake":void 0,...e.self&&{isSelf:!0},isPremium:Boolean(e.premium),...e.verified&&{isVerified:!0},...(e.contact||e.mutualContact)&&{isContact:!0},type:c,...n&&{firstName:n},..."userTypeBot"===c&&{canBeInvitedToGroup:!e.botNochats},...s&&{lastName:s},username:e.username||"",phoneNumber:e.phone||"",noStatus:!e.status,...e.accessHash&&{accessHash:String(e.accessHash)},...r&&{avatarHash:r},hasVideoAvatar:o,...e.bot&&e.botInlinePlaceholder&&{botPlaceholder:e.botInlinePlaceholder},...e.bot&&e.botAttachMenu&&{isAttachMenuBot:e.botAttachMenu}}}function xt(e){return!e||e instanceof h.Api.UserStatusEmpty?{type:"userStatusEmpty"}:e instanceof h.Api.UserStatusOnline?{type:"userStatusOnline",expires:e.expires}:e instanceof h.Api.UserStatusOffline?{type:"userStatusOffline",wasOnline:e.wasOnline}:e instanceof h.Api.UserStatusRecently?{type:"userStatusRecently"}:e instanceof h.Api.UserStatusLastWeek?{type:"userStatusLastWeek"}:{type:"userStatusLastMonth"}}function Vt(e){const t={},n=[];return e.forEach((e=>{const s=Tt(e);s&&(n.push(s),"status"in e&&(t[s.id]=xt(e.status)))})),{users:n,userStatusesById:t}}function Nt(e){if(e instanceof h.Api.WallPaperNoFile)return;const{slug:t}=e,n=Xe(e.document);return n?{slug:t,document:n}:void 0}function Ft(e){return{isCurrent:Boolean(e.current),isOfficialApp:Boolean(e.officialApp),isPasswordPending:Boolean(e.passwordPending),hash:String(e.hash),areCallsEnabled:!e.callRequestsDisabled,areSecretChatsEnabled:!e.encryptedRequestsDisabled,..._(e,["deviceModel","platform","systemVersion","appName","appVersion","dateCreated","dateActive","ip","country","region"])}}function qt(e){return{hash:String(e.hash),botId:z(e.botId,"user"),..._(e,["platform","browser","dateCreated","dateActive","ip","region","domain"])}}function Lt(e){let t,n,s,a,i;return e.forEach((e=>{e instanceof h.Api.PrivacyValueAllowAll?t=t||"everybody":e instanceof h.Api.PrivacyValueAllowContacts?t=t||"contacts":e instanceof h.Api.PrivacyValueDisallowContacts?t=t||"nonContacts":e instanceof h.Api.PrivacyValueDisallowAll?t=t||"nobody":e instanceof h.Api.PrivacyValueAllowUsers?n=e.users.map((e=>z(e,"user"))):e instanceof h.Api.PrivacyValueDisallowUsers?a=e.users.map((e=>z(e,"user"))):e instanceof h.Api.PrivacyValueAllowChatParticipants?s=e.chats.map((e=>z(e,"chat"))):e instanceof h.Api.PrivacyValueDisallowChatParticipants&&(i=e.chats.map((e=>z(e,"chat"))))})),t||(t="nobody"),{visibility:t,allowUserIds:n||[],allowChatIds:s||[],blockUserIds:a||[],blockChatIds:i||[]}}function Ht(e,t,n){const{silent:s,muteUntil:a,showPreviews:i,otherSound:o}=e,r=Boolean(o&&!(o instanceof h.Api.NotificationSoundNone));return{chatId:W(t),isMuted:s||"number"==typeof a&&ct(n)(e[t.key]=Gt(t.value),e)),{})}function Kt(e){if(e instanceof h.Api.UrlAuthResultRequest){const{bot:t,domain:n,requestWriteAccess:s}=e,a=Tt(t);if(!a)return;return X(t),{type:"request",domain:n,shouldRequestWriteAccess:s,bot:a}}return e instanceof h.Api.UrlAuthResultAccepted?{type:"accepted",url:e.url}:e instanceof h.Api.UrlAuthResultDefault?{type:"default"}:void 0}let zt;const Wt=new Set;let jt=0,$t=!1;function Jt(e){e.filter((e=>e instanceof h.Api.User)).map(Tt).forEach((e=>{e&&zt({"@type":"updateUser",id:e.id,user:e})})),e.filter((e=>e instanceof h.Api.Chat||e instanceof h.Api.Channel)).map((e=>ft(e))).forEach((e=>{e&&zt({"@type":"updateChat",id:e.id,chat:e})}))}function Qt(e,t){if(e instanceof h.connection.UpdateServerTimeOffset)jt=e.timeOffset;else if(e instanceof h.connection.UpdateConnectionState){let t;switch(e.state){case h.connection.UpdateConnectionState.disconnected:t="connectionStateConnecting";break;case h.connection.UpdateConnectionState.broken:t="connectionStateBroken";break;case h.connection.UpdateConnectionState.connected:default:t="connectionStateReady"}zt({"@type":"updateConnectionState",connectionState:t})}else if(e instanceof h.Api.UpdateNewMessage||e instanceof h.Api.UpdateNewScheduledMessage||e instanceof h.Api.UpdateNewChannelMessage||e instanceof h.Api.UpdateShortChatMessage||e instanceof h.Api.UpdateShortMessage){let t,s;if(e instanceof h.Api.UpdateShortChatMessage)t=He(z((i=e).chatId,"chat"),{...i,fromId:ne(z(i.fromId,"user"))});else if(e instanceof h.Api.UpdateShortMessage)t=function(e){return He(z(e.userId,"user"),{...e,fromId:ne(e.out?Fe:z(e.userId,"user"))})}(e);else{var n;if(e.message instanceof h.Api.MessageEmpty)return;e.message instanceof h.Api.Message&&fe(e.message)&&J(e.message),t=Le(e.message),s="replyMarkup"in e.message&&(null===(n=e.message)||void 0===n?void 0:n.replyMarkup)instanceof h.Api.ReplyKeyboardForceReply&&(!e.message.replyMarkup.selective||t.isMentioned)}const a=e._entities;if(a&&(Y(a),Jt(a)),e instanceof h.Api.UpdateNewScheduledMessage?zt({"@type":Wt.has(t.id)?"updateScheduledMessage":"newScheduledMessage",id:t.id,chatId:t.chatId,message:t}):zt({"@type":Wt.has(t.id)?"updateMessage":"newMessage",id:t.id,chatId:t.chatId,message:t,shouldForceReply:s}),e.message instanceof h.Api.MessageService){const{action:n}=e.message;if(n instanceof h.Api.MessageActionPaymentSent)zt({"@type":"updatePaymentStateCompleted",slug:n.invoiceSlug});else if(n instanceof h.Api.MessageActionChatEditTitle)zt({"@type":"updateChat",id:t.chatId,chat:{title:n.title}});else if(n instanceof h.Api.MessageActionChatEditPhoto){const s=function(e){if(e instanceof h.Api.PhotoEmpty)return new h.Api.ChatPhotoEmpty;const{dcId:t,id:n}=e;return new h.Api.ChatPhoto({dcId:t,photoId:n})}(n.photo),a=bt(s),i=$(e.message);R.chats[i]&&(R.chats[i].photo=s),Q(n.photo),a&&zt({"@type":"updateChat",id:t.chatId,chat:{avatarHash:a},...n.photo instanceof h.Api.Photo&&{newProfilePhoto:S(n.photo)}})}else if(n instanceof h.Api.MessageActionChatDeletePhoto){const n=$(e.message);R.chats[n]&&(R.chats[n].photo=new h.Api.ChatPhotoEmpty),zt({"@type":"updateChat",id:t.chatId,chat:{avatarHash:void 0}})}else n instanceof h.Api.MessageActionChatDeleteUser?e._entities&&e._entities.some((e=>e instanceof h.Api.User&&Boolean(e.self)&&e.id===n.userId))&&zt({"@type":"updateChat",id:t.chatId,chat:{isForbidden:!0,isNotJoined:!0}}):n instanceof h.Api.MessageActionChatAddUser?e._entities&&e._entities.some((e=>e instanceof h.Api.User&&Boolean(e.self)&&n.users.includes(e.id)))&&zt({"@type":"updateChatJoin",id:t.chatId}):n instanceof h.Api.MessageActionGroupCall&&!n.duration&&n.call&&zt({"@type":"updateGroupCallChatId",chatId:t.chatId,call:{id:n.call.id.toString(),accessHash:n.call.accessHash.toString()}})}}else if(e instanceof h.Api.UpdateEditMessage||e instanceof h.Api.UpdateEditChannelMessage){if(e.message instanceof h.Api.MessageEmpty)return;e.message instanceof h.Api.Message&&fe(e.message)&&J(e.message);const t=Le(e.message);zt({"@type":"updateMessage",id:t.id,chatId:t.chatId,message:t})}else if(e instanceof h.Api.UpdateMessageReactions)zt({"@type":"updateMessageReactions",id:e.msgId,chatId:W(e.peer),reactions:Oe(e.reactions)});else if(e instanceof h.Api.UpdateDeleteMessages)zt({"@type":"deleteMessages",ids:e.messages});else if(e instanceof h.Api.UpdateDeleteScheduledMessages)zt({"@type":"deleteScheduledMessages",ids:e.messages,chatId:W(e.peer)});else if(e instanceof h.Api.UpdateDeleteChannelMessages){const t=z(e.channelId,"channel"),n=e.messages,s=n.filter((e=>R.messages[`${t}-${e}`])),a=n.filter((e=>!R.messages[`${t}-${e}`])),i=n.map((e=>{const n=R.messages[`${t}-${e}`];return n&&n instanceof h.Api.MessageService&&"photo"in n.action?String(n.action.photo.id):void 0})).filter(Boolean);s.length&&zt({"@type":"deleteMessages",ids:s,chatId:t}),i.length&&zt({"@type":"deleteProfilePhotos",ids:i,chatId:t}),a.length&&setTimeout((()=>{zt({"@type":"deleteMessages",ids:a,chatId:t})}),1e3)}else if(e instanceof h.Api.UpdateServiceNotification)if(e.popup)zt({"@type":"error",error:{message:e.message}});else{const t=function(e,t){const n=Ne(),s=We(e);return{id:n,chatId:u,date:e.inboxDate||t,content:s,isOutgoing:!1}}(e,Date.now()/1e3+jt);fe(e)&&J(ge(t.id,t.chatId,e)),zt({"@type":"updateServiceNotification",message:t})}else if((t instanceof h.Api.messages.SendMessage||t instanceof h.Api.messages.SendMedia||t instanceof h.Api.messages.SendMultiMedia||t instanceof h.Api.messages.ForwardMessages)&&(e instanceof h.Api.UpdateMessageID||e instanceof h.Api.UpdateShortSentMessage)){let n;"randomId"in e?n=e.randomId:"randomId"in t&&(n=t.randomId);const s=n&&R.localMessages[String(n)];if(!s)throw new Error("Local message not found");let a;if(e instanceof h.Api.UpdateShortSentMessage){s.content.text&&e.entities&&(a={text:je(s.content.text.text,e.entities)}),e.media&&(a={...a,...Je(e.media)});const t=ge(e.id,s.chatId,e);fe(t)&&J(t)}Wt.add(e.id);const i="date"in e&&1e3*e.datee instanceof h.Api.DialogPeer)).map((e=>W(e.peer))):[];zt({"@type":"updatePinnedChatIds",ids:t,folderId:e.folderId||void 0})}else if(e instanceof h.Api.UpdateFolderPeers)e.folderPeers.forEach((e=>{const{folderId:t,peer:n}=e;zt({"@type":"updateChatListType",id:W(n),folderId:t})}));else if(e instanceof h.Api.UpdateDialogFilter){const{id:t,filter:n}=e,s=n instanceof h.Api.DialogFilter?It(n):void 0;zt({"@type":"updateChatFolder",id:t,folder:s})}else if(e instanceof h.Api.UpdateDialogFilterOrder)zt({"@type":"updateChatFoldersOrder",orderedIds:e.order});else if(e instanceof h.Api.UpdateChatParticipants){const t=vt(e.participants);zt({"@type":"updateChatMembers",id:z(e.participants.chatId,"chat"),replacedMembers:t})}else if(e instanceof h.Api.UpdateChatParticipantAdd){const t=wt(_(e,["userId","inviterId","date"]));zt({"@type":"updateChatMembers",id:z(e.chatId,"chat"),addedMember:t})}else if(e instanceof h.Api.UpdateChatParticipantDelete)zt({"@type":"updateChatMembers",id:z(e.chatId,"chat"),deletedMemberId:z(e.userId,"user")});else if(e instanceof h.Api.UpdatePinnedMessages||e instanceof h.Api.UpdatePinnedChannelMessages){const t=e instanceof h.Api.UpdatePinnedMessages?W(e.peer):z(e.channelId,"channel");zt({"@type":"updatePinnedIds",chatId:t,messageIds:e.messages,isPinned:e.pinned})}else if(e instanceof h.Api.UpdateNotifySettings&&e.peer instanceof h.Api.NotifyPeer)zt({"@type":"updateNotifyExceptions",...Ht(e.notifySettings,e.peer.peer,jt)});else if(e instanceof h.Api.UpdateUserTyping||e instanceof h.Api.UpdateChatUserTyping){const t=e instanceof h.Api.UpdateUserTyping?z(e.userId,"user"):z(e.chatId,"chat");e.action instanceof h.Api.SendMessageEmojiInteraction?zt({"@type":"updateStartEmojiInteraction",id:t,emoji:e.action.emoticon,messageId:e.action.msgId,interaction:(a=JSON.parse(e.action.interaction.data),{timestamps:a.a.map((e=>e.t))})}):zt({"@type":"updateChatTypingStatus",id:t,typingStatus:At(e,jt)})}else if(e instanceof h.Api.UpdateChannelUserTyping){const t=z(e.channelId,"channel");zt({"@type":"updateChatTypingStatus",id:t,typingStatus:At(e,jt)})}else if(e instanceof h.Api.UpdateChannel){const{_entities:n}=e;if(!n)return;const s=n.find((e=>e instanceof h.Api.Channel||e instanceof h.Api.ChannelForbidden));if(s instanceof h.Api.Channel){if($t)return void($t=!1);t instanceof h.Api.messages.ToggleNoForwards&&($t=!0,setTimeout((()=>{$t=!1}),2e3));const n=ft(s);n&&(zt({"@type":"updateChat",id:n.id,chat:n}),zt({"@type":n.isNotJoined?"updateChatLeave":"updateChatJoin",id:z(e.channelId,"channel")}))}else if(s instanceof h.Api.ChannelForbidden){const t=z(e.channelId,"channel");zt({"@type":"updateChat",id:t,chat:{isRestricted:!0}}),zt({"@type":"updateChatLeave",id:t})}else 0===n.length&&zt({"@type":"resetMessages",id:z(e.channelId,"channel")})}else if(e instanceof h.Api.UpdateDialogUnreadMark&&e.peer instanceof h.Api.DialogPeer)zt({"@type":"updateChat",id:W(e.peer.peer),chat:{hasUnreadMark:e.unread}});else if(e instanceof h.Api.UpdateChatDefaultBannedRights)zt({"@type":"updateChat",id:W(e.peer),chat:{defaultBannedRights:w(e.defaultBannedRights)}});else if(e instanceof h.Api.UpdateUserStatus)zt({"@type":"updateUserStatus",userId:z(e.userId,"user"),status:xt(e.status)});else if(e instanceof h.Api.UpdateUserName){const t=z(e.userId,"user"),n=R.users[t],s=null!=n&&n.mutualContact&&!n.self?_(e,["username"]):_(e,["firstName","lastName","username"]);zt({"@type":"updateUser",id:t,user:s})}else if(e instanceof h.Api.UpdateUserPhoto){const{userId:t,photo:n}=e,s=z(t,"user"),a=bt(n);R.users[s]&&(R.users[s].photo=n),zt({"@type":"updateUser",id:s,user:{avatarHash:a}})}else if(e instanceof h.Api.UpdateUserPhone){const{userId:t,phone:n}=e;zt({"@type":"updateUser",id:z(t,"user"),user:{phoneNumber:n}})}else if(e instanceof h.Api.UpdatePeerSettings){const{_entities:t,settings:n}=e;if(!t)return;null!=t&&t.length&&(t.filter((e=>e instanceof h.Api.User&&!e.contact)).forEach((e=>{zt({"@type":"deleteContact",id:z(e.id,"user")})})),t.filter((e=>e instanceof h.Api.User&&e.contact)).map(Tt).forEach((e=>{e&&zt({"@type":"updateUser",id:e.id,user:{...e,...n&&{settings:Mt(n)}}})})))}else if(e instanceof h.Api.UpdateNotifySettings){const{notifySettings:{showPreviews:t,silent:n,muteUntil:s},peer:{className:a}}=e,i="NotifyUsers"===a?"contact":"NotifyChats"===a?"group":"NotifyBroadcasts"===a?"broadcast":void 0;if(!i)return;zt({"@type":"updateNotifySettings",peerType:i,isSilent:Boolean(n||"number"==typeof s&&Date.now()+1e3*jt<1e3*s),shouldShowPreviews:Boolean(t)})}else if(e instanceof h.Api.UpdatePeerBlocked)zt({"@type":"updatePeerBlocked",id:W(e.peerId),isBlocked:e.blocked});else if(e instanceof h.Api.UpdatePrivacy){const t=function(e){switch(e.className){case"PrivacyKeyPhoneNumber":return"phoneNumber";case"PrivacyKeyStatusTimestamp":return"lastSeen";case"PrivacyKeyProfilePhoto":return"profilePhoto";case"PrivacyKeyPhoneCall":return"phoneCall";case"PrivacyKeyPhoneP2P":return"phoneP2P";case"PrivacyKeyForwards":return"forwards";case"PrivacyKeyChatInvite":return"chatInvite"}}(e.key);t&&zt({"@type":"updatePrivacy",key:t,rules:Lt(e.rules)})}else if(e instanceof h.Api.UpdateDraftMessage)zt({"@type":"draftMessage",chatId:W(e.peer),...$e(e.draft)});else if(e instanceof h.Api.UpdateContactsReset)zt({"@type":"updateResetContactList"});else if(e instanceof h.Api.UpdateFavedStickers)zt({"@type":"updateFavoriteStickers"});else if(e instanceof h.Api.UpdateRecentStickers)zt({"@type":"updateRecentStickers"});else if(e instanceof h.Api.UpdateStickerSets)zt({"@type":"updateStickerSets"});else if(e instanceof h.Api.UpdateStickerSetsOrder)zt({"@type":"updateStickerSetsOrder",order:e.order.map((e=>e.toString()))});else if(e instanceof h.Api.UpdateNewStickerSet){if(e.stickerset instanceof h.Api.messages.StickerSet){const t=T(e.stickerset.set);zt({"@type":"updateStickerSet",id:t.id,stickerSet:t})}}else if(e instanceof h.Api.UpdateSavedGifs)zt({"@type":"updateSavedGifs"});else if(e instanceof h.Api.UpdateGroupCall)zt({"@type":"updateGroupCall",call:Re(e.call)});else if(e instanceof h.Api.UpdateGroupCallConnection)zt({"@type":"updateGroupCallConnection",data:JSON.parse(e.params.data),presentation:Boolean(e.presentation)});else if(e instanceof h.Api.UpdateGroupCallParticipants){const t=e._entities;t&&(Y(t),Jt(t)),zt({"@type":"updateGroupCallParticipants",groupCallId:(s=e.call,s.id.toString()),participants:e.participants.map(Pe)})}else if(e instanceof h.Api.UpdatePendingJoinRequests){const t=e._entities;t&&(Y(t),Jt(t)),zt({"@type":"updatePendingJoinRequests",chatId:W(e.peer),recentRequesterIds:e.recentRequesters.map((e=>z(e,"user"))),requestsPending:e.requestsPending})}else if(e instanceof h.Api.UpdatePhoneCall){const t=e._entities;t&&(Y(t),Jt(t)),zt({"@type":"updatePhoneCall",call:Be(e.phoneCall)})}else if(e instanceof h.Api.UpdatePhoneCallSignalingData)zt({"@type":"updatePhoneCallSignalingData",callId:e.phoneCallId.toString(),data:Array.from(e.data)});else if(e instanceof h.Api.UpdateWebViewResultSent){const{queryId:t}=e;zt({"@type":"updateWebViewResultSent",queryId:t.toString()})}else if(e instanceof h.Api.UpdateBotMenuButton){const{botId:t,button:n}=e,s=z(t,"user");zt({"@type":"updateBotMenuButton",botId:s,button:Dt(n)})}else if(e instanceof h.Api.UpdateTranscribedAudio){const t=e._entities;t&&(Y(t),Jt(t)),zt({"@type":"updateTranscribedAudio",transcriptionId:e.transcriptionId.toString(),text:e.text,isPending:e.pending})}else if(e instanceof h.Api.UpdateConfig){const t=e._entities;t&&(Y(t),Jt(t))}var s,a,i}const Xt={PHONE_NUMBER_INVALID:"Invalid phone number.",PHONE_CODE_INVALID:"Invalid code.",PASSWORD_HASH_INVALID:"Incorrect password.",PHONE_PASSWORD_FLOOD:"Limit exceeded. Please try again later.",PHONE_NUMBER_BANNED:"This phone number is banned."},Yt={};let Zt;function en(){return Zt(rn("authorizationStateWaitPhoneNumber")),new Promise(((e,t)=>{Yt.resolve=e,Yt.reject=t}))}function tn(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Zt({...rn("authorizationStateWaitCode"),isCodeViaApp:e}),new Promise(((e,t)=>{Yt.resolve=e,Yt.reject=t}))}function nn(e){return Zt({...rn("authorizationStateWaitPassword"),hint:e}),new Promise((e=>{Yt.resolve=e}))}function sn(){return Zt(rn("authorizationStateWaitRegistration")),new Promise((e=>{Yt.resolve=e}))}function an(e){return Zt({...rn("authorizationStateWaitQrCode"),qrCode:{token:btoa(String.fromCharCode(...e.token)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),expires:e.expires}}),new Promise(((e,t)=>{Yt.reject=t}))}function on(e){let t;if(e instanceof h.errors.FloodWaitError){const n=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(n>1?`${n} hours`:"an hour")}else t=Xt[e.message];t||(t="Unexpected Error"),Zt({"@type":"updateAuthorizationError",message:t})}function rn(e){return{"@type":"updateAuthorizationState",authorizationState:e}}function cn(e){Yt.resolve&&Yt.resolve(e)}function ln(e){Yt.resolve&&Yt.resolve(e)}function dn(e){Yt.resolve&&Yt.resolve(e)}function un(e){const{firstName:t,lastName:n}=e;Yt.resolve&&Yt.resolve([t,n])}function gn(){Yt.reject&&Yt.reject(new Error("RESTART_AUTH"))}function pn(){Yt.reject&&Yt.reject(new Error("RESTART_AUTH_WITH_QR"))}var fn=n(78742),hn=n.n(fn),mn=n(89832);const _n=self.caches;let yn;async function bn(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(_n)try{const a=new Request(t.replace(/:/g,"_")),i=await _n.open(e),o=await i.match(a);if(!o)return;const r=o.headers.get("Content-Type");switch(n){case yn.Text:return await o.text();case yn.Blob:{if(t.startsWith("avatar")&&r&&r.startsWith("text"))return;const e=await o.blob(),n=!e.type||!s&&e.type.includes("html");let a=e.type||r;return n&&a?(s||(a=a.replace(/html/gi,"")),new Blob([e],{type:a})):e}case yn.Json:return await o.json();case yn.ArrayBuffer:return await o.arrayBuffer();default:return}}catch(e){return void console.warn(e)}}async function wn(e,t,n){if(_n)try{const s="string"==typeof n||n instanceof Blob||n instanceof ArrayBuffer?n:JSON.stringify(n),a=new Request(t.replace(/:/g,"_")),i=new Response(s),o=await _n.open(e);return await o.put(a,i)}catch(e){return void console.warn(e)}}async function vn(e,t){try{if(!_n)return;const n=await _n.open(e);return await n.delete(t)}catch(e){return void console.warn(e)}}async function An(e){try{if(!_n)return;return await _n.delete(e)}catch(e){return void console.warn(e)}}!function(e){e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json",e[e.ArrayBuffer=3]="ArrayBuffer"}(yn||(yn={}));const In=new Set(["msg","sticker","gif","wallpaper","photo","webDocument","document","videoAvatar"]);async function Sn(e,t,n,a){let{url:i,mediaFormat:o,start:r,end:c,isHtmlAllowed:l}=e;const{data:d,mimeType:u,fullSize:g}=await async function(e,t,n,s,a,i,o,r){const c=Pn(e);if(!c)return;const{entityType:l,entityId:d,sizeType:u,params:g,mediaMatchType:p}=c;if(!n)return Promise.reject(new Error("ERROR: Client is not connected"));if("staticMap"===l){const e=d,n=new URLSearchParams(g),s=n.get("long"),a=n.get("lat"),i=n.get("w"),o=n.get("h"),r=n.get("zoom"),c=n.get("scale"),l=n.get("accuracy_radius");return{mimeType:"image/png",data:await t.downloadStaticMap(e,s,a,i,o,r,c,l)}}let f;switch(l){case"channel":case"chat":f=R.chats[d];break;case"user":f=R.users[d];break;case"msg":f=R.messages[d];break;case"sticker":case"gif":case"wallpaper":case"document":f=R.documents[d];break;case"videoAvatar":case"photo":f=R.photos[d];break;case"stickerSet":f=R.stickerSets[d];break;case"webDocument":f=R.webDocuments[d]}if(f){if(In.has(l)){o===O.Stream&&(s.acceptsBuffer=!0);const e=await t.downloadMedia(f,{sizeType:u,start:a,end:i,progressCallback:s,workers:16});let n,c;return f instanceof h.Api.Message?(n=function(e,t){if(e&&e.media)return e.media instanceof h.Api.MessageMediaPhoto?"image/jpeg":e.media instanceof h.Api.MessageMediaGeo||e.media instanceof h.Api.MessageMediaVenue||e.media instanceof h.Api.MessageMediaGeoLive?"image/png":e.media instanceof h.Api.MessageMediaDocument&&e.media.document instanceof h.Api.Document?t?e.media.document.attributes.some((e=>e instanceof h.Api.DocumentAttributeSticker))?"image/webp":"image/jpeg":e.media.document.mimeType:e.media instanceof h.Api.MessageMediaWebPage&&e.media.webpage instanceof h.Api.WebPage&&e.media.webpage.document instanceof h.Api.Document?t?"image/jpeg":e.media.webpage.document.mimeType:void 0}(f,u),f.media instanceof h.Api.MessageMediaDocument&&f.media.document instanceof h.Api.Document&&(c=f.media.document.size.toJSNumber()),f.media instanceof h.Api.MessageMediaWebPage&&f.media.webpage instanceof h.Api.WebPage&&f.media.webpage.document instanceof h.Api.Document&&(c=f.media.webpage.document.size.toJSNumber())):f instanceof h.Api.Photo?n="videoAvatar"===l?"video/mp4":"image/jpeg":"sticker"===l&&u?n="image/webp":"webDocument"===l?(n=f.mimeType,c=f.size):(n=f.mimeType,c=f.size.toJSNumber()),!r&&n&&(n=n.replace(/html/gi,"")),{mimeType:n,data:e,fullSize:c}}if("stickerSet"===l){const e=await t.downloadStickerSetThumb(f);return{mimeType:Cn(e),data:e}}{const e=await t.downloadProfilePhoto(f,"profile"===p);return{mimeType:Cn(e),data:e}}}}(i,t,n,a,r,c,o,l)||{};if(!d)return;const p=await async function(e,t,n){switch(t){case O.BlobUrl:return new Blob([e],{type:n});case O.Text:return e.toString();case O.Progressive:return e.buffer}}(d,o,u);if(!p)return;const f=o!==O.Progressive&&(o!==O.BlobUrl||p.size<=524288);return s&&f&&wn(i.startsWith("avatar")?"tt-media-avatars":"tt-media",i,p),{prepared:o===O.Progressive?"":(m=p,m instanceof Blob?URL.createObjectURL(m):m),arrayBuffer:o===O.Progressive?p:void 0,mimeType:u,fullSize:g};var m}function Cn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/jpeg";if(e.length<4)return t;let n=t;const s=e.subarray(0,4).reduce(((e,t)=>e+t.toString(16)),"");switch(s){case"89504e47":n="image/png";break;case"47494638":n="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":n="image/jpeg";break;case"52494646":n="image/webp"}return n}function Pn(e){const t=e.startsWith("staticMap")?e.match(/(staticMap):([0-9-]+)(\?.+)/):e.startsWith("webDocument")?e.match(/(webDocument):(.+)/):e.match(/(avatar|profile|photo|msg|stickerSet|sticker|wallpaper|gif|document|videoAvatar)([-\d\w./]+)(?::\d+)?(\?size=\w+)?/);if(!t)return;const n=t[1],s=t[2];let a;const i=t[3],o=(null==i?void 0:i.replace("?size=",""))||void 0;return a="avatar"===t[1]||"profile"===t[1]?te(s):t[1],{mediaMatchType:n,entityType:a,entityId:s,sizeType:o,params:i}}mn.Logger.setLevel("warn");const Mn={build:e=>e};let kn,Rn,Bn=!1;async function Un(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e||await xn(new h.Api.auth.LogOut),B(),await Rn.destroy()}async function Dn(){await Rn.disconnect()}function En(e){kn({"@type":"updateSession",sessionData:e})}function Tn(e){e instanceof h.connection.UpdateConnectionState?Bn=e.state===h.connection.UpdateConnectionState.connected:e instanceof h.Api.UpdatesTooLong?async function(){try{await xn(new h.Api.users.GetFullUser({id:new h.Api.InputUserSelf}),void 0,!0)}catch(e){"AUTH_KEY_UNREGISTERED"===e.message&&kn({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}}():e instanceof h.connection.UpdateServerTimeOffset&&kn({"@type":"updateServerTimeOffset",serverTimeOffset:e.timeOffset})}async function xn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0;if(Bn)try{const n=await Rn.invoke(e,a);return s||Vn(e,n),t?n&&!0:n}catch(t){if(n)throw t;return void Hn(t,e)}}function Vn(e,t){let n,s;t instanceof h.Api.UpdatesCombined||t instanceof h.Api.Updates?n=t:"object"==typeof t&&"updates"in t&&(t.updates instanceof h.Api.Updates||t.updates instanceof h.Api.UpdatesCombined)?n=t.updates:(t instanceof h.Api.UpdateShortMessage||t instanceof h.Api.UpdateShortChatMessage||t instanceof h.Api.UpdateShort||t instanceof h.Api.UpdateShortSentMessage)&&(s=t),n?(function(e){const t=[...e.users,...e.chats];e.updates.forEach((e=>{t&&(e._entities=t)}))}(n),n.updates.forEach((t=>{Qt(t,e)}))):s&&Qt(s,e)}function Nn(e,t){return Sn(e,Rn,Bn,t).catch((async n=>{if(n.message.startsWith("FILE_REFERENCE"))return await On({url:e.url})?Sn(e,Rn,Bn,t):void 0}))}function Fn(e,t){return Rn.uploadFile({file:e,onProgress:t,workers:16})}function qn(e){return Rn.updateTwoFaSettings(e)}async function Ln(){const e=await xn(new h.Api.users.GetFullUser({id:new h.Api.InputUserSelf}));if(!(e&&e.users[0]instanceof h.Api.User))return;const t=e.users[0];t.photo instanceof h.Api.Photo&&(R.photos[t.photo.id.toString()]=t.photo),R.users[z(t.id,"user")]=t;const n=Et(e);var s;s=n.id,Fe=s,function(e){Zt({"@type":"updateCurrentUser",currentUser:e})}(n)}function Hn(e,t){const n=e.message.startsWith("A wait of")&&(t instanceof h.Api.messages.SendMessage||t instanceof h.Api.messages.SendMedia||t instanceof h.Api.messages.SendMultiMedia),{message:s}=e;kn({"@type":"error",error:{message:s,isSlowMode:n,hasErrorKey:!0}})}async function On(e){let{url:t}=e;const n=Pn(t);if(!n)return;const{entityType:s,entityId:a,mediaMatchType:i}=n;if("file"===i)return!1;if("msg"===s){const e=R.messages[a],t=e.id,n="channelId"in e.peerId?new h.Api.InputChannel({channelId:e.peerId.channelId,accessHash:R.chats[z(e.peerId.channelId,"channel")].accessHash}):void 0,s=await xn(n?new h.Api.channels.GetMessages({channel:n,id:[new h.Api.InputMessageID({id:t})]}):new h.Api.messages.GetMessages({id:[new h.Api.InputMessageID({id:t})]}));if(!s||s instanceof h.Api.messages.MessagesNotModified)return!1;const i=s.messages[0];return!(i instanceof h.Api.MessageEmpty||(J(i),0))}return!1}const Gn=2**31-1;let Kn;async function zn(e){let{limit:t,offsetDate:n,archived:s,withPinned:a,serverTimeOffset:i,lastLocalServiceMessage:o}=e;const r=await xn(new h.Api.messages.GetDialogs({offsetPeer:new h.Api.InputPeerEmpty,limit:t,offsetDate:n,folderId:s?1:void 0,...a&&{excludePinned:!0}})),c=a?await xn(new h.Api.messages.GetPinnedDialogs({folderId:s?1:void 0})):void 0;if(!r||r instanceof h.Api.messages.DialogsNotModified)return;c&&xs(c),xs(r);const l=m((c?c.messages:[]).concat(r.messages).map(Le).filter(Boolean),"chatId"),d={...c&&Ts(c),...Ts(r)},g=[],p={},f={},_=(c?c.dialogs:[]).concat(r.dialogs),y=[];_.forEach((e=>{if(!(e instanceof h.Api.Dialog)||!s&&1===e.folderId||s&&1!==e.folderId)return;const t=dt(e,d[mt(e.peer)],i);if(t.id===u&&o&&(!l[t.id]||o.date>l[t.id].date)?t.lastMessage=o:t.lastMessage=l[t.id],t.isListed=!0,g.push(t),a&&e.pinned&&y.push(t.id),e.draft){const{formattedText:n,replyingToId:s}=$e(e.draft)||{};n&&(p[t.id]=n),s&&(f[t.id]=s)}}));const b=g.map((e=>e.id)),{users:w,userStatusesById:v}=Vt(((null==c?void 0:c.users)||[]).concat(r.users));let A;return A=r instanceof h.Api.messages.DialogsSlice?r.count:b.length,{chatIds:b,chats:g,users:w,userStatusesById:v,draftsById:p,replyingToById:f,orderedPinnedIds:a?y:void 0,totalChatCount:A}}function Wn(e){const{id:t,accessHash:n,adminRights:s}=e;return ie(t,n)instanceof h.Api.InputChannel?async function(e,t,n){var s;const a=await xn(new h.Api.channels.GetFullChannel({channel:ie(e,t)}));if(!(a&&a.fullChat instanceof h.Api.ChannelFull))return;const{about:i,onlineCount:o,exportedInvite:r,slowmodeSeconds:c,slowmodeNextSendDate:l,migratedFromChatId:d,migratedFromMaxId:u,canViewParticipants:g,canViewStats:p,linkedChatId:f,hiddenPrehistory:m,call:_,botInfo:y,availableReactions:b,defaultSendAs:w,requestsPending:v,recentRequesters:A,statsDc:I,participantsCount:C,stickerset:P,chatPhoto:M}=a.fullChat;M instanceof h.Api.Photo&&(R.photos[M.id.toString()]=M);const k=r instanceof h.Api.ChatInviteExported?r.link:void 0,{members:B,users:U,userStatusesById:D}=g&&await Cs(e,t)||{},{members:E,users:x,userStatusesById:V}=g&&n&&await Cs(e,t,"kicked")||{},{members:N,users:F,userStatusesById:q}=g&&n&&await Cs(e,t,"admin")||{},L=y?Ct(y):void 0;if((null==a||null===(s=a.chats)||void 0===s?void 0:s.length)>1){xs(a);const[,e]=a.chats,t=ft(e,void 0,!0);t&&Kn({"@type":"updateChat",id:t.id,chat:t})}const H={...D,...V,...q};return{fullInfo:{...M instanceof h.Api.Photo&&{profilePhoto:S(M)},about:i,onlineCount:o,inviteLink:k,slowMode:c?{seconds:c,nextSendDate:l}:void 0,migratedFrom:d?{chatId:z(d,"chat"),maxMessageId:u}:void 0,canViewMembers:g,canViewStatistics:p,isPreHistoryHidden:m,members:B,kickedMembers:E,adminMembers:N,groupCallId:_?String(_.id):void 0,linkedChatId:f?z(f,"chat"):void 0,botCommands:L,enabledReactions:b,sendAsId:w?W(w):void 0,requestsPending:v,recentRequesterIds:null==A?void 0:A.map((e=>z(e,"user"))),statisticsDcId:I,stickerSet:P?T(P):void 0},users:[...U||[],...x||[],...F||[]],userStatusesById:H,groupCall:_?{chatId:e,isLoaded:!1,id:_.id.toString(),accessHash:null==_?void 0:_.accessHash.toString(),participants:{},version:0,participantsCount:0,connectionState:"disconnected"}:void 0,membersCount:C}}(t,n,s):async function(e){const t=await xn(new h.Api.messages.GetFullChat({chatId:ie(e)}));if(!(t&&t.fullChat instanceof h.Api.ChatFull))return;xs(t);const{about:n,participants:s,exportedInvite:a,botInfo:i,call:o,availableReactions:r,recentRequesters:c,requestsPending:l,chatPhoto:d}=t.fullChat;d instanceof h.Api.Photo&&(R.photos[d.id.toString()]=d);const u=vt(s),g=u?u.filter((e=>{let{isAdmin:t,isOwner:n}=e;return t||n})):void 0,p=i?Ct(i):void 0,{users:f,userStatusesById:m}=Vt(t.users);return{fullInfo:{...d instanceof h.Api.Photo&&{profilePhoto:S(d)},about:n,members:u,adminMembers:g,canViewMembers:!0,botCommands:p,...a instanceof h.Api.ChatInviteExported&&{inviteLink:a.link},groupCallId:null==o?void 0:o.id.toString(),enabledReactions:r,requestsPending:l,recentRequesterIds:null==c?void 0:c.map((e=>z(e,"user")))},users:f,userStatusesById:m,groupCall:o?{chatId:e,isLoaded:!1,id:o.id.toString(),accessHash:o.accessHash.toString(),connectionState:"disconnected",participantsCount:0,version:0,participants:{}}:void 0,membersCount:null==u?void 0:u.length}}(t)}async function jn(e){const{id:t,accessHash:n}=e,s=await xn(new h.Api.messages.GetPeerSettings({peer:se(t,n)}));if(s)return Mt(s.settings)}async function $n(e){let{query:t}=e;const n=await xn(new h.Api.contacts.Search({q:t}));if(!n)return;xs(n);const s=n.myResults.map(W),a=n.chats.concat(n.users).map((e=>ft(e))).filter(Boolean),i=n.users.map(Tt).filter((e=>Boolean(e)&&!e.isSelf));return{localChats:a.filter((e=>s.includes(e.id))),localUsers:i.filter((e=>s.includes(e.id))),globalChats:a.filter((e=>!s.includes(e.id))),globalUsers:i.filter((e=>!s.includes(e.id)))}}async function Jn(e){let t,{type:n,user:s}=e;if("self"===n||"user"===n){const e=await xn(new h.Api.users.GetUsers({id:["user"===n&&s?ie(s.id,s.accessHash):new h.Api.InputUserSelf]}));if(!e||!e.length)return;[t]=e}else if("support"===n){const e=await xn(new h.Api.help.GetSupport);if(!e||!e.user)return;t=e.user}const a=ft(t,"support"===n);if(a)return Kn({"@type":"updateChat",id:a.id,chat:a}),{chatId:a.id}}async function Qn(e){let{chat:t,serverTimeOffset:n,lastLocalMessage:s,noLastMessage:a}=e;const{id:i,accessHash:o}=t,r=await xn(new h.Api.messages.GetPeerDialogs({peers:[new h.Api.InputDialogPeer({peer:se(i,o)})]}));if(!r)return;const c=r.dialogs[0];if(!(c&&c instanceof h.Api.Dialog))return;const l=Ts(r)[mt(c.peer)];if(!l)return;xs(r);const d=Le(r.messages[0]),u=s&&(!d||s.date>d.date)?s:d;Kn({"@type":"updateChat",id:i,chat:{...dt(c,l,n),...!a&&{lastMessage:u}}})}function Xn(e){let{chat:t,text:n,entities:s,replyToMsgId:a}=e;return xn(new h.Api.messages.SaveDraft({peer:se(t.id,t.accessHash),message:n,...s&&{entities:s.map(pe)},replyToMsgId:a}))}function Yn(e){return xn(new h.Api.messages.SaveDraft({peer:se(e.id,e.accessHash),message:""}))}async function Zn(e){let{chat:t,isMuted:n,serverTimeOffset:s}=e;await xn(new h.Api.account.UpdateNotifySettings({peer:new h.Api.InputNotifyPeer({peer:se(t.id,t.accessHash)}),settings:new h.Api.InputPeerNotifySettings({muteUntil:n?Gn:0})})),Kn({"@type":"updateNotifyExceptions",chatId:t.id,isMuted:n}),Qn({chat:t,serverTimeOffset:s,noLastMessage:!0})}async function es(e){let{title:t,about:n="",users:s}=e,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=await xn(new h.Api.channels.CreateChannel({broadcast:!0,title:t,about:n}),void 0,!0);if(!(i instanceof h.Api.Updates))return;const o=i.chats[0];if(!(o&&o instanceof h.Api.Channel))return;const r=ft(o);if(null!=s&&s.length)try{await xn(new h.Api.channels.InviteToChannel({channel:ie(r.id,r.accessHash),users:s.map((e=>{let{id:t,accessHash:n}=e;return ie(t,n)}))}),void 0,a)}catch(e){}return r}function ts(e){let{channelId:t,accessHash:n}=e;return xn(new h.Api.channels.JoinChannel({channel:ie(t,n)}),!0,!0)}function ns(e){let{chat:t,user:n}=e;if("chatTypeBasicGroup"===t.type)return xn(new h.Api.messages.DeleteChatUser({chatId:ie(t.id,t.accessHash),userId:ie(n.id,n.accessHash)}),!0)}function ss(e){let{chatId:t}=e;return xn(new h.Api.messages.DeleteChat({chatId:ie(t)}),!0)}function as(e){let{channelId:t,accessHash:n}=e;return xn(new h.Api.channels.LeaveChannel({channel:ie(t,n)}),!0)}function is(e){let{channelId:t,accessHash:n}=e;return xn(new h.Api.channels.DeleteChannel({channel:ie(t,n)}),!0)}async function os(e){let{title:t,users:n}=e;const s=await xn(new h.Api.messages.CreateChat({title:t,users:n.map((e=>{let{id:t,accessHash:n}=e;return ie(t,n)}))}),void 0,!0);if(!(s instanceof h.Api.Updates))return;const a=s.chats[0];return a&&a instanceof h.Api.Chat?ft(a):void 0}async function rs(e){let{chatId:t,accessHash:n,photo:s}=e;const a=await Fn(s),i=ie(t,n);return xn(i instanceof h.Api.InputChannel?new h.Api.channels.EditPhoto({channel:i,photo:new h.Api.InputChatUploadedPhoto({file:a})}):new h.Api.messages.EditChatPhoto({chatId:i,photo:new h.Api.InputChatUploadedPhoto({file:a})}),!0)}async function cs(e){let{chat:t,shouldBePinned:n}=e;const{id:s,accessHash:a}=t;await xn(new h.Api.messages.ToggleDialogPin({peer:new h.Api.InputDialogPeer({peer:se(s,a)}),pinned:n||void 0}))&&Kn({"@type":"updateChatPinned",id:t.id,isPinned:n})}function ls(e){let{chat:t,folderId:n}=e;const{id:s,accessHash:a}=t;return xn(new h.Api.folders.EditPeerFolders({folderPeers:[new h.Api.InputFolderPeer({peer:se(s,a),folderId:n})]}),!0)}async function ds(){const e=await xn(new h.Api.messages.GetDialogFilters);if(!e)return;const t=e.findIndex((e=>e instanceof h.Api.DialogFilterDefault)),n=e.filter((e=>e instanceof h.Api.DialogFilter)),s=n.map((e=>{let{id:t}=e;return t}));return-1!==t&&s.splice(t,0,0),{byId:m(n.map(It),"id"),orderedIds:s}}async function us(){const e=await xn(new h.Api.messages.GetSuggestedDialogFilters);if(e)return e.map(St).filter(Boolean)}async function gs(e){let{id:t,folderUpdate:n}=e;const s=function(e){const{emoticon:t,contacts:n,nonContacts:s,groups:a,channels:i,bots:o,excludeArchived:r,excludeMuted:c,excludeRead:l,pinnedChatIds:d,includedChatIds:u,excludedChatIds:g}=e,p=d?d.map(ae).filter(Boolean):[],f=u?u.map(ae).filter(Boolean):[],m=g?g.map(ae).filter(Boolean):[];return new h.Api.DialogFilter({id:e.id,title:e.title,emoticon:t||void 0,contacts:n||void 0,nonContacts:s||void 0,groups:a||void 0,bots:o||void 0,excludeArchived:r||void 0,excludeMuted:c||void 0,excludeRead:l||void 0,broadcasts:i||void 0,pinnedPeers:p,includePeers:f,excludePeers:m})}(n);await xn(new h.Api.messages.UpdateDialogFilter({id:t,filter:s}))&&Kn({"@type":"updateChatFolder",id:t,folder:n})}async function ps(e){const t=await xn(new h.Api.messages.UpdateDialogFilter({id:e,filter:void 0})),n=await us();t&&Kn({"@type":"updateChatFolder",id:e,folder:void 0}),n&&Kn({"@type":"updateRecommendedChatFolders",folders:n})}async function fs(e){let{chat:t,hasUnreadMark:n}=e;const{id:s,accessHash:a}=t;await xn(new h.Api.messages.MarkDialogUnread({peer:new h.Api.InputDialogPeer({peer:se(s,a)}),unread:n||void 0}))&&Kn({"@type":"updateChat",id:t.id,chat:{hasUnreadMark:n}})}async function hs(e){return _s(await xn(new h.Api.contacts.ResolvePhone({phone:e})))}async function ms(e){return _s(await xn(new h.Api.contacts.ResolveUsername({username:e})))}function _s(e){if(!e)return;const{users:t,chats:n}=e,s=n.length?ft(n[0]):ft(t[0]);return s?(xs(e),s):void 0}function ys(e){let{chat:t,isEnabled:n}=e;const{id:s,accessHash:a}=t,i=ie(s,a);return xn(new h.Api.channels.TogglePreHistoryHidden({channel:i,enabled:n}),!0)}function bs(e){let{chat:t,bannedRights:n}=e;const{id:s,accessHash:a}=t,i=se(s,a);return xn(new h.Api.messages.EditChatDefaultBannedRights({peer:i,bannedRights:me(n)}),!0)}function ws(e){let{chat:t,user:n,bannedRights:s,untilDate:a}=e;const i=ie(t.id,t.accessHash),o=se(n.id,n.accessHash);return xn(new h.Api.channels.EditBanned({channel:i,participant:o,bannedRights:me(s,a)}),!0)}function vs(e){let{chat:t,user:n,adminRights:s,customTitle:a=""}=e;const i=ie(t.id,t.accessHash),o=ie(n.id,n.accessHash);return xn(new h.Api.channels.EditAdmin({channel:i,userId:o,adminRights:_e(s),rank:a}),!0)}async function As(e,t){const n=ie(e.id,e.accessHash);await xn(n instanceof h.Api.InputChannel?new h.Api.channels.EditTitle({channel:n,title:t}):new h.Api.messages.EditChatTitle({chatId:n,title:t}),!0)}async function Is(e,t){await xn(new h.Api.messages.EditChatAbout({peer:se(e.id,e.accessHash),about:t}))&&Kn({"@type":"updateChatFullInfo",id:e.id,fullInfo:{about:t}})}function Ss(e){let{chat:t,isEnabled:n}=e;const{id:s,accessHash:a}=t,i=ie(s,a);return xn(new h.Api.channels.ToggleSignatures({channel:i,enabled:n}),!0)}async function Cs(e,t){let n,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"recent",a=arguments.length>3?arguments[3]:void 0;switch(s){case"kicked":n=new h.Api.ChannelParticipantsKicked({q:""});break;case"admin":n=new h.Api.ChannelParticipantsAdmins;break;default:n=new h.Api.ChannelParticipantsRecent}const i=await xn(new h.Api.channels.GetParticipants({channel:ie(e,t),filter:n,offset:a,limit:200}));if(!i||i instanceof h.Api.channels.ChannelParticipantsNotModified)return;xs(i);const{users:o,userStatusesById:r}=Vt(i.users);return{members:vt(i),users:o,userStatusesById:r}}async function Ps(){const e=await xn(new h.Api.channels.GetGroupsForDiscussion);if(e)return xs(e),e.chats.map((e=>ft(e)))}function Ms(e){let{channel:t,chat:n}=e;return xn(new h.Api.channels.SetDiscussionGroup({broadcast:se(t.id,t.accessHash),group:n?se(n.id,n.accessHash):new h.Api.InputChannelEmpty}),!0)}async function ks(e){const t=await xn(new h.Api.messages.MigrateChat({chatId:ie(e.id)}),void 0,!0);if(t&&t instanceof h.Api.Updates)return xs(t),ft(t.chats[1])}async function Rs(e){const t=await xn(new h.Api.messages.CheckChatInvite({hash:e}));if(!t)return;let n;if(t instanceof h.Api.ChatInvite){const{photo:n,participantsCount:s,title:a,channel:i,requestNeeded:o,about:r,megagroup:c}=t;n instanceof h.Api.Photo&&Q(t.photo),Kn({"@type":"showInvite",data:{title:a,about:r,hash:e,participantsCount:s,isChannel:i&&!c,isRequestNeeded:o,...n instanceof h.Api.Photo&&{photo:S(n)}}})}else n=ft(t.chat),n&&Kn({"@type":"updateChat",id:n.id,chat:n});return n?{chatId:n.id}:void 0}async function Bs(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?await xn(new h.Api.channels.InviteToChannel({channel:ie(e.id,e.accessHash),users:t.map((e=>ie(e.id,e.accessHash)))}),!0,n):await Promise.all(t.map((t=>xn(new h.Api.messages.AddChatUser({chatId:ie(e.id),userId:ie(t.id,t.accessHash)}),!0,n))))}catch(e){return}}function Us(e,t){return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?ws({chat:e,user:t,bannedRights:{viewMessages:!0,sendMessages:!0,sendMedia:!0,sendStickers:!0,sendGifs:!0,sendGames:!0,sendInline:!0,embedLinks:!0,sendPolls:!0,changeInfo:!0,inviteUsers:!0,pinMessages:!0},untilDate:Gn}):xn(new h.Api.messages.DeleteChatUser({chatId:ie(e.id),userId:ie(t.id,t.accessHash)}),!0)}function Ds(e,t){return xn(new h.Api.channels.ToggleJoinToSend({channel:ie(e.id,e.accessHash),enabled:t}),!0)}function Es(e,t){return xn(new h.Api.channels.ToggleJoinRequest({channel:ie(e.id,e.accessHash),enabled:t}),!0)}function Ts(e){const t={};return e.chats.forEach((e=>{t[`chat${e.id}`]=e})),e.users.forEach((e=>{t[`user${e.id}`]=e})),t}function xs(e){"users"in e&&Y(e.users),"chats"in e&&Y(e.chats),"messages"in e&&e.messages.forEach((e=>{e instanceof h.Api.Message&&fe(e)&&J(e)}))}async function Vs(e){let{hash:t}=e;const n=await xn(new h.Api.messages.ImportChatInvite({hash:t}));if(n instanceof h.Api.Updates&&n.chats.length)return ft(n.chats[0])}function Ns(e){let{chat:t,enabledReactions:n}=e;return xn(new h.Api.messages.SetChatAvailableReactions({peer:se(t.id,t.accessHash),availableReactions:n}),!0)}function Fs(e){let{chat:t,isProtected:n}=e;const{id:s,accessHash:a}=t;return xn(new h.Api.messages.ToggleNoForwards({peer:se(s,a),enabled:n}),!0)}function qs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}async function Ls(e,t){const n=await async function(e){return(await fetch(e)).blob()}(e);return function(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}(n,t)}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...s}=n;super(e,{type:t}),qs(this,"name",void 0),Object.assign(this,s)}else super(e),qs(this,"name",void 0);this.name=t}});var Hs=n(48764).Buffer;let Os;async function Gs(e){let{chat:t,threadId:n,...s}=e;const a=-1===n?h.Api.messages.GetHistory:h.Api.messages.GetReplies;let i;try{i=await xn(new a({peer:se(t.id,t.accessHash),...-1!==n&&{msgId:n},...s}),void 0,!0)}catch(e){"CHANNEL_PRIVATE"===e.message&&Os({"@type":"updateChat",id:t.id,chat:{isRestricted:!0}})}if(!i||i instanceof h.Api.messages.MessagesNotModified||!i.messages)return;_a(i);const o=i.messages.map(Le).filter(Boolean),r=i.users.map(Tt).filter(Boolean),c=i.chats.map((e=>ft(e))).filter(Boolean),l=o.map((e=>{let{threadInfo:t}=e;return t})).filter(Boolean);return{messages:o,users:r,chats:c,threadInfos:l}}async function Ks(e){let{chat:t,messageId:n}=e;const s="channel"===te(t.id);let a;try{a=await xn(s?new h.Api.channels.GetMessages({channel:ie(t.id,t.accessHash),id:[new h.Api.InputMessageID({id:n})]}):new h.Api.messages.GetMessages({id:[new h.Api.InputMessageID({id:n})]}),void 0,!0)}catch(e){const{message:t}=e;"CHANNEL_PRIVATE"!==t&&Os({"@type":"error",error:{message:t,isSlowMode:!1,hasErrorKey:!0}})}if(!a||a instanceof h.Api.messages.MessagesNotModified)return;const i=a.messages[0];if(!i)return;if(i instanceof h.Api.MessageEmpty)return"MESSAGE_DELETED";const o=i&&Le(i);return o?(i instanceof h.Api.Message&&J(i),{message:o,users:a.users.map(Tt).filter(Boolean)}):void 0}let zs=Promise.resolve();function Ws(e,t){let{chat:n,text:s,entities:a,replyingTo:i,replyingToTopId:o,attachment:r,sticker:c,gif:l,poll:d,contact:u,isSilent:g,scheduledAt:p,groupedId:f,noWebPage:m,sendAs:_,serverTimeOffset:y}=e;const b=function(e,t,n,s,a,i,o,r,c,l,d,u,g){let p=arguments.length>13&&void 0!==arguments[13]?arguments[13]:0;const f=Ne(),h=i&&st(i),m="chatTypeChannel"===e.type;return{id:f,chatId:e.id,content:{...t&&{text:{text:t,entities:n}},...h,...o&&{sticker:o},...r&&{video:r},...c&&it(c,f),...l&&{contact:l}},date:u||Math.round(Date.now()/1e3)+p,isOutgoing:!m,senderId:(null==g?void 0:g.id)||Fe,...s&&{replyToMessageId:s},...a&&{replyToTopMessageId:a},...d&&{groupedId:d,...h&&(h.photo||h.video)&&{isInAlbum:!0}},...u&&{isScheduled:!0}}}(n,s,a,i,o,r,c,l,d,u,f,p,_,y);Os({"@type":b.isScheduled?"newScheduledMessage":"newMessage",id:b.id,chatId:n.id,message:b}),setTimeout((()=>{Os({"@type":b.isScheduled?"updateScheduledMessage":"updateMessage",id:b.id,chatId:n.id,message:{sendingState:"messageSendingStatePending"}})}),1e3);const w=de();if(R.localMessages[String(w)]=b,f)return function(e,t,n,s){let{chat:a,text:i,entities:o,replyingTo:r,attachment:c,groupedId:l,isSilent:d,scheduledAt:u,sendAs:g}=e,p=-1;js[l]||(js[l]={counter:0,singleMediaByIndex:{}}),p=js[l].counter++;const f=zs;return zs=(async()=>{let e;try{e=await Qs(n,c,s)}catch(e){return js[l].counter--,void await f}const m=await async function(e,t){const n=await xn(new h.Api.messages.UploadMedia({peer:e,media:t}));if(n instanceof h.Api.MessageMediaPhoto&&n.photo&&n.photo instanceof h.Api.Photo){const{photo:{id:e,accessHash:t,fileReference:s}}=n;return new h.Api.InputMediaPhoto({id:new h.Api.InputPhoto({id:e,accessHash:t,fileReference:s})})}if(n instanceof h.Api.MessageMediaDocument&&n.document&&n.document instanceof h.Api.Document){const{document:{id:e,accessHash:t,fileReference:s}}=n;return new h.Api.InputMediaDocument({id:new h.Api.InputDocument({id:e,accessHash:t,fileReference:s})})}}(se(a.id,a.accessHash),e);if(await f,!m)return void js[l].counter--;if(js[l].singleMediaByIndex[p]=new h.Api.InputSingleMedia({media:m,randomId:t,message:i||"",entities:o?o.map(pe):void 0}),Object.keys(js[l].singleMediaByIndex).length{let e;if(r)try{e=await Qs(b,r,t)}catch(e){return void await v}else c?e=ce(c):l?e=ce(l):d?e=function(e,t){const{summary:n,quiz:s}=e,a=new h.Api.Poll({id:t,publicVoters:n.isPublic,question:n.question,answers:n.answers.map((e=>{let{text:t,option:n}=e;return new h.Api.PollAnswer({text:t,option:ee(n)})})),quiz:n.quiz,multipleChoice:n.multipleChoice});if(!s)return new h.Api.InputMediaPoll({poll:a});const i=s.correctAnswers.map(ee),{solution:o}=s,r=s.solutionEntities?s.solutionEntities.map(pe):[];return new h.Api.InputMediaPoll({poll:a,correctAnswers:i,...o&&{solution:o,solutionEntities:r}})}(d,w):u&&(e=new h.Api.InputMediaContact({phoneNumber:u.phoneNumber,firstName:u.firstName,lastName:u.lastName,vcard:""}));await v;const o=e?h.Api.messages.SendMedia:h.Api.messages.SendMessage;await xn(new o({clearDraft:!0,message:s||"",entities:a?a.map(pe):void 0,peer:se(n.id,n.accessHash),randomId:w,...g&&{silent:g},...p&&{scheduleDate:p},...i&&{replyToMsgId:i},...e&&{media:e},...m&&{noWebpage:m},..._&&{sendAs:se(_.id,_.accessHash)}}),!0)})(),zs}const js={};async function $s(e){let{chat:t,message:n,text:s,entities:a,noWebPage:i,serverTimeOffset:o}=e;const r=1e3*n.date>Date.now()+1e3*o,c={content:{...n.content,...s&&{text:{text:s,entities:a}}}};Os({"@type":r?"updateScheduledMessage":"updateMessage",id:n.id,chatId:t.id,message:c}),R.localMessages[n.id]={...n,...c};const l=a&&a.map(pe);await xn(new h.Api.messages.EditMessage({message:s||"",entities:l,peer:se(t.id,t.accessHash),id:n.id,...r&&{scheduleDate:n.date},...i&&{noWebpage:i}}),!0)}async function Js(e){let{chat:t,message:n,scheduledAt:s}=e;await xn(new h.Api.messages.EditMessage({peer:se(t.id,t.accessHash),id:n.id,scheduleDate:s}),!0)}async function Qs(e,t,n){const{filename:s,blobUrl:a,mimeType:i,quick:o,voice:r,audio:d,previewBlobUrl:u}=t,g=t=>{n.isCanceled?g.isCanceled=!0:n(t,e.id)},p=await Ls(a,s),f=await Fn(p,g),m=u&&await Ls(u,s),_=m?await Fn(m):void 0,y=[new h.Api.DocumentAttributeFilename({fileName:s})];if(o){if(c.has(i))return new h.Api.InputMediaUploadedPhoto({file:f});if(l.has(i)){const{width:e,height:t,duration:n}=o;void 0!==n&&y.push(new h.Api.DocumentAttributeVideo({duration:n,w:e,h:t,supportsStreaming:!0}))}}if(d){const{duration:e,title:t,performer:n}=d;y.push(new h.Api.DocumentAttributeAudio({duration:e,title:t,performer:n}))}if(r){const{duration:e,waveform:t}=r,{data:n}=V(t,63);y.push(new h.Api.DocumentAttributeAudio({voice:!0,duration:e,waveform:Hs.from(n)}))}return new h.Api.InputMediaUploadedDocument({file:f,mimeType:i,attributes:y,thumb:_})}async function Xs(e){let{chat:t,messageId:n,isUnpin:s,isOneSide:a,isSilent:i}=e;await xn(new h.Api.messages.UpdatePinnedMessage({peer:se(t.id,t.accessHash),id:n,...s&&{unpin:!0},...a&&{pmOneside:!0},...i&&{silent:!0}}),!0)}async function Ys(e){let{chat:t}=e;await xn(new h.Api.messages.UnpinAllMessages({peer:se(t.id,t.accessHash)}),!0)}async function Zs(e){let{chat:t,messageIds:n,shouldDeleteForAll:s}=e;const a="channel"===te(t.id);await xn(a?new h.Api.channels.DeleteMessages({channel:ie(t.id,t.accessHash),id:n}):new h.Api.messages.DeleteMessages({id:n,...s&&{revoke:!0}}))&&Os({"@type":"deleteMessages",ids:n,...a&&{chatId:t.id}})}async function ea(e){let{chat:t,messageIds:n}=e;await xn(new h.Api.messages.DeleteScheduledMessages({peer:se(t.id,t.accessHash),id:n}))&&Os({"@type":"deleteScheduledMessages",ids:n,chatId:t.id})}async function ta(e){let{chat:t,shouldDeleteForAll:n,maxId:s}=e;const a="channel"===te(t.id);await xn(a?new h.Api.channels.DeleteHistory({channel:ie(t.id,t.accessHash),maxId:s}):new h.Api.messages.DeleteHistory({peer:se(t.id,t.accessHash),...n&&{revoke:!0},...!n&&{just_clear:!0},maxId:s}))&&Os({"@type":"deleteHistory",chatId:t.id})}async function na(e){let{peer:t,messageIds:n,reason:s,description:a}=e;return await xn(new h.Api.messages.Report({peer:se(t.id,t.accessHash),id:n,reason:we(s),message:a}))}async function sa(e){let{peer:t,threadId:n,action:s}=e;const a=function(e){switch(e.type){case"cancel":return new h.Api.SendMessageCancelAction;case"typing":return new h.Api.SendMessageTypingAction;case"recordAudio":return new h.Api.SendMessageRecordAudioAction;case"chooseSticker":return new h.Api.SendMessageChooseStickerAction;case"playingGame":return new h.Api.SendMessageGamePlayAction}}(s);if(a)return await xn(new h.Api.messages.SetTyping({peer:se(t.id,t.accessHash),topMsgId:n,action:a}))}async function aa(e){let{chat:t,threadId:n,maxId:s,serverTimeOffset:a}=e;const i="channel"===te(t.id);i&&-1===n?await xn(new h.Api.channels.ReadHistory({channel:ie(t.id,t.accessHash),maxId:s})):i?await xn(new h.Api.messages.ReadDiscussion({peer:se(t.id,t.accessHash),msgId:n,readMaxId:s})):await xn(new h.Api.messages.ReadHistory({peer:se(t.id,t.accessHash),maxId:s})),-1===n?Qn({chat:t,serverTimeOffset:a,noLastMessage:!0}):oa({chat:t,threadId:n})}async function ia(e){let{chat:t,messageIds:n}=e;const s="channel"===te(t.id);await xn(s?new h.Api.channels.ReadMessageContents({channel:ie(t.id,t.accessHash),id:n}):new h.Api.messages.ReadMessageContents({id:n})),Os({...s?{"@type":"updateChannelMessages",channelId:t.id}:{"@type":"updateCommonBoxMessages"},ids:n,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}})}async function oa(e){let{chat:t,threadId:n}=e;const[s,a]=await Promise.all([xn(new h.Api.messages.GetDiscussionMessage({peer:se(t.id,t.accessHash),msgId:n})),xn(new h.Api.messages.GetReplies({peer:se(t.id,t.accessHash),msgId:n,offsetId:1,addOffset:-1,limit:1}))]);if(!s||!s.messages.length)return;const i=$(s.messages[0]);return i?(Os({"@type":"updateThreadInfo",chatId:i,threadId:n,threadInfo:{threadId:n,topMessageId:s.messages[s.messages.length-1].id,lastReadInboxMessageId:s.readInboxMaxId,messagesCount:a instanceof h.Api.messages.ChannelMessages?a.count:void 0},firstMessageId:a&&"messages"in a&&a.messages.length?a.messages[0].id:void 0}),s.chats.map((e=>ft(e))).filter(Boolean).forEach((e=>{Os({"@type":"updateChat",id:e.id,chat:e,noTopChatsRequest:!0})})),{discussionChatId:i}):void 0}async function ra(e){let t,{chat:n,type:s,query:a,topMessageId:i,minDate:o,maxDate:r,...c}=e;switch(s){case"media":t=new h.Api.InputMessagesFilterPhotoVideo;break;case"documents":t=new h.Api.InputMessagesFilterDocument;break;case"links":t=new h.Api.InputMessagesFilterUrl;break;case"audio":t=new h.Api.InputMessagesFilterMusic;break;case"voice":t=new h.Api.InputMessagesFilterRoundVoice;break;case"profilePhoto":t=new h.Api.InputMessagesFilterChatPhotos;break;default:t=new h.Api.InputMessagesFilterEmpty}const l=await xn(new h.Api.messages.Search({peer:se(n.id,n.accessHash),filter:t,q:a||"",topMsgId:i,minDate:o,maxDate:r,...c}));if(!l||l instanceof h.Api.messages.MessagesNotModified||!l.messages)return;_a(l);const d=l.chats.map((e=>ft(e))).filter(Boolean),u=l.users.map(Tt).filter(Boolean),g=l.messages.map(Le).filter(Boolean);let p,f=g.length;return(l instanceof h.Api.messages.MessagesSlice||l instanceof h.Api.messages.ChannelMessages)&&(f=l.count,g.length&&(p=g[g.length-1].id)),{chats:d,users:u,messages:g,totalCount:f,nextOffsetId:p}}async function ca(e){let t,{query:n,offsetRate:s=0,limit:a,type:i="text",minDate:o,maxDate:r}=e;switch(i){case"media":t=new h.Api.InputMessagesFilterPhotoVideo;break;case"documents":t=new h.Api.InputMessagesFilterDocument;break;case"links":t=new h.Api.InputMessagesFilterUrl;break;case"audio":t=new h.Api.InputMessagesFilterMusic;break;case"voice":t=new h.Api.InputMessagesFilterRoundVoice;break;default:if(!(n||r&&o))return;t=new h.Api.InputMessagesFilterEmpty}const c=await xn(new h.Api.messages.SearchGlobal({q:n,offsetRate:s,offsetPeer:new h.Api.InputPeerEmpty,limit:a,filter:t,folderId:0,minDate:o,maxDate:r}));if(!c||c instanceof h.Api.messages.MessagesNotModified||!c.messages)return;_a({chats:c.chats,users:c.users,messages:c.messages});const l=c.chats.map((e=>ft(e))).filter(Boolean),d=c.users.map(Tt).filter(Boolean),u=c.messages.map(Le).filter(Boolean);let g,p=u.length;return(c instanceof h.Api.messages.MessagesSlice||c instanceof h.Api.messages.ChannelMessages)&&(p=c.count,u.length&&(g=u[u.length-1].id)),{messages:u,users:d,chats:l,totalCount:p,nextRate:"nextRate"in c&&c.nextRate?c.nextRate:g}}async function la(e){let{message:t}=e;const n=await xn(new h.Api.messages.GetWebPagePreview({message:t}));return n&&tt(n)}async function da(e){let{chat:t,messageId:n,options:s}=e;const{id:a,accessHash:i}=t;await xn(new h.Api.messages.SendVote({peer:se(a,i),msgId:n,options:s.map(ee)}),!0)}async function ua(e){let{chat:t,messageId:n,poll:s}=e;const{id:a,accessHash:i}=t;await xn(new h.Api.messages.EditMessage({peer:se(a,i),id:n,media:le(s,!0)}))}async function ga(e){let{chat:t,messageId:n,option:s,offset:a,limit:i,shouldResetVoters:o}=e;const{id:r,accessHash:c}=t,l=await xn(new h.Api.messages.GetPollVotes({peer:se(r,c),id:n,...s&&{option:ee(s)},...a&&{offset:a},...i&&{limit:i}}));if(!l)return;_a({chats:[],users:l.users,messages:[]});const d=l.users.map(Tt).filter(Boolean),u=l.votes.map((e=>({userId:e.userId,date:e.date})));return{count:l.count,votes:u,users:d,nextOffset:l.nextOffset,shouldResetVoters:o}}async function pa(e){let{fromChat:t,toChat:n,messages:s,serverTimeOffset:a,isSilent:i,scheduledAt:o,sendAs:r,withMyScore:c}=e;const l=s.map((e=>{let{id:t}=e;return t})),d=s.map(de);s.forEach(((e,t)=>{const s=function(e,t,n,s){const a=Ne(),{content:i,chatId:o,id:r,senderId:c,groupedId:l,isInAlbum:d}=t,u=i.audio,g=e.id===Fe&&(o!==e.id||t.forwardInfo)&&!u;return{id:a,chatId:e.id,content:i,date:s||Math.round(Date.now()/1e3)+n,isOutgoing:!g&&"chatTypeChannel"!==e.type,senderId:Fe,sendingState:"messageSendingStatePending",groupedId:l,isInAlbum:d,...c!==Fe&&!u&&{forwardInfo:{date:t.date,isChannelPost:!1,fromChatId:o,fromMessageId:r,senderUserId:c}},...s&&{isScheduled:!0}}}(n,e,a,o);R.localMessages[String(d[t])]=s,Os({"@type":s.isScheduled?"newScheduledMessage":"newMessage",id:s.id,chatId:n.id,message:s})})),await xn(new h.Api.messages.ForwardMessages({fromPeer:se(t.id,t.accessHash),toPeer:se(n.id,n.accessHash),randomId:d,id:l,withMyScore:c||void 0,silent:i||void 0,...o&&{scheduleDate:o},...r&&{sendAs:se(r.id,r.accessHash)}}),!0)}async function fa(e){let{chat:t,timestamp:n}=e;const s=await xn(new h.Api.messages.GetHistory({peer:se(t.id,t.accessHash),offsetDate:n,addOffset:-1,limit:1}));if(s&&!(s instanceof h.Api.messages.MessagesNotModified)&&s.messages&&s.messages.length)return s.messages[0].id}async function ha(e){let{chat:t}=e;const{id:n,accessHash:s}=t,a=await xn(new h.Api.messages.GetScheduledHistory({peer:se(n,s)}));if(a&&!(a instanceof h.Api.messages.MessagesNotModified)&&a.messages)return _a(a),{messages:a.messages.map(Le).filter(Boolean)}}async function ma(e){let{chat:t,ids:n}=e;const{id:s,accessHash:a}=t;await xn(new h.Api.messages.SendScheduledMessages({peer:se(s,a),id:n}),!0)}function _a(e){Y(e.users),Y(e.chats),e.messages.forEach((e=>{(e instanceof h.Api.Message&&fe(e)||e instanceof h.Api.MessageService&&function(e){return"photo"in e.action&&e.action.photo instanceof h.Api.Photo}(e))&&J(e)}))}async function ya(e){let{chat:t}=e;const n=await xn(new h.Api.messages.Search({peer:se(t.id,t.accessHash),filter:new h.Api.InputMessagesFilterPinned,q:"",limit:50}));if(!n||n instanceof h.Api.messages.MessagesNotModified||!n.messages)return;_a(n);const s=n.chats.map((e=>ft(e))).filter(Boolean),a=n.users.map(Tt).filter(Boolean);return{messages:n.messages.map(Le).filter(Boolean),users:a,chats:s}}async function ba(e){let{chat:t,messageId:n}=e;const s=await xn(new h.Api.messages.GetMessageReadParticipants({peer:se(t.id,t.accessHash),msgId:n}));return s?s.map(String):void 0}async function wa(e){let{chat:t}=e;const n=await xn(new h.Api.channels.GetSendAs({peer:se(t.id,t.accessHash)}));if(n)return Y(n.users),Y(n.chats),{users:n.users.map(Tt).filter(Boolean),chats:n.chats.map((e=>ft(e))).filter(Boolean),ids:n.peers.map(W)}}function va(e){let{sendAs:t,chat:n}=e;return xn(new h.Api.messages.SaveDefaultSendAs({peer:se(n.id,n.accessHash),sendAs:se(t.id,t.accessHash)}))}async function Aa(e){let{chat:t}=e;const n=await xn(new h.Api.channels.GetSponsoredMessages({channel:se(t.id,t.accessHash)}));if(n&&n.messages.length)return _a(n),{messages:n.messages.map(qe).filter(Boolean),users:n.users.map(Tt).filter(Boolean),chats:n.chats.map((e=>ft(e))).filter(Boolean)}}async function Ia(e){let{chat:t,random:n}=e;await xn(new h.Api.channels.ViewSponsoredMessage({channel:se(t.id,t.accessHash),randomId:ee(n)}))}function Sa(e){let{chat:t}=e;return xn(new h.Api.messages.ReadMentions({peer:se(t.id,t.accessHash)}),!0)}function Ca(e){let{chat:t}=e;return xn(new h.Api.messages.ReadReactions({peer:se(t.id,t.accessHash)}),!0)}async function Pa(e){let{chat:t,...n}=e;const s=await xn(new h.Api.messages.GetUnreadMentions({peer:se(t.id,t.accessHash),limit:100,...n}));if(s&&!(s instanceof h.Api.messages.MessagesNotModified)&&s.messages)return _a(s),{messages:s.messages.map(Le).filter(Boolean),users:s.users.map(Tt).filter(Boolean),chats:s.chats.map((e=>ft(e))).filter(Boolean)}}async function Ma(e){let{chat:t,...n}=e;const s=await xn(new h.Api.messages.GetUnreadReactions({peer:se(t.id,t.accessHash),limit:100,...n}));if(s&&!(s instanceof h.Api.messages.MessagesNotModified)&&s.messages)return _a(s),{messages:s.messages.map(Le).filter(Boolean),users:s.users.map(Tt).filter(Boolean),chats:s.chats.map((e=>ft(e))).filter(Boolean)}}async function ka(e){let{chat:t,messageId:n}=e;const s=await xn(new h.Api.messages.TranscribeAudio({msgId:n,peer:se(t.id,t.accessHash)}));if(s)return Os({"@type":"updateTranscribedAudio",isPending:s.pending,transcriptionId:s.transcriptionId.toString(),text:s.text}),s.transcriptionId.toString()}let Ra,Ba,Ua,Da;async function Ea(e){let{id:t,accessHash:n}=e;const s=ie(t,n);if(!(s instanceof h.Api.InputUser))return;const a=await xn(new h.Api.users.GetFullUser({id:s}));if(!a)return;a.fullUser.profilePhoto instanceof h.Api.Photo&&(R.photos[a.fullUser.profilePhoto.id.toString()]=a.fullUser.profilePhoto);const i=a.fullUser.botInfo;(null==i?void 0:i.descriptionPhoto)instanceof h.Api.Photo&&(R.photos[i.descriptionPhoto.id.toString()]=i.descriptionPhoto),(null==i?void 0:i.descriptionDocument)instanceof h.Api.Document&&(R.documents[i.descriptionDocument.id.toString()]=i.descriptionDocument);const o=Et(a);Ra({"@type":"updateUser",id:t,user:{fullInfo:o.fullInfo}})}async function Ta(e,t,n){const s=await xn(new h.Api.messages.GetCommonChats({userId:ie(e,t),maxId:n?Ae(n,te(n)):void 0,limit:100}));if(!s)return;Ka(s);const a=[],i=[];return s.chats.forEach((e=>{const t=ft(e);t&&(i.push(t),a.push(t.id))})),{chats:i,chatIds:a,isFullyLoaded:a.length<100}}async function xa(){const e=await xn(new h.Api.help.GetNearestDc);return null==e?void 0:e.country}async function Va(){const e=await xn(new h.Api.contacts.GetTopPeers({correspondents:!0}));if(!(e instanceof h.Api.contacts.TopPeers))return;const t=e.users.map(Tt).filter((e=>Boolean(e)&&!e.isSelf));return{ids:t.map((e=>{let{id:t}=e;return t})),users:t}}async function Na(){const e=await xn(new h.Api.contacts.GetContacts({hash:F()("0")}));if(!e||e instanceof h.Api.contacts.ContactsNotModified)return;e.users.forEach((e=>{e instanceof h.Api.User&&X(e,!0)}));const{users:t,userStatusesById:n}=Vt(e.users);return{users:t,userStatusesById:n,chats:e.users.map((e=>ft(e))).filter(Boolean)}}async function Fa(e){let{users:t}=e;const n=await xn(new h.Api.users.GetUsers({id:t.map((e=>{let{id:t,accessHash:n}=e;return se(t,n)}))}));if(n&&n.length)return n.forEach((e=>{e instanceof h.Api.User&&X(e,!0)})),Vt(n)}async function qa(e){let{phone:t,firstName:n,lastName:s}=e;const a=await xn(new h.Api.contacts.ImportContacts({contacts:[he({phone:t||"",firstName:n||"",lastName:s||""})]}));return a instanceof h.Api.contacts.ImportedContacts&&a.users.length&&X(a.users[0]),null!=a&&a.imported.length?z(a.imported[0].userId,"user"):void 0}function La(e){let{id:t,accessHash:n,phoneNumber:s="",firstName:a="",lastName:i="",shouldSharePhoneNumber:o=!1}=e;return xn(new h.Api.contacts.AddContact({id:ie(t,n),firstName:a,lastName:i,phone:s,...o&&{addPhonePrivacyException:o}}),!0)}async function Ha(e){let{id:t,accessHash:n}=e;const s=ie(t,n);s instanceof h.Api.InputUser&&await xn(new h.Api.contacts.DeleteContacts({id:[s]}))&&Ra({"@type":"deleteContact",id:t})}async function Oa(e,t){if(e){const{id:t,accessHash:n}=e,s=await xn(new h.Api.photos.GetUserPhotos({userId:ie(t,n),limit:40,offset:0,maxId:F()("0")}));if(!s)return;return Ka(s),{photos:s.photos.filter((e=>e instanceof h.Api.Photo)).map(S)}}const n=await ra({chat:t,type:"profilePhoto",limit:40});if(!n)return;const{messages:s,users:a}=n;return{photos:s.map((e=>e.content.action.photo)).filter(Boolean),users:a}}function Ga(e){const{id:t,accessHash:n}=e;return xn(new h.Api.messages.ReportSpam({peer:se(t,n)}),!0)}function Ka(e){"chats"in e&&Y(e.chats),"photos"in e&&e.photos.forEach(Q)}async function za(e){let{hash:t="0"}=e;const n=await xn(new h.Api.messages.GetAllStickers({hash:F()(t)}));if(n&&!(n instanceof h.Api.messages.AllStickersNotModified))return n.sets.forEach((e=>{var t;null!==(t=e.thumbs)&&void 0!==t&&t.length&&(R.stickerSets[String(e.id)]=e)})),{hash:String(n.hash),sets:n.sets.map(T)}}async function Wa(e){let{hash:t="0"}=e;const n=await xn(new h.Api.messages.GetRecentStickers({hash:F()(t)}));if(n&&!(n instanceof h.Api.messages.RecentStickersNotModified))return{hash:String(n.hash),stickers:li(n.stickers.slice(0,20))}}async function ja(e){let{hash:t="0"}=e;const n=await xn(new h.Api.messages.GetFavedStickers({hash:F()(t)}));if(n&&!(n instanceof h.Api.messages.FavedStickersNotModified))return{hash:String(n.hash),stickers:li(n.stickers)}}async function $a(e){let{hash:t="0"}=e;const n=await xn(new h.Api.messages.GetFeaturedStickers({hash:F()(t)}));if(n&&!(n instanceof h.Api.messages.FeaturedStickersNotModified))return{hash:String(n.hash),isPremium:Boolean(n.premium),sets:n.sets.map(x)}}async function Ja(e){let{sticker:t,unfave:n}=e;const s=new h.Api.messages.FaveSticker({id:re(t),unfave:n});await xn(s)&&Ba({"@type":"updateFavoriteStickers"})}function Qa(e){let{sticker:t}=e;return xn(new h.Api.messages.SaveRecentSticker({id:re(t),unsave:!0}))}function Xa(){return xn(new h.Api.messages.ClearRecentStickers)}async function Ya(e){let{stickerSetShortName:t,stickerSetId:n,accessHash:s}=e;const a=await xn(new h.Api.messages.GetStickerSet({stickerset:n?oe(n,s):(i=t,new h.Api.InputStickerSetShortName({shortName:i}))}));var i,o;if(a instanceof h.Api.messages.StickerSet)return{set:T(a.set),stickers:li(a.documents),packs:(o=a.packs,o.reduce(((e,t)=>{let{emoticon:n,documents:s}=t;return e[n]=s.map((e=>E(R.documents[String(e)]))).filter(Boolean),e}),{}))}}async function Za(){const e=await xn(new h.Api.messages.GetStickerSet({stickerset:new h.Api.InputStickerSetAnimatedEmoji}));if(e instanceof h.Api.messages.StickerSet)return{set:T(e.set),stickers:li(e.documents)}}async function ei(){const e=await xn(new h.Api.messages.GetStickerSet({stickerset:new h.Api.InputStickerSetAnimatedEmojiAnimations}));if(e instanceof h.Api.messages.StickerSet)return{set:T(e.set),stickers:li(e.documents)}}async function ti(e){let{query:t,hash:n="0"}=e;const s=await xn(new h.Api.messages.SearchStickerSets({q:t,hash:F()(n)}));if(s&&!(s instanceof h.Api.messages.FoundStickerSetsNotModified))return{hash:String(s.hash),sets:s.sets.map(x)}}async function ni(e){let{hash:t="0"}=e;const n=await xn(new h.Api.messages.GetSavedGifs({hash:F()(t)}));if(n&&!(n instanceof h.Api.messages.SavedGifsNotModified))return{hash:String(n.hash),gifs:di(n.gifs)}}function si(e){let{gif:t,shouldUnsave:n}=e;return xn(new h.Api.messages.SaveGif({id:re(t),unsave:n}),!0)}async function ai(e){let{stickerSetId:t,accessHash:n}=e;await xn(new h.Api.messages.InstallStickerSet({stickerset:oe(t,n)}))&&Ba({"@type":"updateStickerSet",id:t,stickerSet:{installedDate:Date.now()}})}async function ii(e){let{stickerSetId:t,accessHash:n}=e;await xn(new h.Api.messages.UninstallStickerSet({stickerset:oe(t,n)}))&&Ba({"@type":"updateStickerSet",id:t,stickerSet:{installedDate:void 0}})}async function oi(e){let{query:t,offset:n=""}=e;if(!Ua){const e=await xn(new h.Api.help.GetConfig);if(!e)return;const t=await xn(new h.Api.contacts.ResolveUsername({username:e.gifSearchUsername}));if(!(t&&t.users[0]instanceof h.Api.User))return;Ua=new h.Api.InputUser({userId:t.peer.userId,accessHash:t.users[0].accessHash})}const s=await xn(new h.Api.messages.GetInlineBotResults({bot:Ua,peer:new h.Api.InputPeerEmpty,query:t,offset:n}));if(!s)return;const a=s.results.map((e=>{if(e instanceof h.Api.BotInlineMediaResult)return e.document})).filter(Boolean);return{nextOffset:s.nextOffset,gifs:di(a)}}async function ri(e){let{emoji:t,hash:n="0"}=e;const s=await xn(new h.Api.messages.GetStickers({emoticon:t,hash:F()(n)}));if(s&&!(s instanceof h.Api.messages.StickersNotModified))return{stickers:li(s.stickers),hash:String(s.hash)}}async function ci(e){let{language:t,fromVersion:n}=e;const s=await xn(new h.Api.messages.GetEmojiKeywordsDifference({langCode:t,fromVersion:n}));if(s)return{language:s.langCode,version:s.version,keywords:s.keywords.reduce(((e,t)=>(e[t.keyword]=t.emoticons,e)),{})}}function li(e){return e.map((e=>{if(e instanceof h.Api.Document){const t=E(e);if(t)return R.documents[String(e.id)]=e,t}})).filter(Boolean)}function di(e){return e.map((e=>{if(e instanceof h.Api.Document){const t=Qe(e);if(t)return R.documents[String(e.id)]=e,t}})).filter(Boolean)}function ui(e){let{username:t}=e;return xn(new h.Api.channels.CheckUsername({channel:new h.Api.InputChannelEmpty,username:t}))}async function gi(e){let{chat:t,username:n}=e;await xn(new h.Api.channels.UpdateUsername({channel:ie(t.id,t.accessHash),username:n}))&&Da({"@type":"updateChat",id:t.id,chat:{username:n}})}async function pi(e){let{chat:t,usageLimit:n,expireDate:s}=e;const a=await xn(new h.Api.messages.ExportChatInvite({peer:se(t.id,t.accessHash),usageLimit:n,expireDate:s}));if(a instanceof h.Api.ChatInviteExported)return Da({"@type":"updateChatFullInfo",id:t.id,fullInfo:{inviteLink:a.link}}),a.link}async function fi(e){let{peer:t,admin:n,limit:s=0,isRevoked:a}=e;const i=await xn(new h.Api.messages.GetExportedChatInvites({peer:se(t.id,t.accessHash),adminId:ie(n.id,n.accessHash),limit:s,revoked:a||void 0}));if(i)return Y(i.users),i.invites.filter((e=>e instanceof h.Api.ChatInviteExported)).map(Pt)}async function hi(e){let{peer:t,isRevoked:n,link:s,expireDate:a,usageLimit:i,isRequestNeeded:o,title:r}=e;const c=await xn(new h.Api.messages.EditExportedChatInvite({link:s,peer:se(t.id,t.accessHash),expireDate:a,usageLimit:o?void 0:i,requestNeeded:o,title:r,revoked:n||void 0}));if(c){if(Y(c.users),c instanceof h.Api.messages.ExportedChatInvite&&c.invite instanceof h.Api.ChatInviteExported){const e=Pt(c.invite);return{oldInvite:e,newInvite:e}}if(c instanceof h.Api.messages.ExportedChatInviteReplaced&&c.invite instanceof h.Api.ChatInviteExported&&c.newInvite instanceof h.Api.ChatInviteExported)return{oldInvite:Pt(c.invite),newInvite:Pt(c.newInvite)}}}async function mi(e){let{peer:t,expireDate:n,usageLimit:s,isRequestNeeded:a,title:i}=e;const o=await xn(new h.Api.messages.ExportChatInvite({peer:se(t.id,t.accessHash),expireDate:n,usageLimit:a?void 0:s,requestNeeded:a||void 0,title:i}));if(o instanceof h.Api.ChatInviteExported)return Pt(o)}async function _i(e){let{peer:t,link:n}=e;return await xn(new h.Api.messages.DeleteExportedChatInvite({peer:se(t.id,t.accessHash),link:n}))}async function yi(e){let{peer:t,admin:n}=e;return await xn(new h.Api.messages.DeleteRevokedExportedChatInvites({peer:se(t.id,t.accessHash),adminId:ie(n.id,n.accessHash)}))}async function bi(e){let{peer:t,link:n,offsetDate:s=0,offsetUser:a,limit:i=0,isRequested:o}=e;const r=await xn(new h.Api.messages.GetChatInviteImporters({peer:se(t.id,t.accessHash),link:n,offsetDate:s,offsetUser:a?ie(a.id,a.accessHash):new h.Api.InputUserEmpty,limit:i,requested:o||void 0}));if(!r)return;const c=r.users.map((e=>Tt(e))).filter(Boolean);return Y(r.users),{importers:r.importers.map((e=>function(e){const{userId:t,date:n,about:s,requested:a}=e;return{userId:z(t,"user"),date:n,about:s,isRequested:a}}(e))),users:m(c,"id")}}function wi(e){let{peer:t,user:n,isApproved:s}=e;return xn(new h.Api.messages.HideChatJoinRequest({peer:se(t.id,t.accessHash),userId:ie(n.id,n.accessHash),approved:s||void 0}),!0)}function vi(e){let{peer:t,isApproved:n,link:s}=e;return xn(new h.Api.messages.HideAllChatJoinRequests({peer:se(t.id,t.accessHash),approved:n||void 0,link:s}),!0)}function Ai(e){const{id:t,accessHash:n}=e;return xn(new h.Api.messages.HidePeerSettingsBar({peer:se(t,n)}))}const Ii={EMAIL_UNCONFIRMED:"Email unconfirmed",EMAIL_HASH_EXPIRED:"Email hash expired",NEW_SALT_INVALID:"The new salt is invalid",NEW_SETTINGS_INVALID:"The new password settings are invalid",CODE_INVALID:"Invalid Code",PASSWORD_HASH_INVALID:"Invalid Password"},Si={};let Ci,Pi;async function Mi(){const e=await xn(new h.Api.account.GetPassword);if(!e)return;const{hint:t,hasPassword:n}=e;return{hint:t,hasPassword:n}}function ki(e){return Ci({"@type":"updateTwoFaStateWaitCode",length:e}),new Promise(((e,t)=>{Si.resolve=e,Si.reject=t}))}async function Ri(e){try{return await qn({isCheckPassword:!0,currentPassword:e}),!0}catch(e){return Ti(e),!1}}async function Bi(e){try{return await qn({currentPassword:e}),!0}catch(e){return Ti(e),!1}}async function Ui(e,t,n,s){try{return await qn({currentPassword:e,newPassword:t,hint:n,email:s,emailCodeCallback:ki,onEmailCodeError:Ti}),!0}catch(e){return Ti(e),!1}}async function Di(e,t){try{return await qn({currentPassword:e,newPassword:e,email:t,emailCodeCallback:ki,onEmailCodeError:Ti}),!0}catch(e){return Ti(e),!1}}function Ei(e){Si.resolve(e)}function Ti(e){let t;if(e instanceof h.errors.FloodWaitError){const n=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(n>1?`${n} hours`:"an hour")}else t=Ii[e.message];t||(t="Unexpected Error"),Ci({"@type":"updateTwoFaError",message:t})}async function xi(e){let{chatId:t,accessHash:n,messageId:s,data:a,isGame:i}=e;const o=await xn(new h.Api.messages.GetBotCallbackAnswer({peer:se(t,n),msgId:s,data:a?ee(a):void 0,game:i||void 0}));return o?w(o):void 0}async function Vi(){const e=await xn(new h.Api.contacts.GetTopPeers({botsInline:!0}));if(!(e instanceof h.Api.contacts.TopPeers))return;const t=e.users.map(Tt).filter(Boolean);return{ids:t.map((e=>{let{id:t}=e;return t})),users:t}}async function Ni(e){let{username:t}=e;const n=await xn(new h.Api.contacts.ResolveUsername({username:t}));if(n&&n.users[0]instanceof h.Api.User&&n.users[0].bot&&n.users[0].botInlinePlaceholder)return X(n.users[0]),{user:Tt(n.users[0]),chat:ft(n.users[0])}}async function Fi(e){let{bot:t,chat:n,query:s,offset:a=""}=e;const i=await xn(new h.Api.messages.GetInlineBotResults({bot:se(t.id,t.accessHash),peer:se(n.id,n.accessHash),query:s,offset:a}));var o,r,c,l,d;if(i)return Y(i.users),{isGallery:Boolean(i.gallery),help:t.botPlaceholder,nextOffset:(l=t.username,d=i.nextOffset,"gif"===l&&"0"===d?"":d),switchPm:(c=i.switchPm,c?_(c,["text","startParam"]):void 0),users:i.users.map(Tt).filter(Boolean),results:(o=String(i.queryId),r=i.results,r.map((e=>{return e instanceof h.Api.BotInlineMediaResult?(e.document instanceof h.Api.Document&&(t=e.document,R.documents[String(t.id)]=t),e.photo instanceof h.Api.Photo&&(n=e.photo,R.photos[String(n.id)]=n),function(e,t){const{id:n,type:s,title:a,description:i,photo:o,document:r}=e;return{id:n,queryId:t,type:s,title:a,description:i,..."sticker"===s&&r instanceof h.Api.Document&&{sticker:E(r)},...o instanceof h.Api.Photo&&{photo:S(o)},..."gif"===s&&r instanceof h.Api.Document&&{gif:Qe(r)},..."video"===s&&r instanceof h.Api.Document&&{thumbnail:I(r.thumbs)}}}(e,o)):(e.thumb&&(s=e.thumb,R.webDocuments[s.url]=s),function(e,t){const{id:n,type:s,title:a,description:i,url:o,thumb:r}=e;return{id:n,queryId:t,type:s,title:a,description:i,url:o,webThumbnail:at(r)}}(e,o));var t,n,s})))}}async function qi(e){let{chat:t,resultId:n,queryId:s,replyingTo:a,sendAs:i,isSilent:o,scheduleDate:r}=e;const c=de();await xn(new h.Api.messages.SendInlineBotResult({clearDraft:!0,randomId:c,queryId:F()(s),peer:se(t.id,t.accessHash),id:n,scheduleDate:r,...o&&{silent:!0},...a&&{replyToMsgId:a},...i&&{sendAs:se(i.id,i.accessHash)}}),!0)}async function Li(e){let{bot:t,startParam:n}=e;const s=de();await xn(new h.Api.messages.StartBot({bot:se(t.id,t.accessHash),peer:se(t.id,t.accessHash),randomId:s,startParam:n}),!0)}async function Hi(e){let{isSilent:t,peer:n,bot:s,url:a,startParam:i,replyToMessageId:o,theme:r,sendAs:c,isFromBotMenu:l}=e;const d=await xn(new h.Api.messages.RequestWebView({silent:t||void 0,peer:se(n.id,n.accessHash),bot:se(s.id,s.accessHash),replyToMsgId:o,url:a,startParam:i,themeParams:r?ve(r):void 0,fromBotMenu:l||void 0,...c&&{sendAs:se(c.id,c.accessHash)}}));if(d instanceof h.Api.WebViewResultUrl)return{url:d.url,queryId:d.queryId.toString()}}async function Oi(e){let{bot:t,url:n,theme:s}=e;const a=await xn(new h.Api.messages.RequestSimpleWebView({url:n,bot:se(t.id,t.accessHash),themeParams:s?ve(s):void 0}));return null==a?void 0:a.url}function Gi(e){let{isSilent:t,peer:n,bot:s,queryId:a,replyToMessageId:i,sendAs:o}=e;return xn(new h.Api.messages.ProlongWebView({silent:t||void 0,peer:se(n.id,n.accessHash),bot:se(s.id,s.accessHash),queryId:F()(a),replyToMsgId:i,...o&&{sendAs:se(o.id,o.accessHash)}}))}async function Ki(e){let{bot:t,buttonText:n,data:s}=e;const a=de();await xn(new h.Api.messages.SendWebViewData({bot:se(t.id,t.accessHash),buttonText:n,data:s,randomId:a}),!0)}async function zi(e){let{hash:t}=e;const n=await xn(new h.Api.messages.GetAttachMenuBots({hash:t?F()(t):void 0}));if(n instanceof h.Api.AttachMenuBots)return Y(n.users),{hash:n.hash.toString(),bots:m(n.bots.map(kt),"id")}}function Wi(e){let{bot:t,isEnabled:n}=e;return xn(new h.Api.messages.ToggleBotInAttachMenu({bot:se(t.id,t.accessHash),enabled:n}))}async function ji(e){let{chat:t,buttonId:n,messageId:s}=e;const a=await xn(new h.Api.messages.RequestUrlAuth({peer:se(t.id,t.accessHash),buttonId:n,msgId:s}));if(!a)return;const i=Kt(a);return"request"===(null==i?void 0:i.type)&&Pi({"@type":"updateUser",id:i.bot.id,user:i.bot}),i}async function $i(e){let{chat:t,messageId:n,buttonId:s,isWriteAllowed:a}=e;const i=await xn(new h.Api.messages.AcceptUrlAuth({peer:se(t.id,t.accessHash),msgId:n,buttonId:s,writeAllowed:a||void 0}));if(!i)return;const o=Kt(i);return"request"===(null==o?void 0:o.type)&&Pi({"@type":"updateUser",id:o.bot.id,user:o.bot}),o}async function Ji(e){let{url:t}=e;const n=await xn(new h.Api.messages.RequestUrlAuth({url:t}));if(!n)return;const s=Kt(n);return"request"===(null==s?void 0:s.type)&&Pi({"@type":"updateUser",id:s.bot.id,user:s.bot}),s}async function Qi(e){let{url:t,isWriteAllowed:n}=e;const s=await xn(new h.Api.messages.AcceptUrlAuth({url:t,writeAllowed:n||void 0}));if(!s)return;const a=Kt(s);return"request"===(null==a?void 0:a.type)&&Pi({"@type":"updateUser",id:a.bot.id,user:a.bot}),a}var Xi=n(48764).Buffer;let Yi,Zi;async function eo(e){let{call:t}=e;const n=await xn(new h.Api.phone.GetGroupCall({call:Ie(t)}));if(!n)return;Y(n.users),Y(n.chats);const s=n.users.map(Tt).filter(Boolean),a=n.chats.map((e=>ft(e))).filter(Boolean);return{groupCall:Re(n.call),users:s,chats:a}}function to(e){let{call:t}=e;return xn(new h.Api.phone.DiscardGroupCall({call:Ie(t)}),!0)}function no(e){let{call:t,participant:n,muted:s,presentationPaused:a,videoStopped:i,videoPaused:o,volume:r,raiseHand:c}=e;return xn(new h.Api.phone.EditGroupCallParticipant({call:Ie(t),participant:se(n.id,n.accessHash),...void 0!==i&&{videoStopped:i},...void 0!==o&&{videoPaused:o},...void 0!==s&&{muted:s},...void 0!==a&&{presentationPaused:a},...void 0!==c&&{raiseHand:c},...void 0!==r&&{volume:r}}),!0)}function so(e){let{groupCall:t,title:n}=e;return xn(new h.Api.phone.EditGroupCallTitle({title:n,call:Ie(t)}),!0)}async function ao(e){let{call:t,canSelfUnmute:n}=e;const s=await xn(new h.Api.phone.ExportGroupCallInvite({canSelfUnmute:n||void 0,call:Ie(t)}));if(s)return s.link}async function io(e){let{call:t,offset:n}=e;const s=await xn(new h.Api.phone.GetGroupParticipants({call:Ie(t),ids:[],sources:[],offset:n||"",limit:100}));if(!s)return;Y(s.users),Y(s.chats);const a=s.users.map(Tt).filter(Boolean),i=s.chats.map((e=>ft(e))).filter(Boolean);return Yi({"@type":"updateGroupCallParticipants",groupCallId:t.id,participants:s.participants.map(Pe),nextOffset:s.nextOffset}),{users:a,chats:i}}function oo(e){let{call:t}=e;return xn(new h.Api.phone.LeaveGroupCall({call:Ie(t)}),!0)}async function ro(e){let{call:t,inviteHash:n,params:s}=e;const a=await xn(new h.Api.phone.JoinGroupCall({call:Ie(t),joinAs:new h.Api.InputPeerSelf,muted:!0,videoStopped:!0,params:new h.Api.DataJSON({data:JSON.stringify(s)}),inviteHash:n}));if(a&&a instanceof h.Api.Updates){const e=a.updates.find((e=>e instanceof h.Api.UpdateGroupCall));if(!(e instanceof h.Api.UpdateGroupCall))return;return Re(e.call)}}async function co(e){let{peer:t}=e;const n=ue(),s=await xn(new h.Api.phone.CreateGroupCall({peer:se(t.id,t.accessHash),randomId:n}));if(s&&s instanceof h.Api.Updates){const e=s.updates[0];if(e instanceof h.Api.UpdateGroupCall)return Re(e.call)}}function lo(e){let{call:t,params:n}=e;return xn(new h.Api.phone.JoinGroupCallPresentation({call:Ie(t),params:new h.Api.DataJSON({data:JSON.stringify(n)})}),!0)}function uo(e){let{call:t,subscribed:n}=e;return xn(new h.Api.phone.ToggleGroupCallStartSubscription({call:Ie(t),subscribed:n}),!0)}function go(e){let{call:t}=e;return xn(new h.Api.phone.LeaveGroupCallPresentation({call:Ie(t)}),!0)}async function po(){const e=await xn(new h.Api.messages.GetDhConfig({}));if(e&&!(e instanceof h.Api.messages.DhConfigNotModified))return{g:e.g,p:Array.from(e.p),random:Array.from(e.random)}}function fo(e){let{call:t,isBusy:n}=e;return xn(new h.Api.phone.DiscardCall({peer:Se(t),reason:n?new h.Api.PhoneCallDiscardReasonBusy:new h.Api.PhoneCallDiscardReasonHangup}),!0)}async function ho(e){let{user:t,gAHash:n,isVideo:s}=e;const a=await xn(new h.Api.phone.RequestCall({randomId:ue(),userId:se(t.id,t.accessHash),gAHash:Xi.from(n),...s&&{video:!0},protocol:Te()}));if(!a)return!1;const i=Be(a.phoneCall);return Yi({"@type":"updatePhoneCall",call:i}),!0}function mo(e){let{call:t,rating:n,comment:s}=e;return xn(new h.Api.phone.SetCallRating({rating:n,peer:Se(t),comment:s}),!0)}function _o(e){let{call:t}=e;return xn(new h.Api.phone.ReceivedCall({peer:Se(t)}))}async function yo(e){let{call:t,gB:n}=e;const s=await xn(new h.Api.phone.AcceptCall({peer:Se(t),gB:Xi.from(n),protocol:Te()}));s&&(t=Be(s.phoneCall),Yi({"@type":"updatePhoneCall",call:t}))}async function bo(e){let{call:t,gA:n,keyFingerprint:s}=e;const a=await xn(new h.Api.phone.ConfirmCall({peer:Se(t),gA:Xi.from(n),keyFingerprint:F()(s),protocol:Te()}));a&&(t=Be(a.phoneCall),Yi({"@type":"updatePhoneCall",call:t}))}function wo(e){let{data:t,call:n}=e;return xn(new h.Api.phone.SendSignalingData({data:Xi.from(t),peer:Se(n)}))}function vo(e){if(e)return Object.values(e).map((e=>({id:e.id,title:e.title,amount:e.prices.reduce(((e,t)=>e+t.amount.toJSNumber()),0),prices:e.prices.map((e=>{let{label:t,amount:n}=e;return{label:t,amount:n.toJSNumber()}}))})))}function Ao(e){const{formId:t,canSaveCredentials:n,passwordMissing:s,providerId:a,nativeProvider:i,nativeParams:o,savedInfo:r,invoice:c}=e,{test:l,nameRequested:d,phoneRequested:u,emailRequested:g,shippingAddressRequested:p,flexible:f,phoneToProvider:h,emailToProvider:m,currency:_,prices:y}=c,b=y.map((e=>{let{label:t,amount:n}=e;return{label:t,amount:n.toJSNumber()}})),{shippingAddress:v}=r||{},A=r?w(r):void 0;A&&v&&(A.shippingAddress=w(v));const I=o?JSON.parse(o.data):{};return{canSaveCredentials:n,passwordMissing:s,formId:String(t),providerId:String(a),nativeProvider:i,savedInfo:A,invoice:{test:l,nameRequested:d,phoneRequested:u,emailRequested:g,shippingAddressRequested:p,flexible:f,phoneToProvider:h,emailToProvider:m,currency:_,prices:b},nativeParams:{needCardholderName:I.need_cardholder_name,needCountry:I.need_country,needZip:I.need_zip,publishableKey:I.publishable_key,publicToken:null==I?void 0:I.public_token}}}function Io(e){const{invoice:t,description:n,title:s,photo:a}=e,{test:i,currency:o,prices:r,recurring:c,recurringTermsUrl:l}=t,d=r.reduce(((e,t)=>e+t.amount.toJSNumber()),0);return{text:n,title:s,photo:at(a),amount:d,currency:o,isTest:i,isRecurring:c,recurringTermsUrl:l}}function So(e){const{statusText:t,statusEntities:n,videos:s,videoSections:a,currency:i,monthlyAmount:o}=e;return{statusText:t,statusEntities:n.map((e=>ot(e))),videoSections:a,currency:i,videos:s.map(Xe).filter(Boolean),monthlyAmount:o.toString()}}async function Co(e){let{inputInvoice:t,requestInfo:n,shouldSave:s}=e;const a=await xn(new h.Api.payments.ValidateRequestedInfo({invoice:Ce(t),save:s||void 0,info:ye(n)}));if(!a)return;const{id:i,shippingOptions:o}=a;return i?{id:i,shippingOptions:vo(o)}:void 0}async function Po(e){let{inputInvoice:t,formId:n,requestedInfoId:s,shippingOptionId:a,credentials:i}=e;const o=await xn(new h.Api.payments.SendPaymentForm({formId:F()(n),invoice:Ce(t),requestedInfoId:s,shippingOptionId:a,credentials:new h.Api.InputPaymentCredentials({save:i.save,data:new h.Api.DataJSON({data:JSON.stringify(i.data)})})}));if(!(o instanceof h.Api.payments.PaymentVerificationNeeded))return Boolean(o);Zi({"@type":"updatePaymentVerificationNeeded",url:o.url})}async function Mo(e){const t=await xn(new h.Api.payments.GetPaymentForm({invoice:Ce(e)}));if(t)return t.photo&&(R.webDocuments[t.photo.url]=t.photo),{form:Ao(t),invoice:Io(t)}}async function ko(e,t){const n=await xn(new h.Api.payments.GetPaymentReceipt({peer:se(e.id,e.accessHash),msgId:t}));if(n)return function(e){const{invoice:t,info:n,shipping:s,currency:a,totalAmount:i,credentialsTitle:o}=e,{shippingAddress:r,phone:c,name:l}=n||{},{prices:d}=t,u=d.map((e=>{let{label:t,amount:n}=e;return{label:t,amount:n.toJSNumber()}}));let g,p;return s&&(g=s.prices.map((e=>{let{label:t,amount:n}=e;return{label:t,amount:n.toJSNumber()}})),p=s.title),{currency:a,prices:u,info:{shippingAddress:r,phone:c,name:l},totalAmount:i.toJSNumber(),credentialsTitle:o,shippingPrices:g,shippingMethod:p}}(n)}async function Ro(){const e=await xn(new h.Api.help.GetPremiumPromo);if(!e)return;Y(e.users);const t=e.users.map(Tt).filter(Boolean);return e.videos.forEach((e=>{e instanceof h.Api.Document&&(R.documents[e.id.toString()]=e)})),{promo:So(e),users:t}}async function Bo(e){let{peer:t,reason:n,description:s}=e;return await xn(new h.Api.account.ReportPeer({peer:se(t.id,t.accessHash),reason:we(n),message:s}))}async function Uo(e){let{peer:t,photo:n,reason:s,description:a}=e;const i=function(e){const t=R.photos[null==e?void 0:e.id];if(t)return new h.Api.InputPhoto(_(t,["id","accessHash","fileReference"]))}(n);if(i)return await xn(new h.Api.account.ReportProfilePhoto({peer:se(t.id,t.accessHash),photoId:i,reason:we(s),message:a}))}async function Do(e){let{hash:t,areCallsEnabled:n,areSecretChatsEnabled:s}=e;return await xn(new h.Api.account.ChangeAuthorizationSettings({hash:F()(t),...void 0!==n?{callRequestsDisabled:!n}:void 0,...void 0!==s?{encryptedRequestsDisabled:!s}:void 0}))}async function Eo(e){let{days:t}=e;return await xn(new h.Api.account.SetAuthorizationTTL({authorizationTtlDays:t}))}var To=n(48764).Buffer;function xo(e){const{emojies_sounds:t}=e;return t?Object.keys(t).reduce(((e,n)=>{const s=t[n];return R.documents[s.id]=new h.Api.Document({id:F()(s.id),accessHash:F()(s.access_hash),dcId:1,mimeType:"audio/ogg",fileReference:To.from(atob(s.file_reference_base64.replace(/-/g,"+").replace(/_/g,"/")))}),e[n]=s.id,e}),{}):{}}function Vo(e,t,n){return[e[`${t}_default`]||g[n][0],e[`${t}_premium`]||g[n][1]]}const No=["ar","fa","id","ko","uz","en"];function Fo(e){let{firstName:t,lastName:n,about:s}=e;return xn(new h.Api.account.UpdateProfile({firstName:t||"",lastName:n||"",about:s||""}),!0)}function qo(e){return xn(new h.Api.account.CheckUsername({username:e}))}function Lo(e){return xn(new h.Api.account.UpdateUsername({username:e}),!0)}async function Ho(e){const t=await Fn(e);return xn(new h.Api.photos.UploadProfilePhoto({file:t}),!0)}async function Oo(e){const t=await Fn(e);await xn(new h.Api.photos.UploadProfilePhoto({file:t}))}async function Go(){const e=await xn(new h.Api.account.GetWallPapers({hash:F()("0")}));if(!e||e instanceof h.Api.account.WallPapersNotModified)return;const t=e.wallpapers.filter((e=>e instanceof h.Api.WallPaper&&e.document instanceof h.Api.Document&&!e.pattern&&"application/x-tgwallpattern"!==e.document.mimeType));return t.forEach((e=>{R.documents[String(e.document.id)]=e.document})),{wallpapers:t.map(Nt).filter(Boolean)}}async function Ko(e){const t=await Fn(e),n=await xn(new h.Api.account.UploadWallPaper({file:t,mimeType:e.type,settings:new h.Api.WallPaperSettings}));if(!(n&&n instanceof h.Api.WallPaper))return;const s=Nt(n);return s?(R.documents[String(n.document.id)]=n.document,{wallpaper:s}):void 0}async function zo(){const e=await xn(new h.Api.contacts.GetBlocked({limit:100}));if(e)return hr(e),{users:e.users.map(Tt).filter(Boolean),chats:e.chats.map((e=>ft(e,void 0,!0))).filter(Boolean),blockedIds:e.blocked.map((e=>W(e.peerId))),totalCount:e instanceof h.Api.contacts.BlockedSlice?e.count:e.blocked.length}}function Wo(e,t){return xn(new h.Api.contacts.Block({id:se(e,t)}))}function jo(e,t){return xn(new h.Api.contacts.Unblock({id:se(e,t)}))}async function $o(){const e=await xn(new h.Api.account.GetAuthorizations);if(e)return{authorizations:m(e.authorizations.map(Ft),"hash"),ttlDays:e.authorizationTtlDays}}function Jo(e){return xn(new h.Api.account.ResetAuthorization({hash:F()(e)}))}function Qo(){return xn(new h.Api.auth.ResetAuthorizations)}async function Xo(){const e=await xn(new h.Api.account.GetWebAuthorizations);if(e)return m(e.authorizations.map(qt),"hash")}function Yo(e){return xn(new h.Api.account.ResetWebAuthorization({hash:F()(e)}))}function Zo(){return xn(new h.Api.account.ResetWebAuthorizations)}async function er(e){let{serverTimeOffset:t}=e;const n=await xn(new h.Api.account.GetNotifyExceptions({compareSound:!0}),void 0,void 0,!0);if(n instanceof h.Api.Updates||n instanceof h.Api.UpdatesCombined)return hr(n),n.updates.reduce(((e,n)=>n instanceof h.Api.UpdateNotifySettings&&n.peer instanceof h.Api.NotifyPeer?(e.push(Ht(n.notifySettings,n.peer.peer,t)),e):e),[])}async function tr(e){let{serverTimeOffset:t}=e;const[n,s,a,i]=await Promise.all([xn(new h.Api.account.GetContactSignUpNotification),xn(new h.Api.account.GetNotifySettings({peer:new h.Api.InputNotifyUsers})),xn(new h.Api.account.GetNotifySettings({peer:new h.Api.InputNotifyChats})),xn(new h.Api.account.GetNotifySettings({peer:new h.Api.InputNotifyBroadcasts}))]);if(!s||!a||!i)return!1;const{silent:o,muteUntil:r,showPreviews:c}=s,{silent:l,muteUntil:d,showPreviews:u}=a,{silent:g,muteUntil:p,showPreviews:f}=i;return{hasContactJoinedNotifications:!n,hasPrivateChatsNotifications:!(o||"number"==typeof r&&ct(t)xn(new h.Api.langpack.GetLangPack({langPack:e,langCode:No.includes(n)?`${n}-raw`:n})))))).filter(Boolean).map((e=>m(e.strings.map(w),"key")));if(s.length)return{langPack:Object.assign({},...s.reverse())}}async function or(e){let{langPack:t,langCode:n,keys:s}=e;const a=await xn(new h.Api.langpack.GetStrings({langPack:t,langCode:No.includes(n)?`${n}-raw`:n,keys:s}));if(a)return a.map(w)}async function rr(e){const t=be(e),n=await xn(new h.Api.account.GetPrivacy({key:t}));if(n)return hr(n),Lt(n.rules)}function cr(e){const t=Rn.session.getAuthKey().getKey();return xn(new h.Api.account.RegisterDevice({tokenType:10,secret:t,appSandbox:!1,otherUids:[],token:e}))}function lr(e){return xn(new h.Api.account.UnregisterDevice({tokenType:10,otherUids:[],token:e}))}async function dr(e,t){const n=be(e),s=[];switch(t.allowedUsers&&s.push(new h.Api.InputPrivacyValueAllowUsers({users:t.allowedUsers.map((e=>{let{id:t,accessHash:n}=e;return ie(t,n)}))})),t.allowedChats&&s.push(new h.Api.InputPrivacyValueAllowChatParticipants({chats:t.allowedChats.map((e=>{let{id:t}=e;return ie(t)}))})),t.blockedUsers&&s.push(new h.Api.InputPrivacyValueDisallowUsers({users:t.blockedUsers.map((e=>{let{id:t,accessHash:n}=e;return ie(t,n)}))})),t.blockedChats&&s.push(new h.Api.InputPrivacyValueDisallowChatParticipants({chats:t.blockedChats.map((e=>{let{id:t}=e;return ie(t)}))})),t.visibility){case"everybody":s.push(new h.Api.InputPrivacyValueAllowAll);break;case"contacts":s.push(new h.Api.InputPrivacyValueAllowContacts);break;case"nonContacts":s.push(new h.Api.InputPrivacyValueDisallowContacts);break;case"nobody":s.push(new h.Api.InputPrivacyValueDisallowAll)}const a=await xn(new h.Api.account.SetPrivacy({key:n,rules:s}));if(a)return hr(a),Lt(a.rules)}async function ur(e){await xn(new h.Api.account.UpdateStatus({offline:!e}))}async function gr(){const e=await xn(new h.Api.account.GetContentSettings);if(e)return{isSensitiveEnabled:Boolean(e.sensitiveEnabled),canChangeSensitive:Boolean(e.sensitiveCanChange)}}function pr(e){return xn(new h.Api.account.SetContentSettings({sensitiveEnabled:e||void 0}))}async function fr(){const e=await xn(new h.Api.help.GetAppConfig);if(e)return function(e){const t=Gt(e);return{emojiSounds:xo(t),defaultReaction:t.reactions_default,seenByMaxChatMembers:t.chat_read_mark_size_threshold,seenByExpiresAt:t.chat_read_mark_expire_period,autologinDomains:t.autologin_domains||[],autologinToken:t.autologin_token||"",urlAuthDomains:t.url_auth_domains||[],premiumBotUsername:t.premium_bot_username,premiumInvoiceSlug:t.premium_invoice_slug,isPremiumPurchaseBlocked:t.premium_purchase_blocked,limits:{uploadMaxFileparts:Vo(t,"upload_max_fileparts","uploadMaxFileparts"),stickersFaved:Vo(t,"stickers_faved_limit","stickersFaved"),savedGifs:Vo(t,"saved_gifs_limit","savedGifs"),dialogFiltersChats:Vo(t,"dialog_filters_chats_limit","dialogFiltersChats"),dialogFilters:Vo(t,"dialog_filters_limit","dialogFilters"),dialogFolderPinned:Vo(t,"dialogs_pinned_limit","dialogFolderPinned"),captionLength:Vo(t,"caption_length_limit","captionLength"),channels:Vo(t,"channels_limit","channels"),channelsPublic:Vo(t,"channels_public_limit","channelsPublic"),aboutLength:Vo(t,"about_length_limit","aboutLength")}}}(e)}function hr(e){Y(e.users),Y(e.chats)}async function mr(e){let{langCode:t="en"}=e;const n=await xn(new h.Api.help.GetCountriesList({langCode:t}));if(n instanceof h.Api.help.CountriesList)return function(e){const t=e.filter((e=>{let{hidden:t}=e;return!t}));return{phoneCodes:t.map((e=>e.countryCodes.map((t=>Ot(e,t))))).flat().sort(((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName))),general:t.map((e=>Ot(e,e.countryCodes[0]))).sort(((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName)))}}(n.countries)}async function _r(){const e=await xn(new h.Api.account.GetGlobalPrivacySettings);if(e)return{shouldArchiveAndMuteNewNonContact:Boolean(e.archiveAndMuteNewNoncontactPeers)}}async function yr(e){let{shouldArchiveAndMuteNewNonContact:t}=e;const n=await xn(new h.Api.account.SetGlobalPrivacySettings({settings:new h.Api.GlobalPrivacySettings({archiveAndMuteNewNoncontactPeers:t})}));if(n)return{shouldArchiveAndMuteNewNonContact:Boolean(n.archiveAndMuteNewNoncontactPeers)}}function br(e){let{chat:t,emoticon:n}=e;return xn(new h.Api.messages.SetTyping({peer:se(t.id,t.accessHash),action:new h.Api.SendMessageEmojiInteractionSeen({emoticon:n})}))}function wr(e){let{chat:t,emoticon:n,messageId:s,timestamps:a}=e;return xn(new h.Api.messages.SetTyping({peer:se(t.id,t.accessHash),action:new h.Api.SendMessageEmojiInteraction({emoticon:n,msgId:s,interaction:new h.Api.DataJSON({data:JSON.stringify({v:1,a:a.map((e=>({t:e,i:1})))})})})}))}async function vr(){const e=await xn(new h.Api.messages.GetAvailableReactions({}));if(e&&!(e instanceof h.Api.messages.AvailableReactionsNotModified))return e.reactions.forEach((e=>{e.staticIcon instanceof h.Api.Document&&(R.documents[String(e.staticIcon.id)]=e.staticIcon),e.selectAnimation instanceof h.Api.Document&&(R.documents[String(e.selectAnimation.id)]=e.selectAnimation),e.aroundAnimation instanceof h.Api.Document&&(R.documents[String(e.aroundAnimation.id)]=e.aroundAnimation),e.centerIcon instanceof h.Api.Document&&(R.documents[String(e.centerIcon.id)]=e.centerIcon)})),e.reactions.map(ze)}function Ar(e){let{chat:t,messageId:n,reaction:s}=e;return xn(new h.Api.messages.SendReaction({...s&&{reaction:s},peer:se(t.id,t.accessHash),msgId:n}),!0)}function Ir(e){let{ids:t,chat:n}=e;return xn(new h.Api.messages.GetMessagesReactions({id:t,peer:se(n.id,n.accessHash)}),!0)}async function Sr(e){let{chat:t,messageId:n,reaction:s,offset:a}=e;const i=await xn(new h.Api.messages.GetMessageReactionsList({peer:se(t.id,t.accessHash),id:n,...s&&{reaction:s},limit:100,...a&&{offset:a}}));if(!i)return;Y(i.users);const{nextOffset:o,reactions:r,count:c}=i;return{users:i.users.map(Tt).filter(Boolean),nextOffset:o,reactions:r.map(Ke),count:c}}function Cr(e){let{reaction:t}=e;return xn(new h.Api.messages.SetDefaultReaction({reaction:t}))}function Pr(e,t){if(e.error)return;const n=JSON.parse(e.json.data),[s,...a]=n.columns,i=n.y_scaled;return{type:t?"area":n.types.y0,zoomToken:e.zoomToken,labelFormatter:n.xTickFormatter,tooltipFormatter:n.xTooltipFormatter,labels:s.slice(1),hideCaption:!n.subchart.show,hasSecondYAxis:i,isStacked:n.stacked&&!i,isPercentage:t,datasets:a.map((e=>{const t=e[0];return{name:n.names[t],color:(s=n.colors[t],s.substring(s.indexOf("#"))),values:e.slice(1)};var s})),...Mr(n.subchart.defaultZoom,s.slice(1))}}function Mr(e,t){const[n,s]=e;let a=0,i=t.length-1;return t.forEach(((e,t)=>{!a&&e>=n&&(a=t),!i&&e>=s&&(i=t)})),{minimapRange:{begin:Math.max(0,a/(t.length-1)),end:Math.min(1,i/(t.length-1))},labelFromIndex:a,labelToIndex:i}}function kr(e){let{current:t,previous:n}=e;const s=t-n;return{current:t,change:s,...n&&{percentage:(s?Math.abs(s)/n*100:0).toFixed(2)}}}async function Rr(e){let{chat:t}=e;const n=await xn(new h.Api.stats.GetBroadcastStats({channel:ie(t.id,t.accessHash)}),void 0,void 0,void 0,t.fullInfo.statisticsDcId);var s,a;if(n)return{growthGraph:Pr((s=n).growthGraph),followersGraph:Pr(s.followersGraph),muteGraph:Pr(s.muteGraph),topHoursGraph:Pr(s.topHoursGraph),languagesGraph:s.languagesGraph.token,viewsBySourceGraph:s.viewsBySourceGraph.token,newFollowersBySourceGraph:s.newFollowersBySourceGraph.token,interactionsGraph:s.interactionsGraph.token,followers:kr(s.followers),viewsPerPost:kr(s.viewsPerPost),sharesPerPost:kr(s.sharesPerPost),enabledNotifications:(a=s.enabledNotifications,{percentage:(a.part/a.total*100).toFixed(2)}),recentTopMessages:s.recentMessageInteractions}}async function Br(e){let{chat:t}=e;const n=await xn(new h.Api.stats.GetMegagroupStats({channel:ie(t.id,t.accessHash)}),void 0,void 0,void 0,t.fullInfo.statisticsDcId);var s,a;if(n)return{growthGraph:Pr((s=n).growthGraph),membersGraph:Pr(s.membersGraph),topHoursGraph:Pr(s.topHoursGraph),languagesGraph:s.languagesGraph.token,messagesGraph:s.messagesGraph.token,actionsGraph:s.actionsGraph.token,period:(a=s.period,{maxDate:a.maxDate,minDate:a.minDate}),members:kr(s.members),viewers:kr(s.viewers),messages:kr(s.messages),posters:kr(s.posters)}}async function Ur(e){let{chat:t,messageId:n}=e;const s=await xn(new h.Api.stats.GetMessageStats({channel:ie(t.id,t.accessHash),msgId:n}),void 0,void 0,void 0,t.fullInfo.statisticsDcId);if(s)return{viewsGraph:Pr(s.viewsGraph)}}async function Dr(e){let{chat:t,messageId:n,dcId:s}=e;const a=await xn(new h.Api.stats.GetMessagePublicForwards({channel:ie(t.id,t.accessHash),msgId:n,offsetPeer:new h.Api.InputPeerEmpty}),void 0,void 0,void 0,s);if(a)return"chats"in a&&Y(a.chats),function(e){if(e&&"messages"in e)return e.messages.map((t=>{const n=z(t.peerId.channelId,"channel"),s=e.chats.find((e=>z(e.id,"channel")===n));return{messageId:t.id,views:t.views,title:s.title,chat:{id:n,type:"chatTypeChannel",username:s.username,avatarHash:bt(s.photo)}}}))}(a)}async function Er(e){let{token:t,x:n,isPercentage:s,dcId:a}=e;const i=await xn(new h.Api.stats.LoadAsyncGraph({token:t,...n&&{x:F()(n)}}),void 0,void 0,void 0,a);if(i)return Pr(i,s)}var Tr=n(59109),xr=n.n(Tr),Vr=n(96748),Nr=n.n(Vr),Fr=n(13302),qr=n.n(Fr),Lr=n(48764).Buffer;function Hr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Or,Gr;class Kr{constructor(e){this.isOutgoing=e,Hr(this,"state",void 0),Hr(this,"seq",0),Hr(this,"gA",void 0),Hr(this,"gB",void 0),Hr(this,"p",void 0),Hr(this,"random",void 0),Hr(this,"waitForState",void 0),Hr(this,"resolveState",void 0),this.waitForState=new Promise((e=>{this.resolveState=e}))}async requestCall(e){let{p:t,g:n,random:s}=e;const a=L().readBigIntFromBuffer(Lr.from(t),!1),i=L().readBigIntFromBuffer(Lr.from(s),!1),o=L().modExp(F()(n),i,a);this.gA=o,this.p=a,this.random=i;const r=await L().sha256(L().getByteArray(o));return Array.from(r)}acceptCall(e){let{p:t,g:n,random:s}=e;const a=L().readBigIntFromBuffer(t,!1),i=L().readBigIntFromBuffer(s,!1),o=L().modExp(F()(n),i,a);return this.gB=o,this.p=a,this.random=i,Array.from(L().getByteArray(o))}async confirmCall(e,t,n){this.isOutgoing?this.gB=L().readBigIntFromBuffer(Lr.from(e),!1):this.gA=L().readBigIntFromBuffer(Lr.from(e),!1);const s=L().modExp(this.isOutgoing?this.gB:this.gA,this.random,this.p),a=await L().sha1(L().getByteArray(s)),i=L().readBigIntFromBuffer(a.slice(-8).reverse(),!1),o=await async function(e,t,n,s){const a=await L().sha256(Lr.concat([new Uint8Array(e),new Uint8Array(t)])),i=[],o=s.length-1;for(let e=0;e!==a.byteLength;e+=8){const t=(r=a.subarray(e,e+8),F()(r[0]).and(127).shiftLeft(56).or(F()(r[1]).shiftLeft(48)).or(F()(r[2]).shiftLeft(40)).or(F()(r[3]).shiftLeft(32)).or(F()(r[4]).shiftLeft(24)).or(F()(r[5]).shiftLeft(16)).or(F()(r[6]).shiftLeft(8)).or(F()(r[7]))).modPow(1,o).toJSNumber(),c=s[t],l=s[t+1]-c;i.push(String.fromCharCode(...n.subarray(c,c+l)))}var r;return i.join("")}(L().getByteArray(s),L().getByteArray(this.gA),t,n),r=new(qr());return await r.setKey(L().getByteArray(s)),this.state=new(xr())(r,new(Nr()),!0,this.isOutgoing),this.resolveState(),{gA:Array.from(L().getByteArray(this.gA)),keyFingerprint:i.toString(),emojis:o}}async encode(e){if(!this.state)return;const t=new Uint32Array(1);t[0]=this.seq++;const n=await this.state.encryptMessageData(Lr.concat([L().convertToLittle(t),Lr.from(e)]));return Array.from(n)}async decode(e){if(!this.state)return this.waitForState.then((()=>this.decode(e)));const t=await this.state.decryptMessageData(Lr.from(e));return JSON.parse(t.toString())}}function zr(e){Or=new Kr(...e)}function Wr(){Or=void 0}function jr(e){return Or.encode(...e)}function $r(e){return Or.decode(...e)}function Jr(e){return Or.confirmCall(...e)}function Qr(e){return Or.acceptCall(...e)}function Xr(e){return Or.requestCall(...e)}async function Yr(e,t){Gr=e,function(e){zt=e}(sc),function(e){Zt=e}(sc),function(e){Kn=e}(sc),function(e){Os=e}(sc),function(e){Ra=e}(sc),function(e){Ba=e}(sc),function(e){Da=e}(sc),function(e){Ci=e}(sc),function(e){Pi=e}(sc),function(e){Yi=e}(sc),function(e){Zi=e}(sc),await async function(e,t){kn=e;const{userAgent:n,platform:s,sessionData:a,isTest:i,isMovSupported:o,isWebmSupported:c}=t,d=new h.sessions.CallbackSession(a,En);self.isMovSupported=o,o&&l.add(r),self.isWebmSupported=c,Rn=new(hn())(d,"2496","8da85b0d5bfe62527e5b244c209159c3",{deviceModel:navigator.userAgent||n||"Unknown UserAgent",systemVersion:s||"Unknown platform",appVersion:"1.49.5 Z",useWSS:!0,additionalDcsDisabled:!1,testServers:i}),Rn.addEventHandler(Tn,Mn),Rn.addEventHandler(Qt,Mn);try{try{await Rn.start({phoneNumber:en,phoneCode:tn,password:nn,firstAndLastNames:sn,qrCode:an,onError:on,initialMethod:"iOS"===s||"Android"===s?"phoneNumber":"qrCode",shouldThrowIfUnauthorized:Boolean(a)})}catch(e){if(console.error(e),"Disconnect"!==e.message&&"Cannot send requests while disconnected"!==e.message)return void kn({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}Zt(rn("authorizationStateReady")),En(d.getSessionData()),kn({"@type":"updateApiReady"}),Ln()}catch(e){throw e}}(sc,t)}const Zr=function(e,t){let n,s=!1;return function(){for(var a=arguments.length,i=new Array(a),o=0;o{s=!1,t(...n)})))}}((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];p?t?f.push(e):p.push(e):(p=t?[]:[e],f=t?[e]:[],Promise.resolve().then((()=>{const e=p,t=f;p=void 0,f=void 0,t.forEach((e=>e())),e.forEach((e=>e()))})))}),(function(e){if(!nc||e!==tc)return;const t=nc;nc=void 0,t.forEach(Gr)}));let ec,tc,nc;function sc(e){nc?nc.push(e):nc=[e],ec&&!o.has(e["@type"])||(ec=function(e,t){let n,s,a,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(){s=!0;for(var o=arguments.length,r=new Array(o),c=0;c{if(!s)return self.clearInterval(n),void(n=void 0);s=!1,e(...a)}),t))}}(Zr,i,!0),tc=Math.random()),ec(tc)}self.onerror=e=>{console.error(e),oc({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",(e=>{console.error(e),oc({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})}));const ac=new Map;function ic(e){oc({type:"update",update:e})}function oc(e,t){t?postMessage(e,[t]):postMessage(e)}onmessage=async e=>{const{data:t}=e;switch(t.type){case"initApi":await Yr(ic,t.args[0]);break;case"callMethod":{const{messageId:e,name:n,args:s}=t;try{if(e){const t=function(){for(var t=arguments.length,n=new Array(t),s=0;s1?t-1:0),s=1;s{var s=n(48764).Buffer;const a=n(24736),i=n(66842);function o(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=s.from(e);const o=i.length;t&&(i=i.reverse());let r=a(i.toString("hex"),16);return n&&Math.floor(r.toString("2").length/8)>=o&&(r=r.subtract(a(2).pow(a(8*o)))),r}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const n=a(e),i=[];for(let e=0;e2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=(e=a(e)).bitLength(),r=Math.ceil(o/8);if(t0&&void 0!==arguments[0])||arguments[0];return o(l(8),!0,e)},mod:function(e,t){return(e%t+t)%t},crc32:function(e){u||(u=function(){let e;const t=[];for(let n=0;n<256;n++){e=n;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}()),s.isBuffer(e)||(e=s.from(e));let t=-1;for(let n=0;n>>8}return(-1^t)>>>0},generateRandomBytes:l,generateKeyDataFromNonce:async function(e,t){e=r(e,16),t=r(t,32);const[n,a,i]=await Promise.all([d(s.concat([t,e])),d(s.concat([e,t])),d(s.concat([t,t]))]);return{key:s.concat([n,a.slice(0,12)]),iv:s.concat([a.slice(12,20),i,t.slice(0,4)])}},sha1:d,sha256:function(e){const t=i.createHash("sha256");return t.update(e),t.digest()},bigIntMod:function(e,t){return e.remainder(t).add(t).remainder(t)},modExp:function(e,t,n){e=e.remainder(n);let s=a.one,i=e;for(;t.greater(a.zero);){const e=t.remainder(a(2));t=t.divide(a(2)),e.eq(a.one)&&(s=s.multiply(i),s=s.remainder(n)),i=i.multiply(i),i=i.remainder(n)}return s},getRandomInt:function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e},sleep:e=>new Promise((t=>{setTimeout(t,e)})),getByteArray:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.toString(2).length,s=Math.floor((n+8-1)/8);return c(a(e),s,!1,t)},toSignedLittleBuffer:r,convertToLittle:function(e){const t=s.alloc(4*e.length);for(let n=0;n{e=t})),resolve:e}}}},59674:(e,t,n)=>{var s=n(48764).Buffer;const a=n(24736),{constructors:i}=n(57404),{readBigIntFromBuffer:o,readBufferFromBigInt:r,sha256:c,bigIntMod:l,modExp:d,generateRandomBytes:u}=n(89618),g=n(66842);function p(e,t){if(!s.from([199,28,174,185,198,177,201,4,142,108,82,47,112,241,63,115,152,13,64,35,142,62,33,193,73,52,208,55,86,61,147,15,72,25,138,10,167,193,64,88,34,148,147,210,37,48,244,219,250,51,111,110,10,201,37,19,149,67,174,212,76,206,124,55,32,253,81,246,148,88,112,90,198,140,212,254,107,107,19,171,220,151,70,81,41,105,50,132,84,241,143,175,140,89,95,100,36,119,254,150,187,42,148,29,91,205,29,74,200,204,73,136,7,8,250,155,55,142,60,79,58,144,96,190,230,124,249,164,164,166,149,129,16,81,144,126,22,39,83,181,107,15,107,65,13,186,116,216,168,75,42,20,179,20,78,14,241,40,71,84,253,23,237,149,13,89,101,180,185,221,70,88,45,177,23,141,22,156,107,196,101,176,214,255,156,163,146,143,239,91,154,228,228,24,252,21,232,62,190,160,248,127,169,255,94,237,112,5,13,237,40,73,244,123,249,89,217,86,133,12,233,41,133,31,13,129,21,246,53,177,5,238,46,78,21,208,75,36,84,191,111,79,173,240,52,177,4,3,17,156,216,227,185,47,204,91]).equals(e)||![3,4,5,7].includes(t))throw new Error("Changing passwords unsupported")}function f(e){return s.concat([s.alloc(256-e.length),e])}function h(e){return r(e,256,!1)}function m(e,t){const n=t.subtract(e);return!(n.lesser(a(0))||n.bitLength()<1984||e.bitLength()<1984||Math.floor((e.bitLength()+7)/8)>256)}function _(e,t){const n=Math.min(e.length,t.length);for(let s=0;s{for(;;){const e=u(256),t=o(e,!1),n=d(a(b),t,g);if(m(n,g)){const e=h(n),i=o(await c(s.concat([e,S])),!1);if(i.greater(a(0)))return[t,e,i]}}})(),U=l(w.subtract(M),g);if(!m(U,g))throw new Error("bad gB");const D=B.multiply(v),E=k.add(D),T=d(U,E,g),[x,V,N,F,q]=await Promise.all([c(h(T)),c(A),c(I),c(n.salt1),c(n.salt2)]),L=await c(s.concat([_(V,N),F,q,R,S,x]));return new i.InputCheckPasswordSRP({srpId:e.srpId,A:s.from(R),M1:L})},computeDigest:async function(e,t){try{p(e.p,e.g)}catch(e){throw new Error("bad p/g in password")}return h(d(a(e.g),o(await y(e,t),!1),o(e.p,!1)))}}},48960:(e,t,n)=>{var s=n(48764).Buffer;const{constructors:a}=n(57404),i=s.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00","hex"),o=s.from("ffd9","hex");function r(e,t){throw new Error(`Cannot cast ${e.className} to any kind of ${t}`)}e.exports={getMessageId:function(e){if(void 0!==e){if("number"==typeof e)return e;if(2030045667===e.SUBCLASS_OF_ID)return e.id;throw new Error(`Invalid message type: ${e.constructor.name}`)}},getInputPeer:function e(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t.SUBCLASS_OF_ID){if(n&&"inputEntity"in t)return t.inputEntity;if("entity"in t)return e(t.entity);r(t,"InputPeer")}if(3374092470===t.SUBCLASS_OF_ID)return t;if(t instanceof a.User){if(t.isSelf&&n)return new a.InputPeerSelf;if(void 0===t.accessHash&&s)throw new Error("User without accessHash or min info cannot be input");return new a.InputPeerUser({userId:t.id,accessHash:t.accessHash})}if(t instanceof a.Chat||t instanceof a.ChatEmpty||t instanceof a.ChatForbidden)return new a.InputPeerChat({chatId:t.id});if(t instanceof a.Channel){if(void 0===t.accessHash&&s)throw new TypeError("Channel without accessHash or min info cannot be input");return new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash})}return t instanceof a.ChannelForbidden?new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash}):t instanceof a.InputUser?new a.InputPeerUser({userId:t.userId,accessHash:t.accessHash}):t instanceof a.InputChannel?new a.InputPeerChannel({channelId:t.channelId,accessHash:t.accessHash}):t instanceof a.UserEmpty?new a.InputPeerEmpty:t instanceof a.UserFull?e(t.user):t instanceof a.ChatFull?new a.InputPeerChat({chatId:t.id}):t instanceof a.PeerChat?new a.InputPeerChat(t.chatId):void r(t,"InputPeer")},getDisplayName:function(e){return e instanceof a.User?e.lastName&&e.firstName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:"":e instanceof a.Chat||e instanceof a.Channel?e.title:""},getAppropriatedPartSize:function(e){if(e<=104857600)return 128;if(e<=786432e3)return 256;if(e<=2097152e3)return 512;if(e<=4194304e3)return 512;throw new Error("File size too large")},strippedPhotoToJpg:function(e){if(e.length<3||1!==e[0])return e;const t=s.from(i);return t[164]=e[1],t[166]=e[2],s.concat([t,e.slice(3),o])},getDC:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case 1:return{id:1,ipAddress:`zws1${t?"-1":""}.web.telegram.org`,port:443};case 2:return{id:2,ipAddress:`zws2${t?"-1":""}.web.telegram.org`,port:443};case 3:return{id:3,ipAddress:`zws3${t?"-1":""}.web.telegram.org`,port:443};case 4:return{id:4,ipAddress:`zws4${t?"-1":""}.web.telegram.org`,port:443};case 5:return{id:5,ipAddress:`zws5${t?"-1":""}.web.telegram.org`,port:443};default:throw new Error(`Cannot find the DC with the ID of ${e}`)}}}},61472:e=>{e.exports="0.0.2"},70243:(e,t,n)=>{"use strict";n.r(t),n.d(t,{updateTwoFaSettings:()=>d});var s=n(77150),a=n.n(s),i=n(89618),o=n(59674),r=n(87873),c=n.n(r),l=n(48764).Buffer;async function d(e,t){let{isCheckPassword:n,currentPassword:s,newPassword:r,hint:d="",email:u,emailCodeCallback:g,onEmailCodeError:p}=t;if(!r&&!s)throw new Error("Neither `currentPassword` nor `newPassword` is present");if(u&&(!g||!p))throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");const f=await e.invoke(new(a().account.GetPassword));f.newAlgo instanceof a().PasswordKdfAlgoUnknown||(f.newAlgo.salt1=l.concat([f.newAlgo.salt1,(0,i.generateRandomBytes)(32)])),!f.hasPassword&&s&&(s=void 0);const h=s?await(0,o.computeCheck)(f,s):new(a().InputCheckPasswordEmpty);if(n)await e.invoke(new(a().auth.CheckPassword)({password:h}));else try{await e.invoke(new(a().account.UpdatePasswordSettings)({password:h,newSettings:new(a().account.PasswordInputSettings)({newAlgo:f.newAlgo,newPasswordHash:r?await(0,o.computeDigest)(f.newAlgo,r):l.alloc(0),hint:d,email:u,newSecureSettings:void 0})}))}catch(t){if(!(t instanceof c().EmailUnconfirmedError))throw t;for(;;)try{const n=await g(t.codeLength);if(!n)throw new Error("Code is empty");await e.invoke(new(a().account.ConfirmPasswordEmail)({code:n}));break}catch(e){p(e)}}}},78742:(e,t,n)=>{var s=n(48764).Buffer;const a=n(67435),i=n(96748),{sleep:o}=n(89618),r=n(87873),c=n(33995),l=n(89618),d=n(48960),u=n(59270),{LAYER:g}=n(70845),{constructors:p,requests:f}=n(57404),{ConnectionTCPObfuscated:h,MTProtoSender:m,UpdateConnectionState:_}=n(18415),{authFlow:y,checkAuthorization:b}=n(21545),{downloadFile:w}=n(52288),{uploadFile:v}=n(74766),{updateTwoFaSettings:A}=n(70243),I=131072,S=["u","v","w","y","d","x","c","m","b","a","s","f"];class C{constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:C.DEFAULT_OPTIONS;if(!t||!n)throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');const o={...C.DEFAULT_OPTIONS,...s};if(this.apiId=t,this.apiHash=n,this._useIPV6=o.useIPV6,"string"==typeof o.baseLogger?this._log=new i:this._log=o.baseLogger,"string"!=typeof e&&e){if(!(e instanceof u))throw new Error("The given session must be str or a session instance")}else try{throw new Error("not implemented")}catch(t){e=new c}this.floodSleepLimit=o.floodSleepLimit,this._eventBuilders=[],this._phoneCodeHash={},this.session=e,this.apiId=parseInt(t,10),this.apiHash=n,this._requestRetries=o.requestRetries,this._connectionRetries=o.connectionRetries,this._retryDelay=o.retryDelay||0,o.proxy&&this._log.warn("proxies are not supported"),this._proxy=o.proxy,this._timeout=o.timeout,this._autoReconnect=o.autoReconnect,this._connection=o.connection,this._floodWaitedRequests={},this._initWith=e=>new f.InvokeWithLayer({layer:g,query:new f.InitConnection({apiId:this.apiId,deviceModel:o.deviceModel||a.type().toString()||"Unknown",systemVersion:o.systemVersion||a.release().toString()||"1.0",appVersion:o.appVersion||"1.0",langCode:o.langCode,langPack:"",systemLangCode:o.systemLangCode,query:e,proxy:void 0})}),this._args=o,this._config=void 0,this.phoneCodeHashes=[],this._exportedSenderPromises={},this._exportedSenderReleaseTimeouts={},this._additionalDcsDisabled=o.additionalDcsDisabled,this._loopStarted=!1,this._isSwitchingDc=!1,this._destroyed=!1}async connect(){await this._initSession(),void 0===this._sender&&(this._sender=new m(this.session.getAuthKey(),{logger:this._log,dcId:this.session.dcId,retries:this._connectionRetries,delay:this._retryDelay,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),updateCallback:this._handleUpdate.bind(this),isMainSender:!0})),this._sender.userDisconnected=!1,this._sender._user_connected=!1,this._sender.isReconnecting=!1,this._sender._disconnected=!0;const e=new this._connection(this.session.serverAddress,this.session.port,this.session.dcId,this._log,this._args.testServers);await this._sender.connect(e)?(this.session.setAuthKey(this._sender.authKey),await this._sender.send(this._initWith(new f.help.GetConfig({}))),this._loopStarted||(this._updateLoop(),this._loopStarted=!0),this._isSwitchingDc=!1):this._loopStarted||(this._updateLoop(),this._loopStarted=!0)}async _initSession(){await this.session.load(),this.session.serverAddress&&this.session.serverAddress.includes(":")===this._useIPV6||this.session.setDC(2,this._useIPV6?"[2001:67c:4e8:f002::a]":"zws2.web.telegram.org",this._args.useWSS?443:80)}async _updateLoop(){let e;for(;!this._destroyed;)if(await l.sleep(3e3),this._sender.isReconnecting||this._isSwitchingDc)e=void 0;else{try{const t=()=>this._sender.send(new f.PingDelayDisconnect({pingId:l.getRandomInt(Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),disconnectDelay:6e4})),n=Date.now(),s=e?n-e:void 0;if(!s||s<5e3)await B((()=>R(t,5e3)),3,100);else{let e=setTimeout((()=>{this._handleUpdate(new _(_.disconnected)),e=void 0}),1e3);await R(t,3e3),e&&(clearTimeout(e),e=void 0),this._handleUpdate(new _(_.connected))}e=Date.now()}catch(t){if(console.warn(t),e=void 0,this._sender.isReconnecting||this._isSwitchingDc)continue;await this.disconnect(),await this.connect()}if((new Date).getTime()-this._lastRequest>18e5){try{await this.invoke(new f.updates.GetState)}catch(e){}e=void 0}}await this.disconnect()}async disconnect(){this._sender&&await this._sender.disconnect(),await Promise.all(Object.values(this._exportedSenderPromises).map((e=>e&&e.then((e=>{if(e)return e.disconnect()}))))),this._exportedSenderPromises={}}async destroy(){this._destroyed=!0;try{await this.disconnect()}catch(e){}this.session.delete(),this._eventBuilders=[]}async _switchDC(e){this._log.info(`Reconnecting to new data center ${e}`);const t=d.getDC(e);return this.session.setDC(e,t.ipAddress,t.port),await this._sender.authKey.setKey(void 0),this.session.setAuthKey(void 0),this._isSwitchingDc=!0,await this.disconnect(),this.connect()}_authKeyCallback(e,t){this.session.setAuthKey(e,t)}async _cleanupExportedSender(e){this.session.dcId!==e&&this.session.setAuthKey(void 0,e);const t=await this._exportedSenderPromises[e];this._exportedSenderPromises[e]=void 0,await t.disconnect()}async _connectSender(e,t){const n=d.getDC(t,Boolean(e.authKey.getKey()));for(;;)try{if(await e.connect(new this._connection(n.ipAddress,n.port,t,this._log,this._args.testServers)),this.session.dcId!==t&&!e._authenticated){this._log.info(`Exporting authorization for data center ${n.ipAddress}`);const s=await this.invoke(new f.auth.ExportAuthorization({dcId:t})),a=this._initWith(new f.auth.ImportAuthorization({id:s.id,bytes:s.bytes}));await e.send(a),e._authenticated=!0}return e.dcId=t,e.userDisconnected=!1,e}catch(t){console.error(t),await l.sleep(1e3),await e.disconnect()}}async _borrowExportedSender(e,t,n){if(this._additionalDcsDisabled)return;let s;this._exportedSenderPromises[e]&&!t||(this._exportedSenderPromises[e]=this._connectSender(n||this._createExportedSender(e),e));try{if(s=await this._exportedSenderPromises[e],!s.isConnected())return s.isConnecting?(await l.sleep(1e3),this._borrowExportedSender(e,!1,s)):this._borrowExportedSender(e,!0,s)}catch(t){return console.error(t),this._borrowExportedSender(e,!0)}return this._exportedSenderReleaseTimeouts[e]&&(clearTimeout(this._exportedSenderReleaseTimeouts[e]),this._exportedSenderReleaseTimeouts[e]=void 0),this._exportedSenderReleaseTimeouts[e]=setTimeout((()=>{this._exportedSenderReleaseTimeouts[e]=void 0,s.disconnect()}),3e4),s}_createExportedSender(e){return new m(this.session.getAuthKey(e),{logger:this._log,dcId:e,retries:this._connectionRetries,delay:this._retryDelay,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),isMainSender:e===this.session.dcId,onConnectionBreak:this._cleanupExportedSender.bind(this)})}getSender(e){return e?this._borrowExportedSender(e):Promise.resolve(this._sender)}downloadFile(e){return w(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}downloadMedia(e,t){let n;if(n=e instanceof p.Message?e.media:e,"string"==typeof n)throw new Error("not implemented");return n instanceof p.MessageMediaWebPage&&n.webpage instanceof p.WebPage&&(n=n.webpage.document||n.webpage.photo),n instanceof p.MessageMediaPhoto||n instanceof p.Photo?this._downloadPhoto(n,t):n instanceof p.MessageMediaDocument||n instanceof p.Document?this._downloadDocument(n,t):n instanceof p.MessageMediaContact?this._downloadContact(n,t):n instanceof p.WebDocument||n instanceof p.WebDocumentNoProxy?this._downloadWebDocument(n,t):void 0}downloadProfilePhoto(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=t?"x":"m";let s,a,i;if([765557111,3316604308,524706233,3566872215].includes(e.SUBCLASS_OF_ID)){if(!e.photo){if(!e.chatPhoto)return;return this._downloadPhoto(e.chatPhoto,{sizeType:n})}s=e.photo}else s=e;if(s instanceof p.UserProfilePhoto||s instanceof p.ChatPhoto)return a=s.dcId,i=new p.InputPeerPhotoFileLocation({peer:d.getInputPeer(e),photoId:s.photoId,big:t}),this.downloadFile(i,{dcId:a})}downloadStickerSetThumb(e){if(!e.thumbs||!e.thumbs.length)return;const{thumbVersion:t}=e;return this.downloadFile(new p.InputStickerSetThumb({stickerset:new p.InputStickerSetID({id:e.id,accessHash:e.accessHash}),thumbVersion:t}),{dcId:e.thumbDcId})}_pickFileSize(e,t){if(!t||!e||!e.length)return;let n;for(let s=S.indexOf(t);se.type===S[s])),n)return n}_downloadCachedPhotoSize(e){let t;return t=e instanceof p.PhotoStrippedSize?d.strippedPhotoToJpg(e.bytes):e.bytes,t}_downloadPhoto(e,t){if(e instanceof p.MessageMediaPhoto&&(e=e.photo),!(e instanceof p.Photo))return;const n="u"===t.sizeType||"v"===t.sizeType,s=this._pickFileSize(n?[...e.videoSizes,...e.sizes]:e.sizes,t.sizeType);return!s||s instanceof p.PhotoSizeEmpty?void 0:s instanceof p.PhotoCachedSize||s instanceof p.PhotoStrippedSize?this._downloadCachedPhotoSize(s):this.downloadFile(new p.InputPhotoFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:s.type}),{dcId:e.dcId,fileSize:s.size,progressCallback:t.progressCallback})}_downloadDocument(e,t){if(e instanceof p.MessageMediaDocument&&(e=e.document),!(e instanceof p.Document))return;let n;if(t.sizeType){if(n=e.thumbs?this._pickFileSize([...e.videoThumbs||[],...e.thumbs],t.sizeType):void 0,!n&&e.mimeType.startsWith("video/"))return;if(n&&(n instanceof p.PhotoCachedSize||n instanceof p.PhotoStrippedSize))return this._downloadCachedPhotoSize(n)}return this.downloadFile(new p.InputDocumentFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:n?n.type:""}),{fileSize:n?n.size:e.size.toJSNumber(),progressCallback:t.progressCallback,start:t.start,end:t.end,dcId:e.dcId,workers:t.workers})}_downloadContact(e,t){throw new Error("not implemented")}async _downloadWebDocument(e){if(e.url&&!("accessHash"in e)){const t=await fetch(e.url).then((e=>e.arrayBuffer()));return s.from(t)}try{const t=[];let n=0;for(;;){const s=new f.upload.GetWebFile({location:new p.InputWebFileLocation({url:e.url,accessHash:e.accessHash}),offset:n,limit:I}),a=await this._borrowExportedSender(4),i=await a.send(s);if(n+=131072,!i.bytes.length)break;if(t.push(i.bytes),i.bytes.length0&&void 0!==arguments[0]?arguments[0]:{update:void 0,others:void 0,channelId:void 0,ptsDate:void 0};for(const[t,n]of this._eventBuilders){const s=t.build(e.update);s&&await n(s)}}isConnected(){return!(!this._sender||!this._sender.isConnected())}}var P,M,k;function R(e,t){let n=!1;return Promise.race([e(),l.sleep(t).then((()=>n?void 0:Promise.reject(new Error("TIMEOUT"))))]).finally((()=>{n=!0}))}async function B(e,t,n){for(let s=0;s{"use strict";n.r(t),n.d(t,{authFlow:()=>d,checkAuthorization:()=>u});var s=n(77150),a=n.n(s),i=n(48960),o=n.n(i),r=n(89618),c=n(59674);const l="phoneNumber";async function d(e,t,n){let s;if("botAuthToken"in n)s=await async function(e,t,n){const{apiId:s,apiHash:i}=t,{botAuthToken:o}=n,{user:r}=await e.invoke(new(a().auth.ImportBotAuthorization)({apiId:s,apiHash:i,botAuthToken:o}));return r}(e,t,n);else{const{initialMethod:a=l}=n;s="phoneNumber"===a?await g(e,t,n):await p(e,t,n)}e._log.info("Signed in successfully as",o().getDisplayName(s))}async function u(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return await e.invoke(new(a().updates.GetState)),!0}catch(e){if("Disconnect"===e.message||t)throw e;return!1}}async function g(e,t,n){let s,i,o,r=!1;for(;;)try{if("function"==typeof n.phoneNumber)try{s=await n.phoneNumber()}catch(s){if("RESTART_AUTH_WITH_QR"===s.message)return p(e,t,n);throw s}else s=n.phoneNumber;const a=await f(e,t,s,n.forceSMS);if(i=a.phoneCodeHash,r=a.isCodeViaApp,"string"!=typeof i)throw new Error("Failed to retrieve phone code hash");break}catch(e){if("function"!=typeof n.phoneNumber)throw e;n.onError(e)}let c,l=!1;for(;;)try{try{o=await n.phoneCode(r)}catch(s){if("RESTART_AUTH"===s.message)return g(e,t,n)}if(!o)throw new Error("Code is empty");const d=await e.invoke(new(a().auth.SignIn)({phoneNumber:s,phoneCodeHash:i,phoneCode:o}));if(d instanceof a().auth.AuthorizationSignUpRequired){l=!0,c=d.termsOfService;break}return d.user}catch(t){if("SESSION_PASSWORD_NEEDED"===t.message)return h(e,0,n);n.onError(t)}if(l)for(;;)try{const[t,o]=await n.firstAndLastNames();if(!t)throw new Error("First name is required");const{user:r}=await e.invoke(new(a().auth.SignUp)({phoneNumber:s,phoneCodeHash:i,firstName:t,lastName:o}));return c&&await e.invoke(new(a().help.AcceptTermsOfService)({id:c.id})),r}catch(e){n.onError(e)}return n.onError(new Error("Auth failed")),g(e,t,n)}async function p(e,t,n){let s=!1;const i=(async()=>{for(;!s;){const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(!(t instanceof a().auth.LoginToken))throw new Error("Unexpected");const{token:s,expires:i}=t;await Promise.race([n.qrCode({token:s,expires:i}),(0,r.sleep)(3e4)])}})(),o=new Promise((t=>{e.addEventHandler((e=>{e instanceof a().UpdateLoginToken&&t()}),{build:e=>e})}));try{await Promise.race([o,i])}catch(s){if("RESTART_AUTH"===s.message)return await g(e,t,n);throw s}finally{s=!0}try{const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(t instanceof a().auth.LoginTokenSuccess&&t.authorization instanceof a().auth.Authorization)return t.authorization.user;if(t instanceof a().auth.LoginTokenMigrateTo){await e._switchDC(t.dcId);const n=await e.invoke(new(a().auth.ImportLoginToken)({token:t.token}));if(n instanceof a().auth.LoginTokenSuccess&&n.authorization instanceof a().auth.Authorization)return n.authorization.user}}catch(t){if("SESSION_PASSWORD_NEEDED"===t.message)return h(e,0,n);throw t}throw void 0}async function f(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{const{apiId:i,apiHash:o}=t,r=await e.invoke(new(a().auth.SendCode)({phoneNumber:n,apiId:i,apiHash:o,settings:new(a().CodeSettings)}));if(!s||r.type instanceof a().auth.SentCodeTypeSms)return{phoneCodeHash:r.phoneCodeHash,isCodeViaApp:r.type instanceof a().auth.SentCodeTypeApp};const c=await e.invoke(new(a().auth.ResendCode)({phoneNumber:n,phoneCodeHash:r.phoneCodeHash}));return{phoneCodeHash:c.phoneCodeHash,isCodeViaApp:c.type instanceof a().auth.SentCodeTypeApp}}catch(a){if("AUTH_RESTART"===a.message)return f(e,t,n,s);throw a}}async function h(e,t,n){for(;;)try{const t=await e.invoke(new(a().account.GetPassword)),s=await n.password(t.hint);if(!s)throw new Error("Password is empty");const i=await(0,c.computeCheck)(t,s),{user:o}=await e.invoke(new(a().auth.CheckPassword)({password:i}));return o}catch(e){n.onError(e)}}},52288:(e,t,n)=>{"use strict";n.r(t),n.d(t,{downloadFile:()=>m});var s=n(24736),a=n.n(s),i=n(77150),o=n.n(i),r=n(48960),c=n(89618),l=n(87873),d=n.n(l),u=n(48764).Buffer;function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const p=1048576;class f{constructor(e){this.maxWorkers=e,g(this,"deferred",void 0),g(this,"activeWorkers",0)}requestWorker(){return this.activeWorkers++,this.activeWorkers>this.maxWorkers?(this.deferred=(0,c.createDeferred)(),this.deferred.promise):Promise.resolve()}releaseWorker(){this.activeWorkers--,this.deferred&&this.activeWorkers<=this.maxWorkers&&this.deferred.resolve()}}class h{constructor(e){g(this,"type",void 0),g(this,"size",void 0),g(this,"buffer",void 0),g(this,"largeFile",void 0),g(this,"largeFileAccessHandle",void 0),this.size=e,this.type=e&&e>2097152e3?"opfs":"memory"}async init(){if("opfs"===this.type){var e;if(null===(e=FileSystemFileHandle)||void 0===e||!e.prototype.createSyncAccessHandle)throw new Error("`createSyncAccessHandle` is not available. Cannot download files larger than 2GB.");const t=await navigator.storage.getDirectory(),n=await t.getDirectoryHandle("downloads",{create:!0});this.largeFile=await n.getFileHandle(Math.random().toString(),{create:!0}),this.largeFileAccessHandle=await this.largeFile.createSyncAccessHandle()}else this.buffer=this.size?u.alloc(this.size):u.alloc(0)}write(e,t){if("opfs"===this.type)this.largeFileAccessHandle.write(e,{at:t});else if(this.size)for(let n=0;n=this.buffer.length)return;this.buffer.writeUInt8(e[n],t+n)}else this.buffer=u.concat([this.buffer,e])}getData(){return"opfs"===this.type?this.largeFile.getFile():Promise.resolve(this.buffer)}}async function m(e,t,n){const{dcId:s}=n;for(let a=0;a<5;a++)try{return await _(e,t,n)}catch(t){if(4===a||!t.message.startsWith("SESSION_REVOKED"))throw t;await e._cleanupExportedSender(s)}}async function _(e,t,n){let{partSizeKb:s,end:i}=n;const{fileSize:l,workers:u=1}=n,{dcId:g,progressCallback:m,start:_=0}=n;i=i&&i{for(;;){let l;try{l=await e.getSender(g);const d=await Promise.race([l.send(new(o().upload.GetFile)({location:t,offset:a()(r),limit:n,precise:s||void 0})),(0,c.sleep)(6e4).then((()=>g===e.session.dcId?Promise.reject(new Error("USER_CANCELED")):Promise.reject(new Error("SESSION_REVOKED"))))]);if(m){if(m.isCanceled)throw new Error("USER_CANCELED");C+=1/b,m(C)}return!i&&d.bytes.lengthi)break}return await Promise.all(A),v.getData()}},74766:(e,t,n)=>{"use strict";n.r(t),n.d(t,{uploadFile:()=>d});var s=n(77150),a=n.n(s),i=n(89618),o=n(48960),r=n(87873),c=n.n(r),l=n(48764).Buffer;async function d(e,t){const{file:n,onProgress:s}=t;let{workers:r}=t;const{name:d,size:u}=n,g=(0,i.readBigIntFromBuffer)((0,i.generateRandomBytes)(8),!0,!0),p=u>10485760,f=1024*(0,o.getAppropriatedPartSize)(u),h=Math.floor((u+f-1)/f);await e.getSender(e.session.dcId),r&&u||(r=1),r>=h&&(r=h);let m=0;s&&s(m);for(let t=0;th&&(d=h);for(let r=t;r{for(;;){let o;try{o=await e.getSender(e.session.dcId);const s=await n.arrayBuffer();await o.send(p?new(a().upload.SaveBigFilePart)({fileId:g,filePart:t,fileTotalParts:h,bytes:l.from(s)}):new(a().upload.SaveFilePart)({fileId:g,filePart:t,bytes:l.from(s)}))}catch(e){if(o&&!o.isConnected()){await(0,i.sleep)(1e3);continue}if(e instanceof c().FloodWaitError){await(0,i.sleep)(1e3*e.seconds);continue}throw e}if(s){if(s.isCanceled)throw new Error("USER_CANCELED");m+=1/h,s(m)}break}})(r,t))}await Promise.all(o)}return p?new(a().InputFileBig)({id:g,parts:h,name:d}):new(a().InputFile)({id:g,parts:h,name:d,md5Checksum:""})}},13302:(e,t,n)=>{var s=n(48764).Buffer;const{sha1:a,toSignedLittleBuffer:i,readBufferFromBigInt:o,readBigIntFromBuffer:r}=n(89618),c=n(35544),{sleep:l}=n(89618);class d{constructor(e,t){if(!t||!e)return;this._key=e,this._hash=t;const n=new c(t);this.auxHash=n.readLong(!1),n.read(4),this.keyId=n.readLong(!1)}async setKey(e){if(!e)return this._key=void 0,this.auxHash=void 0,this.keyId=void 0,void(this._hash=void 0);if(e instanceof d)return this._key=e._key,this.auxHash=e.auxHash,this.keyId=e.keyId,void(this._hash=e._hash);this._key=e,this._hash=await a(this._key);const t=new c(this._hash);this.auxHash=t.readLong(!1),t.read(4),this.keyId=t.readLong(!1)}async waitForKey(){for(;!this.keyId;)await l(20)}getKey(){return this._key}async calcNewNonceHash(e,t){e=i(e,32);const n=s.alloc(1);n.writeUInt8(t,0);const c=s.concat([e,s.concat([n,o(this.auxHash,8,!0)])]),l=(await a(c)).slice(4,20);return r(l,!0,!0)}equals(e){return e instanceof this.constructor&&this._key&&e.getKey()&&e.getKey().equals(this._key)}}e.exports=d},55830:(e,t,n)=>{var s=n(48764).Buffer;const a=n(66842);e.exports=class{constructor(e,t){if(!s.isBuffer(e)||!s.isBuffer(t)||16!==t.length)throw new Error("Key and iv need to be a buffer");this.cipher=a.createCipheriv("AES-256-CTR",e,t)}encrypt(e){return s.from(this.cipher.update(e))}}},89636:(e,t,n)=>{const s=n(24736),{modExp:a}=n(89618);class i{static gcd(e,t){for(;t.neq(s.zero);){const n=t;t=e.remainder(t),e=n}return e}static factorize(e){if(e.remainder(2).equals(s.zero))return{p:s(2),q:e.divide(s(2))};let t=s.randBetween(s(1),e.minus(1));const n=s.randBetween(s(1),e.minus(1)),o=s.randBetween(s(1),e.minus(1));let r,c=s.one,l=s.one,d=s.one,u=s.zero,g=s.zero;for(;c.eq(s.one);){u=t;for(let i=0;s(i).lesser(l);i++)t=a(t,s(2),e).add(n).remainder(e);for(r=s.zero;r.lesser(l)&&c.eq(s.one);){g=t;const p=s.min(o,l.minus(r));for(let i=0;s(i).lesser(p);i++)t=a(t,s(2),e).add(n).remainder(e),d=d.multiply(u.minus(t).abs()).remainder(e);c=i.gcd(d,e),r=r.add(o)}l=l.multiply(2)}if(c.eq(e))for(;g=a(g,s(2),e).add(n).remainder(e),c=i.gcd(u.minus(g).abs(),e),!c.greater(1););const p=c;return d=e.divide(c),p{var s=n(48764).Buffer;const{IGE:a}=n(28136),i=n(89618);e.exports=class{constructor(e,t){this.ige=new a(e,t)}decryptIge(e){return i.convertToLittle(this.ige.decrypt(e))}encryptIge(e){const t=e.length%16;return t&&(e=s.concat([e,i.generateRandomBytes(16-t)])),i.convertToLittle(this.ige.encrypt(e))}}},74121:(e,t,n)=>{"use strict";function s(e){const t=new Uint8Array(4*e.length);let n=0;for(let s=0;s>>24,t[n++]=a>>16&255,t[n++]=a>>8&255,t[n++]=255&a}return t.buffer}function a(e){return e.buffer}function i(e){const t=new Uint8Array(e),n=new Uint32Array(t.length/4);for(let e=0;el,ab2iBig:()=>o,ab2iLow:()=>i,i2ab:()=>c,i2abBig:()=>a,i2abLow:()=>s,isBigEndian:()=>r});const r=1===new Uint8Array(new Uint32Array([16909060]))[0],c=r?a:s,l=r?o:i},66842:(e,t,n)=>{var s=n(48764).Buffer;const a=n(28136).default,{i2ab:i,ab2i:o}=n(74121),{getWords:r}=n(77760);class c{constructor(e){this.setBytes(e)}setBytes(e){e=s.from(e),this._counter=e}increment(){for(let e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}}}class l{constructor(e,t){t instanceof c||(t=new c(t)),this._counter=t,this._remainingCounter=void 0,this._remainingCounterIndex=16,this._aes=new a(r(e))}update(e){return this.encrypt(e)}encrypt(e){const t=s.from(e);for(let e=0;e{"use strict";function s(e,t){return e.charCodeAt(t)<<24^e.charCodeAt(t+1)<<16^e.charCodeAt(t+2)<<8^e.charCodeAt(t+3)}function a(e){if(e instanceof Uint32Array)return e;if("string"==typeof e){if(e.length%4!=0)for(let t=e.length%4;t<=4;t++)e+="\0x00";const t=new Uint32Array(e.length/4);for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:e;for(let s=0;sa,s2i:()=>s,xor:()=>i})},48187:e=>{class t extends Error{constructor(){super("The read operation was cancelled.")}}class n extends Error{constructor(e,t){super(`Could not find a matching Constructor ID for the TLObject that was supposed to be\n read with ID ${e}. Most likely, a TLObject was trying to be read when\n it should not be read. Remaining bytes: ${t.length}`),"undefined"!=typeof alert&&alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${e}`),this.invalidConstructorId=e,this.remaining=t}}class s extends Error{constructor(e,t){super(`Invalid checksum (${e} when ${t} was expected). This packet should be skipped.`),this.checksum=e,this.validChecksum=t}}class a extends Error{constructor(e){let t;4===e.length?(t=-e.readInt32LE(0),super(`Invalid response buffer (HTTP code ${t})`)):super(`Invalid response buffer (too short ${e})`),this.code=t,this.payload=e}}class i extends Error{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n{function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class n extends Error{constructor(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;super("RPCError {0}: {1}{2}".replace("{0}",s).replace("{1}",e).replace("{2}",n._fmtRequest(t))),this.code=s,this.message=e}static _fmtRequest(e){return e?` (caused by ${e.className})`:""}}e.exports={RPCError:n,InvalidDCError:class extends n{constructor(e,t,n){super(t,e,n),this.code=n||303,this.message=t||"ERROR_SEE_OTHER"}},BadRequestError:class extends n{constructor(){super(...arguments),t(this,"code",400),t(this,"message","BAD_REQUEST")}},UnauthorizedError:class extends n{constructor(){super(...arguments),t(this,"code",401),t(this,"message","UNAUTHORIZED")}},ForbiddenError:class extends n{constructor(){super(...arguments),t(this,"code",403),t(this,"message","FORBIDDEN")}},NotFoundError:class extends n{constructor(){super(...arguments),t(this,"code",404),t(this,"message","NOT_FOUND")}},AuthKeyError:class extends n{constructor(){super(...arguments),t(this,"code",406),t(this,"message","AUTH_KEY")}},FloodError:class extends n{constructor(){super(...arguments),t(this,"code",420),t(this,"message","FLOOD")}},ServerError:class extends n{constructor(){super(...arguments),t(this,"code",500),t(this,"message","INTERNAL")}},TimedOutError:class extends n{constructor(){super(...arguments),t(this,"code",503),t(this,"message","Timeout")}}}},65651:(e,t,n)=>{const{RPCError:s,InvalidDCError:a,FloodError:i,BadRequestError:o}=n(86952);class r extends a{constructor(e){const t=Number(e.capture||0);super(`The user whose identity is being used to execute queries is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The user whose identity is being used to execute queries is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class c extends a{constructor(e){const t=Number(e.capture||0);super(`The phone number a user is trying to use for authorization is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The phone number a user is trying to use for authorization is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class l extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required before sending another message in this chat${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required before sending another message in this chat${s._fmtRequest(e.request)}`,this.seconds=t}}class d extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required${s._fmtRequest(e.request)}`,this.seconds=t}}class u extends i{constructor(e){super(`Message failed to be sent.${s._fmtRequest(e.request)}`),this.message=`Message failed to be sent.${s._fmtRequest(e.request)}`}}class g extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required in the test servers${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required in the test servers${s._fmtRequest(e.request)}`,this.seconds=t}}class p extends a{constructor(e){const t=Number(e.capture||0);super(`The file to be accessed is currently stored in DC ${t}${s._fmtRequest(e.request)}`),this.message=`The file to be accessed is currently stored in DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class f extends a{constructor(e){const t=Number(e.capture||0);super(`The source IP address is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The source IP address is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class h extends o{constructor(e){const t=Number(e.capture||0);super(`Email unconfirmed, the length of the code must be ${t}${s._fmtRequest(e.request)}`),this.message=`Email unconfirmed, the length of the code must be ${t}${s._fmtRequest(e.request)}`,this.codeLength=t}}const m=[[/FILE_MIGRATE_(\d+)/,p],[/FLOOD_TEST_PHONE_WAIT_(\d+)/,g],[/FLOOD_WAIT_(\d+)/,d],[/MSG_WAIT_(.*)/,u],[/PHONE_MIGRATE_(\d+)/,c],[/SLOWMODE_WAIT_(\d+)/,l],[/USER_MIGRATE_(\d+)/,r],[/NETWORK_MIGRATE_(\d+)/,f],[/EMAIL_UNCONFIRMED_(\d+)/,h]];e.exports={rpcErrorRe:m,FileMigrateError:p,FloodTestPhoneWaitError:g,FloodWaitError:d,PhoneMigrateError:c,SlowModeWaitError:l,UserMigrateError:r,NetworkMigrateError:f,MsgWaitError:u,EmailUnconfirmedError:h}},87873:(e,t,n)=>{const{RPCError:s}=n(86952),{rpcErrorRe:a}=n(65651),i=n(48187),o=n(86952),r=n(65651);e.exports={RPCMessageToError:function(e,t){for(const[n,s]of a){const a=e.errorMessage.match(n);if(a)return new s({request:t,capture:2===a.length?parseInt(a[1],10):void 0})}return new s(e.errorMessage,t)},...i,...o,...r}},26316:()=>{},43903:(e,t,n)=>{const{EventBuilder:s}=n(80663);e.exports=class extends s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{types:void 0,func:void 0};super(),e.types?this.types=e.types:this.types=!0}build(e){return e}}},80663:e=>{e.exports={EventBuilder:class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{chats:void 0,blacklistChats:void 0,func:void 0};this.chats=e.chats,this.blacklistChats=Boolean(e.blacklistChats),this.resolved=!1,this.func=e.func}build(e){}}}},33182:(e,t,n)=>{const s=n(26316),a=n(43903);class i extends Error{}e.exports={NewMessage:s,StopPropagation:i,Raw:a}},16151:e=>{e.exports=class{constructor(){this._queue=[],this.canGet=new Promise((e=>{this.resolveGet=e})),this.canPush=!0}async push(e){await this.canPush,this._queue.push(e),this.resolveGet(!0),this.canPush=new Promise((e=>{this.resolvePush=e}))}async pop(){await this.canGet;const e=this._queue.pop();return this.resolvePush(!0),this.canGet=new Promise((e=>{this.resolveGet=e})),e}}},35544:(e,t,n)=>{const{TypeNotFoundError:s}=n(48187),{coreObjects:a}=n(92058),{tlobjects:i}=n(70845),{readBigIntFromBuffer:o}=n(89618);e.exports=class{constructor(e){this.stream=e,this._last=void 0,this.offset=0}readByte(){return this.read(1)[0]}readInt(){let e;return e=arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?this.stream.readUInt32LE(this.offset):this.stream.readInt32LE(this.offset),this.offset+=4,e}readLong(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.readLargeInt(64,e)}readFloat(){return this.read(4).readFloatLE(0)}readDouble(){return this.read(8).readDoubleLE(0)}readLargeInt(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.read(Math.floor(e/8));return o(n,!0,t)}read(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1===e&&(e=this.stream.length-this.offset);const t=this.stream.slice(this.offset,this.offset+e);if(this.offset+=e,t.length!==e)throw Error(`No more data left to read (need ${e}, got ${t.length}: ${t}); last read ${this._last}`);return this._last=t,t}getBuffer(){return this.stream}tgReadBytes(){const e=this.readByte();let t,n;254===e?(n=this.readByte()|this.readByte()<<8|this.readByte()<<16,t=n%4):(n=e,t=(n+1)%4);const s=this.read(n);return t>0&&(t=4-t,this.read(t)),s}tgReadString(){return this.tgReadBytes().toString("utf-8")}tgReadBool(){const e=this.readInt(!1);if(2574415285===e)return!0;if(3162085175===e)return!1;throw new Error(`Invalid boolean code ${e.toString("16")}`)}tgReadDate(){const e=this.readInt();return new Date(1e3*e)}tgReadObject(){const e=this.readInt(!1);let t=i[e];if(void 0===t){if(2574415285===e)return!0;if(3162085175===e)return!1;if(481674261===e){const e=[],t=this.readInt();for(let n=0;n{var s=n(48764).Buffer;e.exports=class{constructor(e){this._stream=e}write(e){this._stream=s.concat([this._stream,e])}getValue(){return this._stream}}},96748:e=>{let t;class n{constructor(e){t||(t=e||"debug"),this.isBrowser="undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs,this.isBrowser?this.colors={start:"%c",warn:"color : #ff00ff",info:"color : #ffff00",debug:"color : #00ffff",error:"color : #ff0000",end:""}:this.colors={start:"",warn:"",info:"",debug:"",error:"",end:""},this.messageFormat="[%t] [%l] - [%m]"}static setLevel(e){t=e}canSend(e){return n.levels.indexOf(t)>=n.levels.indexOf(e)}warn(e){"debug"===t&&console.error((new Error).stack),this._log("warn",e,this.colors.warn)}info(e){this._log("info",e,this.colors.info)}debug(e){this._log("debug",e,this.colors.debug)}error(e){"debug"===t&&console.error((new Error).stack),this._log("error",e,this.colors.error)}format(e,t){return this.messageFormat.replace("%t",(new Date).toISOString()).replace("%l",t.toUpperCase()).replace("%m",e)}_log(e,n,s){t&&this.canSend(e)&&(this.isBrowser?console.log(this.colors.start+this.format(n,e),s):console.log(s+this.format(n,e)+this.colors.end))}}var s,a,i;i=["error","warn","info","debug"],(a="levels")in(s=n)?Object.defineProperty(s,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[a]=i,e.exports=n},36411:(e,t,n)=>{var s=n(48764).Buffer;const a=n(63254),i=n(40355),o=n(96472),r=["messages.SendMessage","messages.SendMedia","messages.SendMultiMedia","messages.ForwardMessages","messages.SendInlineBotResult"];e.exports=class{constructor(e,t){this._state=e,this._queue=[],this._pendingStates=[],this._ready=new Promise((e=>{this.setReady=e})),this._log=t}values(){return this._queue}append(e){if(e&&r.includes(e.request.className))for(let t=this._queue.length-1;t>=0;t--)if(r.includes(this._queue[t].request.className)){e.after=this._queue[t];break}this._queue.push(e),this.setReady(!0),e&&1658238041!==e.request.CONSTRUCTOR_ID&&(this._pendingStates.push(e),e.promise.catch((()=>{})).finally((()=>{this._pendingStates=this._pendingStates.filter((t=>t!==e))})))}extend(e){for(const t of e)this._queue.push(t);this.setReady(!0)}async get(){if(this._queue.length||(this._ready=new Promise((e=>{this.setReady=e})),await this._ready),!this._queue[this._queue.length-1])return void(this._queue=[]);let e,t=new o(s.alloc(0));const n=[];let r=0;for(;this._queue.length&&n.length<=a.MAXIMUM_LENGTH;){const e=this._queue.shift();if(r+=e.data.length+i.SIZE_OVERHEAD,r<=a.MAXIMUM_SIZE){let s;e.after&&(s=e.after.msgId),e.msgId=await this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,s),this._log.debug(`Assigned msgId = ${e.msgId} to ${e.request.className||e.request.constructor.name}`),n.push(e)}else{if(n.length){this._queue.unshift(e);break}this._log.warn(`Message payload for ${e.request.className||e.request.constructor.name} is too long ${e.data.length} and cannot be sent`),e.reject("Request Payload is too big"),r=0}}if(n.length){if(n.length>1){const i=s.alloc(8);i.writeUInt32LE(a.CONSTRUCTOR_ID,0),i.writeInt32LE(n.length,4),e=s.concat([i,t.getValue()]),t=new o(s.alloc(0));const r=await this._state.writeDataAsMessage(t,e,!1);for(const e of n)e.containerId=r}return e=t.getValue(),{batch:n,data:e}}}rejectAll(){this._pendingStates.forEach((e=>{e.reject(new Error("Disconnect"))}))}}},7214:(e,t,n)=>{var s=n(48764).Buffer;const{Mutex:a}=n(48125),i=new a,o=n(45840).w3cwebsocket,r=new Error("WebSocket was closed");e.exports=class{constructor(e){this.client=void 0,this.closed=!0,this.disconnectedCallback=e}async readExactly(e){let t=s.alloc(0);for(;;){const n=await this.read(e);if(t=s.concat([t,n]),!(e-=n.length))return t}}async read(e){if(this.closed)throw r;if(await this.canRead,this.closed)throw r;const t=this.stream.slice(0,e);return this.stream=this.stream.slice(e),0===this.stream.length&&(this.canRead=new Promise((e=>{this.resolveRead=e}))),t}async readAll(){if(this.closed||!await this.canRead)throw r;const e=this.stream;return this.stream=s.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),e}getWebSocketLink(e,t,n){return 443===t?`wss://${e}:${t}/apiws${n?"_test":""}`:`ws://${e}:${t}/apiws${n?"_test":""}`}connect(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.stream=s.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),this.closed=!1,this.website=this.getWebSocketLink(t,e,n),this.client=new o(this.website,"binary"),new Promise(((e,n)=>{this.client.onopen=()=>{this.receive(),e(this)},this.client.onerror=e=>{console.error("WebSocket error",e),n(e)},this.client.onclose=e=>{const{code:n,reason:s,wasClean:a}=e;1e3!==n&&console.error(`Socket ${t} closed. Code: ${n}, reason: ${s}, was clean: ${a}`),this.resolveRead(!1),this.closed=!0,this.disconnectedCallback&&this.disconnectedCallback()},self.addEventListener("offline",(async()=>{await this.close(),this.resolveRead(!1)}))}))}write(e){if(this.closed)throw r;this.client.send(e)}async close(){await this.client.close(),this.closed=!0}receive(){this.client.onmessage=async e=>{await i.runExclusive((async()=>{const t=e.data instanceof ArrayBuffer?s.from(e.data):s.from(await new Response(e.data).arrayBuffer());this.stream=s.concat([this.stream,t]),this.resolveRead(!0)}))}}}},89832:(e,t,n)=>{const s=n(96748),a=n(96472),i=n(35544),o=n(7214),r=n(36411),c=n(16151);e.exports={BinaryWriter:a,BinaryReader:i,MessagePacker:r,AsyncQueue:c,Logger:s,PromisedWebSockets:o}},13522:(e,t,n)=>{const s=n(77150),a=n(78742),i=n(18415),o=n(57404),r=n(61472),c=n(33182),l=n(48960),d=n(87873),u=n(15886),g=n(89832),p=n(89618);e.exports={Api:s,TelegramClient:a,sessions:u,connection:i,extensions:g,tl:o,version:r,events:c,utils:l,errors:d,helpers:p}},59870:(e,t,n)=>{"use strict";n.r(t),n.d(t,{doAuthentication:()=>m});var s=n(77150),a=n.n(s),i=n(87873),o=n(24736),r=n.n(o);n(89618),n(48764).Buffer;const c=[{fingerprint:r()("-3414540481677951611"),n:r()("29379598170669337022986177149456128565388431120058863768162556424047512191330847455146576344487764408661701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531316010870401287642763009136156734339538042419388722777357134487746169093539093850251243897188928735903389451772730245253062963384108812842079887538976360465290946139638691491496062099570836476454855996319192747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),e:65537},{fingerprint:r()("-5595554452916591101"),n:r()("25342889448840415564971689590713473206898847759084779052582026594546022463853940585885215951168491965708222649399180603818074200620463776135424884632162512403163793083921641631564740959529419359595852941166848940585952337613333022396096584117954892216031229237302943701877588456738335398602461675225081791820393153757504952636234951323237820036543581047826906120927972487366805292115792231423684261262330394324750785450942589751755390156647751460719351439969059949569615302809050721500330239005077889855323917509948255722081644689442127297605422579707142646660768825302832201908302295573257427896031830742328565032949"),e:65537}].reduce(((e,t)=>{let{fingerprint:n,...s}=t;return e.set(n.toString(),s),e}),new Map);var l=n(48764).Buffer;const d=n(24736),u=n(32608),g=n(13302),p=n(89636),f=n(89618),h=n(35544);async function m(e,t){let n=f.generateRandomBytes(16);const s=f.readBigIntFromBuffer(n,!1,!0),o=await e.send(new(a().ReqPqMulti)({nonce:s}));if(t.debug("Starting authKey generation step 1"),!(o instanceof a().ResPQ))throw new i.SecurityError(`Step 1 answer was ${o}`);if(o.nonce.neq(s))throw new i.SecurityError("Step 1 invalid nonce from server");const r=f.readBigIntFromBuffer(o.pq,!1,!0);t.debug("Finished authKey generation step 1");const{p:m,q:_}=p.factorize(r),y=f.getByteArray(m),b=f.getByteArray(_);n=f.generateRandomBytes(32);const w=f.readBigIntFromBuffer(n,!0,!0),v=new(a().PQInnerData)({pq:f.getByteArray(r),p:y,q:b,nonce:o.nonce,serverNonce:o.serverNonce,newNonce:w}).getBytes();if(v.length>144)throw new i.SecurityError("Step 1 invalid nonce from server");let A,I;for(const e of o.serverPublicKeyFingerprints)if(I=c.get(e.toString()),void 0!==I){A=e;break}if(void 0===A||void 0===I)throw new i.SecurityError("Step 2 could not find a valid key for fingerprints");const S=f.generateRandomBytes(192-v.length),C=l.concat([v,S]),P=l.from(C).reverse();let M;for(let e=0;e<20;e++){const e=f.generateRandomBytes(32),n=await f.sha256(l.concat([e,C])),s=l.concat([P,n]),a=new u(e,l.alloc(32)).encryptIge(s),i=f.bufferXor(e,await f.sha256(a)),o=l.concat([i,a]),r=f.readBigIntFromBuffer(o,!1,!1);if(r.greaterOrEquals(I.n)){t.debug("Aes key greater than RSA. retrying");continue}const c=f.modExp(r,d(I.e),I.n);M=f.readBufferFromBigInt(c,256,!1,!1);break}if(void 0===M)throw new i.SecurityError("Step 2 could create a secure encrypted key");t.debug("Step 2 : Generated a secure aes encrypted data");const k=await e.send(new(a().ReqDHParams)({nonce:o.nonce,serverNonce:o.serverNonce,p:y,q:b,publicKeyFingerprint:A,encryptedData:M}));if(!(k instanceof a().ServerDHParamsOk||k instanceof a().ServerDHParamsFail))throw new Error(`Step 2.1 answer was ${k}`);if(k.nonce.neq(o.nonce))throw new i.SecurityError("Step 2 invalid nonce from server");if(k.serverNonce.neq(o.serverNonce))throw new i.SecurityError("Step 2 invalid server nonce from server");if(k instanceof a().ServerDHParamsFail){const e=await f.sha1(f.toSignedLittleBuffer(w,32).slice(4,20)),t=f.readBigIntFromBuffer(e,!0,!0);if(k.newNonceHash.neq(t))throw new i.SecurityError("Step 2 invalid DH fail nonce from server")}if(!(k instanceof a().ServerDHParamsOk))throw new Error(`Step 2.2 answer was ${k}`);t.debug("Finished authKey generation step 2"),t.debug("Starting authKey generation step 3");const{key:R,iv:B}=await f.generateKeyDataFromNonce(o.serverNonce,w);if(k.encryptedAnswer.length%16!=0)throw new i.SecurityError("Step 3 AES block size mismatch");const U=new u(R,B),D=U.decryptIge(k.encryptedAnswer),E=new h(D);E.read(20);const T=E.tgReadObject();if(!(T instanceof a().ServerDHInnerData))throw new Error(`Step 3 answer was ${T}`);if(T.nonce.neq(o.nonce))throw new i.SecurityError("Step 3 Invalid nonce in encrypted answer");if(T.serverNonce.neq(o.serverNonce))throw new i.SecurityError("Step 3 Invalid server nonce in encrypted answer");const x=f.readBigIntFromBuffer(T.dhPrime,!1,!1),V=f.readBigIntFromBuffer(T.gA,!1,!1),N=T.serverTime-Math.floor((new Date).getTime()/1e3),F=f.readBigIntFromBuffer(f.generateRandomBytes(256),!1,!1),q=f.modExp(d(T.g),F,x),L=f.modExp(V,F,x),H=new(a().ClientDHInnerData)({nonce:o.nonce,serverNonce:o.serverNonce,retryId:d.zero,gB:f.getByteArray(q,!1)}).getBytes(),O=l.concat([await f.sha1(H),H]),G=U.encryptIge(O),K=await e.send(new(a().SetClientDHParams)({nonce:o.nonce,serverNonce:o.serverNonce,encryptedData:G})),z=[a().DhGenOk,a().DhGenRetry,a().DhGenFail];if(!(K instanceof z[0]||K instanceof z[1]||K instanceof z[2]))throw new Error(`Step 3.1 answer was ${K}`);const{name:W}=K.constructor;if(K.nonce.neq(o.nonce))throw new i.SecurityError(`Step 3 invalid ${W} nonce from server`);if(K.serverNonce.neq(o.serverNonce))throw new i.SecurityError(`Step 3 invalid ${W} server nonce from server`);const j=new g;await j.setKey(f.getByteArray(L));const $=1+["DhGenOk","DhGenRetry","DhGenFail"].indexOf(K.className),J=await j.calcNewNonceHash(w,$);if(K[`newNonceHash${$}`].neq(J))throw new i.SecurityError("Step 3 invalid new nonce hash");if(!(K instanceof a().DhGenOk))throw new Error(`Step 3.2 answer was ${K}`);return t.debug("Finished authKey generation step 3"),{authKey:j,timeOffset:N}}},45585:(e,t,n)=>{var s=n(48764).Buffer;const a=n(24736),i=n(59109),o=n(35544),{InvalidBufferError:r}=n(48187),{toSignedLittleBuffer:c}=n(89618);e.exports=class{constructor(e,t){this._state=new i(e,t),this._connection=e}async send(e){let t=e.getBytes(),n=this._state._getNewMsgId();const i=c(n,8),l=s.alloc(4);l.writeInt32LE(t.length,0);const d=s.concat([s.concat([s.alloc(8),i,l]),t]);if(await this._connection.send(d),t=await this._connection.recv(),t.length<8)throw new r(t);const u=new o(t);if(u.readLong().neq(a(0)))throw new Error("Bad authKeyId");if(n=u.readLong(),n.eq(a(0)))throw new Error("Bad msgId");if(u.readInt()<=0)throw new Error("Bad length");return u.tgReadObject()}}},74046:(e,t,n)=>{const{RPCError:s}=n(87873),a=n(45585),i=n(59109),o=n(89618),r=n(13302),{doAuthentication:c}=n(59870),l=n(52301),d=n(63254),u=n(68963),g=n(44287),{MsgsAck:p,upload:f,MsgsStateInfo:h,Pong:m}=n(57404).constructors,_=n(36411),y=n(35544),{UpdateConnectionState:b,UpdateServerTimeOffset:w}=n(68744),{BadMessageError:v}=n(48187),{BadServerSalt:A,BadMsgNotification:I,MsgDetailedInfo:S,MsgNewDetailedInfo:C,NewSessionCreated:P,FutureSalts:M,MsgsStateReq:k,MsgResendReq:R,MsgsAllInfo:B}=n(57404).constructors,{SecurityError:U}=n(48187),{InvalidBufferError:D}=n(48187),{LogOut:E}=n(57404).requests.auth,{RPCMessageToError:T}=n(87873),{TypeNotFoundError:x}=n(48187);class V{constructor(e,t){const n={...V.DEFAULT_OPTIONS,...t};this._connection=void 0,this._log=n.logger,this._dcId=n.dcId,this._retries=n.retries,this._delay=n.delay,this._autoReconnect=n.autoReconnect,this._connectTimeout=n.connectTimeout,this._authKeyCallback=n.authKeyCallback,this._updateCallback=n.updateCallback,this._autoReconnectCallback=n.autoReconnectCallback,this._isMainSender=n.isMainSender,this._onConnectionBreak=n.onConnectionBreak,this.userDisconnected=!1,this._user_connected=!1,this.isReconnecting=!1,this._disconnected=!0,this._send_loop_handle=void 0,this._recv_loop_handle=void 0,this.authKey=e||new r,this._state=new i(this.authKey,this._log),this._send_queue=new _(this._state,this._log),this._pending_state={},this._pending_ack=new Set,this._last_acks=[],this._handlers={[l.CONSTRUCTOR_ID]:this._handleRPCResult.bind(this),[d.CONSTRUCTOR_ID]:this._handleContainer.bind(this),[u.CONSTRUCTOR_ID]:this._handleGzipPacked.bind(this),[m.CONSTRUCTOR_ID]:this._handlePong.bind(this),[A.CONSTRUCTOR_ID]:this._handleBadServerSalt.bind(this),[I.CONSTRUCTOR_ID]:this._handleBadNotification.bind(this),[S.CONSTRUCTOR_ID]:this._handleDetailedInfo.bind(this),[C.CONSTRUCTOR_ID]:this._handleNewDetailedInfo.bind(this),[P.CONSTRUCTOR_ID]:this._handleNewSessionCreated.bind(this),[p.CONSTRUCTOR_ID]:this._handleAck.bind(this),[M.CONSTRUCTOR_ID]:this._handleFutureSalts.bind(this),[k.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[R.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[B.CONSTRUCTOR_ID]:this._handleMsgAll.bind(this)}}async connect(e,t){if(this.userDisconnected=!1,this._user_connected&&!t)return this._log.info("User is already connected!"),!1;this.isConnecting=!0,this._connection=e;for(let e=0;e=10&&this._last_acks.shift(),this._pending_ack.clear()}this._log.debug(`Waiting for messages to send...${this.isReconnecting}`);const e=await this._send_queue.get();if(this.isReconnecting)return;if(!e)continue;let{data:t}=e;const{batch:n}=e;this._log.debug(`Encrypting ${n.length} message(s) in ${t.length} bytes for sending`),t=await this._state.encryptMessageData(t);try{await this._connection.send(t)}catch(e){return this._log.error(e),void this._log.info("Connection closed while sending data")}for(const e of n)if(Array.isArray(e))for(const t of e)"request"===t.request.classType&&(this._pending_state[t.msgId]=t);else"request"===e.request.classType&&(this._pending_state[e.msgId]=e);this._log.debug("Encrypted messages put in a queue to be sent")}}async _recvLoop(){let e,t;for(;this._user_connected&&!this.isReconnecting;){this._log.debug("Receiving items from the network...");try{e=await this._connection.recv()}catch(e){return void(this.userDisconnected||(this._log.error(e),this._log.warn("Connection closed while receiving data"),this.reconnect()))}try{t=await this._state.decryptMessageData(e)}catch(e){if(e instanceof x){this._log.info(`Type ${e.invalidConstructorId} not found, remaining data ${e.remaining}`);continue}if(e instanceof U){this._log.warn(`Security error while unpacking a received message: ${e}`);continue}return e instanceof D?void(404===e.code?this._handleBadAuthKey():(this._log.warn(`Invalid buffer ${e.code} for dc ${this._dcId}`),this.reconnect())):(this._log.error("Unhandled error while receiving data"),this._log.error(e),void this.reconnect())}try{await this._processMessage(t)}catch(e){e instanceof s?"AUTH_KEY_UNREGISTERED"===e.message&&this._handleBadAuthKey(!0):(this._log.error("Unhandled error while receiving data"),this._log.error(e))}}}_handleBadAuthKey(e){e&&this._isMainSender||(this._log.warn(`Broken authorization key for dc ${this._dcId}, resetting...`),this._isMainSender&&this._updateCallback?this._updateCallback(new b(b.broken)):!this._isMainSender&&this._onConnectionBreak&&this._onConnectionBreak(this._dcId))}async _processMessage(e){this._pending_ack.add(e.msgId),e.obj=await e.obj;let t=this._handlers[e.obj.CONSTRUCTOR_ID];t||(t=this._handleUpdate.bind(this)),await t(e)}_popStates(e){let t=this._pending_state[e];if(t)return this._pending_state[e].deferred.resolve(),delete this._pending_state[e],[t];const n=[];for(t of Object.values(this._pending_state))t.containerId&&t.containerId.equals(e)&&n.push(t.msgId);if(n.length){const e=[];for(const t of n)e.push(this._pending_state[t]),this._pending_state[t].deferred.resolve(),delete this._pending_state[t];return e}for(const t of this._last_acks)if(t.msgId===e)return[t];return[]}_handleRPCResult(e){const t=e.obj,n=this._pending_state[t.reqMsgId];if(n&&(n.deferred.resolve(),delete this._pending_state[t.reqMsgId]),this._log.debug(`Handling RPC result for message ${t.reqMsgId}`),!n)try{if(!(new y(t.body).tgReadObject()instanceof f.File))throw new x("Not an upload.File")}catch(e){if(this._log.error(e),e instanceof x)return void this._log.info(`Received response without parent request: ${t.body}`);throw e}if(t.error){const e=T(t.error,n.request);throw this._send_queue.append(new g(new p({msgIds:[n.msgId]}))),n.reject(e),e}try{const e=new y(t.body),s=n.request.readResult(e);n.resolve(s)}catch(e){throw n.reject(e),e}}async _handleContainer(e){this._log.debug("Handling container");for(const t of e.obj.messages)await this._processMessage(t)}async _handleGzipPacked(e){this._log.debug("Handling gzipped data");const t=new y(e.obj.data);e.obj=t.tgReadObject(),await this._processMessage(e)}_handleUpdate(e){2331323052===e.obj.SUBCLASS_OF_ID?(this._log.debug(`Handling update ${e.obj.className}`),this._updateCallback&&this._updateCallback(e.obj)):this._log.warn(`Note: ${e.obj.className} is not an update, not dispatching it`)}_handlePong(e){const t=e.obj,n=this._state.updateTimeOffset(e.msgId);this._updateCallback&&this._updateCallback(new w(n)),this._log.debug(`Handling pong for message ${t.msgId}`);const s=this._pending_state[t.msgId];this._pending_state[t.msgId].deferred.resolve(),delete this._pending_state[t.msgId],s&&s.resolve(t)}_handleBadServerSalt(e){const t=e.obj;this._log.debug(`Handling bad salt for message ${t.badMsgId}`),this._state.salt=t.newServerSalt;const n=this._popStates(t.badMsgId);this._send_queue.extend(n),this._log.debug(`${n.length} message(s) will be resent`)}_handleBadNotification(e){const t=e.obj,n=this._popStates(t.badMsgId);if(this._log.debug(`Handling bad msg ${JSON.stringify(t)}`),[16,17].includes(t.errorCode)){const t=this._state.updateTimeOffset(e.msgId);this._updateCallback&&this._updateCallback(new w(t)),this._log.info(`System clock is wrong, set time offset to ${t}s`)}else if(32===t.errorCode)this._state._sequence+=64;else{if(33!==t.errorCode){for(const e of n)e.reject(new v(e.request,t.errorCode));return}this._state._sequence-=16}this._send_queue.extend(n),this._log.debug(`${n.length} messages will be resent due to bad msg`)}_handleDetailedInfo(e){const t=e.obj.answerMsgId;this._log.debug(`Handling detailed info for message ${t}`),this._pending_ack.add(t)}_handleNewDetailedInfo(e){const t=e.obj.answerMsgId;this._log.debug(`Handling new detailed info for message ${t}`),this._pending_ack.add(t)}_handleNewSessionCreated(e){this._log.debug("Handling new session created"),this._state.salt=e.obj.serverSalt}_handleAck(e){const t=e.obj;this._log.debug(`Handling acknowledge for ${t.msgIds}`);for(const e of t.msgIds){const t=this._pending_state[e];t&&t.request instanceof E&&(this._pending_state[e].deferred.resolve(),delete this._pending_state[e],t.resolve(!0))}}_handleFutureSalts(e){this._log.debug(`Handling future salts for message ${e.msgId}`);const t=this._pending_state[e.msgId];t&&(this._pending_state[e].deferred.resolve(),delete this._pending_state[e],t.resolve(e.obj))}_handleStateForgotten(e){this._send_queue.append(new g(new h(e.msgId,String.fromCharCode(1).repeat(e.obj.msgIds))))}_handleMsgAll(e){}reconnect(){this._user_connected&&!this.isReconnecting&&(this.isReconnecting=!0,o.sleep(1e3).then((()=>{this._log.info("Started reconnecting"),this._reconnect()})))}async _reconnect(){this._log.debug("Closing current connection...");try{await this._disconnect()}catch(e){this._log.warn(e)}this._send_queue.append(void 0),this._state.reset();const e=new this._connection.constructor(this._connection._ip,this._connection._port,this._connection._dcId,this._connection._log,this._connection._testServers);await this.connect(e,!0),this.isReconnecting=!1;for(const e of Object.values(this._pending_state))e.deferred.resolve();this._pending_state={},this._autoReconnectCallback&&await this._autoReconnectCallback()}}var N,F,q;q={logger:void 0,retries:1/0,delay:2e3,autoReconnect:!0,connectTimeout:void 0,authKeyCallback:void 0,updateCallback:void 0,autoReconnectCallback:void 0,isMainSender:void 0,onConnectionBreak:void 0},(F="DEFAULT_OPTIONS")in(N=V)?Object.defineProperty(N,F,{value:q,enumerable:!0,configurable:!0,writable:!0}):N[F]=q,e.exports=V},59109:(e,t,n)=>{var s=n(48764).Buffer;const a=n(24736),i=n(28136),o=n(89618),r=n(32608),c=n(35544),l=n(68963),{TLMessage:d}=n(92058),{SecurityError:u,InvalidBufferError:g}=n(48187),{InvokeAfterMsg:p}=n(57404).requests,{toSignedLittleBuffer:f}=n(89618);e.exports=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.authKey=e,this._log=t,this._isCall=n,this._isOutgoing=s,this.timeOffset=0,this.salt=0,this.id=void 0,this._sequence=void 0,this._lastMsgId=void 0,this.msgIds=[],this.reset()}reset(){this.id=o.generateRandomLong(!0),this._sequence=0,this._lastMsgId=a(0),this.msgIds=[]}updateMessageId(e){e.msgId=this._getNewMsgId()}async _calcKey(e,t,n){const a=this._isCall?128+(this._isOutgoing^n?8:0):!0===n?0:8,[i,r]=await Promise.all([o.sha256(s.concat([t,e.slice(a,a+36)])),o.sha256(s.concat([e.slice(a+40,a+76),t]))]),c=s.concat([i.slice(0,8),r.slice(8,24),i.slice(24,32)]);return this._isCall?{key:c,iv:s.concat([r.slice(0,4),i.slice(8,16),r.slice(24,28)])}:{key:c,iv:s.concat([r.slice(0,8),i.slice(8,24),r.slice(24,32)])}}async writeDataAsMessage(e,t,n,a){const i=this._getNewMsgId(),o=this._getSeqNo(n);let r;r=a?await l.gzipIfSmaller(n,new p(a,{getBytes:()=>t}).getBytes()):await l.gzipIfSmaller(n,t);const c=s.alloc(4);c.writeInt32LE(o,0);const d=s.alloc(4);d.writeInt32LE(r.length,0);const u=f(i,8);return e.write(s.concat([u,c,d])),e.write(r),i}async encryptMessageData(e){if(await this.authKey.waitForKey(),this._isCall){const t=128+(this._isOutgoing?0:8),n=e.length;e=s.from(e),n%4!=0&&(e=s.concat([e,s.from(new Array(4-n%4).fill(32))]));const a=(await o.sha256(s.concat([this.authKey.getKey().slice(88+t,88+t+32),s.from(e)]))).slice(8,24),{iv:r,key:c}=await this._calcKey(this.authKey.getKey(),a,!0);return e=o.convertToLittle(new i.CTR(c,r).encrypt(e)),s.concat([a,e])}{const t=f(this.salt,8),n=f(this.id,8);e=s.concat([s.concat([t,n]),e]);const a=o.generateRandomBytes(o.mod(-(e.length+12),16)+12),i=(await o.sha256(s.concat([this.authKey.getKey().slice(88,120),e,a]))).slice(8,24),{iv:c,key:l}=await this._calcKey(this.authKey.getKey(),i,!0),d=o.readBufferFromBigInt(this.authKey.keyId,8);return s.concat([d,i,new r(l,c).encryptIge(s.concat([e,a]))])}}async decryptMessageData(e){if(e.length<8)throw new g(e);if(e.length<0)throw new u("Server replied with negative length");if(e.length%4!=0&&!this._isCall)throw new u("Server replied with length not divisible by 4");if(!this._isCall&&o.readBigIntFromBuffer(e.slice(0,8)).neq(this.authKey.keyId))throw new u("Server replied with an invalid auth key");const t=this._isCall?e.slice(0,16):e.slice(8,24),n=this._isCall?128+(this.isOutgoing?8:0):void 0,{iv:a,key:l}=await this._calcKey(this.authKey.getKey(),t,!1);if(this._isCall){const t=(e=e.slice(16)).length;e=s.concat([e,s.from(new Array(4-t%4).fill(0))]),e=(e=o.convertToLittle(new i.CTR(l,a).decrypt(e))).slice(0,t)}else e=new r(l,a).decryptIge(this._isCall?e.slice(16):e.slice(24));const p=this._isCall?await o.sha256(s.concat([this.authKey.getKey().slice(88+n,88+n+32),e])):await o.sha256(s.concat([this.authKey.getKey().slice(96,128),e]));if(!this._isCall&&!t.equals(p.slice(8,24)))throw new u("Received msg_key doesn't match with expected one");const f=new c(e);if(this._isCall)return f.readInt(!1),f.read(e.length-4);{if(f.readLong(),!f.readLong().eq(this.id))throw new u("Server replied with a wrong session ID");const t=f.readLong();if(this.msgIds.includes(t.toString()))throw new u("Duplicate msgIds");this.msgIds.length>500&&this.msgIds.shift(),this.msgIds.push(t.toString());const n=f.readInt(),s=f.readInt(),a=e.length-s;if(a<12||a>1024)throw new u("Server replied with the wrong message padding");const i=f.tgReadObject();return new d(t,n,i)}}_getNewMsgId(){const e=(new Date).getTime()/1e3+this.timeOffset,t=Math.floor(1e9*(e-Math.floor(e)));let n=a(Math.floor(e)).shiftLeft(a(32)).or(a(t).shiftLeft(a(2)));return this._lastMsgId.greaterOrEquals(n)&&(n=this._lastMsgId.add(a(4))),this._lastMsgId=n,n}updateTimeOffset(e){const t=this._getNewMsgId(),n=this.timeOffset,s=Math.floor((new Date).getTime()/1e3),i=e.shiftRight(a(32));return this.timeOffset=i-s,this.timeOffset!==n&&(this._lastMsgId=a(0),this._log.debug(`Updated time offset (old offset ${n}, bad ${t}, good ${e}, new ${this.timeOffset})`)),this.timeOffset}_getSeqNo(e){if(e){const e=2*this._sequence+1;return this._sequence+=1,e}return 2*this._sequence}}},44287:(e,t,n)=>{const{createDeferred:s}=n(89618);e.exports=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.containerId=void 0,this.msgId=void 0,this.request=e,this.data=e.getBytes(),this.after=t,this.result=void 0,this.pending=n,this.deferred=s(),this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}isReady(){const e=this.pending[this.after.id];return!e||e.deferred.promise}}},34353:(e,t,n)=>{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(7214),i=n(16151);class o{constructor(e,t,n,o,r){s(this,"PacketCodecClass",void 0),this._ip=e,this._port=t,this._dcId=n,this._log=o,this._testServers=r,this._connected=!1,this._sendTask=void 0,this._recvTask=void 0,this._codec=void 0,this._obfuscation=void 0,this._sendArray=new i,this._recvArray=new i,this.socket=new a(this.disconnectCallback.bind(this))}async disconnectCallback(){await this.disconnect(!0)}async _connect(){this._log.debug("Connecting"),this._codec=new this.PacketCodecClass(this),await this.socket.connect(this._port,this._ip,this._testServers),this._log.debug("Finished connecting"),await this._initConn()}async connect(){await this._connect(),this._connected=!0,this._sendTask||(this._sendTask=this._sendLoop()),this._recvTask=this._recvLoop()}async disconnect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._connected&&(this._connected=!1,this._recvArray.push(void 0),e||await this.socket.close())}async send(e){if(!this._connected)throw new Error("Not connected");await this._sendArray.push(e)}async recv(){for(;this._connected;){const e=await this._recvArray.pop();if(e)return e}throw new Error("Not connected")}async _sendLoop(){try{for(;this._connected;){const e=await this._sendArray.pop();if(!e)return void(this._sendTask=void 0);await this._send(e)}}catch(e){this._log.info("The server closed the connection while sending")}}async _recvLoop(){let e;for(;this._connected;){try{if(e=await this._recv(),!e)throw new Error("no data received")}catch(e){return this._log.info("connection closed"),void this.disconnect()}await this._recvArray.push(e)}}async _initConn(){this._codec.tag&&await this.socket.write(this._codec.tag)}_send(e){const t=this._codec.encodePacket(e);this.socket.write(t)}_recv(){return this._codec.readPacket(this.socket)}toString(){return`${this._ip}:${this._port}/${this.constructor.name.replace("Connection","")}`}}e.exports={Connection:o,PacketCodec:class{constructor(e){this._conn=e}encodePacket(e){throw new Error("Not Implemented")}readPacket(e){throw new Error("Not Implemented")}},ObfuscatedConnection:class extends o{constructor(){super(...arguments),s(this,"ObfuscatedIO",void 0)}_initConn(){this._obfuscation=new this.ObfuscatedIO(this),this.socket.write(this._obfuscation.header)}_send(e){this._obfuscation.write(this._codec.encodePacket(e))}_recv(){return this._codec.readPacket(this._obfuscation)}}}},26302:(e,t,n)=>{var s=n(48764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=n(24736),{readBufferFromBigInt:o}=n(89618),{Connection:r,PacketCodec:c}=n(34353);class l extends c{constructor(e){super(e),this.tag=l.tag,this.obfuscateTag=l.obfuscateTag}encodePacket(e){let t=e.length>>2;if(t<127){const e=s.alloc(1);e.writeUInt8(t,0),t=e}else t=s.concat([s.from("7f","hex"),o(i(t),3)]);return s.concat([t,e])}async readPacket(e){let t=(await e.read(1))[0];return t>=127&&(t=s.concat([await e.read(3),s.alloc(1)]).readInt32LE(0)),e.read(t<<2)}}a(l,"tag",s.from("ef","hex")),a(l,"obfuscateTag",s.from("efefefef","hex")),e.exports={ConnectionTCPAbridged:class extends r{constructor(){super(...arguments),a(this,"PacketCodecClass",l)}},AbridgedPacketCodec:l}},5484:()=>{},72986:(e,t,n)=>{var s=n(48764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{generateRandomBytes:i}=n(89618),{ObfuscatedConnection:o}=n(34353),{AbridgedPacketCodec:r}=n(26302),c=n(55830);class l{constructor(e){a(this,"header",void 0),this.connection=e.socket;const t=this.initHeader(e.PacketCodecClass);this.header=t.random,this._encrypt=t.encryptor,this._decrypt=t.decryptor}initHeader(e){const t=[s.from("50567247","hex"),s.from("474554","hex"),s.from("504f5354","hex"),s.from("eeeeeeee","hex")];let n;for(;;)if(n=i(64),239!==n[0]&&!n.slice(4,8).equals(s.alloc(4))){let e=!0;for(const s of t)if(s.equals(n.slice(0,4))){e=!1;break}if(e)break}n=n.toJSON().data;const a=s.from(n.slice(8,56)).reverse(),o=s.from(n.slice(8,40)),r=s.from(n.slice(40,56)),l=s.from(a.slice(0,32)),d=s.from(a.slice(32,48)),u=new c(o,r),g=new c(l,d);return n=s.concat([s.from(n.slice(0,56)),e.obfuscateTag,s.from(n.slice(60))]),n=s.concat([s.from(n.slice(0,56)),s.from(u.encrypt(n).slice(56,64)),s.from(n.slice(64))]),{random:n,encryptor:u,decryptor:g}}async read(e){const t=await this.connection.readExactly(e);return this._decrypt.encrypt(t)}write(e){this.connection.write(this._encrypt.encrypt(e))}}e.exports={ConnectionTCPObfuscated:class extends o{constructor(){super(...arguments),a(this,"ObfuscatedIO",l),a(this,"PacketCodecClass",r)}}}},30417:(e,t,n)=>{const{Connection:s}=n(34353),{ConnectionTCPFull:a}=n(5484),{ConnectionTCPAbridged:i}=n(26302),{ConnectionTCPObfuscated:o}=n(72986);e.exports={Connection:s,ConnectionTCPFull:a,ConnectionTCPAbridged:i,ConnectionTCPObfuscated:o}},18415:(e,t,n)=>{const s=n(45585),a=n(74046),{Connection:i,ConnectionTCPFull:o,ConnectionTCPAbridged:r,ConnectionTCPObfuscated:c}=n(30417),{UpdateConnectionState:l,UpdateServerTimeOffset:d}=n(68744);e.exports={Connection:i,ConnectionTCPFull:o,ConnectionTCPAbridged:r,ConnectionTCPObfuscated:c,MTProtoPlainSender:s,MTProtoSender:a,UpdateConnectionState:l,UpdateServerTimeOffset:d}},68744:e=>{function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class n{constructor(e,t){this.state=e,this.origin=t}}t(n,"disconnected",-1),t(n,"connected",1),t(n,"broken",0),e.exports={UpdateConnectionState:n,UpdateServerTimeOffset:class{constructor(e){this.timeOffset=e}}}},59270:e=>{e.exports=class{get dcId(){throw new Error("Not Implemented")}get serverAddress(){throw new Error("Not Implemented")}get port(){throw new Error("Not Implemented")}get authKey(){throw new Error("Not Implemented")}set authKey(e){throw new Error("Not Implemented")}setDC(e,t,n){throw new Error("Not implemented")}save(){throw new Error("Not Implemented")}delete(){throw new Error("Not Implemented")}}},926:(e,t,n)=>{const s=n(28753),a="GramJs";e.exports=class extends s{async _delete(){const e=new Request(this._storageKey);return(await self.caches.open(a)).delete(e)}async _fetchFromCache(){const e=new Request(this._storageKey),t=await self.caches.open(a),n=await t.match(e);return n?n.text():void 0}async _saveToCache(e){const t=new Request(this._storageKey),n=new Response(e);return(await self.caches.open(a)).put(t,n)}}},80007:(e,t,n)=>{var s=n(48764).Buffer;const a=n(33995),i=n(13302),o=n(48960);e.exports=class extends a{constructor(e,t){super(),this._sessionData=e,this._callback=t,this._authKeys={}}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(!this._sessionData)return;const{mainDcId:e,keys:t,hashes:n}=this._sessionData,{ipAddress:a,port:r}=o.getDC(e);this.setDC(e,a,r,!0),await Promise.all(Object.keys(t).map((async e=>{const a="string"==typeof t[e]?s.from(t[e],"hex"):s.from(t[e]);if(n[e]){const t="string"==typeof n[e]?s.from(n[e],"hex"):s.from(n[e]);this._authKeys[e]=new i(a,t)}else this._authKeys[e]=new i,await this._authKeys[e].setKey(a,!0)})))}setDC(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._dcId=e,this._serverAddress=t,this._port=n,delete this._authKeys[e],s||this._onUpdate()}getAuthKey(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._dcId;return this._authKeys[e]}setAuthKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._dcId;this._authKeys[t]=e,this._onUpdate()}getSessionData(){const e={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((t=>{const n=this._authKeys[t];n&&n._key&&(e.keys[t]=n._key.toString("hex"),e.hashes[t]=n._hash.toString("hex"))})),e}_onUpdate(){this._callback(this.getSessionData())}delete(){this._callback(void 0)}}},45945:(e,t,n)=>{const s=n(24678),a=n(28753);e.exports=class extends a{_delete(){return s.del(`GramJs:${this._storageKey}`)}_fetchFromCache(){return s.get(`GramJs:${this._storageKey}`)}_saveToCache(e){return s.set(`GramJs:${this._storageKey}`,e)}}},31753:(e,t,n)=>{const s=n(28753);e.exports=class extends s{_delete(){return localStorage.removeItem(this._storageKey)}_fetchFromCache(){return localStorage.getItem(this._storageKey)}_saveToCache(e){return localStorage.setItem(this._storageKey,e)}}},33995:(e,t,n)=>{const s=n(59270);e.exports=class extends s{constructor(){super(),this._serverAddress=void 0,this._dcId=0,this._port=void 0,this._takeoutId=void 0,this._entities=new Set,this._updateStates={}}get dcId(){return this._dcId}get serverAddress(){return this._serverAddress}get port(){return this._port}get authKey(){return this._authKey}set authKey(e){this._authKey=e}setDC(e,t,n){this._dcId=0|e,this._serverAddress=t,this._port=n}}},28753:(e,t,n)=>{var s=n(48764).Buffer;const a=n(33995),i=n(13302),o=n(48960);e.exports=class extends a{constructor(e){super(),this._authKeys={},e&&e.startsWith("session:")?this._sessionString=e:e&&(this._storageKey=e)}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(this._sessionString)await this._loadFromSessionString();else if(this._storageKey)try{const e=await this._fetchFromCache(),{mainDcId:t,keys:n,hashes:a}=JSON.parse(e),{ipAddress:r,port:c}=o.getDC(t);this.setDC(t,r,c,!0),Object.keys(n).forEach((e=>{n[e]&&a[e]&&(this._authKeys[e]=new i(s.from(n[e].data),s.from(a[e].data)))}))}catch(e){console.warn("Failed to retrieve or parse session from storage"),console.warn(e)}}setDC(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._dcId=e,this._serverAddress=t,this._port=n,delete this._authKeys[e],s||this._updateStorage()}async save(){return this._storageKey||(this._storageKey=`GramJs-session-${Date.now()}`),await this._updateStorage(),this._storageKey}getAuthKey(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._dcId;return this._authKeys[e]}setAuthKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._dcId;this._authKeys[t]=e,this._updateStorage()}getSessionData(e){const t={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((n=>{const s=this._authKeys[n];s._key&&(t.keys[n]=e?s._key.toString("hex"):s._key,t.hashes[n]=e?s._hash.toString("hex"):s._hash)})),t}async _loadFromSessionString(){const[,e,t]=this._sessionString.split(":"),n=Number(e),{ipAddress:a,port:r}=o.getDC(n);this.setDC(n,a,r);const c=new i;await c.setKey(s.from(t,"hex"),!0),this.setAuthKey(c,n)}async _updateStorage(){if(this._storageKey)try{await this._saveToCache(JSON.stringify(this.getSessionData()))}catch(e){console.warn("Failed to update session in storage"),console.warn(e)}}async delete(){try{return await this._delete()}catch(e){console.warn("Failed to delete session from storage"),console.warn(e)}}_delete(){throw new Error("Not Implemented")}_fetchFromCache(){throw new Error("Not Implemented")}_saveToCache(e){throw new Error("Not Implemented")}}},12433:(e,t,n)=>{var s=n(48764).Buffer;const a=n(33995),i=n(13302),o=n(35544);class r extends a{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(super(),e){if("1"!==e[0])throw new Error("Not a valid string");e=e.slice(1);const t=r.decode(e),n=new o(t);this._dcId=n.read(1).readUInt8(0);const s=n.read(2).readInt16BE(0);this._serverAddress=String(n.read(s)),this._port=n.read(2).readInt16BE(0),this._key=n.read(-1)}}static encode(e){return e.toString("base64")}static decode(e){return s.from(e,"base64")}async load(){this._key&&(this._authKey=new i,await this._authKey.setKey(this._key))}save(){if(!this.authKey)return"";const e=s.from([this.dcId]),t=s.from(this.serverAddress),n=s.alloc(2);n.writeInt16BE(t.length,0);const a=s.alloc(2);return a.writeInt16BE(this.port,0),"1"+r.encode(s.concat([e,n,t,a,this.authKey.getKey()]))}getAuthKey(e){if(!e||e===this.dcId)return this.authKey}setAuthKey(e,t){t&&t!==this.dcId||(this.authKey=e)}}e.exports=r},15886:(e,t,n)=>{const s=n(33995),a=n(12433),i=n(926),o=n(31753),r=n(45945),c=n(80007);e.exports={Memory:s,StringSession:a,CacheApiSession:i,LocalStorageSession:o,IdbSession:r,CallbackSession:c}},70845:(e,t,n)=>{const s=n(77150),a={};for(const e of Object.values(s))if(e.CONSTRUCTOR_ID)a[e.CONSTRUCTOR_ID]=e;else for(const t of Object.values(e))a[t.CONSTRUCTOR_ID]=t;e.exports={LAYER:143,tlobjects:a}},77150:(e,t,n)=>{var s=n(48764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{parseTl:i,serializeBytes:o,serializeDate:r}=n(51436),{toSignedLittleBuffer:c}=n(89618),l=n(84779),d=n(48106),u="undefined"!=typeof self&&void 0!==self.localStorage,g="GramJs:apiCache";function p(e){const t=i(e,109),n=[],s=[];for(const e of t)e.isFunction?s.push(e):n.push(e);return[n,s]}function f(e,t){switch(t){case"int":{const t=s.alloc(4);return t.writeInt32LE(e,0),t}case"long":return c(e,8);case"int128":return c(e,16);case"int256":return c(e,32);case"double":{const t=s.alloc(8);return t.writeDoubleLE(e,0),t}case"string":case"bytes":return o(e);case"Bool":return e?s.from("b5757299","hex"):s.from("379779bc","hex");case"true":return s.alloc(0);case"date":return r(e);default:return e.getBytes()}}function h(e,t){if(t.isVector){t.useVectorId&&e.readInt();const n=[],s=e.readInt();t.isVector=!1;for(let a=0;a{this[e]=t[e]}))}static fromReader(e){const t={};for(const n in c)if(c.hasOwnProperty(n)){const s=c[n];if(s.isFlag){const a=s.flagIndex>30?t.flags2&1<f(t,c[e].type)))))}else if(c[e].flagIndicator)if(Object.values(c).some((e=>e.isFlag))){let e=0;for(const t in c)c[t].isFlag&&(!1===this[t]&&"true"===c[t].type||void 0===this[t]?e|=0:e|=1</);if(n){t.readInt();const e=[],s=t.readInt();if("int"===n[1])for(let n=0;n{"function"!=typeof t[e]&&n[e]?Object.assign(n[e],t[e]):n[e]=t[e]})),n}(m("constructor",e.constructors),m("request",e.requests))}()},84779:e=>{e.exports="boolFalse#bc799737 = Bool;\nboolTrue#997275b5 = Bool;\ntrue#3fedd339 = True;\nvector#1cb5c415 {t:Type} # [ t ] = Vector t;\nerror#c4b9f9bb code:int text:string = Error;\nnull#56730bcc = Null;\ninputPeerEmpty#7f3b18ea = InputPeer;\ninputPeerSelf#7da07ec9 = InputPeer;\ninputPeerChat#35a95cb9 chat_id:long = InputPeer;\ninputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer;\ninputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer;\ninputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer;\ninputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer;\ninputUserEmpty#b98886cf = InputUser;\ninputUserSelf#f7c1b13f = InputUser;\ninputUser#f21158c6 user_id:long access_hash:long = InputUser;\ninputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#1e287d04 flags:# file:InputFile stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaPhoto#b3ba0635 flags:# id:InputPhoto ttl_seconds:flags.0?int = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector stickers:flags.0?Vector ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#33473058 flags:# id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\ninputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia;\ninputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;\ninputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector solution:flags.1?string solution_entities:flags.1?Vector = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\ninputChatUploadedPhoto#c642724e flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = InputChatPhoto;\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\ninputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\ninputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;\ninputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\ninputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;\ninputTakeoutFileLocation#29be5899 = InputFileLocation;\ninputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;\ninputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;\ninputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;\ninputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation;\npeerUser#59511722 user_id:long = Peer;\npeerChat#36c6019a chat_id:long = Peer;\npeerChannel#a2a5371e channel_id:long = Peer;\nstorage.fileUnknown#aa963b05 = storage.FileType;\nstorage.filePartial#40bc6f52 = storage.FileType;\nstorage.fileJpeg#7efe0e = storage.FileType;\nstorage.fileGif#cae1aadf = storage.FileType;\nstorage.filePng#a4f63c0 = storage.FileType;\nstorage.filePdf#ae1e508d = storage.FileType;\nstorage.fileMp3#528a0677 = storage.FileType;\nstorage.fileMov#4b09ebbc = storage.FileType;\nstorage.fileMp4#b3cea0e4 = storage.FileType;\nstorage.fileWebp#1081464c = storage.FileType;\nuserEmpty#d3bc4b7a id:long = User;\nuser#3ff6ecb0 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;\nuserProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;\nuserProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;\nuserStatusEmpty#9d05049 = UserStatus;\nuserStatusOnline#edb93949 expires:int = UserStatus;\nuserStatusOffline#8c703f was_online:int = UserStatus;\nuserStatusRecently#e26f42f1 = UserStatus;\nuserStatusLastWeek#7bf09fc = UserStatus;\nuserStatusLastMonth#77ebc742 = UserStatus;\nchatEmpty#29562865 id:long = Chat;\nchat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;\nchatForbidden#6592a1a7 id:long title:string = Chat;\nchannel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;\nchannelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;\nchatFull#d18ee226 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector available_reactions:flags.18?Vector = ChatFull;\nchannelFull#ea68a619 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags.31?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector default_send_as:flags.29?Peer available_reactions:flags.30?Vector = ChatFull;\nchatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;\nchatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;\nchatParticipantAdmin#a0933f5b user_id:long inviter_id:long date:int = ChatParticipant;\nchatParticipantsForbidden#8763d3e1 flags:# chat_id:long self_participant:flags.0?ChatParticipant = ChatParticipants;\nchatParticipants#3cbc93f8 chat_id:long participants:Vector version:int = ChatParticipants;\nchatPhotoEmpty#37c1011c = ChatPhoto;\nchatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;\nmessageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;\nmessage#38116ee0 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector ttl_period:flags.25?int = Message;\nmessageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;\nmessageMediaEmpty#3ded6320 = MessageMedia;\nmessageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\nmessageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia;\nmessageMediaUnsupported#9f84f49e = MessageMedia;\nmessageMediaDocument#9cb070d7 flags:# nopremium:flags.3?true document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\nmessageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia;\nmessageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;\nmessageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;\nmessageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;\nmessageActionEmpty#b6aef7b0 = MessageAction;\nmessageActionChatCreate#bd47cbad title:string users:Vector = MessageAction;\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\nmessageActionChatDeletePhoto#95e3fbef = MessageAction;\nmessageActionChatAddUser#15cefd00 users:Vector = MessageAction;\nmessageActionChatDeleteUser#a43f30cc user_id:long = MessageAction;\nmessageActionChatJoinedByLink#31224c3 inviter_id:long = MessageAction;\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\nmessageActionChatMigrateTo#e1037f92 channel_id:long = MessageAction;\nmessageActionChannelMigrateFrom#ea3948e9 title:string chat_id:long = MessageAction;\nmessageActionPinMessage#94bd38ed = MessageAction;\nmessageActionHistoryClear#9fbab604 = MessageAction;\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\nmessageActionPaymentSentMe#8f31b327 flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;\nmessageActionPaymentSent#96163f56 flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long invoice_slug:flags.0?string = MessageAction;\nmessageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\nmessageActionScreenshotTaken#4792929b = MessageAction;\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\nmessageActionBotAllowed#abe9affe domain:string = MessageAction;\nmessageActionSecureValuesSentMe#1b287353 values:Vector credentials:SecureCredentialsEncrypted = MessageAction;\nmessageActionSecureValuesSent#d95c6154 types:Vector = MessageAction;\nmessageActionContactSignUp#f3f25f76 = MessageAction;\nmessageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;\nmessageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;\nmessageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector = MessageAction;\nmessageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;\nmessageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;\nmessageActionSetChatTheme#aa786345 emoticon:string = MessageAction;\nmessageActionChatJoinedByRequest#ebbca3cb = MessageAction;\nmessageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;\nmessageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;\ndialog#a8edd0f5 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;\ndialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;\nphotoEmpty#2331b22d id:long = Photo;\nphoto#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector video_sizes:flags.1?Vector dc_id:int = Photo;\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\nphotoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;\nphotoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;\nphotoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;\nphotoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector = PhotoSize;\nphotoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;\ngeoPointEmpty#1117dd5f = GeoPoint;\ngeoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;\nauth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\nauth.authorization#33fb7bb8 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int user:User = auth.Authorization;\nauth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;\nauth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization;\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\ninputNotifyUsers#193b4417 = InputNotifyPeer;\ninputNotifyChats#4a95e84e = InputNotifyPeer;\ninputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;\ninputPeerNotifySettings#df1f002b flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?NotificationSound = InputPeerNotifySettings;\npeerNotifySettings#a83b0426 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int ios_sound:flags.3?NotificationSound android_sound:flags.4?NotificationSound other_sound:flags.5?NotificationSound = PeerNotifySettings;\npeerSettings#a518110d flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true request_chat_broadcast:flags.10?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int = PeerSettings;\nwallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;\nwallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;\ninputReportReasonSpam#58dbcab8 = ReportReason;\ninputReportReasonViolence#1e22c78d = ReportReason;\ninputReportReasonPornography#2e59d922 = ReportReason;\ninputReportReasonChildAbuse#adf44ee3 = ReportReason;\ninputReportReasonOther#c1e4a2b1 = ReportReason;\ninputReportReasonCopyright#9b89f93a = ReportReason;\ninputReportReasonGeoIrrelevant#dbd4feed = ReportReason;\ninputReportReasonFake#f5ddd6e7 = ReportReason;\ninputReportReasonIllegalDrugs#a8eb2be = ReportReason;\ninputReportReasonPersonalDetails#9ec7863d = ReportReason;\nuserFull#8c72ea81 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true id:long about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights = UserFull;\ncontact#145ade0b user_id:long mutual:Bool = Contact;\nimportedContact#c13e3c50 user_id:long client_id:long = ImportedContact;\ncontactStatus#16d9703b user_id:long status:UserStatus = ContactStatus;\ncontacts.contactsNotModified#b74ba9d2 = contacts.Contacts;\ncontacts.contacts#eae87e42 contacts:Vector saved_count:int users:Vector = contacts.Contacts;\ncontacts.importedContacts#77d01c3b imported:Vector popular_invites:Vector retry_contacts:Vector users:Vector = contacts.ImportedContacts;\ncontacts.blocked#ade1591 blocked:Vector chats:Vector users:Vector = contacts.Blocked;\ncontacts.blockedSlice#e1664194 count:int blocked:Vector chats:Vector users:Vector = contacts.Blocked;\nmessages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs;\nmessages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;\nmessages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.channelMessages#64479808 flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector chats:Vector users:Vector = messages.Messages;\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\nmessages.chats#64ff9fd5 chats:Vector = messages.Chats;\nmessages.chatsSlice#9cd81144 count:int chats:Vector = messages.Chats;\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull;\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\ninputMessagesFilterEmpty#57e2f66c = MessagesFilter;\ninputMessagesFilterPhotos#9609a51c = MessagesFilter;\ninputMessagesFilterVideo#9fc00e65 = MessagesFilter;\ninputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;\ninputMessagesFilterDocument#9eddf188 = MessagesFilter;\ninputMessagesFilterUrl#7ef0dd87 = MessagesFilter;\ninputMessagesFilterGif#ffc86587 = MessagesFilter;\ninputMessagesFilterVoice#50f5c392 = MessagesFilter;\ninputMessagesFilterMusic#3751b49e = MessagesFilter;\ninputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\ninputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;\ninputMessagesFilterRoundVideo#b549da53 = MessagesFilter;\ninputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;\ninputMessagesFilterGeo#e7026d0d = MessagesFilter;\ninputMessagesFilterContacts#e062db83 = MessagesFilter;\ninputMessagesFilterPinned#1bb00451 = MessagesFilter;\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\nupdateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update;\nupdateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;\nupdateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\nupdateUserStatus#e5bdf8de user_id:long status:UserStatus = Update;\nupdateUserName#c3f202e0 user_id:long first_name:string last_name:string username:string = Update;\nupdateUserPhoto#f227868c user_id:long date:int photo:UserProfilePhoto previous:Bool = Update;\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\nupdateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date:int version:int = Update;\nupdateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update;\nupdateDcOptions#8e5e9873 dc_options:Vector = Update;\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update;\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update;\nupdateUserPhone#5492a13 user_id:long phone:string = Update;\nupdateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\nupdateReadMessagesContents#68c13933 messages:Vector pts:int pts_count:int = Update;\nupdateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update;\nupdateChannel#635b4c09 channel_id:long = Update;\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\nupdateReadChannelInbox#922e6e10 flags:# folder_id:flags.0?int channel_id:long max_id:int still_unread_count:int pts:int = Update;\nupdateDeleteChannelMessages#c32d5b12 channel_id:long messages:Vector pts:int pts_count:int = Update;\nupdateChannelMessageViews#f226ac08 channel_id:long id:int views:int = Update;\nupdateChatParticipantAdmin#d7ca61a2 chat_id:long user_id:long is_admin:Bool version:int = Update;\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector = Update;\nupdateStickerSets#43ae3dec = Update;\nupdateSavedGifs#9375341e = Update;\nupdateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;\nupdateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\nupdateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\nupdateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update;\nupdateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;\nupdateReadFeaturedStickers#571d2742 = Update;\nupdateRecentStickers#9a422c20 = Update;\nupdateConfig#a229dd06 = Update;\nupdatePtsChanged#3354678f = Update;\nupdateChannelWebPage#2f2ba99f channel_id:long webpage:WebPage pts:int pts_count:int = Update;\nupdateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;\nupdatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector = Update;\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\nupdateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update;\nupdateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\nupdateLangPackTooLong#46560264 lang_code:string = Update;\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\nupdateFavedStickers#e511996d = Update;\nupdateChannelReadMessagesContents#44bdd535 channel_id:long messages:Vector = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update;\nupdateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;\nupdateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;\nupdateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;\nupdateFolderPeers#19360dc0 folder_peers:Vector pts:int pts_count:int = Update;\nupdatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;\nupdatePeerLocated#b4afcfb0 peers:Vector = Update;\nupdateNewScheduledMessage#39a51dfb message:Message = Update;\nupdateDeleteScheduledMessages#90866cee peer:Peer messages:Vector = Update;\nupdateTheme#8216fba3 theme:Theme = Update;\nupdateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;\nupdateLoginToken#564fe691 = Update;\nupdateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector qts:int = Update;\nupdateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;\nupdateDialogFilterOrder#a5d72105 order:Vector = Update;\nupdateDialogFilters#3504914f = Update;\nupdatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;\nupdateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update;\nupdateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update;\nupdateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update;\nupdatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update;\nupdateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;\nupdatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector pts:int pts_count:int = Update;\nupdatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector pts:int pts_count:int = Update;\nupdateChat#f89a6a4e chat_id:long = Update;\nupdateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update;\nupdateGroupCall#14b24500 chat_id:long call:GroupCall = Update;\nupdatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;\nupdateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateChannelParticipant#985d3abb flags:# channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;\nupdateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;\nupdateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector = Update;\nupdatePendingJoinRequests#7063c3db peer:Peer requests_pending:int recent_requesters:Vector = Update;\nupdateBotChatInviteRequester#11dfa986 peer:Peer date:int user_id:long about:string invite:ExportedChatInvite qts:int = Update;\nupdateMessageReactions#154798c3 peer:Peer msg_id:int reactions:MessageReactions = Update;\nupdateAttachMenuBots#17b7a20b = Update;\nupdateWebViewResultSent#1592b79d query_id:long = Update;\nupdateBotMenuButton#14b85813 bot_id:long button:BotMenuButton = Update;\nupdateSavedRingtones#74d8be99 = Update;\nupdateTranscribedAudio#84cd5a flags:# pending:flags.0?true peer:Peer msg_id:int transcription_id:long text:string = Update;\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\nupdates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector state:updates.State = updates.Difference;\nupdates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector intermediate_state:updates.State = updates.Difference;\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\nupdatesTooLong#e317af7e = Updates;\nupdateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nupdateShort#78d4dec1 update:Update date:int = Updates;\nupdatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates;\nupdates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates;\nupdateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector ttl_period:flags.25?int = Updates;\nphotos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos;\nphotos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos;\nphotos.photo#20212ca8 photo:Photo users:Vector = photos.Photo;\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\nupload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector = upload.File;\ndcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true this_port_only:flags.5?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;\nconfig#330b4067 flags:# phonecalls_enabled:flags.1?true default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true ignore_phone_entities:flags.5?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true pfs_enabled:flags.13?true force_try_ipv6:flags.14?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int saved_gifs_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int stickers_faved_limit:int channels_read_media_period:int tmp_sessions:flags.0?int pinned_dialogs_count_max:int pinned_infolder_count_max:int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int = Config;\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\nhelp.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;\nhelp.noAppUpdate#c45a6536 = help.AppUpdate;\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\nencryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat;\nencryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat;\nencryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\nencryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\nencryptedFileEmpty#c21f497e = EncryptedFile;\nencryptedFile#a8008cd8 id:long access_hash:long size:long dc_id:int key_fingerprint:int = EncryptedFile;\ninputEncryptedFileEmpty#1837c364 = InputEncryptedFile;\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\ninputDocumentEmpty#72f0eaae = InputDocument;\ninputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;\ndocumentEmpty#36f8c871 id:long = Document;\ndocument#8fd4c4d8 flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:long thumbs:flags.0?Vector video_thumbs:flags.1?Vector dc_id:int attributes:Vector = Document;\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\nnotifyUsers#b4c83b4c = NotifyPeer;\nnotifyChats#c007cec3 = NotifyPeer;\nnotifyBroadcasts#d612e8ef = NotifyPeer;\nsendMessageTypingAction#16bf744e = SendMessageAction;\nsendMessageCancelAction#fd5ec8f5 = SendMessageAction;\nsendMessageRecordVideoAction#a187d66f = SendMessageAction;\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\nsendMessageRecordAudioAction#d52f73f7 = SendMessageAction;\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\nsendMessageGeoLocationAction#176f8ba1 = SendMessageAction;\nsendMessageChooseContactAction#628cbc6f = SendMessageAction;\nsendMessageGamePlayAction#dd6a8f48 = SendMessageAction;\nsendMessageRecordRoundAction#88f27fbc = SendMessageAction;\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\nspeakingInGroupCallAction#d92c2285 = SendMessageAction;\nsendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;\nsendMessageChooseStickerAction#b05ac6b1 = SendMessageAction;\nsendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction;\nsendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;\ncontacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found;\ninputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;\ninputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;\ninputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;\ninputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;\ninputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;\ninputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;\ninputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;\ninputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;\nprivacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;\nprivacyKeyChatInvite#500e6dfa = PrivacyKey;\nprivacyKeyPhoneCall#3d662b7b = PrivacyKey;\nprivacyKeyPhoneP2P#39491cc8 = PrivacyKey;\nprivacyKeyForwards#69ec56a3 = PrivacyKey;\nprivacyKeyProfilePhoto#96151fed = PrivacyKey;\nprivacyKeyPhoneNumber#d19ae46d = PrivacyKey;\nprivacyKeyAddedByPhone#42ffd42b = PrivacyKey;\ninputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;\ninputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;\ninputPrivacyValueAllowUsers#131cc67f users:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;\ninputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;\ninputPrivacyValueDisallowUsers#90110467 users:Vector = InputPrivacyRule;\ninputPrivacyValueAllowChatParticipants#840649cf chats:Vector = InputPrivacyRule;\ninputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector = InputPrivacyRule;\nprivacyValueAllowContacts#fffe1bac = PrivacyRule;\nprivacyValueAllowAll#65427b82 = PrivacyRule;\nprivacyValueAllowUsers#b8905fb2 users:Vector = PrivacyRule;\nprivacyValueDisallowContacts#f888fa1a = PrivacyRule;\nprivacyValueDisallowAll#8b73e763 = PrivacyRule;\nprivacyValueDisallowUsers#e4621141 users:Vector = PrivacyRule;\nprivacyValueAllowChatParticipants#6b134e8e chats:Vector = PrivacyRule;\nprivacyValueDisallowChatParticipants#41c87565 chats:Vector = PrivacyRule;\naccount.privacyRules#50a04e45 rules:Vector chats:Vector users:Vector = account.PrivacyRules;\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\ndocumentAttributeAnimated#11b58939 = DocumentAttribute;\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\ndocumentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true supports_streaming:flags.1?true duration:int w:int h:int = DocumentAttribute;\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\ndocumentAttributeHasStickers#9801d2f7 = DocumentAttribute;\nmessages.stickersNotModified#f1749a22 = messages.Stickers;\nmessages.stickers#30a6ec7e hash:long stickers:Vector = messages.Stickers;\nstickerPack#12b299d4 emoticon:string documents:Vector = StickerPack;\nmessages.allStickersNotModified#e86602c3 = messages.AllStickers;\nmessages.allStickers#cdbbcebb hash:long sets:Vector = messages.AllStickers;\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\nwebPageEmpty#eb1477e8 id:long = WebPage;\nwebPagePending#c586da1c id:long date:int = WebPage;\nwebPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector = WebPage;\nwebPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;\nauthorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\naccount.authorizations#4bff8ea0 authorization_ttl_days:int authorizations:Vector = account.Authorizations;\naccount.password#185b184f flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int = account.Password;\naccount.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;\naccount.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\nchatInviteExported#ab4a819 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int title:flags.8?string = ExportedChatInvite;\nchatInvitePublicJoinRequests#ed107ab7 = ExportedChatInvite;\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\nchatInvite#300c44c1 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector = ChatInvite;\nchatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;\ninputStickerSetEmpty#ffb62b95 = InputStickerSet;\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\ninputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;\ninputStickerSetDice#e67f520e emoticon:string = InputStickerSet;\ninputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;\nstickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true videos:flags.6?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;\nmessages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet;\nmessages.stickerSetNotModified#d3f924eb = messages.StickerSet;\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\nbotInfo#8f300b57 flags:# user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector menu_button:flags.3?BotMenuButton = BotInfo;\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\nkeyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\nkeyboardButtonSwitchInline#568a748 flags:# same_peer:flags.0?true text:string query:string = KeyboardButton;\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\nkeyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;\ninputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;\nkeyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;\ninputKeyboardButtonUserProfile#e988037b text:string user_id:InputUser = KeyboardButton;\nkeyboardButtonUserProfile#308660c1 text:string user_id:long = KeyboardButton;\nkeyboardButtonWebView#13767230 text:string url:string = KeyboardButton;\nkeyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;\nkeyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow;\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\nreplyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;\nreplyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector placeholder:flags.3?string = ReplyMarkup;\nreplyInlineMarkup#48a30254 rows:Vector = ReplyMarkup;\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\nmessageEntityMentionName#dc7b1140 offset:int length:int user_id:long = MessageEntity;\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\nmessageEntityPhone#9b69e34b offset:int length:int = MessageEntity;\nmessageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;\nmessageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;\nmessageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;\nmessageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;\nmessageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;\nmessageEntitySpoiler#32ca960f offset:int length:int = MessageEntity;\ninputChannelEmpty#ee8c1e86 = InputChannel;\ninputChannel#f35aec28 channel_id:long access_hash:long = InputChannel;\ninputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel;\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector users:Vector = contacts.ResolvedPeer;\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\nupdates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector chats:Vector users:Vector = updates.ChannelDifference;\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector other_updates:Vector chats:Vector users:Vector = updates.ChannelDifference;\nchannelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector = ChannelMessagesFilter;\nchannelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant;\nchannelParticipantSelf#35a8bfa7 flags:# via_request:flags.0?true user_id:long inviter_id:long date:int = ChannelParticipant;\nchannelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;\nchannelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;\nchannelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant;\nchannelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;\nchannelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;\nchannelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\nchannelParticipantsBots#b0d1865b = ChannelParticipantsFilter;\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\nchannelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;\nchannelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;\nchannels.channelParticipants#9ab0feaf count:int participants:Vector chats:Vector users:Vector = channels.ChannelParticipants;\nchannels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;\nchannels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector users:Vector = channels.ChannelParticipant;\nhelp.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector min_age_confirm:flags.1?int = help.TermsOfService;\nmessages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;\nmessages.savedGifs#84a02a0d hash:long gifs:Vector = messages.SavedGifs;\ninputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\nbotInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\nmessages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM results:Vector cache_time:int users:Vector = messages.BotResults;\nexportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;\nmessageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;\nauth.codeTypeSms#72a3158c = auth.CodeType;\nauth.codeTypeCall#741cd3e3 = auth.CodeType;\nauth.codeTypeFlashCall#226ccefb = auth.CodeType;\nauth.codeTypeMissedCall#d61ad6ee = auth.CodeType;\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\nauth.sentCodeTypeMissedCall#82006484 prefix:string length:int = auth.SentCodeType;\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\ninputBotInlineMessageID64#b6d915d7 dc_id:int owner_id:long id:int access_hash:long = InputBotInlineMessageID;\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\nmessages.peerDialogs#3371c354 dialogs:Vector messages:Vector chats:Vector users:Vector state:updates.State = messages.PeerDialogs;\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\ntopPeerCategoryBotsPM#ab661b5b = TopPeerCategory;\ntopPeerCategoryBotsInline#148677e2 = TopPeerCategory;\ntopPeerCategoryCorrespondents#637b7ed = TopPeerCategory;\ntopPeerCategoryGroups#bd17a14a = TopPeerCategory;\ntopPeerCategoryChannels#161d9628 = TopPeerCategory;\ntopPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;\ntopPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;\ntopPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector = TopPeerCategoryPeers;\ncontacts.topPeersNotModified#de266ef5 = contacts.TopPeers;\ncontacts.topPeers#70b772a8 categories:Vector chats:Vector users:Vector = contacts.TopPeers;\ncontacts.topPeersDisabled#b52c939d = contacts.TopPeers;\ndraftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;\ndraftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector date:int = DraftMessage;\nmessages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;\nmessages.featuredStickers#be382906 flags:# premium:flags.0?true hash:long count:int sets:Vector unread:Vector = messages.FeaturedStickers;\nmessages.recentStickersNotModified#b17f890 = messages.RecentStickers;\nmessages.recentStickers#88d37c56 hash:long packs:Vector stickers:Vector dates:Vector = messages.RecentStickers;\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector = messages.ArchivedStickers;\nmessages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector = messages.StickerSetInstallResult;\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector = StickerSetCovered;\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\nhighScore#73a379eb pos:int user_id:long score:int = HighScore;\nmessages.highScores#9a3bfd99 scores:Vector users:Vector = messages.HighScores;\ntextEmpty#dc3d824f = RichText;\ntextPlain#744694e0 text:string = RichText;\ntextBold#6724abc4 text:RichText = RichText;\ntextItalic#d912a59c text:RichText = RichText;\ntextUnderline#c12622c4 text:RichText = RichText;\ntextStrike#9bf8bb95 text:RichText = RichText;\ntextFixed#6c3f19b9 text:RichText = RichText;\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\ntextConcat#7e6260d7 texts:Vector = RichText;\ntextSubscript#ed6a8504 text:RichText = RichText;\ntextSuperscript#c7fb5e01 text:RichText = RichText;\ntextMarked#34b8621 text:RichText = RichText;\ntextPhone#1ccb966a text:RichText phone:string = RichText;\ntextImage#81ccf4f document_id:long w:int h:int = RichText;\ntextAnchor#35553762 text:RichText name:string = RichText;\npageBlockUnsupported#13567e8a = PageBlock;\npageBlockTitle#70abc3fd text:RichText = PageBlock;\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\npageBlockHeader#bfd064ec text:RichText = PageBlock;\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\npageBlockParagraph#467a0766 text:RichText = PageBlock;\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\npageBlockFooter#48870999 text:RichText = PageBlock;\npageBlockDivider#db20b188 = PageBlock;\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\npageBlockList#e4e88011 items:Vector = PageBlock;\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\npageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;\npageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\npageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;\npageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector caption:PageCaption = PageBlock;\npageBlockCollage#65a0fa4d items:Vector caption:PageCaption = PageBlock;\npageBlockSlideshow#31f9590 items:Vector caption:PageCaption = PageBlock;\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\npageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;\npageBlockKicker#1e148390 text:RichText = PageBlock;\npageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector = PageBlock;\npageBlockOrderedList#9a8ae1e1 items:Vector = PageBlock;\npageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector title:RichText = PageBlock;\npageBlockRelatedArticles#16115a96 title:RichText articles:Vector = PageBlock;\npageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;\nphoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;\nphoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;\nphoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;\nphoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;\ndataJSON#7d748d04 data:string = DataJSON;\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\ninvoice#3e85a91b flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector recurring_terms_url:flags.9?string = Invoice;\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\nwebDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector = WebDocument;\nwebDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector = WebDocument;\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector = InputWebDocument;\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\ninputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\npayments.paymentForm#b0133b37 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector = payments.PaymentForm;\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo;\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\npayments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;\npayments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector = payments.PaymentReceipt;\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\nshippingOption#b6213cdf id:string title:string prices:Vector = ShippingOption;\ninputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords = InputStickerSetItem;\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\nphoneCallEmpty#5366c915 id:long = PhoneCall;\nphoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\nphoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCall#967f7c67 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector start_date:int = PhoneCall;\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\nphoneConnection#9cc123c7 flags:# tcp:flags.0?true id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\nphoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;\nphoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector = PhoneCallProtocol;\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector = phone.PhoneCall;\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\ncdnConfig#5725e40a public_keys:Vector = CdnConfig;\nlangPackString#cad181f6 key:string value:string = LangPackString;\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector = LangPackDifference;\nlangPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLinkedChat#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByRequest#afb6144a invite:ExportedChatInvite approved_by:long = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleNoForwards#cb2ac766 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionSendMessage#278f2868 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAvailableReactions#9cf7f76a prev_value:Vector new_value:Vector = ChannelAdminLogEventAction;\nchannelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\nchannels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults;\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true = ChannelAdminLogEventsFilter;\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\nmessages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;\nmessages.favedStickers#2cb51097 hash:long packs:Vector stickers:Vector = messages.FavedStickers;\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\nrecentMeUrlUser#b92c09e2 url:string user_id:long = RecentMeUrl;\nrecentMeUrlChat#b2da71d2 url:string chat_id:long = RecentMeUrl;\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\nhelp.recentMeUrls#e0310d7 urls:Vector chats:Vector users:Vector = help.RecentMeUrls;\ninputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector = InputSingleMedia;\nwebAuthorization#a6f8f452 hash:long bot_id:long domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;\naccount.webAuthorizations#ed56c9fc authorizations:Vector users:Vector = account.WebAuthorizations;\ninputMessageID#a676a322 id:int = InputMessage;\ninputMessageReplyTo#bad88395 id:int = InputMessage;\ninputMessagePinned#86872538 = InputMessage;\ninputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;\ninputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;\ninputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;\ndialogPeer#e56dbf05 peer:Peer = DialogPeer;\ndialogPeerFolder#514519e2 folder_id:int = DialogPeer;\nmessages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;\nmessages.foundStickerSets#8af09dd2 hash:long sets:Vector = messages.FoundStickerSets;\nfileHash#f39b035c offset:long limit:int hash:bytes = FileHash;\ninputClientProxy#75588b3f address:string port:int = InputClientProxy;\nhelp.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;\nhelp.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;\ninputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;\ninputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;\nsecureFileEmpty#64199744 = SecureFile;\nsecureFile#7d09c27e id:long access_hash:long size:long dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;\nsecureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;\nsecurePlainPhone#7d6099dd phone:string = SecurePlainData;\nsecurePlainEmail#21ec5a5f email:string = SecurePlainData;\nsecureValueTypePersonalDetails#9d2a81e3 = SecureValueType;\nsecureValueTypePassport#3dac6a00 = SecureValueType;\nsecureValueTypeDriverLicense#6e425c4 = SecureValueType;\nsecureValueTypeIdentityCard#a0d0744b = SecureValueType;\nsecureValueTypeInternalPassport#99a48f23 = SecureValueType;\nsecureValueTypeAddress#cbe31e26 = SecureValueType;\nsecureValueTypeUtilityBill#fc36954e = SecureValueType;\nsecureValueTypeBankStatement#89137c0d = SecureValueType;\nsecureValueTypeRentalAgreement#8b883488 = SecureValueType;\nsecureValueTypePassportRegistration#99e3806a = SecureValueType;\nsecureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;\nsecureValueTypePhone#b320aadb = SecureValueType;\nsecureValueTypeEmail#8e3ca7ee = SecureValueType;\nsecureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;\ninputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData = InputSecureValue;\nsecureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;\nsecureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;\nsecureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector text:string = SecureValueError;\nsecureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;\naccount.authorizationForm#ad2e1cd8 flags:# required_types:Vector values:Vector errors:Vector users:Vector privacy_policy_url:flags.0?string = account.AuthorizationForm;\naccount.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;\nhelp.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;\nhelp.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector = help.DeepLinkInfo;\nsavedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;\naccount.takeout#4dba4501 id:long = account.Takeout;\npasswordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;\npasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;\nsecurePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;\nsecureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;\ninputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;\ninputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;\nsecureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;\nsecureRequiredTypeOneOf#27477b4 types:Vector = SecureRequiredType;\nhelp.passportConfigNotModified#bfb9f457 = help.PassportConfig;\nhelp.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;\ninputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;\njsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;\njsonNull#3f6d7b68 = JSONValue;\njsonBool#c7345e6a value:Bool = JSONValue;\njsonNumber#2be0dfa4 value:double = JSONValue;\njsonString#b71e767a value:string = JSONValue;\njsonArray#f7444763 value:Vector = JSONValue;\njsonObject#99c1d49d value:Vector = JSONValue;\npageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;\npageTableRow#e0c0c5e5 cells:Vector = PageTableRow;\npageCaption#6f747657 text:RichText credit:RichText = PageCaption;\npageListItemText#b92fb6cd text:RichText = PageListItem;\npageListItemBlocks#25e073fc blocks:Vector = PageListItem;\npageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;\npageListOrderedItemBlocks#98dd8936 num:string blocks:Vector = PageListOrderedItem;\npageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;\npage#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector photos:Vector documents:Vector views:flags.3?int = Page;\nhelp.supportName#8c05f1c9 name:string = help.SupportName;\nhelp.userInfoEmpty#f3ae2eed = help.UserInfo;\nhelp.userInfo#1eb3758 message:string entities:Vector author:string date:int = help.UserInfo;\npollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;\npoll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector close_period:flags.4?int close_date:flags.5?int = Poll;\npollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;\npollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector total_voters:flags.2?int recent_voters:flags.3?Vector solution:flags.4?string solution_entities:flags.4?Vector = PollResults;\nchatOnlines#f041e250 onlines:int = ChatOnlines;\nstatsURL#47a971e0 url:string = StatsURL;\nchatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true = ChatAdminRights;\nchatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights;\ninputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;\ninputWallPaperSlug#72091c80 slug:string = InputWallPaper;\ninputWallPaperNoFile#967a462e id:long = InputWallPaper;\naccount.wallPapersNotModified#1c199183 = account.WallPapers;\naccount.wallPapers#cdc3858c hash:long wallpapers:Vector = account.WallPapers;\ncodeSettings#8a6469c2 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true allow_missed_call:flags.5?true logout_tokens:flags.6?Vector = CodeSettings;\nwallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;\nautoDownloadSettings#8efab953 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true photo_size_max:int video_size_max:long file_size_max:long video_upload_maxbitrate:int = AutoDownloadSettings;\naccount.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;\nemojiKeyword#d5b3b9f9 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordDeleted#236df622 keyword:string emoticons:Vector = EmojiKeyword;\nemojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector = EmojiKeywordsDifference;\nemojiURL#a575739d url:string = EmojiURL;\nemojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;\nfolder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;\ninputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;\nfolderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;\nmessages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;\nurlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;\nurlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;\nurlAuthResultDefault#a9d6db1f = UrlAuthResult;\nchannelLocationEmpty#bfb5ad8b = ChannelLocation;\nchannelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;\npeerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;\npeerSelfLocated#f8ec284b expires:int = PeerLocated;\nrestrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;\ninputTheme#3c5693e9 id:long access_hash:long = InputTheme;\ninputThemeSlug#f5890df1 slug:string = InputTheme;\ntheme#a00e67d6 flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?Vector emoticon:flags.6?string installs_count:flags.4?int = Theme;\naccount.themesNotModified#f41eb622 = account.Themes;\naccount.themes#9a3d8c6d hash:long themes:Vector = account.Themes;\nauth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;\nauth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;\nauth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;\naccount.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;\nmessages.inactiveChats#a927fec5 dates:Vector chats:Vector users:Vector = messages.InactiveChats;\nbaseThemeClassic#c3a12462 = BaseTheme;\nbaseThemeDay#fbd81688 = BaseTheme;\nbaseThemeNight#b7b31ea8 = BaseTheme;\nbaseThemeTinted#6d5f77ee = BaseTheme;\nbaseThemeArctic#5b11125a = BaseTheme;\ninputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;\nthemeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector wallpaper:flags.1?WallPaper = ThemeSettings;\nwebPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector settings:flags.1?ThemeSettings = WebPageAttribute;\nmessageUserVote#34d247b4 user_id:long option:bytes date:int = MessageUserVote;\nmessageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote;\nmessageUserVoteMultiple#8a65e557 user_id:long options:Vector date:int = MessageUserVote;\nmessages.votesList#823f649 flags:# count:int votes:Vector users:Vector next_offset:flags.0?string = messages.VotesList;\nbankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;\npayments.bankCardData#3e24e573 title:string open_urls:Vector = payments.BankCardData;\ndialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector include_peers:Vector exclude_peers:Vector = DialogFilter;\ndialogFilterDefault#363293ae = DialogFilter;\ndialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;\nstatsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;\nstatsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;\nstatsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;\nstatsGraphAsync#4a27eb2d token:string = StatsGraph;\nstatsGraphError#bedc9822 error:string = StatsGraph;\nstatsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;\nmessageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters;\nstats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector = stats.BroadcastStats;\nhelp.promoDataEmpty#98f6ac75 expires:int = help.PromoData;\nhelp.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;\nvideoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;\nstatsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster;\nstatsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin;\nstatsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter;\nstats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector top_admins:Vector top_inviters:Vector users:Vector = stats.MegagroupStats;\nglobalPrivacySettings#bea2f424 flags:# archive_and_mute_new_noncontact_peers:flags.0?Bool = GlobalPrivacySettings;\nhelp.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector patterns:flags.1?Vector = help.CountryCode;\nhelp.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector = help.Country;\nhelp.countriesListNotModified#93cc1f32 = help.CountriesList;\nhelp.countriesList#87d0759e countries:Vector hash:int = help.CountriesList;\nmessageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;\nmessages.messageViews#b6c4f543 views:Vector chats:Vector users:Vector = messages.MessageViews;\nmessages.discussionMessage#a6341782 flags:# messages:Vector max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector users:Vector = messages.DiscussionMessage;\nmessageReplyHeader#a6d57763 flags:# reply_to_scheduled:flags.2?true reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;\nmessageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;\npeerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;\nstats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;\ngroupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;\ngroupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;\ngroupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;\nphone.groupCall#9e727aad call:GroupCall participants:Vector participants_next_offset:string chats:Vector users:Vector = phone.GroupCall;\nphone.groupParticipants#f47751b6 count:int participants:Vector next_offset:string chats:Vector users:Vector version:int = phone.GroupParticipants;\ninlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;\ninlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;\ninlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;\ninlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;\ninlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;\nmessages.historyImport#1662af0b id:long = messages.HistoryImport;\nmessages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;\nmessages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector = messages.AffectedFoundMessages;\nchatInviteImporter#8c5adfd9 flags:# requested:flags.0?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter;\nmessages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites;\nmessages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;\nmessages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters;\nchatAdminWithInvites#f2ecef23 admin_id:long invites_count:int revoked_invites_count:int = ChatAdminWithInvites;\nmessages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites;\nmessages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;\nphone.joinAsPeers#afe5623f peers:Vector chats:Vector users:Vector = phone.JoinAsPeers;\nphone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;\ngroupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector = GroupCallParticipantVideoSourceGroup;\ngroupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector audio_source:flags.1?int = GroupCallParticipantVideo;\nstickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;\nbotCommandScopeDefault#2f6cb2ab = BotCommandScope;\nbotCommandScopeUsers#3c4f04d8 = BotCommandScope;\nbotCommandScopeChats#6fe1a881 = BotCommandScope;\nbotCommandScopeChatAdmins#b9aa606a = BotCommandScope;\nbotCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;\nbotCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;\nbotCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;\naccount.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;\naccount.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;\naccount.resetPasswordOk#e926d63e = account.ResetPasswordResult;\nsponsoredMessage#3a836df8 flags:# recommended:flags.5?true random_id:bytes from_id:flags.3?Peer chat_invite:flags.4?ChatInvite chat_invite_hash:flags.4?string channel_post:flags.2?int start_param:flags.0?string message:string entities:flags.1?Vector = SponsoredMessage;\nmessages.sponsoredMessages#65a4c7d5 messages:Vector chats:Vector users:Vector = messages.SponsoredMessages;\nsearchResultsCalendarPeriod#c9b0539f date:int min_msg_id:int max_msg_id:int count:int = SearchResultsCalendarPeriod;\nmessages.searchResultsCalendar#147ee23c flags:# inexact:flags.0?true count:int min_date:int min_msg_id:int offset_id_offset:flags.1?int periods:Vector messages:Vector chats:Vector users:Vector = messages.SearchResultsCalendar;\nsearchResultPosition#7f648b67 msg_id:int date:int offset:int = SearchResultsPosition;\nmessages.searchResultsPositions#53b22baf count:int positions:Vector = messages.SearchResultsPositions;\nchannels.sendAsPeers#8356cda9 peers:Vector chats:Vector users:Vector = channels.SendAsPeers;\nusers.userFull#3b6d152e full_user:UserFull chats:Vector users:Vector = users.UserFull;\nmessages.peerSettings#6880b94d settings:PeerSettings chats:Vector users:Vector = messages.PeerSettings;\nauth.loggedOut#c3a2835f flags:# future_auth_token:flags.0?bytes = auth.LoggedOut;\nreactionCount#6fb250d1 flags:# chosen:flags.0?true reaction:string count:int = ReactionCount;\nmessageReactions#4f2b9479 flags:# min:flags.0?true can_see_list:flags.2?true results:Vector recent_reactions:flags.1?Vector = MessageReactions;\nmessages.messageReactionsList#31bd492d flags:# count:int reactions:Vector chats:Vector users:Vector next_offset:flags.0?string = messages.MessageReactionsList;\navailableReaction#c077ec01 flags:# inactive:flags.0?true premium:flags.2?true reaction:string title:string static_icon:Document appear_animation:Document select_animation:Document activate_animation:Document effect_animation:Document around_animation:flags.1?Document center_icon:flags.1?Document = AvailableReaction;\nmessages.availableReactionsNotModified#9f071957 = messages.AvailableReactions;\nmessages.availableReactions#768e3aad hash:int reactions:Vector = messages.AvailableReactions;\nmessages.translateNoResult#67ca4737 = messages.TranslatedText;\nmessages.translateResultText#a214f7d0 text:string = messages.TranslatedText;\nmessagePeerReaction#51b67eff flags:# big:flags.0?true unread:flags.1?true peer_id:Peer reaction:string = MessagePeerReaction;\ngroupCallStreamChannel#80eb48af channel:int scale:int last_timestamp_ms:long = GroupCallStreamChannel;\nphone.groupCallStreamChannels#d0e482b2 channels:Vector = phone.GroupCallStreamChannels;\nphone.groupCallStreamRtmpUrl#2dbf3432 url:string key:string = phone.GroupCallStreamRtmpUrl;\nattachMenuBotIconColor#4576f3f0 name:string color:int = AttachMenuBotIconColor;\nattachMenuBotIcon#b2a7386b flags:# name:string icon:Document colors:flags.0?Vector = AttachMenuBotIcon;\nattachMenuBot#c8aa2cd2 flags:# inactive:flags.0?true has_settings:flags.1?true bot_id:long short_name:string peer_types:Vector icons:Vector = AttachMenuBot;\nattachMenuBotsNotModified#f1d88a5c = AttachMenuBots;\nattachMenuBots#3c4301c0 hash:long bots:Vector users:Vector = AttachMenuBots;\nattachMenuBotsBot#93bf667f bot:AttachMenuBot users:Vector = AttachMenuBotsBot;\nwebViewResultUrl#c14557c query_id:long url:string = WebViewResult;\nsimpleWebViewResultUrl#882f76bb url:string = SimpleWebViewResult;\nwebViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;\nbotMenuButtonDefault#7533a588 = BotMenuButton;\nbotMenuButtonCommands#4258c205 = BotMenuButton;\nbotMenuButton#c7b57ce6 text:string url:string = BotMenuButton;\naccount.savedRingtonesNotModified#fbf6e8b1 = account.SavedRingtones;\naccount.savedRingtones#c1e92cc5 hash:long ringtones:Vector = account.SavedRingtones;\nnotificationSoundDefault#97e8bebe = NotificationSound;\nnotificationSoundNone#6f0c34df = NotificationSound;\nnotificationSoundLocal#830b9ae4 title:string data:string = NotificationSound;\nnotificationSoundRingtone#ff6c8049 id:long = NotificationSound;\naccount.savedRingtone#b7263f6d = account.SavedRingtone;\naccount.savedRingtoneConverted#1f307eb7 document:Document = account.SavedRingtone;\nattachMenuPeerTypeSameBotPM#7d6be90e = AttachMenuPeerType;\nattachMenuPeerTypeBotPM#c32bfa1a = AttachMenuPeerType;\nattachMenuPeerTypePM#f146d31f = AttachMenuPeerType;\nattachMenuPeerTypeChat#509113f = AttachMenuPeerType;\nattachMenuPeerTypeBroadcast#7bfbdefc = AttachMenuPeerType;\ninputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice;\ninputInvoiceSlug#c326caef slug:string = InputInvoice;\npayments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;\nmessages.transcribedAudio#93752c52 flags:# pending:flags.0?true transcription_id:long text:string = messages.TranscribedAudio;\nhelp.premiumPromo#8a4f3c29 status_text:string status_entities:Vector video_sections:Vector videos:Vector currency:string monthly_amount:long users:Vector = help.PremiumPromo;\n---functions---\ninitConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;\ninvokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;\nauth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;\nauth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;\nauth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:string = auth.Authorization;\nauth.logOut#3e72ba19 = auth.LoggedOut;\nauth.resetAuthorizations#9fab0d1a = Bool;\nauth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;\nauth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization;\nauth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;\nauth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;\nauth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;\nauth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;\nauth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;\nauth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector = Bool;\nauth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector = auth.LoginToken;\nauth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;\naccount.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool;\naccount.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector = Bool;\naccount.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;\naccount.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;\naccount.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;\naccount.updateStatus#6628562c offline:Bool = Bool;\naccount.getWallPapers#7967d36 hash:long = account.WallPapers;\naccount.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool;\naccount.checkUsername#2714d86c username:string = Bool;\naccount.updateUsername#3e0bdd7c username:string = User;\naccount.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;\naccount.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector = account.PrivacyRules;\naccount.getAuthorizations#e320c158 = account.Authorizations;\naccount.resetAuthorization#df77f3bc hash:long = Bool;\naccount.getPassword#548a30f5 = account.Password;\naccount.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;\naccount.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;\naccount.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;\naccount.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;\naccount.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;\naccount.getWebAuthorizations#182e6d6f = account.WebAuthorizations;\naccount.resetWebAuthorization#2d01b9ef hash:long = Bool;\naccount.resetWebAuthorizations#682d2594 = Bool;\naccount.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;\naccount.confirmPasswordEmail#8fdf1920 code:string = Bool;\naccount.getContactSignUpNotification#9f07c728 = Bool;\naccount.setContactSignUpNotification#cff43f61 silent:Bool = Bool;\naccount.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates;\naccount.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;\naccount.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;\naccount.getContentSettings#8b9b4dae = account.ContentSettings;\naccount.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings;\naccount.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings;\naccount.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;\naccount.setAuthorizationTTL#bf899aa0 authorization_ttl_days:int = Bool;\naccount.changeAuthorizationSettings#40f48462 flags:# hash:long encrypted_requests_disabled:flags.0?Bool call_requests_disabled:flags.1?Bool = Bool;\nusers.getUsers#d91a548 id:Vector = Vector;\nusers.getFullUser#b60f5918 id:InputUser = users.UserFull;\ncontacts.getContacts#5dd69e12 hash:long = contacts.Contacts;\ncontacts.importContacts#2c800be5 contacts:Vector = contacts.ImportedContacts;\ncontacts.deleteContacts#96a0e00 id:Vector = Updates;\ncontacts.block#68cc1411 id:InputPeer = Bool;\ncontacts.unblock#bea65d50 id:InputPeer = Bool;\ncontacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;\ncontacts.search#11f812d8 q:string limit:int = contacts.Found;\ncontacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;\ncontacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;\ncontacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;\ncontacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;\nmessages.getMessages#63c66506 id:Vector = messages.Messages;\nmessages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;\nmessages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;\nmessages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;\nmessages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages;\nmessages.receivedMessages#5a954c0 max_id:int = Vector;\nmessages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;\nmessages.sendMessage#d9d75a4 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.sendMedia#e25ff8e0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.forwardMessages#cc30290b flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.reportSpam#cf1592db peer:InputPeer = Bool;\nmessages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings;\nmessages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool;\nmessages.getChats#49e9528f id:Vector = messages.Chats;\nmessages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull;\nmessages.editChatTitle#73783ffd chat_id:long title:string = Updates;\nmessages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates;\nmessages.addChatUser#f24753e3 chat_id:long user_id:InputUser fwd_limit:int = Updates;\nmessages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;\nmessages.createChat#9cb126e users:Vector title:string = Updates;\nmessages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;\nmessages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages;\nmessages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers;\nmessages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers;\nmessages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia;\nmessages.exportChatInvite#a02ce5d5 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string = ExportedChatInvite;\nmessages.checkChatInvite#3eadb1bb hash:string = ChatInvite;\nmessages.importChatInvite#6c50051c hash:string = Updates;\nmessages.getStickerSet#c8a0ec74 stickerset:InputStickerSet hash:int = messages.StickerSet;\nmessages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;\nmessages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;\nmessages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;\nmessages.migrateChat#a2875319 chat_id:long = Updates;\nmessages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nmessages.getDocumentByHash#b1f2061f sha256:bytes size:long mime_type:string = Document;\nmessages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs;\nmessages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;\nmessages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;\nmessages.sendInlineBotResult#7aa11297 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int = Updates;\nmessages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;\nmessages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs;\nmessages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool;\nmessages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers;\nmessages.readFeaturedStickers#5b118126 id:Vector = Bool;\nmessages.getRecentStickers#9da9403b flags:# attached:flags.0?true hash:long = messages.RecentStickers;\nmessages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool;\nmessages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool;\nmessages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats;\nmessages.getWebPage#32ca8f91 url:string hash:int = WebPage;\nmessages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;\nmessages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;\nmessages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers;\nmessages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;\nmessages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\nmessages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory;\nmessages.sendMultiMedia#f803138f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;\nmessages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;\nmessages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;\nmessages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector = Updates;\nmessages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;\nmessages.editChatAbout#def60797 peer:InputPeer about:string = Bool;\nmessages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;\nmessages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;\nmessages.requestUrlAuth#198fb446 flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;\nmessages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;\nmessages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool;\nmessages.getScheduledHistory#f516760b peer:InputPeer hash:long = messages.Messages;\nmessages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector = Updates;\nmessages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector = Updates;\nmessages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;\nmessages.getDialogFilters#f19ed96d = Vector;\nmessages.getSuggestedDialogFilters#a29cd42c = Vector;\nmessages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;\nmessages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;\nmessages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;\nmessages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;\nmessages.deleteChat#5bd0ee50 chat_id:long = Bool;\nmessages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites;\nmessages.editExportedChatInvite#bdca2f75 flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int request_needed:flags.3?Bool title:flags.4?string = messages.ExportedChatInvite;\nmessages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool;\nmessages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool;\nmessages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;\nmessages.getMessageReadParticipants#2c6f97b7 peer:InputPeer msg_id:int = Vector;\nmessages.hideChatJoinRequest#7fe7e815 flags:# approved:flags.0?true peer:InputPeer user_id:InputUser = Updates;\nmessages.hideAllChatJoinRequests#e085f4ea flags:# approved:flags.0?true peer:InputPeer link:flags.1?string = Updates;\nmessages.toggleNoForwards#b11eafa2 peer:InputPeer enabled:Bool = Updates;\nmessages.saveDefaultSendAs#ccfddf96 peer:InputPeer send_as:InputPeer = Bool;\nmessages.sendReaction#25690ce4 flags:# big:flags.1?true peer:InputPeer msg_id:int reaction:flags.0?string = Updates;\nmessages.getMessagesReactions#8bba90e6 peer:InputPeer id:Vector = Updates;\nmessages.getMessageReactionsList#e0ee6b77 flags:# peer:InputPeer id:int reaction:flags.0?string offset:flags.1?string limit:int = messages.MessageReactionsList;\nmessages.setChatAvailableReactions#14050ea6 peer:InputPeer available_reactions:Vector = Updates;\nmessages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions;\nmessages.setDefaultReaction#d960c4d4 reaction:string = Bool;\nmessages.getUnreadReactions#e85bae1a peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\nmessages.readReactions#82e251d7 peer:InputPeer = messages.AffectedHistory;\nmessages.getAttachMenuBots#16fcc2cb hash:long = AttachMenuBots;\nmessages.getAttachMenuBot#77216192 bot:InputUser = AttachMenuBotsBot;\nmessages.toggleBotInAttachMenu#1aee33af bot:InputUser enabled:Bool = Bool;\nmessages.requestWebView#91b15831 flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON reply_to_msg_id:flags.0?int send_as:flags.13?InputPeer = WebViewResult;\nmessages.prolongWebView#ea5fbcce flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int send_as:flags.13?InputPeer = Bool;\nmessages.requestSimpleWebView#6abb2f73 flags:# bot:InputUser url:string theme_params:flags.0?DataJSON = SimpleWebViewResult;\nmessages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;\nmessages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;\nmessages.transcribeAudio#269e9a49 peer:InputPeer msg_id:int = messages.TranscribedAudio;\nupdates.getState#edd4882a = updates.State;\nupdates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;\nupdates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;\nphotos.uploadProfilePhoto#89f30f69 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double = photos.Photo;\nphotos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;\nupload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;\nupload.getFile#be5335be flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:long limit:int = upload.File;\nupload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;\nupload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;\nhelp.getConfig#c4f9186b = Config;\nhelp.getNearestDc#1fb33026 = NearestDc;\nhelp.getSupport#9cdf08cd = help.Support;\nhelp.acceptTermsOfService#ee72f79a id:DataJSON = Bool;\nhelp.getAppConfig#98914110 = JSONValue;\nhelp.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;\nhelp.getPremiumPromo#b81b93d4 = help.PremiumPromo;\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages;\nchannels.getMessages#ad8c9a23 channel:InputChannel id:Vector = messages.Messages;\nchannels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants;\nchannels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;\nchannels.getChannels#a7f6bbb id:Vector = messages.Chats;\nchannels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;\nchannels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;\nchannels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;\nchannels.editTitle#566decd0 channel:InputChannel title:string = Updates;\nchannels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;\nchannels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;\nchannels.updateUsername#3514b3de channel:InputChannel username:string = Bool;\nchannels.joinChannel#24b524c5 channel:InputChannel = Updates;\nchannels.leaveChannel#f836aa95 channel:InputChannel = Updates;\nchannels.inviteToChannel#199f3a6c channel:InputChannel users:Vector = Updates;\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\nchannels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;\nchannels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;\nchannels.readMessageContents#eab5dc38 channel:InputChannel id:Vector = Bool;\nchannels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;\nchannels.getGroupsForDiscussion#f5dad378 = messages.Chats;\nchannels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;\nchannels.viewSponsoredMessage#beaedb94 channel:InputChannel random_id:bytes = Bool;\nchannels.getSponsoredMessages#ec210fbf channel:InputChannel = messages.SponsoredMessages;\nchannels.getSendAs#dc770ee peer:InputPeer = channels.SendAsPeers;\nchannels.toggleJoinToSend#e4cb9580 channel:InputChannel enabled:Bool = Updates;\nchannels.toggleJoinRequest#4c2985b6 channel:InputChannel enabled:Bool = Updates;\npayments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm;\npayments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;\npayments.validateRequestedInfo#b6c8f12b flags:# save:flags.0?true invoice:InputInvoice info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;\npayments.sendPaymentForm#2d03522f flags:# form_id:long invoice:InputInvoice requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;\npayments.getSavedInfo#227d824b = payments.SavedInfo;\nphone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.receivedCall#17d54f61 peer:InputPhoneCall = Bool;\nphone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates;\nphone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates;\nphone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;\nphone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;\nphone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;\nphone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;\nphone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;\nphone.discardGroupCall#7a777135 call:InputGroupCall = Updates;\nphone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall;\nphone.getGroupParticipants#c558d8ab call:InputGroupCall ids:Vector sources:Vector offset:string limit:int = phone.GroupParticipants;\nphone.editGroupCallParticipant#a5273abf flags:# call:InputGroupCall participant:InputPeer muted:flags.0?Bool volume:flags.1?int raise_hand:flags.2?Bool video_stopped:flags.3?Bool video_paused:flags.4?Bool presentation_paused:flags.5?Bool = Updates;\nphone.exportGroupCallInvite#e6aa647f flags:# can_self_unmute:flags.0?true call:InputGroupCall = phone.ExportedGroupCallInvite;\nphone.toggleGroupCallStartSubscription#219c34e6 call:InputGroupCall subscribed:Bool = Updates;\nphone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates;\nphone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;\nlangpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;\nlangpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector;\nlangpack.getLanguages#42c6978f lang_pack:string = Vector;\nfolders.editPeerFolders#6847d0ab folder_peers:Vector = Updates;\nstats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats;\nstats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;\nstats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats;\nstats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nstats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;"},68963:(e,t,n)=>{var s=n(48764).Buffer;function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{inflate:i}=n(35802),{serializeBytes:o}=n(57404);class r{constructor(e){this.data=e,this.CONSTRUCTOR_ID=812830625,this.classType="constructor"}static async gzipIfSmaller(e,t){if(e&&t.length>512){const e=await new r(t).toBytes();if(e.length{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(40355);class i{constructor(e){this.CONSTRUCTOR_ID=1945237724,this.messages=e,this.classType="constructor"}static fromReader(e){const t=[],n=e.readInt();for(let s=0;s{function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{RpcError:a}=n(57404).constructors,i=n(68963);class o{constructor(e,t,n){this.CONSTRUCTOR_ID=4082920705,this.reqMsgId=e,this.body=t,this.error=n,this.classType="constructor"}static async fromReader(e){const t=e.readLong(),n=e.readInt(!1);return n===a.CONSTRUCTOR_ID?new o(t,void 0,a.fromReader(e)):n===i.CONSTRUCTOR_ID?new o(t,(await i.fromReader(e)).data):(e.seek(-4),new o(t,e.read(),void 0))}}s(o,"CONSTRUCTOR_ID",4082920705),s(o,"classType","constructor"),e.exports=o},40355:e=>{function t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class n{constructor(e,t,n){this.msgId=e,this.seqNo=t,this.obj=n,this.classType="constructor"}}t(n,"SIZE_OVERHEAD",12),t(n,"classType","constructor"),e.exports=n},92058:(e,t,n)=>{const s=n(40355),a=n(52301),i=n(63254),o=n(68963),r={[a.CONSTRUCTOR_ID]:a,[o.CONSTRUCTOR_ID]:o,[i.CONSTRUCTOR_ID]:i};e.exports={TLMessage:s,RPCResult:a,MessageContainer:i,GZIPPacked:o,coreObjects:r}},51436:(e,t,n)=>{var s=n(48764).Buffer;const a=e=>e.replace(/(?:^|_)([a-z])/g,((e,t)=>t.toUpperCase())).replace(/_/g,""),i=e=>e.replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),o=new Set([3162085175,2574415285,1072550713,3300522427,1450380236]),r=new Set([85337187,2211011308,2851430293,1013613780,1459478408,3504867164,3045658042,1715713620,3608339646,4110704415,812830625]);let c;function l(e){c||(c=function(){let e;const t=[];for(let n=0;n<256;n++){e=n;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}()),s.isBuffer(e)||(e=s.from(e));let t=-1;for(let n=0;n>>8}return(-1^t)>>>0}const d=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e.flags.includes("g")||(e=new RegExp(e.source,"g"));const s=e.exec(t);return s&&(n.push(s.slice(1)),d(e,t,n)),n},u=(e,t)=>{const n=e.match(/([\w.]+)(?:#([0-9a-fA-F]+))?(?:\s{?\w+:[\w\d<>#.?!]+}?)*\s=\s([\w\d<>#.?]+);$/);if(!n)throw new Error(`Cannot parse TLObject ${e}`);const o=d(/({)?(\w+):([\w\d<>#.?!]+)}?/,e),r={name:n[1],constructorId:parseInt(n[2],16),argsConfig:{},subclassOfId:l(n[3]),result:n[3],isFunction:t,namespace:void 0};if(!r.constructorId){const e="";let t;t=Object.values(r.argsConfig).length?` ${Object.keys(r.argsConfig).map((e=>e.toString())).join(" ")}`:"";const n=`${r.name}${e}${t} = ${r.result}`.replace(/(:|\?)bytes /g,"$1string ").replace(/|{|}/g,"").replace(/ \w+:flags\.\d+\?true/g,"");"inputMediaInvoice"===r.name&&r.name,r.constructorId=l(s.from(n,"utf8"))}for(const[e,t,n]of o)void 0===e&&(r.argsConfig[i(t)]=g(t,n));return r.name.includes(".")&&([r.namespace,r.name]=r.name.split(/\.(.+)/)),r.name=a(r.name),r};function g(e,t){e="self"===e?"is_self":e;const n={isVector:!1,isFlag:!1,skipConstructorId:!1,flagIndex:-1,flagIndicator:!0,type:void 0,useVectorId:void 0};if("#"!==t){n.flagIndicator=!1,n.type=t.replace(/^!+/,"");const e=n.type.match(/flags.(\d+)\?([\w<>.]+)/);e&&(n.isFlag=!0,n.flagIndex=Number(e[1]),[,,n.type]=e);const s=n.type.match(/[Vv]ector<([\w\d.]+)>/);s&&(n.isVector=!0,n.useVectorId="V"===n.type.charAt(0),[,n.type]=s),/^[a-z]$/.test(n.type.split(".").pop().charAt(0))&&(n.skipConstructorId=!0)}return n}e.exports={findAll:d,parseTl:function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o;(n||[]).reduce(((e,t)=>({...e,[t.name]:t})),{});const a=[],i={},c={},l=e;let d=!1;for(let e of l.split("\n")){const t=e.indexOf("//");if(-1!==t&&(e=e.slice(0,t)),e=e.trim(),!e)continue;const n=e.match(/---(\w+)---/);if(n){const[,e]=n;d="functions"===e}else try{const t=u(e,d);if(s.has(t.constructorId))continue;a.push(t),t.isFunction||(c[t.result]||(c[t.result]=[]),i[t.name]=t,c[t.result].push(t))}catch(e){if(!e.toString().includes("vector#1cb5c415"))throw e}}for(const e of a)if(r.has(e.constructorId))for(const t in e.argsConfig)"string"===e.argsConfig[t].type&&(e.argsConfig[t].type="bytes");for(const e of a)yield e},buildArgConfig:g,fromLine:u,CORE_TYPES:o,serializeDate:function(e){if(!e)return s.alloc(4).fill(0);if(e instanceof Date&&(e=Math.floor((Date.now()-e.getTime())/1e3)),"number"==typeof e){const t=s.alloc(4);return t.writeInt32LE(e,0),t}throw Error(`Cannot interpret "${e}" as a date`)},serializeBytes:function(e){if(!(e instanceof s)){if("string"!=typeof e)throw Error(`Bytes or str expected, not ${e.constructor.name}`);e=s.from(e)}const t=[];let n;return e.length<254?(n=(e.length+1)%4,0!==n&&(n=4-n),t.push(s.from([e.length])),t.push(e)):(n=e.length%4,0!==n&&(n=4-n),t.push(s.from([254,e.length%256,(e.length>>8)%256,(e.length>>16)%256])),t.push(e)),t.push(s.alloc(n).fill(0)),s.concat(t)},snakeToCamelCase:a,variableSnakeToCamelCase:i}},57404:(e,t,n)=>{const s=n(77150),{serializeBytes:a,serializeDate:i}=n(51436);e.exports={constructors:s,requests:s,serializeBytes:a,serializeDate:i}},48106:e=>{e.exports="resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector = ResPQ;\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\np_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;\np_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;\np_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data;\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n---functions---\nreq_pq#60469778 nonce:int128 = ResPQ;\nreq_pq_multi#be7e8ef1 nonce:int128 = ResPQ;\nreq_pq_multi_new#51b410fd nonce:int128 = ResPQ;\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n---types---\nmsgs_ack#62d6b459 msg_ids:Vector = MsgsAck;\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\nmsgs_state_req#da69fb52 msg_ids:Vector = MsgsStateReq;\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\nmsgs_all_info#8cc0d131 msg_ids:Vector info:string = MsgsAllInfo;\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_resend_req#7d861a08 msg_ids:Vector = MsgResendReq;\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\nrpc_answer_unknown#5e2ad36e = RpcDropAnswer;\nrpc_answer_dropped_running#cd78e586 = RpcDropAnswer;\nrpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector = FutureSalts;\npong#347773c5 msg_id:long ping_id:long = Pong;\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\nhttp_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;\nipPort#d433ad73 ipv4:int port:int = IpPort;\nipPortSecret#37982646 ipv4:int port:int secret:bytes = IpPort;\naccessPointRule#4679b65f phone_prefix_rules:string dc_id:int ips:vector = AccessPointRule;\nhelp.configSimple#5a592a6c date:int expires:int rules:vector = help.ConfigSimple;\ntlsClientHello blocks:vector = TlsClientHello;\ntlsBlockString data:string = TlsBlock;\ntlsBlockRandom length:int = TlsBlock;\ntlsBlockZero length:int = TlsBlock;\ntlsBlockDomain = TlsBlock;\ntlsBlockGrease seed:int = TlsBlock;\ntlsBlockScope entries:Vector = TlsBlock;\n---functions---\nping#7abe77ec ping_id:long = Pong;\nping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;"}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=n,a.x=()=>{var e=a.O(void 0,[5802,5313],(()=>a(98090)));return a.O(e)},e=[],a.O=(t,n,s,i)=>{if(!n){var o=1/0;for(d=0;d=i)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(r=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[n,s,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((t,n)=>(a.f[n](e,t),t)),[])),a.u=e=>e+"."+{5313:"3417bfbe0af0b56e2830",5802:"5a998479cf43543543ff"}[e]+".js",a.miniCssF=e=>{},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={8090:1};a.f.i=(t,n)=>{e[t]||importScripts(a.p+a.u(t))};var t=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],n=t.push.bind(t);t.push=t=>{var[s,i,o]=t;for(var r in i)a.o(i,r)&&(a.m[r]=i[r]);for(o&&o(a);s.length;)e[s.pop()]=1;n(t)}})(),t=a.x,a.x=()=>Promise.all([a.e(5802),a.e(5313)]).then(t),a.x()})(); //# sourceMappingURL=8090.c19874b60475f7467e94.js.map