mezon-js 2.16.23 → 2.16.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +2 -1
- package/dist/mezon-js.cjs.js +1 -1
- package/dist/mezon-js.esm.mjs +1 -1
- package/dist/mezon-js.iife.js +1 -1
- package/dist/mezon-js.umd.js +1 -1
- package/dist/mezon-js.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +10 -0
- package/package.json +2 -2
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ge=Object.create;var z=Object.defineProperty,fe=Object.defineProperties,_e=Object.getOwnPropertyDescriptor,ye=Object.getOwnPropertyDescriptors,be=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,Ce=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable;var ie=(y,e,t)=>e in y?z(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,v=(y,e)=>{for(var t in e||(e={}))se.call(e,t)&&ie(y,t,e[t]);if(ne)for(var t of ne(e))Ae.call(e,t)&&ie(y,t,e[t]);return y},M=(y,e)=>fe(y,ye(e));var Pe=(y,e)=>{for(var t in e)z(y,t,{get:e[t],enumerable:!0})},re=(y,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of be(e))!se.call(y,r)&&r!==t&&z(y,r,{get:()=>e[r],enumerable:!(n=_e(e,r))||n.enumerable});return y};var oe=(y,e,t)=>(t=y!=null?ge(Ce(y)):{},re(e||!y||!y.__esModule?z(t,"default",{value:y,enumerable:!0}):t,y)),Re=y=>re(z({},"__esModule",{value:!0}),y);var l=(y,e,t)=>new Promise((n,r)=>{var a=c=>{try{i(t.next(c))}catch(d){r(d)}},o=c=>{try{i(t.throw(c))}catch(d){r(d)}},i=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);i((t=t.apply(y,e)).next())});var ze={};Pe(ze,{ApiAppRole:()=>ce,ChannelStreamMode:()=>de,ChannelType:()=>le,Client:()=>ee,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>$,E_CONNECT_ERROR:()=>X,EveryoneChannelExcludeType:()=>ae.EveryoneChannelExcludeType,NotificationType:()=>ue,WebrtcSignalingType:()=>he,b64DecodeUnicode:()=>ve,b64EncodeUnicode:()=>Se,buildFetchOptions:()=>m,decodeAttachments:()=>x,decodeChannelTimelineAttachments:()=>T,decodeGenerateMeetTokenResponse:()=>Y,decodeMentions:()=>B,decodeNotificationFcm:()=>G,decodeReactions:()=>N,decodeRefs:()=>W,encodeAttachments:()=>ke,encodeMentions:()=>Me,encodeNotificationFcm:()=>Te,encodeReactions:()=>Ee,encodeRefs:()=>qe,normalizeClanHashtags:()=>I,safeJSONParse:()=>P});module.exports=Re(ze);var io=require("whatwg-fetch");var ae=require("mezon-js-protobuf");var H=require("js-base64"),S=oe(require("mezon-js-protobuf"));function Y(y){let e=y[0];if(y.length===0||e===10||e===18)try{return S.GenerateMeetTokenResponse.decode(y)}catch(n){}return{token:new TextDecoder("utf-8").decode(y)}}function m(y,e,t){let n=v({method:y},e);return n.headers=v({},e.headers),Object.keys(n.headers).includes("Accept")||(n.headers.Accept="application/proto"),Object.keys(n.headers).includes("Content-Type")||(n.headers["Content-Type"]="application/proto"),Object.keys(n.headers).forEach(r=>{n.headers[r]||delete n.headers[r]}),t&&(n.body=t),n}function Se(y){return(0,H.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function ve(y){return decodeURIComponent((0,H.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var we=512;function I(y){let e=y.trim();if(!e)return"";let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0).join(",");if([...n].length>we)throw new Error("clan hashtags too long");return n}function P(y){if(y==null)return{t:y};let e;if(y instanceof Uint8Array)e=new TextDecoder().decode(y);else if(typeof y=="string")e=y;else return typeof y=="object"?y:{t:y};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let n=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(n)}catch(n){return console.error("JSON Parse failed completely:",{original:e,error:n}),{t:e}}}}var O=y=>!y||y===null||y===void 0||y===""||y==="[]";function B(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageMentionList.decode(r)}catch(n){return P(y)}}function x(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageAttachmentList.decode(r)}catch(n){return P(y)}}function T(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.ListChannelTimelineAttachment.decode(r)}catch(n){return P(y)}}function W(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageRefList.decode(r)}catch(n){return P(y)}}function N(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageReactionList.decode(r)}catch(n){return P(y)}}function G(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.DirectFcmProto.decode(r)}catch(n){return P(y)}}function Me(y){return S.MessageMentionList.encode(S.MessageMentionList.fromPartial(y)).finish()}function ke(y){return S.MessageAttachmentList.encode(S.MessageAttachmentList.fromPartial(y)).finish()}function qe(y){return S.MessageRefList.encode(S.MessageRefList.fromPartial(y)).finish()}function Ee(y){return S.MessageReactionList.encode(S.MessageReactionList.fromPartial(y)).finish()}function Te(y){return S.DirectFcmProto.encode(S.DirectFcmProto.fromPartial(y)).finish()}var ce=(a=>(a[a.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",a[a.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",a[a.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",a[a.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",a[a.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",a))(ce||{});var le=(d=>(d[d.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",d[d.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",d[d.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",d[d.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",d[d.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",d[d.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",d[d.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",d[d.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",d[d.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",d))(le||{}),de=(a=>(a[a.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",a[a.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",a[a.STREAM_MODE_DM=4]="STREAM_MODE_DM",a[a.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",a[a.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",a))(de||{}),ue=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ue||{}),he=(d=>(d[d.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",d[d.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",d[d.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",d[d.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",d[d.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",d[d.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",d[d.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",d[d.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",d[d.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",d))(he||{});function $(y){let e,t,n,r,a,o;try{e=P(y.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=N(y.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=B(y.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=x(y.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{a=W(y.channel_message.references)}catch(c){console.log("references is invalid",c)}try{o=y.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:y.id||y.channel_message.message_id,avatar:y.channel_message.avatar,channel_id:y.channel_message.channel_id,mode:y.channel_message.mode,channel_label:y.channel_message.channel_label,clan_id:y.channel_message.clan_id,code:y.channel_message.code,message_id:y.channel_message.message_id,sender_id:y.channel_message.sender_id,update_time:y.channel_message.update_time,clan_logo:y.channel_message.clan_logo,category_name:y.channel_message.category_name,username:y.channel_message.username,clan_nick:y.channel_message.clan_nick,clan_avatar:y.channel_message.clan_avatar,display_name:y.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:r==null?void 0:r.attachments,referenced_message:o,references:a==null?void 0:a.refs,hide_editted:y.channel_message.hide_editted,is_public:y.channel_message.is_public,create_time_seconds:y.channel_message.create_time_seconds,update_time_seconds:y.channel_message.update_time_seconds,topic_id:y.channel_message.topic_id}}var X=(t=>(t.TIME_OUT="TIME_OUT",t.SOCKET_CLOSED_BEFORE_ESTABLISH="SOCKET_CLOSED_BEFORE_ESTABLISH",t))(X||{});var k=require("js-base64"),s=oe(require("mezon-js-protobuf")),me=require("mezon-js-protobuf");var Oe="CHECK_HEALTHY",j=class{constructor(){this.maxAllowedFailures=3;this.minAllowedFastRate=.95;this.maxAllowedLatencyMs=1e3;this.metricsWindowMs=6e4;this.minRequests=20;this.windowStartTime=0;this.totalRequests=0;this.failed=0;this.slowCount=0;this.requests=new Map}start(e){this.requests.set(e,performance.now())}end(e,t=!1){let n=this.requests.get(e);if(n===void 0)return;let r=performance.now();this.windowStartTime!==0&&n-this.windowStartTime>=this.metricsWindowMs&&(this.reset(),this.windowStartTime=n);let a=r-n;if(this.totalRequests++,t?this.failed++:a>this.maxAllowedLatencyMs&&this.slowCount++,this.totalRequests>=this.minRequests){let o=(this.totalRequests-this.slowCount)/this.totalRequests;o<this.minAllowedFastRate&&(typeof window!="undefined"&&window.dispatchEvent(new CustomEvent(Oe,{detail:{requestId:e,fastRate:o,totalRequests:this.totalRequests,slowCount:this.slowCount}})),this.reset(),this.windowStartTime=performance.now())}this.requests.delete(e)}get shouldSwitch(){if(this.totalRequests<this.minRequests)return!1;let e=(this.totalRequests-this.slowCount)/this.totalRequests;return this.failed>=this.maxAllowedFailures||e<this.minAllowedFastRate}get stats(){let e=this.totalRequests>0?this.slowCount/this.totalRequests:0,t=this.totalRequests>0?(this.totalRequests-this.slowCount)/this.totalRequests:0;return{totalRequests:this.totalRequests,failedCount:this.failed,slowCount:this.slowCount,slowRate:e,fastRate:t,isUnhealthy:this.shouldSwitch}}reset(){this.windowStartTime=0,this.totalRequests=0,this.failed=0,this.slowCount=0,this.requests.clear()}};var Z=(u=>(u[u.ListChannelDescs=0]="ListChannelDescs",u[u.GetAccount=1]="GetAccount",u[u.ListClanDescs=2]="ListClanDescs",u[u.ListClanUsers=3]="ListClanUsers",u[u.ListRoles=4]="ListRoles",u[u.ListEvents=5]="ListEvents",u[u.GetRoleOfUserInTheClan=6]="GetRoleOfUserInTheClan",u[u.GetListPermission=7]="GetListPermission",u[u.ListUserPermissionInChannel=8]="ListUserPermissionInChannel",u[u.GetNotificationClan=9]="GetNotificationClan",u[u.ListMutedChannel=10]="ListMutedChannel",u[u.ListStreamingChannelUsers=11]="ListStreamingChannelUsers",u[u.ListQuickMenuAccess=12]="ListQuickMenuAccess",u[u.GetNotificationChannel=13]="GetNotificationChannel",u[u.ListFriends=14]="ListFriends",u[u.EmojiRecentList=15]="EmojiRecentList",u[u.GetListEmojisByUserId=16]="GetListEmojisByUserId",u[u.ListClanBadgeCount=17]="ListClanBadgeCount",u[u.ListChannelBadgeCount=18]="ListChannelBadgeCount",u[u.ListLogedDevice=19]="ListLogedDevice",u[u.ListClanUsersStatus=20]="ListClanUsersStatus",u[u.ListChannelApps=21]="ListChannelApps",u[u.GetListFavoriteChannel=22]="GetListFavoriteChannel",u[u.ListCategoryDescs=23]="ListCategoryDescs",u[u.ListOnboarding=24]="ListOnboarding",u[u.GetListStickersByUserId=25]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=26]="GetSystemMessageByClanId",u[u.GetPinMessagesList=27]="GetPinMessagesList",u[u.GetChannelCanvasList=28]="GetChannelCanvasList",u[u.ListChannelTimeline=29]="ListChannelTimeline",u[u.ListChannelMessages=30]="ListChannelMessages",u[u.ListActivity=31]="ListActivity",u[u.ListChannelByUserId=32]="ListChannelByUserId",u[u.ListUserClansByUserId=33]="ListUserClansByUserId",u[u.GetUserProfileOnClan=34]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=35]="RegistFCMDeviceToken",u[u.IsBanned=36]="IsBanned",u[u.ListThreadDescs=37]="ListThreadDescs",u[u.ListArchivedChannelDescs=38]="ListArchivedChannelDescs",u[u.ListChannelDetail=39]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=40]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=41]="ListRoleUsers",u[u.ListChannelUsers=42]="ListChannelUsers",u[u.ListChannelAttachment=43]="ListChannelAttachment",u[u.ListChannelVoiceUsers=44]="ListChannelVoiceUsers",u[u.ListUserOnline=45]="ListUserOnline",u[u.ListNotifications=46]="ListNotifications",u[u.ListChannelUsersUC=47]="ListChannelUsersUC",u[u.ListWebhookByChannelId=48]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=49]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=50]="ListChannelSetting",u[u.ListApps=51]="ListApps",u[u.GetApp=52]="GetApp",u[u.ListForSaleItems=53]="ListForSaleItems",u[u.ListClanWebhook=54]="ListClanWebhook",u[u.GetUserStatus=55]="GetUserStatus",u[u.ListSdTopic=56]="ListSdTopic",u[u.AddFriends=57]="AddFriends",u[u.AddChannelUsers=58]="AddChannelUsers",u[u.RegistrationEmail=59]="RegistrationEmail",u[u.BlockFriends=60]="BlockFriends",u[u.UnblockFriends=61]="UnblockFriends",u[u.UploadAttachmentFile=62]="UploadAttachmentFile",u[u.UploadOauthFile=63]="UploadOauthFile",u[u.AddRolesChannelDesc=64]="AddRolesChannelDesc",u[u.CreateCategoryDesc=65]="CreateCategoryDesc",u[u.CreateChannelDesc=66]="CreateChannelDesc",u[u.CreateRole=67]="CreateRole",u[u.CreateEvent=68]="CreateEvent",u[u.DeleteRole=69]="DeleteRole",u[u.DeleteEvent=70]="DeleteEvent",u[u.DeleteRoleChannelDesc=71]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=72]="DeleteChannelDesc",u[u.CloseDMByChannelId=73]="CloseDMByChannelId",u[u.OpenDMByChannelId=74]="OpenDMByChannelId",u[u.DeleteAccount=75]="DeleteAccount",u[u.DeleteFriends=76]="DeleteFriends",u[u.DeleteCategoryDesc=77]="DeleteCategoryDesc",u[u.DeleteNotifications=78]="DeleteNotifications",u[u.DeleteClanDesc=79]="DeleteClanDesc",u[u.UpdateUser=80]="UpdateUser",u[u.UpdateUserProfileByClan=81]="UpdateUserProfileByClan",u[u.UpdateClanOrder=82]="UpdateClanOrder",u[u.RemoveChannelUsers=83]="RemoveChannelUsers",u[u.LeaveThread=84]="LeaveThread",u[u.ArchiveChannel=85]="ArchiveChannel",u[u.LinkSMS=86]="LinkSMS",u[u.ConfirmLinkMezonOTP=87]="ConfirmLinkMezonOTP",u[u.LinkEmail=88]="LinkEmail",u[u.CreateClanDesc=89]="CreateClanDesc",u[u.RemoveClanUsers=90]="RemoveClanUsers",u[u.BanClanUsers=91]="BanClanUsers",u[u.CreateLinkInviteUser=92]="CreateLinkInviteUser",u[u.InviteUser=93]="InviteUser",u[u.SetRoleChannelPermission=94]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=95]="SetNotificationChannelSetting",u[u.SetMuteChannel=96]="SetMuteChannel",u[u.SetMuteCategory=97]="SetMuteCategory",u[u.SetNotificationClanSetting=98]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=99]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=100]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=101]="DeleteNotificationChannel",u[u.CreatePinMessage=102]="CreatePinMessage",u[u.CreateMessage2Inbox=103]="CreateMessage2Inbox",u[u.UnlinkMezon=104]="UnlinkMezon",u[u.UnlinkEmail=105]="UnlinkEmail",u[u.UpdateAccount=106]="UpdateAccount",u[u.UpdateUsername=107]="UpdateUsername",u[u.UpdateCategory=108]="UpdateCategory",u[u.UpdateCategoryOrder=109]="UpdateCategoryOrder",u[u.UpdateRoleOrder=110]="UpdateRoleOrder",u[u.UpdateClanDesc=111]="UpdateClanDesc",u[u.UpdateChannelDesc=112]="UpdateChannelDesc",u[u.UpdateChannelPrivate=113]="UpdateChannelPrivate",u[u.UpdateRole=114]="UpdateRole",u[u.UpdateEvent=115]="UpdateEvent",u[u.SearchMessage=116]="SearchMessage",u[u.CreateClanEmoji=117]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=118]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=119]="UpdateClanEmojiById",u[u.GenerateWebhook=120]="GenerateWebhook",u[u.HandleWebhook=121]="HandleWebhook",u[u.UpdateWebhookById=122]="UpdateWebhookById",u[u.DeleteWebhookById=123]="DeleteWebhookById",u[u.AddClanSticker=124]="AddClanSticker",u[u.UpdateClanStickerById=125]="UpdateClanStickerById",u[u.DeleteClanStickerById=126]="DeleteClanStickerById",u[u.ChangeChannelCategory=127]="ChangeChannelCategory",u[u.CheckDuplicateName=128]="CheckDuplicateName",u[u.AddApp=129]="AddApp",u[u.DeleteApp=130]="DeleteApp",u[u.UpdateApp=131]="UpdateApp",u[u.AddAppToClan=132]="AddAppToClan",u[u.CreateSystemMessage=133]="CreateSystemMessage",u[u.UpdateSystemMessage=134]="UpdateSystemMessage",u[u.DeleteSystemMessage=135]="DeleteSystemMessage",u[u.StreamingServerCallback=136]="StreamingServerCallback",u[u.EditChannelCanvases=137]="EditChannelCanvases",u[u.GetChannelCanvasDetail=138]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=139]="DeleteChannelCanvas",u[u.AddChannelFavorite=140]="AddChannelFavorite",u[u.RemoveChannelFavorite=141]="RemoveChannelFavorite",u[u.CreateActiviy=142]="CreateActiviy",u[u.GetPubKeys=143]="GetPubKeys",u[u.PushPubKey=144]="PushPubKey",u[u.GetChanEncryptionMethod=145]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=146]="SetChanEncryptionMethod",u[u.GetKeyServer=147]="GetKeyServer",u[u.ListAuditLog=148]="ListAuditLog",u[u.GetOnboardingDetail=149]="GetOnboardingDetail",u[u.CreateOnboarding=150]="CreateOnboarding",u[u.UpdateOnboarding=151]="UpdateOnboarding",u[u.DeleteOnboarding=152]="DeleteOnboarding",u[u.ListOnboardingStep=153]="ListOnboardingStep",u[u.UpdateOnboardingStep=154]="UpdateOnboardingStep",u[u.GenerateClanWebhook=155]="GenerateClanWebhook",u[u.UpdateClanWebhookById=156]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=157]="DeleteClanWebhookById",u[u.HandleClanWebhook=158]="HandleClanWebhook",u[u.UpdateUserStatus=159]="UpdateUserStatus",u[u.UpdateUserCustomStatus=160]="UpdateUserCustomStatus",u[u.GetTopicDetail=161]="GetTopicDetail",u[u.CreateSdTopic=162]="CreateSdTopic",u[u.DeleteSdTopic=163]="DeleteSdTopic",u[u.CreateExternalMezonMeet=164]="CreateExternalMezonMeet",u[u.GenerateMeetToken=165]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=166]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=167]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=168]="CreateRoomChannelApps",u[u.GetMezonOauthClient=169]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=170]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=171]="UpdateMezonOauthClient",u[u.SearchThread=172]="SearchThread",u[u.GenerateHashChannelApps=173]="GenerateHashChannelApps",u[u.DeleteUserEvent=174]="DeleteUserEvent",u[u.AddUserEvent=175]="AddUserEvent",u[u.DeleteQuickMenuAccess=176]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=177]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=178]="UpdateQuickMenuAccess",u[u.TransferOwnership=179]="TransferOwnership",u[u.SendChannelMessage=180]="SendChannelMessage",u[u.UpdateChannelMessage=181]="UpdateChannelMessage",u[u.DeleteChannelMessage=182]="DeleteChannelMessage",u[u.ReportMessageAbuse=183]="ReportMessageAbuse",u[u.MessageButtonClick=184]="MessageButtonClick",u[u.DropdownBoxSelected=185]="DropdownBoxSelected",u[u.ActiveArchivedThread=186]="ActiveArchivedThread",u[u.UpdateChannelTimeline=187]="UpdateChannelTimeline",u[u.AddAgentToChannel=188]="AddAgentToChannel",u[u.DisconnectAgent=189]="DisconnectAgent",u[u.CreateChannelTimeline=190]="CreateChannelTimeline",u[u.DetailChannelTimeline=191]="DetailChannelTimeline",u[u.CreatePoll=192]="CreatePoll",u[u.VotePoll=193]="VotePoll",u[u.ClosePoll=194]="ClosePoll",u[u.GetPoll=195]="GetPoll",u[u.ReactChannelMessage=196]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=197]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=198]="MultipartUploadAttachmentFileFinish",u[u.SessionRefresh=199]="SessionRefresh",u[u.SessionLogout=200]="SessionLogout",u[u.Healthcheck=201]="Healthcheck",u[u.UnbanClanUsers=202]="UnbanClanUsers",u[u.ListBannedUsers=203]="ListBannedUsers",u[u.GetNotificationCategory=204]="GetNotificationCategory",u[u.ListRolePermissions=205]="ListRolePermissions",u[u.IsFollower=206]="IsFollower",u[u.DeletePinMessage=207]="DeletePinMessage",u[u.MarkAsRead=208]="MarkAsRead",u[u.UploadBatchAttachmentFile=209]="UploadBatchAttachmentFile",u[u.SearchCtrlK=210]="SearchCtrlK",u[u.SearchMentionUsers=211]="SearchMentionUsers",u[u.GenerateCDNSignature=212]="GenerateCDNSignature",u[u.GetStreamPlayback=213]="GetStreamPlayback",u[u.LinkCDNFile=214]="LinkCDNFile",u[u.SfuBreakoutRoom=215]="SfuBreakoutRoom",u[u.SfuBreakoutMerge=216]="SfuBreakoutMerge",u[u.SetOverrideEveryoneChannel=217]="SetOverrideEveryoneChannel",u[u.GetOverrideEveryoneChannel=218]="GetOverrideEveryoneChannel",u[u.GetDMSetting=219]="GetDMSetting",u[u.UpdateDMSetting=220]="UpdateDMSetting",u))(Z||{});function pe(){let y=new Error("The request was aborted.");return y.name="AbortError",y}var V=class V{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new me.MezonNetworkAdapter,this.metricLatency=new j}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return this.nextCid>=65535?this.nextCid=1:++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in Z)return Z[e]}connect(e,t,n,r,a,o){let[i,c]=t.split(":");this.adapter.connect(i,c,n,e,o),this.adapter.onOpen=a.onOpen,this.adapter.onError=a.onError,this.adapter.onClose=a.onClose,this.adapter.onMessage=(d,h,f)=>l(this,null,function*(){if(r&&typeof console!="undefined"&&console.log("incomming message with cid %o and message %o",d,f),d!=0){let _=this.cIds[d];if(!_){r&&typeof console!="undefined"&&console.error("No promise executor for message: %o",f);return}delete this.cIds[d],f.error?(_.reject({code:h,error:f.error}),this.metricLatency.end(d,!0)):(_.resolve({code:h,message:f}),this.metricLatency.end(d))}else yield a.onMessage(0,0,f)})}send(e,t=V.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:r}=e,a=r==null?void 0:r.signal,o=r;if(n!=null&&n.includes("/mezon.api.Mezon/")){let i=n.substring(17);o={api_request_event:{api_index:this.getApiFromPath(i),api_name:i,body:r.body}}}return new Promise((i,c)=>l(this,null,function*(){var d,h,f;if(a!=null&&a.aborted)c(pe());else if(!this.adapter.isOpen())c("Socket connection has not been established yet.");else{o.channel_message_send?o.channel_message_send.content=JSON.stringify(o.channel_message_send.content):o.channel_message_update?o.channel_message_update.content=JSON.stringify(o.channel_message_update.content):o.ephemeral_message_send?o.ephemeral_message_send.message.content=JSON.stringify((d=o.ephemeral_message_send.message)==null?void 0:d.content):o.quick_menu_event&&(o.quick_menu_event.message.content=JSON.stringify((h=o.quick_menu_event.message)==null?void 0:h.content));let _=this.generatecid();this.metricLatency.start(_),this.cIds[_]={resolve:i,reject:c};let b,g=()=>{delete this.cIds[_],b&&clearTimeout(b),this.metricLatency.end(_,!0),c(pe())};(f=a==null?void 0:a.addEventListener)==null||f.call(a,"abort",g,{once:!0}),t!==1/0&&t>0&&(b=setTimeout(()=>{var A;(A=a==null?void 0:a.removeEventListener)==null||A.call(a,"abort",g),this.metricLatency.end(_,!0),c("The socket timed out while waiting for a response.")},t)),o.cid=_,this.adapter.send(o)}}))}deleteAccount(e={}){let t="/mezon.api.Mezon/DeleteAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,o)=>setTimeout(o,this.timeoutMs,"Request timed out."))])}getAccount(e={}){let t="/mezon.api.Mezon/GetAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.Account.decode(a.message)})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateAccount",a=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/checklogin",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/v2/account/authenticate/confirmlogin",r=new Map,a="";a=JSON.stringify(e||{});let o=this.buildFullUrl(this.basePath,n,r),i=m("POST",t,a);return i.headers.Accept="application/x-protobuf",i.headers["Content-Type"]="application/json",Promise.race([fetch(o,i).then(c=>c),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/createqrlogin",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.LoginIDResponse.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/smsotp",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/emailotp",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/email",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,r,a,o,i={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/mezon",d=new Map;d.set("create",r),d.set("username",a),d.set("is_remember",o);let h="";h=JSON.stringify(n||{});let f=this.buildFullUrl(this.basePath,c,d),_=m("POST",i,h);return e&&(_.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),_.headers.Accept="application/x-protobuf",Promise.race([fetch(f,_).then(b=>l(this,null,function*(){if(!b.ok)throw b;let g=yield b.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkEmail",a=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkAccountConfirmRequest.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkSMS",a=s.AccountMezon.encode(s.AccountMezon.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkAccountConfirmRequest.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ConfirmLinkMezonOTP",a=s.LinkAccountConfirmRequest.encode(s.LinkAccountConfirmRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,o.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/confirmotp",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegistrationEmail",a=s.RegistrationEmailRequest.encode(s.RegistrationEmailRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SessionRefresh",i=s.SessionRefreshRequest.encode(s.SessionRefreshRequest.fromPartial(n)).finish(),c=m("POST",r,"");return c.body=i,e&&(c.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.Session.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkEmail",a=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}unlinkMezon(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkMezon",a=s.AccountMezon.encode(s.AccountMezon.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listActivity(e={}){let t="/mezon.api.Mezon/ListActivity",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.ListUserActivity.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateActiviy",a=s.CreateActivityRequest.encode(s.CreateActivityRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UserActivity.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddApp",a=s.AddAppRequest.encode(s.AddAppRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.App.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,r={}){let a="/mezon.api.Mezon/ListApps",i=s.ListAppsRequest.encode(s.ListAppsRequest.fromPartial({filter:e,tombstones:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.AppList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n={}){if(e==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddAppToClan",o=s.AppClan.encode(s.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteApp",a=s.App.encode(s.App.fromPartial({id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetApp",a=s.App.encode(s.App.fromPartial({id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.App.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateApp",o=s.UpdateAppRequest.encode(s.UpdateAppRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.App.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,r,a={}){let o="/mezon.api.Mezon/ListAuditLog",c=s.ListAuditLogRequest.encode(s.ListAuditLogRequest.fromPartial({clan_id:n,user_id:t,action_log:e,date_log:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListAuditLog.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateCategoryOrder",a=s.UpdateCategoryOrderRequest.encode(s.UpdateCategoryOrderRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,r,a,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListCategoryDescs",d=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:r,category_order:a})).finish(),h=m("POST",o,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.CategoryDescList.decode(f.message)})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t={}){let n="/mezon.api.Mezon/ListChannelApps",a=s.ListChannelAppsRequest.encode(s.ListChannelAppsRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListChannelAppsResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,r,a={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/GetChannelCanvasList",c=s.ChannelCanvasListRequest.encode(s.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ChannelCanvasListResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddChannelFavorite",a=s.AddFavoriteChannelRequest.encode(s.AddFavoriteChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.AddFavoriteChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelFavorite",o=s.RemoveFavoriteChannelRequest.encode(s.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetListFavoriteChannel",a=s.ListFavoriteChannelRequest.encode(s.ListFavoriteChannelRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListFavoriteChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,r,a,o,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelMessages",h=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:r,limit:a,topic_id:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.ChannelMessageList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddChannelUsers",o=s.AddChannelUsersRequest.encode(s.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,a,o,i,c,d={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let h="/mezon.api.Mezon/ListChannelAttachment",_=s.ListChannelAttachmentRequest.encode(s.ListChannelAttachmentRequest.fromPartial({channel_id:e,clan_id:t,file_type:n,limit:r,state:a,before:o,after:i,around:c})).finish(),b=m("POST",d,"");return b.body=_,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return s.ChannelAttachmentList.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetChanEncryptionMethod",o=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ChanEncryptionMethod.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/SetChanEncryptionMethod",o=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial(M(v({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/LeaveThread",o=s.LeaveThreadRequest.encode(s.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ArchiveChannel",o=s.ArchiveChannelRequest.encode(s.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListArchivedChannelDescs",a=s.ListArchivedChannelDescsRequest.encode(s.ListArchivedChannelDescsRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListArchivedChannelDescsResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelUsers",o=s.RemoveChannelUsersRequest.encode(s.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,r,a,o,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelUsers",h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:a,cursor:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.ChannelUserList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/ListChannelDescs",h=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:r,channel_type:a,is_mobile:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.ChannelDescList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelDesc",a=s.CreateChannelDescRequest.encode(s.CreateChannelDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelDescription.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let r="/mezon.api.Mezon/ListChannelUsersUC",o=s.AllUsersAddChannelRequest.encode(s.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.AllUsersAddChannelResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteChannelDesc",o=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateChannelDesc",o=s.UpdateChannelDescRequest.encode(s.UpdateChannelDescRequest.fromPartial(M(v({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,a,o,i,c,d,h,f={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let _="/mezon.api.Mezon/ListChannelSetting",g=s.ChannelSettingListRequest.encode(s.ChannelSettingListRequest.fromPartial({clan_id:e,parent_id:t,category_id:n,active:a,private_channel:r,status:o,type:i,limit:c,page:d,channel_label:h})).finish(),A=m("POST",f,"");return A.body=g,Promise.race([this.send({urlPath:_,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return s.ChannelSettingListResponse.decode(C.message)})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n={}){let r="/mezon.api.Mezon/ListChannelVoiceUsers",o=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.VoiceChannelUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,r={}){let a="/mezon.api.Mezon/ListClanDescs",i=s.ListClanDescRequest.encode(s.ListClanDescRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ClanDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanBadgeCount(){let e="/mezon.api.Mezon/ListClanBadgeCount",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return s.ListClanBadgeCountResponse.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,r={}){let a="/mezon.api.Mezon/ListChannelBadgeCount",i=s.ListChannelBadgeCountRequest.encode(s.ListChannelBadgeCountRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ListChannelBadgeCountResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,r={}){let a="/mezon.api.Mezon/ListUserOnline",i=s.ListUserOnlineRequest.encode(s.ListUserOnlineRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ListUserOnlineResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanDesc",a=s.CreateClanDescRequest.encode(s.CreateClanDescRequest.fromPartial({clan_name:e.clan_name,logo:e.logo,banner:e.banner})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanDesc.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t={}){if(e==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteClanDesc",a=s.DeleteClanDescRequest.encode(s.DeleteClanDescRequest.fromPartial({clan_desc_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanDesc",o=s.UpdateClanDescRequest.encode(s.UpdateClanDescRequest.fromPartial(v({clan_id:e},t))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveClanUsers",o=s.RemoveClanUsersRequest.encode(s.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let r="/mezon.api.Mezon/ListBannedUsers",o=s.BannedUserListRequest.encode(s.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.BannedUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,r,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/UnbanClanUsers",c=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,r,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/BanClanUsers",c=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsers",a=s.ListClanUsersRequest.encode(s.ListClanUsersRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanUserList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsersStatus",a=s.ListClanUsersStatusRequest.encode(s.ListClanUsersStatusRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanUserStatusList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateCategoryDesc",a=s.CreateCategoryDescRequest.encode(s.CreateCategoryDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CategoryDesc.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CheckDuplicateName",a=s.CheckDuplicateNameRequest.encode(s.CheckDuplicateNameRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code==0)return s.CheckDuplicateNameResponse.decode(i.message);throw i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,r={}){if(e==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteCategoryDesc",i=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,r,a={}){let o="/mezon.api.Mezon/RegistFCMDeviceToken",c=s.RegistFcmDeviceTokenRequest.encode(s.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.RegistFcmDeviceTokenResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CloseDMByChannelId",a=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/OpenDMByChannelId",a=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanEmoji",a=s.ClanEmojiCreateRequest.encode(s.ClanEmojiCreateRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteByIdClanEmoji",i=s.ClanEmojiDeleteRequest.encode(s.ClanEmojiDeleteRequest.fromPartial({id:e,clan_id:t,emoji_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanEmojiById",o=s.ClanEmojiUpdateRequest.encode(s.ClanEmojiUpdateRequest.fromPartial({id:t.id,shortname:t.shortname,clan_id:t.clan_id})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e={}){let t="/mezon.api.Mezon/EmojiRecentList",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.EmojiRecentList.decode(a.message)})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e={}){let t="/mezon.api.Mezon/GetListEmojisByUserId",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.EmojiListedResponse.decode(a.message)})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMessage",a=s.SearchMessageRequest.encode(s.SearchMessageRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchMessageResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchCtrlK(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchCtrlK",a=s.SearchCtrlKRequest.encode(s.SearchCtrlKRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchCtrlKResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchMentionUsers(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMentionUsers",a=s.SearchMentionUsersRequest.encode(s.SearchMentionUsersRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchMentionUsersResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateCDNSignature(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateCDNSignature",a=s.GenerateCDNSignatureRequest.encode(s.GenerateCDNSignatureRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GenerateCDNSignatureResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getStreamPlayback(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetStreamPlayback",a=s.GetStreamPlaybackRequest.encode(s.GetStreamPlaybackRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetStreamPlaybackResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setOverrideEveryoneChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetOverrideEveryoneChannel",a=s.SetOverrideEveryoneChannelRequest.encode(s.SetOverrideEveryoneChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getOverrideEveryoneChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetOverrideEveryoneChannel",a=s.GetOverrideEveryoneChannelRequest.encode(s.GetOverrideEveryoneChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetOverrideEveryoneChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getDMSetting(e={}){let t="/mezon.api.Mezon/GetDMSetting",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.DMSetting.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateDMSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateDMSetting",a=s.UpdateDMSettingRequest.encode(s.UpdateDMSettingRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.DMSetting.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}event(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",a=s.Event.encode(s.Event.fromPartial({external:e.external,name:e.name,properties:e.properties})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listEvents(e,t={}){let n="/mezon.api.Mezon/ListEvents",a=s.ListEventsRequest.encode(s.ListEventsRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EventList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",a=s.CreateEventRequest.encode(s.CreateEventRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EventManagement.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateEventUser",a=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,r,a,o={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteEvent",d=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:r,channel_id:a})).finish(),h=m("POST",o,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return{}})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateEvent",o=s.UpdateEventRequest.encode(s.UpdateEventRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let r="/mezon.api.Mezon/DeleteFriends",o=s.DeleteFriendsRequest.encode(s.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,r={}){let a="/mezon.api.Mezon/ListFriends",i=s.ListFriendsRequest.encode(s.ListFriendsRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.FriendList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n={}){let r="/mezon.api.Mezon/AddFriends",o=s.AddFriendsRequest.encode(s.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.AddFriendsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let r="/mezon.api.Mezon/BlockFriends",o=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let r="/mezon.api.Mezon/UnblockFriends",o=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t={}){let n="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",a=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationChannelCategorySettingList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetUserProfileOnClan",a=s.ClanProfileRequest.encode(s.ClanProfileRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanProfile.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t={}){let n="/mezon.api.Mezon/GetNotificationCategory",a=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationUserChannel.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t={}){let n="/mezon.api.Mezon/GetNotificationChannel",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationUserChannel.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t={}){let n="/mezon.api.Mezon/GetNotificationClan",a=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationSetting.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t={}){let n="/mezon.api.Mezon/GetNotificationReactMessage",a=s.NotifiReactMessage.encode(s.NotifiReactMessage.fromPartial({channel_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotifiReactMessage.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e={}){let t="/mezon.api.Mezon/GetKeyServer",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.GetKeyServerResp.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateLinkInviteUser",a=s.LinkInviteUserRequest.encode(s.LinkInviteUserRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkInviteUser.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t={}){if(e==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/InviteUser",a=s.InviteUserRequest.encode(s.InviteUserRequest.fromPartial({invite_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.InviteUserRes.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,r={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let a="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),o=new Map,i="",c=this.buildFullUrl(this.basePath,a,o),d=m("GET",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e={}){let t="/mezon.api.Mezon/ListChannelByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.ChannelDescList.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MarkAsRead",a=s.MarkAsReadRequest.encode(s.MarkAsReadRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e={}){let t="/mezon.api.Mezon/ListMezonOauthClient",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.MezonOauthClientList.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteCategory",a=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteChannel",a=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let r="/mezon.api.Mezon/DeleteNotifications",o=s.DeleteNotificationsRequest.encode(s.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,a,o={}){let i="/mezon.api.Mezon/ListNotifications",d=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:r,direction:a})).finish(),h=m("POST",o,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.NotificationList.decode(f.message)})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationChannelSetting",a=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationClanSetting",a=s.SetDefaultNotificationRequest.encode(s.SetDefaultNotificationRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationCategorySetting",a=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationCategorySetting",a=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationChannel",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t={}){let n="/mezon.api.Mezon/DeleteNotiReactMessage",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationReactMessage",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetRoleChannelPermission",a=s.UpdateRoleChannelRequest.encode(s.UpdateRoleChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getListPermission(e={}){let t="/mezon.api.Mezon/GetListPermission",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.PermissionList.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,r={}){let a="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",i=s.PermissionRoleChannelListEventRequest.encode(s.PermissionRoleChannelListEventRequest.fromPartial({role_id:e,channel_id:t,user_id:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.PermissionRoleChannelListEventResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,r,a={}){let o="/mezon.api.Mezon/DeletePinMessage",c=s.DeletePinMessage.encode(s.DeletePinMessage.fromPartial({id:e,message_id:t,channel_id:n,clan_id:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,r={}){let a="/mezon.api.Mezon/GetPinMessagesList",i=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial({message_id:e,channel_id:t,clan_id:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.PinMessagesList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateMessage2Inbox",a=s.Message2InboxRequest.encode(s.Message2InboxRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelMessageHeader.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePinMessage",a=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelMessageHeader.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t={}){let n="/mezon.api.Mezon/GetPubKeys",a=s.GetPubKeysRequest.encode(s.GetPubKeysRequest.fromPartial({user_ids:e||[]})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetPubKeysResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/PushPubKey",a=s.PushPubKeyRequest.encode(s.PushPubKeyRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddRolesChannelDesc",a=s.AddRoleChannelDescRequest.encode(s.AddRoleChannelDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n={}){if(e==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ChangeChannelCategory",o=s.ChangeChannelCategoryRequest.encode(s.ChangeChannelCategoryRequest.fromPartial(M(v({},t),{new_category_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteRoleChannelDesc",a=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,r,a={}){let o="/mezon.api.Mezon/ListRoles",c=s.RoleListEventRequest.encode(s.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.RoleListEventResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRole",a=s.CreateRoleRequest.encode(s.CreateRoleRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Role.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteRole",o=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,r,a={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteRole",c=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial({role_id:e,channel_id:t,clan_id:n,role_label:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateRole",o=s.UpdateRoleRequest.encode(s.UpdateRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListRolePermissions",a=s.ListPermissionsRequest.encode(s.ListPermissionsRequest.fromPartial({role_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.PermissionList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,r={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListRoleUsers",i=s.ListRoleUsersRequest.encode(s.ListRoleUsersRequest.fromPartial({role_id:e,limit:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.RoleUserList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetRoleOfUserInTheClan",o=s.ListPermissionOfUsersRequest.encode(s.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.RoleList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,r={}){let a="/mezon.api.Mezon/SearchThread",i=s.SearchThreadRequest.encode(s.SearchThreadRequest.fromPartial({clan_id:e,channel_id:t,label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ChannelDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SessionLogout",a=s.SessionLogoutRequest.encode(s.SessionLogoutRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddClanSticker",a=s.ClanStickerAddRequest.encode(s.ClanStickerAddRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteClanStickerById",i=s.ClanStickerDeleteRequest.encode(s.ClanStickerDeleteRequest.fromPartial({id:e,clan_id:t,sticker_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanStickerById",o=s.ClanStickerUpdateByIdRequest.encode(s.ClanStickerUpdateByIdRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e={}){let t="/mezon.api.Mezon/GetListStickersByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.StickerListedResponse.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegisterStreamingChannel",a=s.RegisterStreamingChannelRequest.encode(s.RegisterStreamingChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.RegisterStreamingChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/ListStreamingChannelUsers",h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:a,cursor:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.StreamingChannelUserList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e={}){let t="/mezon.api.Mezon/GetSystemMessagesList",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.SystemMessagesList.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSystemMessage",a=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,r={}){let a="/mezon.api.Mezon/ListSdTopic",i=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.fromPartial({clan_id:e,limit:t,page:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.SdTopicList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSdTopic",a=s.SdTopicRequest.encode(s.SdTopicRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SdTopic.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSdTopic",a=s.DeleteSdTopicRequest.encode(s.DeleteSdTopicRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSystemMessage",a=s.DeleteSystemMessage.encode(s.DeleteSystemMessage.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetSystemMessageByClanId",a=s.GetSystemMessage.encode(s.GetSystemMessage.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SystemMessage.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateSystemMessage",o=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,r,a,o,i={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListThreadDescs",h=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:r,thread_id:a,page:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.ChannelDescListNoPool.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateCategory",o=s.UpdateCategoryDescRequest.encode(s.UpdateCategoryDescRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelPrivate",a=s.ChangeChannelPrivateRequest.encode(s.ChangeChannelPrivateRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateUserProfileByClan",o=s.UpdateClanProfileRequest.encode(s.UpdateClanProfileRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadOauthFile",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadAttachmentFile",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadBatchAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadBatchAttachmentFile",a=s.UploadBatchAttachmentRequest.encode(s.UploadBatchAttachmentRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachmentBatch.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MultipartUploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileFinish",a=s.MultipartUploadAttachmentFinishRequest.encode(s.MultipartUploadAttachmentFinishRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkCDNFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkCDNFile",a=s.LinkCDNFileRequest.encode(s.LinkCDNFileRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sfuBreakoutRoom(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SfuBreakoutRoom",a=s.SfuBreakoutRoomRequest.encode(s.SfuBreakoutRoomRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SfuBreakoutRoomResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sfuBreakoutMerge(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SfuBreakoutMerge",a=s.SfuBreakoutMergeRequest.encode(s.SfuBreakoutMergeRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUser",a=s.UpdateUsersRequest.encode(s.UpdateUsersRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e={}){let t="/mezon.api.Mezon/ListUserClansByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.AllUserClans.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n={}){let r="/mezon.api.Mezon/ListUserPermissionInChannel",o=s.UserPermissionInChannelListRequest.encode(s.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.UserPermissionInChannelListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e={}){let t="/mezon.api.Mezon/GetUserStatus",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.UserStatus.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserStatus",a=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserCustomStatus",a=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateWebhook",a=s.WebhookCreateRequest.encode(s.WebhookCreateRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.WebhookGenerateResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateWebhookById",o=s.WebhookUpdateRequestById.encode(s.WebhookUpdateRequestById.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListWebhookByChannelId",o=s.WebhookListRequest.encode(s.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.WebhookListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteWebhookById",o=s.WebhookDeleteRequestById.encode(s.WebhookDeleteRequestById.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let r=e+t+"?";for(let[a,o]of n)o instanceof Array?r+=o.reduce((i,c)=>i+encodeURIComponent(a)+"="+encodeURIComponent(c)+"&",""):o!=null&&(r+=encodeURIComponent(a)+"="+encodeURIComponent(o)+"&");return r}editChannelCanvases(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/EditChannelCanvases",a=s.EditChannelCanvasRequest.encode(s.EditChannelCanvasRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EditChannelCanvasResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetChannelCanvasDetail",i=s.ChannelCanvasDetailRequest.encode(s.ChannelCanvasDetailRequest.fromPartial({id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ChannelCanvasDetailResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,r={}){if(e==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteChannelCanvas",i=s.DeleteChannelCanvasRequest.encode(s.DeleteChannelCanvasRequest.fromPartial({canvas_id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,r,a={}){let o="/mezon.api.Mezon/ListOnboarding",c=s.ListOnboardingRequest.encode(s.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListOnboardingResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateOnboarding",a=s.CreateOnboardingRequest.encode(s.CreateOnboardingRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListOnboardingResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteOnboarding",o=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetOnboardingDetail",o=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.OnboardingItem.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboarding",o=s.UpdateOnboardingRequest.encode(s.UpdateOnboardingRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateClanWebhook",a=s.GenerateClanWebhookRequest.encode(s.GenerateClanWebhookRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GenerateClanWebhookResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanWebhook",a=s.ListClanWebhookRequest.encode(s.ListClanWebhookRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListClanWebhookResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteClanWebhookById",a={id:e,clan_id:t},i=s.ClanWebhookRequest.encode(s.ClanWebhookRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanWebhookById",a=M(v({},t),{id:e}),i=s.UpdateClanWebhookRequest.encode(s.UpdateClanWebhookRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t={}){let n="/mezon.api.Mezon/GetTopicDetail",r={topic_id:e},o=s.SdTopicDetailRequest.encode(s.SdTopicDetailRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.SdTopic.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,r={}){let a="/mezon.api.Mezon/ListOnboardingStep",o={clan_id:e,limit:t,page:n},c=s.ListOnboardingStepRequest.encode(s.ListOnboardingStepRequest.fromPartial(o)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListOnboardingStepResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboardingStep",a=M(v({},t),{clan_id:e}),i=s.UpdateOnboardingStepRequest.encode(s.UpdateOnboardingStepRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRoomChannelApps",a=s.CreateRoomChannelApps.encode(s.CreateRoomChannelApps.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CreateRoomChannelApps.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateMeetToken",a=s.GenerateMeetTokenRequest.encode(s.GenerateMeetTokenRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return console.log(i.message),Y(new Uint8Array(i.message))})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n={}){let r="/mezon.api.Mezon/GetMezonOauthClient",a={client_id:e,client_name:t},i=s.GetMezonOauthClientRequest.encode(s.GetMezonOauthClientRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.MezonOauthClient.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateMezonOauthClient",a=s.MezonOauthClient.encode(s.MezonOauthClient.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MezonOauthClient.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",r={app_id:e},o=s.GenerateHashChannelAppsRequest.encode(s.GenerateHashChannelAppsRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.GenerateHashChannelAppsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddUserEvent",a=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n={}){let r="/mezon.api.Mezon/DeleteUserEvent",a={clan_id:e,event_id:t},i=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateRoleOrder",a=s.UpdateRoleOrderRequest.encode(s.UpdateRoleOrderRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e={}){let t="/mezon.api.Mezon/CreateExternalMezonMeet",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.GenerateMezonMeetResponse.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,r,a={}){if(e==null)throw new Error("'token' is a required parameter but is null or undefined.");let o="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(e))),i=new Map;i.set("username",t),i.set("metadata",n),i.set("is_guest",r);let c="",d=this.buildFullUrl(this.basePath,o,i),h=m("POST",a,c);return h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([fetch(d,h).then(f=>l(this,null,function*(){if(!f.ok)throw f;let _=yield f.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(_))})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MuteParticipantMezonMeet",a=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RemoveParticipantMezonMeet",a=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelDetail",r={channel_id:e},o=s.ListChannelDetailRequest.encode(s.ListChannelDetailRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ChannelDescription.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelTimeline",a=s.ListChannelTimelineRequest.encode(s.ListChannelTimelineRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelTimeline",a=s.CreateChannelTimelineRequest.encode(s.CreateChannelTimelineRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CreateChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelTimeline",a=s.UpdateChannelTimelineRequest.encode(s.UpdateChannelTimelineRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UpdateChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DetailChannelTimeline",a=s.ChannelTimelineDetailRequest.encode(s.ChannelTimelineDetailRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelTimelineDetailResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateClanOrder",a=s.UpdateClanOrderRequest.encode(s.UpdateClanOrderRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/clan/discover",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:r,background:a,action_msg:o},f=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(d)).finish(),_=m("POST",i,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,r={}){let a="/mezon.api.Mezon/ListQuickMenuAccess",o={bot_id:e,channel_id:t,menu_type:n},c=s.ListQuickMenuAccessRequest.encode(s.ListQuickMenuAccessRequest.fromPartial(o)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.QuickMenuAccessList.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddQuickMenuAccess",a=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateQuickMenuAccess",a=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",r={page:e},o=s.ListForSaleItemsRequest.encode(s.ListForSaleItemsRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ForSaleItemList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsFollower",a=s.IsFollowerRequest.encode(s.IsFollowerRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.IsFollowerResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/TransferOwnership",a=s.TransferOwnershipRequest.encode(s.TransferOwnershipRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUsername(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUsername",a=s.UpdateUsernameRequest.encode(s.UpdateUsernameRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsBanned",r={channel_id:e},o=s.IsBannedRequest.encode(s.IsBannedRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.IsBannedResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n={}){let r="/mezon.api.Mezon/ReportMessageAbuse",a={message_id:e,abuse_type:t},i=s.ReportMessageAbuseReqest.encode(s.ReportMessageAbuseReqest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){let g="/mezon.api.Mezon/SendChannelMessage",C=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,content:a,mentions:o,attachments:i,references:c,anonymous_message:d,mention_everyone:h,avatar:f,code:_,topic_id:b})).finish(),R=m("POST",{},"");return R.body=C,Promise.race([this.send({urlPath:g,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return s.ChannelMessageAck.decode(w.message)})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessageApi(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A={}){var te;let C="/mezon.api.Mezon/SendChannelMessage",R=new Map,w=typeof o=="string"?o:JSON.stringify(o!=null?o:{}),J=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:r,is_public:a,content:w,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g})).finish(),D=this.buildFullUrl((te=e.api_url)!=null?te:"",C,R),L=m("POST",A,"");return L.body=J,e.token&&(L.headers.Authorization="Bearer "+e.token),Promise.race([fetch(D,L).then(F=>l(this,null,function*(){if(!F.ok)throw F;if(F.status===204)return{};let Q=yield F.arrayBuffer();return s.ChannelMessageAck.decode(new Uint8Array(Q))})),new Promise((F,Q)=>setTimeout(()=>Q(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,a,o,i,c,d,h,f,_){let b="/mezon.api.Mezon/UpdateChannelMessage",A=s.ChannelMessageUpdate.encode(s.ChannelMessageUpdate.fromPartial({clan_id:e,channel_id:t,message_id:a,mode:n,is_public:r,content:o,mentions:i,attachments:c,create_time_seconds:d,hide_editted:h,topic_id:f,is_update_msg_topic:_})).finish(),C=m("POST",{},"");return C.body=A,Promise.race([this.send({urlPath:b,fetchOptions:C}).then(R=>l(this,null,function*(){if(R.code!=0)throw R;return s.ChannelMessageUpdate.decode(R.message)})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,r,a,o,i,c,d){let h="/mezon.api.Mezon/DeleteChannelMessage",_=s.ChannelMessageRemove.encode(s.ChannelMessageRemove.fromPartial({clan_id:e,channel_id:t,message_id:a,mode:n,is_public:r,has_attachment:o,mentions:c,references:d,topic_id:i})).finish(),b=m("POST",{},"");return b.body=_,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return s.ChannelMessageRemove.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,r,a,o={}){let i="/mezon.api.Mezon/UpdateMezonVoiceState",c={clan_id:e,channel_id:t,display_name:n,room_name:r,state:a},h=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(c)).finish(),f=m("POST",o,"");return f.body=h,Promise.race([this.send({urlPath:i,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return _})),new Promise((_,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:a,extra_data:o},f=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(d)).finish(),_=m("POST",i,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:a,values:o},f=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(d)).finish(),_=m("POST",i,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n={}){let r="/mezon.api.Mezon/ActiveArchivedThread",a={clan_id:e,channel_id:t},i=s.ActiveArchivedThread.encode(s.ActiveArchivedThread.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n={}){let r="/mezon.api.Mezon/AddAgentToChannel",a={room_name:e,channel_id:t},i=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n={}){let r="/mezon.api.Mezon/DisconnectAgent",a={room_name:e,channel_id:t},i=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListMutedChannel",a=s.ListMutedChannelRequest.encode(s.ListMutedChannelRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MutedChannelList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,r,a,o,i,c,d,h,f,_,b){let g="/mezon.api.Mezon/ReactChannelMessage",C=s.MessageReaction.encode(s.MessageReaction.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,message_id:a,emoji_id:o,emoji:i,count:c,message_sender_id:d,action:h,emoji_recent_id:_,sender_name:b,topic_id:f})).finish(),R=m("POST",{},"");return R.body=C,Promise.race([this.send({urlPath:g,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return s.ChannelMessageSend.decode(w.message)})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var i,c,d,h,f,_;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePoll",a=s.CreatePollRequest.encode(s.CreatePollRequest.fromPartial({channel_id:(i=e.channel_id)!=null?i:"0",clan_id:(c=e.clan_id)!=null?c:"0",question:(d=e.question)!=null?d:"",answers:(h=e.answers)!=null?h:[],expire_hours:(f=e.expire_hours)!=null?f:0,type:(_=e.type)!=null?_:0})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;let g=s.CreatePollResponse.decode(b.message);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(A=>({index:A.index,label:A.label})),answer_counts:g.answer_counts,exp:g.exp,is_closed:g.is_closed,creator_id:g.creator_id,type:g.type,total_votes:g.total_votes}})),new Promise((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var i,c,d,h;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/VotePoll",a=s.VotePollRequest.encode(s.VotePollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(h=e.answer_indices)!=null?h:[]})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(f=>l(this,null,function*(){var b;let _=f.code==0?s.VotePollResponse.decode(f.message):{my_answer_indices:[]};return{my_answer_indices:Array.from((b=_.my_answer_indices)!=null?b:[])}})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var i,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ClosePoll",a=s.ClosePollRequest.encode(s.ClosePollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(h=>{if(h.code==0)return{};throw h}),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var i,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetPoll",a=s.GetPollRequest.encode(s.GetPollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;let f=s.GetPollResponse.decode(h.message);return{poll_id:f.poll_id,message_id:f.message_id,question:f.question,answers:f.answers.map(_=>({index:_.index,label:_.label})),answer_counts:f.answer_counts,exp:f.exp,is_closed:f.is_closed,creator_id:f.creator_id,type:f.type,total_votes:f.total_votes,voter_details:f.voter_details.map(_=>({answer_index:_.answer_index,user_ids:_.user_ids}))}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return l(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return l(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return l(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return{}})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,r){return l(this,null,function*(){let a="",o={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:a,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,r){let a="",o={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:a,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,a,o,i,c,d){return l(this,null,function*(){let h="",f={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:a,is_public:r,has_attachment:o,topic_id:i,mentions:c,references:d}};return Promise.race([this.send({urlPath:h,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return{}})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])})}unfollowUsers(e){let t="",n={status_unfollow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,r,a,o,i,c,d,h,f,_){return l(this,null,function*(){let b="",g={channel_message_update:{clan_id:e,channel_id:t,message_id:a,content:o,mentions:i,attachments:c,create_time_seconds:d,mode:n,is_public:r,hide_editted:h,topic_id:f,is_update_msg_topic:_}};return Promise.race([this.send({urlPath:b,fetchOptions:g}).then(A=>l(this,null,function*(){if(A.code!=0)throw A;return{}})),new Promise((A,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])})}updateStatus(e){let t="",n={status_update:{status:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A,C){return l(this,null,function*(){let R="",w={clan_id:t,channel_id:n,mode:r,is_public:a,content:o,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g};A!=null&&String(A).length>0&&(w.id=A);let E={menu_name:e,message:w};C!=null&&String(C).length>0&&String(C)!=="0"&&(E.message_sender_id=C);let J={quick_menu_event:E};return Promise.race([this.send({urlPath:R,fetchOptions:J}).then(D=>l(this,null,function*(){if(D.code!=0)throw D;return{}})),new Promise((D,L)=>setTimeout(()=>L(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A){return l(this,null,function*(){let C="",R={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:r,is_public:a,content:o,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g,id:A}}};return Promise.race([this.send({urlPath:C,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return{}})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){return l(this,null,function*(){let g="",A={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:r,content:a,mentions:o,attachments:i,references:c,anonymous_message:d,mention_everyone:h,avatar:f,code:_,topic_id:b}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){var R;if(C.code!=0)throw C;return(R=C==null?void 0:C.message)==null?void 0:R.channel_message_ack})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){let A="",C={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:r,is_public:a,message_id:o,emoji_id:i,emoji:c,count:d,message_sender_id:h,action:f,topic_id:_,emoji_recent_id:b,sender_name:g}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(R=>l(this,null,function*(){if(R.code!=0)throw R;return{}})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,r,a,o){return l(this,null,function*(){let i="",c={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:r,sender_display_name:a,topic_id:o}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,r,a,o){return l(this,null,function*(){let i="",c={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:r,timestamp_seconds:a,badge_count:o}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){return l(this,null,function*(){let g="",A={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:r,message_id:a,timestamp_seconds:o,operation:i,message_sender_avatar:c,message_sender_id:d,message_sender_username:h,message_content:f,message_attachment:_,message_created_time:b}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return{}})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,r){return l(this,null,function*(){let a="",o={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:r}};return Promise.race([this.send({urlPath:a,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return l(this,null,function*(){let n="",r={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceInteractiveEvent(e,t,n,r,a,o){return l(this,null,function*(){let i="",c={voice_interactive_event:{clan_id:e,voice_channel_id:t,sender_id:n,receiver_id:r,event_type:a,params:o}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,r,a){return l(this,null,function*(){let o="",i={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:r,caller_id:a}};return Promise.race([this.send({urlPath:o,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return l(this,null,function*(){let a="",o={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:r}};return Promise.race([this.send({urlPath:a,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return l(this,null,function*(){let r="",a={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:r,fetchOptions:a}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return{}})),new Promise((o,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}writeStreamingWatch(e,t){return l(this,null,function*(){let n="",r={streaming_watch:{channel_id:e,watching:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}listLogedDevice(){return l(this,null,function*(){let e="/mezon.api.Mezon/ListLogedDevice",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){return n.code!=0?{}:s.LogedDeviceList.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}};V.DefaultSendTimeoutMs=1e4;var K=V;var Ue="127.0.0.1",De="7350",Le="defaultkey",Fe=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};function U(y){return typeof Event=="function"?new Event(y):{type:y,target:null,currentTarget:null,bubbles:!1,cancelable:!1,defaultPrevented:!1,timeStamp:Date.now(),preventDefault:()=>{},stopPropagation:()=>{},stopImmediatePropagation:()=>{}}}var q=class q{constructor(e=Le,t=Ue,n=De,r=!1,a=Fe,o=!0){this.serverkey=e;this.timeout=a;this.autoFallbackHttp=o;this.verbose=!1;this._hasConnectedOnce=!1;this._connectAttemptSeq=0;this._heartbeatSuspended=!1;this._serverDisconnectStreak=0;this.host=t,this.port=n,this.useSSL=r;let c=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatIntervalMs=q.DefaultHeartbeatIntervalMs,this._heartbeatTimeoutMs=q.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.serverDisconnectStreakLogoutThreshold=q.DefaultServerDisconnectStreakLogoutThreshold,this.transport=new K(e,a,c)}failConnect(e){let t=this._connectReject;this._connectReject=void 0,t&&t(e)}isOpen(){return this._connectionState===p.CONNECTED}connect(e,t,n=!1,r=!1,a=q.DefaultConnectTimeoutMs){var h,f;this.verbose=r;let o=((h=this._lastConnectArgs)==null?void 0:h.session_id)===e&&((f=this._lastConnectArgs)==null?void 0:f.url)===t;if(this._connectionState===p.CONNECTED&&this.transport.adapter.isOpen()&&o)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise&&o)return this._connectPromise;(this._connectionState===p.CONNECTED||this._connectionState===p.CONNECTING)&&(this.failConnect(new Error("Connect superseded by new connect().")),this.transport.close(),this.markDisconnected("connect_superseded",U("close"),!1,!1)),this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this._connectAttemptSeq+=1,this._lastConnectArgs={session_id:e,url:t,createStatus:n,verbose:r,connectTimeoutMs:a};let i,c,d=new Promise((_,b)=>{i=_,c=b});this._connectPromise=d,this._connectReject=c,this._connectTimeoutTimer=setTimeout(()=>{this._connectionState===p.CONNECTING&&(this.markDisconnected("connect_timeout",U("timeout"),!0,!1),this.transport.close(),this.failConnect(new Error("TIME_OUT")))},a);try{this.transport.connect(e,t,n,r,{onMessage:(_,b,g)=>l(this,null,function*(){if(!g.cid)if(g.notifications)g.notifications.notifications.forEach(A=>{A.content=A.content?G(A.content):void 0,this.onnotification(A)});else if(g.voice_started_event)this.onvoicestarted(g.voice_started_event);else if(g.voice_ended_event)this.onvoiceended(g.voice_ended_event);else if(g.voice_joined_event)this.onvoicejoined(g.voice_joined_event);else if(g.voice_leaved_event)this.onvoiceleaved(g.voice_leaved_event);else if(g.channel_created_event)this.onchannelcreated(g.channel_created_event);else if(g.category_event)this.oncategoryevent(g.category_event);else if(g.role_event)this.onroleevent(g.role_event);else if(g.event_emoji)this.oneventemoji(g.event_emoji);else if(g.noti_user_channel)this.oneventnotiuserchannel(g.noti_user_channel);else if(g.webhook_event)this.oneventwebhook(g.webhook_event);else if(g.channel_deleted_event)this.onchanneldeleted(g.channel_deleted_event);else if(g.clan_deleted_event)this.onclandeleted(g.clan_deleted_event);else if(g.sticker_create_event)this.onstickercreated(g.sticker_create_event);else if(g.sticker_update_event)this.onstickerupdated(g.sticker_update_event);else if(g.sticker_delete_event)this.onstickerdeleted(g.sticker_delete_event);else if(g.channel_updated_event)this.onchannelupdated(g.channel_updated_event);else if(g.channel_archive_event)this.onchannelarchive(g.channel_archive_event);else if(g.delete_account_event)this.ondeleteaccount(g.delete_account_event);else if(g.clan_profile_updated_event)this.onclanprofileupdated(g.clan_profile_updated_event);else if(g.clan_updated_event)this.onclanupdated(g.clan_updated_event);else if(g.last_seen_message_event)this.onlastseenupdated(g.last_seen_message_event);else if(g.status_presence_event)this.onstatuspresence(g.status_presence_event);else if(g.channel_message){let A=$(g);this.onchannelmessage(A)}else g.message_typing_event?this.onmessagetyping(g.message_typing_event):g.message_reaction_event?this.onmessagereaction(g.message_reaction_event):g.channel_presence_event?this.onchannelpresence(g.channel_presence_event):g.last_pin_message_event?this.onpinmessage(g.last_pin_message_event):g.custom_status_event?this.oncustomstatus(g.custom_status_event):g.canvas_event?this.oncanvasevent(g.canvas_event):g.user_channel_added_event?this.onuserchanneladded(g.user_channel_added_event):g.add_clan_user_event?this.onuserclanadded(g.add_clan_user_event):g.user_profile_updated_event?this.onuserprofileupdate(g.user_profile_updated_event):g.user_channel_removed_event?this.onuserchannelremoved(g.user_channel_removed_event):g.block_friend?this.onblockfriend(g.block_friend):g.un_block_friend?this.onunblockfriend(g.un_block_friend):g.add_friend?this.onaddfriend(g.add_friend):g.remove_friend?this.onremovefriend(g.remove_friend):g.user_clan_removed_event?this.onuserclanremoved(g.user_clan_removed_event):g.clan_event_created?this.oneventcreated(g.clan_event_created):g.give_coffee_event?this.oncoffeegiven(g.give_coffee_event):g.role_assign_event?this.onroleassign(g.role_assign_event):g.streaming_started_event?this.onstreamingchannelstarted(g.streaming_started_event):g.streaming_ended_event?this.onstreamingchannelended(g.streaming_ended_event):g.streaming_joined_event?this.onstreamingchanneljoined(g.streaming_joined_event):g.streaming_leaved_event?this.onstreamingchannelleaved(g.streaming_leaved_event):g.streaming_viewer_count_event?this.onstreamingviewercount(g.streaming_viewer_count_event):g.permission_set_event?this.onpermissionset(g.permission_set_event):g.permission_changed_event?this.onpermissionchanged(g.permission_changed_event):g.unmute_event?this.onunmuteevent(g.unmute_event):g.token_sent_event?this.ontokensent(g.token_sent_event):g.message_button_clicked?this.onmessagebuttonclicked(g.message_button_clicked):g.dropdown_box_selected?this.onmessagedropdownboxselected(g.dropdown_box_selected):g.mark_as_read?this.onmarkasread(g.mark_as_read):g.voice_reaction_send?this.onvoicereactionmessage(g.voice_reaction_send):g.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(g.webrtc_signaling_fwd):g.list_activity?this.onactivityupdated(g.list_activity):g.sd_topic_event?this.onsdtopicevent(g.sd_topic_event):g.channel_app_event?this.onchannelappevent(g.channel_app_event):g.user_status_event?this.onuserstatusevent(g.user_status_event):g.join_channel_app_data?this.onjoinchannelappevent(g.join_channel_app_data):g.unpin_message_event?this.onunpinmessageevent(g.unpin_message_event):g.quick_menu_event?this.onquickmenuevent(g.quick_menu_event):g.meet_participant_event?this.onmeetparticipantevent(g.meet_participant_event):g.transfer_ownership_event?this.ontransferownership(g.transfer_ownership_event):g.ban_user_event?this.onbanneduser(g.ban_user_event):g.list_channel_users_banned_event?this.onlistchannelusersbanned(g.list_channel_users_banned_event):g.allow_anonymous_event?this.onallowanonymousevent(g.allow_anonymous_event):g.aiagent_enabled_event?this.onaiagentenabled(g.aiagent_enabled_event):g.refresh_session_event?this.onrefreshsession(g.refresh_session_event):g.topic_in_message_event?this.ontopicinmessage(g.topic_in_message_event):g.screen_share_event?this.onscreenshare(g.screen_share_event):g.voice_interactive_event?this.onvoiceinteractiveevent(g.voice_interactive_event):g.sfu_breakout_room_event?this.onsfubreakoutroomevent(g.sfu_breakout_room_event):g.pong?this.verbose&&typeof console!="undefined"&&console.log("Pong message received: %o",g):this.verbose&&typeof console!="undefined"&&console.log("Unrecognized message received: %o",g)}),onClose:_=>{let b=this._connectionState===p.CONNECTING;this.markDisconnected("transport_on_close",_,!0,!0),b&&this.failConnect(new Error("SOCKET_CLOSED_BEFORE_ESTABLISH"))},onOpen:_=>{this.verbose&&typeof console!="undefined"&&console.log(_);let b=this._hasConnectedOnce;this._hasConnectedOnce=!0,this.clearConnectTimeout(),this._serverDisconnectStreak=0,this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,i(),this._connectReject=void 0,b?this.onreconnect(_):this.onconnect(_)},onError:_=>{this.onerror(_),this._connectAttemptSeq+=1,this.failConnect(_ instanceof Error?_:new Error("Socket error during connect.")),this.transport.close(),this.markDisconnected("transport_on_error",_,!0,!1)}})}catch(_){let b=U("error");this.onerror(b),this.markDisconnected("connect_sync_throw",b,!0,!1),this.failConnect(_ instanceof Error?_:new Error(String(_)))}return d}setAutoReconnect(e){}disconnect(e=!0){this._lastConnectArgs=void 0,this.failConnect(new Error("Client disconnected.")),this.markDisconnected("client_disconnect",U("close"),e,!1),this.transport.close()}pingPong(){return l(this,null,function*(){if(!this.isOpen())return;let e=this._connectAttemptSeq;try{let t="",n={ping:{}};yield this.transport.send({urlPath:t,fetchOptions:n},this._heartbeatTimeoutMs)}catch(t){if(e!==this._connectAttemptSeq||this._connectionState!==p.CONNECTED)return;this.verbose&&typeof console!="undefined"&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this._connectAttemptSeq+=1,this.transport.adapter.isOpen()&&this.transport.close(),this.markDisconnected("heartbeat_unreachable",U("close"),!0,!1);return}e===this._connectAttemptSeq&&this.startHeartbeatLoop()})}startHeartbeatLoop(){this._heartbeatSuspended||(this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatIntervalMs))}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}markDisconnected(e,t=U("close"),n=!0,r=!1){this.verbose&&typeof console!="undefined"&&console.log(e);let a=this._connectionState===p.DISCONNECTED;if(this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this._connectPromise=void 0,a||n&&this.ondisconnect(t),r&&!a&&this.serverDisconnectStreakLogoutThreshold>0&&(this._serverDisconnectStreak+=1,this._serverDisconnectStreak>=this.serverDisconnectStreakLogoutThreshold)){let o=this._serverDisconnectStreak;this._serverDisconnectStreak=0,this.onserverdisconnectstreaklogout(t,o)}}onconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onreconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondisconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onserverdisconnectstreaklogout(e,t){this.verbose&&typeof console!="undefined"&&console.log("Server disconnect streak reached: %o",t,e)}onerror(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagetyping(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagereaction(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelpresence(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserchanneladded(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserclanadded(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserprofileupdate(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserchannelremoved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onaddfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onremovefriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onblockfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunblockfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserclanremoved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onnotification(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstatuspresence(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onpinmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceended(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicestarted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicejoined(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceleaved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelcreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncategoryevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onroleevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventemoji(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventnotiuserchannel(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventwebhook(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchanneldeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclandeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickercreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickerdeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickerupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelarchive(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondeleteaccount(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclanprofileupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclanupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onlastseenupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onheartbeattimeout(){this.verbose&&typeof console!="undefined"&&console.log("Heartbeat timeout.")}oncustomstatus(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncanvasevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventcreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncoffeegiven(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onroleassign(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelstarted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelended(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchanneljoined(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelleaved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingviewercount(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionset(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onpermissionchanged(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunmuteevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ontokensent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagebuttonclicked(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagedropdownboxselected(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmarkasread(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicereactionmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onwebrtcsignalingfwd(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onactivityupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onsdtopicevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onsfubreakoutroomevent(e){this.verbose&&window&&window.console&&console.log(e)}onchannelappevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserstatusevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onjoinchannelappevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunpinmessageevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onquickmenuevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ontransferownership(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onbanneduser(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onlistchannelusersbanned(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmeetparticipantevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onallowanonymousevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onaiagentenabled(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onrefreshsession(e){this.verbose&&typeof console!="undefined"&&console.log(`Token refresh occurred. Token: ${e.token}`)}ontopicinmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onscreenshare(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceinteractiveevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}authenticateMezon(e,t,n,r,a={},o={}){let i={token:e,vars:a};return this.transport.authenticateMezon(this.serverkey,"",i,t,n,r,o).then(c=>({token:c.token||"",refresh_token:c.refresh_token||"",created:c.created||!1,api_url:c.api_url||"",ws_url:c.ws_url||"",id_token:c.id_token||"",is_remember:c.is_remember||!1,session_id:c.session_id||""}))}authenticateSMSOTPRequest(e,t,n){let r={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",r,t).then(a=>Promise.resolve(a))}authenticateEmailOTPRequest(e,t,n){let r={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",r,t).then(a=>Promise.resolve(a))}confirmAuthenticateOTP(e){return l(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}authenticateEmail(e,t,n,r){let a={username:n,account:{email:e,password:t,vars:r}};return this.transport.authenticateEmail(this.serverkey,"",a,n).then(o=>({token:o.token||"",refresh_token:o.refresh_token||"",created:o.created||!1,api_url:o.api_url||"",ws_url:o.ws_url||"",id_token:o.id_token||"",is_remember:o.is_remember||!1,session_id:o.session_id||""}))}addChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(t,n).then(r=>r!==void 0)})}addFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(t,n)})}blockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(t,n).then(r=>Promise.resolve(r!=null))})}unblockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(t,n).then(r=>Promise.resolve(r!=null))})}uploadOauthFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(t)})}uploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(t)})}uploadBatchAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadBatchAttachmentFile(t)})}multipartUploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(t)})}multipartUploadAttachmentFileFinish(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(t)})}linkCDNFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkCDNFile(t)})}sfuBreakoutRoom(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sfuBreakoutRoom(t)})}sfuBreakoutMerge(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sfuBreakoutMerge(t)})}createChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(t)})}createCategoryDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(t).then(n=>Promise.resolve(n))})}createRole(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(t).then(n=>Promise.resolve(n))})}createEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(t).then(n=>n!==void 0)})}deleteApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(t,n).then(r=>r!==void 0)})}deleteChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(t,n).then(r=>r!==void 0)})}deleteClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(t,n,r).then(a=>a!==void 0)})}deleteNotifications(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(t,n).then(r=>Promise.resolve(r!=null))})}deleteRole(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(t,"0",n,r).then(()=>!0)})}deleteEvent(e,t,n,r,a,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,a,o).then(i=>i!==void 0)})}updateEventUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(t).then(n=>n!==void 0)})}emitEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getAccount(e.token)})}removeClanUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(t,n).then(r=>Promise.resolve(r!=null))})}listBannedUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(t,n).then(r=>Promise.resolve(r))})}unbanClanUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(t,n,r).then(a=>Promise.resolve(a!=null))})}banClanUsers(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(t,n,r,a).then(o=>Promise.resolve(o!=null))})}removeChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(t,n).then(r=>Promise.resolve(r!=null))})}listChannelMessages(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,r,a,o,i).then(c=>{let d={messages:[],last_seen_message:c.last_seen_message,last_sent_message:c.last_sent_message};return c.messages==null||c.messages.forEach(h=>{let f,_,b,g,A;try{f=P(h.content)}catch(C){console.log("error parse content",C)}try{let C=N(h.reactions);_=(C==null?void 0:C.reactions)||C||P(h.reactions||"[]")}catch(C){_=P(h.reactions||"[]")}try{let C=B(h.mentions);b=(C==null?void 0:C.mentions)||C||P(h.mentions||"[]")}catch(C){b=P(h.mentions||"[]")}try{let C=x(h.attachments);g=(C==null?void 0:C.attachments)||C||P(h.attachments||"[]")}catch(C){g=P(h.attachments||"[]")}try{let C=W(h.references);A=(C==null?void 0:C.refs)||C||P(h.references||"[]")}catch(C){A=P(h.references||"[]")}d.messages.push({channel_id:h.channel_id,code:h.code?Number(h.code):0,id:h.message_id||"",sender_id:h.sender_id,username:h.username,display_name:h.display_name,avatar:h.avatar,content:f,channel_label:h.channel_label,clan_logo:h.clan_logo,category_name:h.category_name,clan_nick:h.clan_nick,clan_avatar:h.clan_avatar,attachments:g,mentions:b,reactions:_,references:A,clan_id:h.clan_id,create_time_seconds:h.create_time_seconds,update_time_seconds:h.update_time_seconds,hide_editted:h.hide_editted})}),Promise.resolve(d)})})}listChannelVoiceUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(t,n).then(r=>{let a={voice_channel_users:[]};return r.voice_channel_users==null||r.voice_channel_users.forEach(o=>{a.voice_channel_users.push({id:o.id,channel_id:o.channel_id,user_ids:o.user_ids,room_name:o.room_name,share_screen_ids:o.share_screen_ids})}),Promise.resolve(a)})})}listChannelUsers(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,o,a,i).then(c=>{let d={channel_users:[],cursor:c.cursor,channel_id:c.channel_id};return c.channel_users==null||c.channel_users.forEach(h=>{d.channel_users.push({user_id:h.user_id,role_id:h.role_id,thread_id:h.thread_id,clan_avatar:h.clan_avatar,clan_nick:h.clan_nick,id:h.id,clan_id:h.clan_id,added_by:h.added_by,is_banned:h.is_banned})}),Promise.resolve(d)})})}listChannelAttachments(e,t,n,r,a,o,i,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,o,a,i,c).then(d=>{let h={attachments:[]};return d.attachments==null||d.attachments.forEach(f=>{h.attachments.push({filename:f.filename,filesize:f.filesize,filetype:f.filetype,id:f.id,uploader:f.uploader,url:f.url,message_id:f.message_id,create_time_seconds:f.create_time_seconds,width:f.width,height:f.height})}),Promise.resolve(h)})})}listClanUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(t).then(n=>{let r={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(a=>{var o;r.clan_users.push({user:{avatar_url:a.user.avatar_url,create_time_seconds:a.user.create_time_seconds,display_name:a.user.display_name,edge_count:a.user.edge_count?Number(a.user.edge_count):0,id:a.user.id,lang_tag:a.user.lang_tag,location:a.user.location,online:a.user.online,is_mobile:(o=a.user)==null?void 0:o.is_mobile,timezone:a.user.timezone,update_time:a.user.update_time,username:a.user.username,user_status:a.user.user_status,status:a.user.status,about_me:a.user.about_me,mezon_id:a.user.mezon_id,list_nick_names:a.user.list_nick_names,phone_number:a.user.phone_number,join_time_seconds:a.user.join_time_seconds},role_id:a.role_id,clan_nick:a.clan_nick,clan_avatar:a.clan_avatar})}),Promise.resolve(r)})})}listClanUsersStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(t).then(n=>{let r={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(a=>{r.clan_user_statuses.push({user_id:a.user_id,user_status:a.user_status})}),Promise.resolve(r)})})}listChannelDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,r,a,o,i).then(c=>{let d={channeldesc:[],next_cursor:c.next_cursor,prev_cursor:c.prev_cursor,cacheable_cursor:c.cacheable_cursor};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listClanDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(t,n,r).then(a=>{let o={clandesc:[]};return a.clandesc==null||(o.clandesc=a.clandesc),Promise.resolve(o)})})}listClanBadgeCount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanBadgeCount().then(t=>{var n;return{list_badge:(n=t.list_badge)!=null?n:[]}})})}listChannelBadgeCount(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(t,n,r).then(a=>{var o;return{channeldesc:(o=a.channeldesc)!=null?o:[],total_count:a.total_count}})})}listUserOnline(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(t,n,r).then(a=>{var o;return{users:(o=a.users)!=null?o:[],total_count:a.total_count}})})}listCategoryDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(t,n,r).then(a=>{let o={categorydesc:[]};return a.categorydesc==null||(o.categorydesc=a.categorydesc),Promise.resolve(o)})})}listEvents(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(t).then(n=>Promise.resolve(n))})}getListPermission(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(t,n,r).then(a=>Promise.resolve(a))})}registFCMDeviceToken(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(t,n,r,a).then(o=>Promise.resolve(o))})}getUserProfileOnClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(t).then(n=>n!==void 0)})}openDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(t)})}linkSMS(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(n,t,r).then(a=>{let o={friends:[],cursor:a.cursor};return a.friends==null||a.friends.forEach(i=>{var c;o.friends.push({user:{avatar_url:i.user.avatar_url,create_time_seconds:i.user.create_time_seconds,display_name:i.user.display_name,edge_count:i.user.edge_count?Number(i.user.edge_count):0,id:i.user.id,lang_tag:i.user.lang_tag,location:i.user.location,online:i.user.online,timezone:i.user.timezone,update_time:i.user.update_time,username:i.user.username,is_mobile:(c=i.user)==null?void 0:c.is_mobile,user_status:i.user.user_status,status:i.user.status,mezon_id:i.user.mezon_id,list_nick_names:i.user.list_nick_names,phone_number:i.user.phone_number,about_me:i.user.about_me},state:i.state,source_id:i.source_id})}),Promise.resolve(o)})})}listNotifications(e,t,n,r,a,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,r,a,o).then(i=>{let c={cacheable_cursor:i.cacheable_cursor,notifications:[]};return i.notifications==null||i.notifications.forEach(d=>{c.notifications.push({id:d.id,subject:d.subject,content:d.content?G(d.content):void 0,code:d.code?Number(d.code):0,sender_id:d.sender_id,create_time_seconds:d.create_time_seconds,persistent:d.persistent,category:d.category})}),Promise.resolve(c)})})}sessionLogout(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout({refresh_token:n,token:t,device_id:r,platform:a}).then(o=>o!==void 0)})}unlinkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(t).then(n=>n!==void 0)})}unlinkMezon(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkMezon(t).then(n=>n!==void 0)})}updateUsername(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(t,n).then(r=>r!==void 0)})}updateClanDesc(e,t,n){return l(this,null,function*(){this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e));let r=v({},n);return r.hashtags!==void 0&&(r.hashtags=I(r.hashtags)),this.transport.updateClanDesc(t,r).then(a=>a!==void 0)})}updateCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(t,n).then(r=>r!==void 0)})}updateUserProfileByClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(t,n).then(r=>r!==void 0)})}updateRole(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(t,n).then(()=>!0)})}updateEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(t,n).then(r=>r!==void 0)})}updateApp(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(t,n).then(r=>Promise.resolve(r))})}createLinkInviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return l(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(t).then(n=>n!==void 0)})}setMuteCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(t).then(n=>n!==void 0)})}setMuteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage({channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(t).then(n=>n!==void 0)})}searchMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(t).then(n=>Promise.resolve(n))})}searchCtrlK(r,a){return l(this,arguments,function*(e,t,n={}){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchCtrlK(t,n).then(o=>Promise.resolve(o))})}searchMentionUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMentionUsers(t).then(n=>Promise.resolve(n))})}generateCDNSignature(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateCDNSignature(t).then(n=>Promise.resolve(n))})}getStreamPlayback(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getStreamPlayback(t).then(n=>Promise.resolve(n))})}setOverrideEveryoneChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setOverrideEveryoneChannel(t).then(n=>Promise.resolve(n))})}getOverrideEveryoneChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOverrideEveryoneChannel(t).then(n=>Promise.resolve(n))})}getDMSetting(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getDMSetting().then(t=>Promise.resolve(t))})}updateDMSetting(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateDMSetting(t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(t,n,r).then(a=>{let o={pin_messages_list:[]};return a.pin_messages_list==null||a.pin_messages_list.forEach(i=>{o.pin_messages_list.push({id:i.id,avatar:i.avatar,channel_id:i.channel_id,content:i.content,create_time_seconds:i.create_time_seconds,message_id:i.message_id,sender_id:i.sender_id,username:i.username,attachment:i.attachment})}),Promise.resolve(o)})})}deletePinMessage(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(t,n,r,a).then(o=>o!==void 0)})}createClanEmoji(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(t,n).then(r=>r!==void 0)})}deleteByIdClanEmoji(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(t,n,r).then(a=>a!==void 0)})}generateWebhookLink(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(t,n).then(r=>Promise.resolve(r))})}updateWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(t,n).then(r=>r!==void 0)})}deleteWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(t,n).then(r=>r!==void 0)})}addClanSticker(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(t,n,r).then(a=>a!==void 0)})}updateClanStickerById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(t,n).then(r=>r!==void 0)})}changeChannelCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(t,n).then(r=>r!==void 0)})}setRoleChannelPermission(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(t).then(n=>n!==void 0)})}addApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(t).then(n=>Promise.resolve(n))})}getApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(t).then(n=>Promise.resolve(n))})}listApps(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(t,n).then(r=>r!==void 0)})}getSystemMessagesList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(t,n).then(r=>Promise.resolve(r))})}deleteSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(t).then(n=>Promise.resolve(n))})}listStreamingChannelUsers(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,o,a,i).then(c=>{let d={streaming_channel_users:[]};return c.streaming_channel_users==null||c.streaming_channel_users.forEach(h=>{d.streaming_channel_users.push({id:h.id,channel_id:h.channel_id,user_id:h.user_id,participant:h.participant,is_publisher:h.is_publisher})}),Promise.resolve(d)})})}registerStreamingChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(t).then(n=>n!==void 0)})}listChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(t).then(n=>{let r={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(a=>{r.channel_apps.push({id:a.id,channel_id:a.channel_id,app_id:a.app_id,clan_id:a.clan_id,app_url:a.app_url,app_name:a.app_name,app_logo:a.app_logo})}),Promise.resolve(r)})})}getChannelCategoryNotiSettingsList(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(t,n).then(r=>Promise.resolve(r))})}getListEmojisByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(t,n,r,a).then(o=>{let i={clan_id:t,roles:o.roles};return Promise.resolve(i)})})}listUserPermissionInChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(t,n).then(r=>{let a={clan_id:t,channel_id:n,permissions:r.permissions};return Promise.resolve(a)})})}getPermissionByRoleIdChannelId(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(t,n,r).then(a=>{let o={role_id:t,channel_id:n,permission_role_channel:a.permission_role_channel,user_id:r};return Promise.resolve(o)})})}markAsRead(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,r,a,o,i).then(c=>{let d={channeldesc:[]};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(t).then(n=>{var r;return(r=n.events)==null||r.forEach(a=>{a.attachments=[];let o;try{let i=T(a.preview_imgs);o=(i==null?void 0:i.attachments)||i||P(a.preview_imgs||"[]")}catch(i){o=P(a.preview_imgs||"[]")}Array.isArray(o)?a.preview_imgs=o:a.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(t).then(n=>{let r=n.event;if(r){let a,o;try{let i=T(r.attachments),c=T(r.preview_imgs);a=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),o=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){a=P(r.attachments||"[]"),o=P(r.preview_imgs||"[]")}Array.isArray(a)?r.attachments=a:r.attachments=[],Array.isArray(o)?r.preview_imgs=o:r.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(t).then(n=>{let r=n.event;if(r){let a,o;try{let i=T(r.attachments),c=T(r.preview_imgs);a=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),o=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){a=P(r.attachments||"[]"),o=P(r.preview_imgs||"[]")}Array.isArray(a)?r.attachments=a:r.attachments=[],Array.isArray(o)?r.preview_imgs=o:r.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(t).then(n=>{let r=n.event;if(r){let a,o;try{let i=T(r.attachments),c=T(r.preview_imgs);a=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),o=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){a=P(r.attachments||"[]"),o=P(r.preview_imgs||"[]")}Array.isArray(a)?r.attachments=a:r.attachments=[],Array.isArray(o)?r.preview_imgs=o:r.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(t,n).then(r=>Promise.resolve(r))})}archiveChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(t,n).then(r=>Promise.resolve(r))})}listArchivedChannelDescs(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,r,a,o,i,c,d,h,f){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(t,n,r,a,o,i,c,d,h,f).then(_=>Promise.resolve(_))})}getChannelCanvasList(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(t,n,r,a).then(o=>{let i={channel_canvases:[]};return o.channel_canvases==null||(i.clan_id=o.clan_id,i.channel_id=o.channel_id,i.channel_canvases=o.channel_canvases,i.count=o.count),Promise.resolve(i)})})}getChannelCanvasDetail(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(t,n,r).then(a=>Promise.resolve(a))})}editChannelCanvases(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(t,n,r).then(a=>a!==void 0)})}addFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite({channel_id:t,clan_id:n}).then(r=>r)})}removeFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(t,n).then(r=>r)})}getListFavoriteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(t).then(n=>n)})}listActivity(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(t).then(n=>n)})}createQRLogin(e){return l(this,null,function*(){let t=yield this.transport.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return l(this,null,function*(){let t=yield this.transport.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?{token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}:null})}confirmLogin(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(t).then(n=>n)})}getChanEncryptionMethod(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(t,{method:n}).then(r=>r)})}getPubKeys(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(t).then(n=>n)})}pushPubKey(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey({PK:t}).then(n=>n)})}getKeyServer(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(t,n,r,a).then(o=>o)})}listOnboarding(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(t,n,r,a).then(o=>o)})}getOnboardingDetail(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(t,n).then(r=>Promise.resolve(r))})}createOnboarding(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(t).then(n=>n)})}updateOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(t,n).then(r=>r!==void 0)})}deleteOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(t,n).then(r=>r!==void 0)})}generateClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(t,n).then(r=>r!==void 0)})}updateClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(t,n).then(r=>r!==void 0)})}listOnboardingStep(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(t,n,r).then(a=>Promise.resolve(a))})}updateOnboardingStepByClanId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(t,n).then(r=>r!==void 0)})}updateUserStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(t).then(n=>n!==void 0)})}getUserStatus(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(t,n,r).then(a=>Promise.resolve(a))})}createSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(t).then(n=>n)})}deleteSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSdTopic(t)})}getTopicDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(t,n).then(r=>Promise.resolve(r))})}updateMezonOauthClient(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(t,n,r).then(a=>Promise.resolve(a))})}generateHashChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail({email:t,password:n,old_password:r}).then(a=>Promise.resolve(a))})}addUserEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(t,n).then(r=>r!==void 0)})}updateRoleOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(t).then(n=>Promise.resolve(n))})}deleteAccount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,n,r){return l(this,null,function*(){return this.transport.generateMeetTokenExternal(e,t,n,r).then(a=>Promise.resolve(a))})}removeMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(t).then(n=>n!==void 0)})}listClanDiscover(e){return l(this,null,function*(){let t=v({},e);return t.hashtags!==void 0&&(t.hashtags=I(t.hashtags)),this.transport.clanDiscover(this.serverkey,"",t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(t,n,r).then(a=>Promise.resolve(a))})}deleteQuickMenuAccess(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(t,n).then(r=>r!==void 0)})}addQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(t).then(n=>n!==void 0)})}listForSaleItems(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(t).then(n=>Promise.resolve(n))})}isFollower(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(t).then(n=>n!==void 0)})}isBanned(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(t,n).then(r=>r!==void 0)})}updateMezonVoiceState(e,t,n,r,a,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,r,a,o).then(i=>i!==void 0)})}sendChannelMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(t,n,r,a,o,i,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}sendChannelMessageApi(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.transport.sendChannelMessageApi(e,t,n,r,a,o,i,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,a,o,i,c,d,h,f,_,b).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,n,r,a,o,i,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(t,n,r,a,o,i,c,d,h).then(f=>Promise.resolve(f))})}messageButtonClick(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(t,n,r,a,o,i).then(c=>Promise.resolve(c))})}dropdownBoxSelected(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(t,n,r,a,o,i).then(c=>Promise.resolve(c))})}activeArchivedThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(t,n).then(r=>Promise.resolve(r))})}addAgentToChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(t,n).then(r=>Promise.resolve(r))})}disconnectAgent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(t,n).then(r=>Promise.resolve(r))})}listMutedChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(t,n,r,a,o,i,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}createPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(t)})}votePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(t)})}closePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(t)})}getPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(t)})}followUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,r,a)})}leaveChat(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,r,a)})}removeChatMessage(e,t,n,r,a,o,i,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,r,a,o,i,c,d,h)})}unfollowUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,a,o,i,c,d,h,f,_,b)})}updateStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A,C,R){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,r,a,o,i,c,d,h,f,_,b,g,A,C,R)})}writeEphemeralMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A,C){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,r,a,o,i,c,d,h,f,_,b,g,A,C)})}writeChatMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,r,a,o,i,c,d,h,f,_,b,g)})}writeMessageReaction(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,r,a,o,i,c,d,h,f,_,b,g,A)})}writeMessageTyping(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,r,a,o,i)})}writeLastSeenMessage(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,r,a,o,i)})}writeLastPinMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,r,a,o,i,c,d,h,f,_,b,g)})}writeCustomStatus(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,r,a)})}writeVoiceReaction(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}writeVoiceInteractiveEvent(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceInteractiveEvent(t,n,r,a,o,i)})}forwardWebrtcSignaling(e,t,n,r,a,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,a,o)})}makeCallPush(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,r,a)})}writeChannelAppEvent(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,r)})}writeStreamingWatch(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeStreamingWatch(t,n)})}listLogedDevice(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listLogedDevice()})}refreshSession(e){return l(this,null,function*(){return this.transport.sessionRefresh(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}};q.DefaultHeartbeatIntervalMs=1e4,q.DefaultHeartbeatTimeoutMs=1e4,q.DefaultConnectTimeoutMs=3e4,q.DefaultServerDisconnectStreakLogoutThreshold=3;var ee=q;
|
|
1
|
+
"use strict";var ge=Object.create;var z=Object.defineProperty,fe=Object.defineProperties,_e=Object.getOwnPropertyDescriptor,ye=Object.getOwnPropertyDescriptors,be=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,Ce=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable;var ie=(y,e,t)=>e in y?z(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,v=(y,e)=>{for(var t in e||(e={}))se.call(e,t)&&ie(y,t,e[t]);if(ne)for(var t of ne(e))Ae.call(e,t)&&ie(y,t,e[t]);return y},M=(y,e)=>fe(y,ye(e));var Pe=(y,e)=>{for(var t in e)z(y,t,{get:e[t],enumerable:!0})},re=(y,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of be(e))!se.call(y,r)&&r!==t&&z(y,r,{get:()=>e[r],enumerable:!(n=_e(e,r))||n.enumerable});return y};var oe=(y,e,t)=>(t=y!=null?ge(Ce(y)):{},re(e||!y||!y.__esModule?z(t,"default",{value:y,enumerable:!0}):t,y)),Re=y=>re(z({},"__esModule",{value:!0}),y);var l=(y,e,t)=>new Promise((n,r)=>{var a=c=>{try{i(t.next(c))}catch(d){r(d)}},o=c=>{try{i(t.throw(c))}catch(d){r(d)}},i=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);i((t=t.apply(y,e)).next())});var ze={};Pe(ze,{ApiAppRole:()=>ce,ChannelStreamMode:()=>de,ChannelType:()=>le,Client:()=>ee,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>$,E_CONNECT_ERROR:()=>X,EveryoneChannelExcludeType:()=>ae.EveryoneChannelExcludeType,NotificationType:()=>ue,WebrtcSignalingType:()=>he,b64DecodeUnicode:()=>ve,b64EncodeUnicode:()=>Se,buildFetchOptions:()=>m,decodeAttachments:()=>x,decodeChannelTimelineAttachments:()=>T,decodeGenerateMeetTokenResponse:()=>Y,decodeMentions:()=>B,decodeNotificationFcm:()=>G,decodeReactions:()=>N,decodeRefs:()=>W,encodeAttachments:()=>ke,encodeMentions:()=>Me,encodeNotificationFcm:()=>Te,encodeReactions:()=>Ee,encodeRefs:()=>qe,normalizeClanHashtags:()=>I,safeJSONParse:()=>P});module.exports=Re(ze);var so=require("whatwg-fetch");var ae=require("mezon-js-protobuf");var H=require("js-base64"),S=oe(require("mezon-js-protobuf"));function Y(y){let e=y[0];if(y.length===0||e===10||e===18)try{return S.GenerateMeetTokenResponse.decode(y)}catch(n){}return{token:new TextDecoder("utf-8").decode(y)}}function m(y,e,t){let n=v({method:y},e);return n.headers=v({},e.headers),Object.keys(n.headers).includes("Accept")||(n.headers.Accept="application/proto"),Object.keys(n.headers).includes("Content-Type")||(n.headers["Content-Type"]="application/proto"),Object.keys(n.headers).forEach(r=>{n.headers[r]||delete n.headers[r]}),t&&(n.body=t),n}function Se(y){return(0,H.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function ve(y){return decodeURIComponent((0,H.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var we=512;function I(y){let e=y.trim();if(!e)return"";let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0).join(",");if([...n].length>we)throw new Error("clan hashtags too long");return n}function P(y){if(y==null)return{t:y};let e;if(y instanceof Uint8Array)e=new TextDecoder().decode(y);else if(typeof y=="string")e=y;else return typeof y=="object"?y:{t:y};if(!e||e===""||e==="[]")return{t:e};try{return JSON.parse(e)}catch(t){try{let n=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(n)}catch(n){return console.error("JSON Parse failed completely:",{original:e,error:n}),{t:e}}}}var O=y=>!y||y===null||y===void 0||y===""||y==="[]";function B(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageMentionList.decode(r)}catch(n){return P(y)}}function x(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageAttachmentList.decode(r)}catch(n){return P(y)}}function T(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.ListChannelTimelineAttachment.decode(r)}catch(n){return P(y)}}function W(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageRefList.decode(r)}catch(n){return P(y)}}function N(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.MessageReactionList.decode(r)}catch(n){return P(y)}}function G(y){if(O(y))return;let e=y[0];if(e===91||e===123)return P(y);try{let n=y,r=new Uint8Array(n);return S.DirectFcmProto.decode(r)}catch(n){return P(y)}}function Me(y){return S.MessageMentionList.encode(S.MessageMentionList.fromPartial(y)).finish()}function ke(y){return S.MessageAttachmentList.encode(S.MessageAttachmentList.fromPartial(y)).finish()}function qe(y){return S.MessageRefList.encode(S.MessageRefList.fromPartial(y)).finish()}function Ee(y){return S.MessageReactionList.encode(S.MessageReactionList.fromPartial(y)).finish()}function Te(y){return S.DirectFcmProto.encode(S.DirectFcmProto.fromPartial(y)).finish()}var ce=(a=>(a[a.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",a[a.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",a[a.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",a[a.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",a[a.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",a))(ce||{});var le=(d=>(d[d.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",d[d.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",d[d.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",d[d.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",d[d.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",d[d.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",d[d.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",d[d.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",d[d.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",d))(le||{}),de=(a=>(a[a.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",a[a.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",a[a.STREAM_MODE_DM=4]="STREAM_MODE_DM",a[a.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",a[a.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",a))(de||{}),ue=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(ue||{}),he=(d=>(d[d.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",d[d.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",d[d.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",d[d.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",d[d.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",d[d.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",d[d.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",d[d.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",d[d.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",d))(he||{});function $(y){let e,t,n,r,a,o;try{e=P(y.channel_message.content)}catch(c){console.log("content is invalid",c)}try{t=N(y.channel_message.reactions)}catch(c){console.log("reactions is invalid",c)}try{n=B(y.channel_message.mentions)}catch(c){console.log("mentions is invalid",c)}try{r=x(y.channel_message.attachments)}catch(c){console.log("attachments is invalid",c)}try{a=W(y.channel_message.references)}catch(c){console.log("references is invalid",c)}try{o=y.channel_message.referenced_message}catch(c){console.log("referenced messages is invalid",c)}return{id:y.id||y.channel_message.message_id,avatar:y.channel_message.avatar,channel_id:y.channel_message.channel_id,mode:y.channel_message.mode,channel_label:y.channel_message.channel_label,clan_id:y.channel_message.clan_id,code:y.channel_message.code,message_id:y.channel_message.message_id,sender_id:y.channel_message.sender_id,update_time:y.channel_message.update_time,clan_logo:y.channel_message.clan_logo,category_name:y.channel_message.category_name,username:y.channel_message.username,clan_nick:y.channel_message.clan_nick,clan_avatar:y.channel_message.clan_avatar,display_name:y.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:r==null?void 0:r.attachments,referenced_message:o,references:a==null?void 0:a.refs,hide_editted:y.channel_message.hide_editted,is_public:y.channel_message.is_public,create_time_seconds:y.channel_message.create_time_seconds,update_time_seconds:y.channel_message.update_time_seconds,topic_id:y.channel_message.topic_id}}var X=(t=>(t.TIME_OUT="TIME_OUT",t.SOCKET_CLOSED_BEFORE_ESTABLISH="SOCKET_CLOSED_BEFORE_ESTABLISH",t))(X||{});var k=require("js-base64"),s=oe(require("mezon-js-protobuf")),me=require("mezon-js-protobuf");var Oe="CHECK_HEALTHY",j=class{constructor(){this.maxAllowedFailures=3;this.minAllowedFastRate=.95;this.maxAllowedLatencyMs=1e3;this.metricsWindowMs=6e4;this.minRequests=20;this.windowStartTime=0;this.totalRequests=0;this.failed=0;this.slowCount=0;this.requests=new Map}start(e){this.requests.set(e,performance.now())}end(e,t=!1){let n=this.requests.get(e);if(n===void 0)return;let r=performance.now();this.windowStartTime!==0&&n-this.windowStartTime>=this.metricsWindowMs&&(this.reset(),this.windowStartTime=n);let a=r-n;if(this.totalRequests++,t?this.failed++:a>this.maxAllowedLatencyMs&&this.slowCount++,this.totalRequests>=this.minRequests){let o=(this.totalRequests-this.slowCount)/this.totalRequests;o<this.minAllowedFastRate&&(typeof window!="undefined"&&window.dispatchEvent(new CustomEvent(Oe,{detail:{requestId:e,fastRate:o,totalRequests:this.totalRequests,slowCount:this.slowCount}})),this.reset(),this.windowStartTime=performance.now())}this.requests.delete(e)}get shouldSwitch(){if(this.totalRequests<this.minRequests)return!1;let e=(this.totalRequests-this.slowCount)/this.totalRequests;return this.failed>=this.maxAllowedFailures||e<this.minAllowedFastRate}get stats(){let e=this.totalRequests>0?this.slowCount/this.totalRequests:0,t=this.totalRequests>0?(this.totalRequests-this.slowCount)/this.totalRequests:0;return{totalRequests:this.totalRequests,failedCount:this.failed,slowCount:this.slowCount,slowRate:e,fastRate:t,isUnhealthy:this.shouldSwitch}}reset(){this.windowStartTime=0,this.totalRequests=0,this.failed=0,this.slowCount=0,this.requests.clear()}};var Z=(u=>(u[u.ListChannelDescs=0]="ListChannelDescs",u[u.GetAccount=1]="GetAccount",u[u.ListClanDescs=2]="ListClanDescs",u[u.ListClanUsers=3]="ListClanUsers",u[u.ListRoles=4]="ListRoles",u[u.ListEvents=5]="ListEvents",u[u.GetRoleOfUserInTheClan=6]="GetRoleOfUserInTheClan",u[u.GetListPermission=7]="GetListPermission",u[u.ListUserPermissionInChannel=8]="ListUserPermissionInChannel",u[u.GetNotificationClan=9]="GetNotificationClan",u[u.ListMutedChannel=10]="ListMutedChannel",u[u.ListStreamingChannelUsers=11]="ListStreamingChannelUsers",u[u.ListQuickMenuAccess=12]="ListQuickMenuAccess",u[u.GetNotificationChannel=13]="GetNotificationChannel",u[u.ListFriends=14]="ListFriends",u[u.EmojiRecentList=15]="EmojiRecentList",u[u.GetListEmojisByUserId=16]="GetListEmojisByUserId",u[u.ListClanBadgeCount=17]="ListClanBadgeCount",u[u.ListChannelBadgeCount=18]="ListChannelBadgeCount",u[u.ListLogedDevice=19]="ListLogedDevice",u[u.ListClanUsersStatus=20]="ListClanUsersStatus",u[u.ListChannelApps=21]="ListChannelApps",u[u.GetListFavoriteChannel=22]="GetListFavoriteChannel",u[u.ListCategoryDescs=23]="ListCategoryDescs",u[u.ListOnboarding=24]="ListOnboarding",u[u.GetListStickersByUserId=25]="GetListStickersByUserId",u[u.GetSystemMessageByClanId=26]="GetSystemMessageByClanId",u[u.GetPinMessagesList=27]="GetPinMessagesList",u[u.GetChannelCanvasList=28]="GetChannelCanvasList",u[u.ListChannelTimeline=29]="ListChannelTimeline",u[u.ListChannelMessages=30]="ListChannelMessages",u[u.ListActivity=31]="ListActivity",u[u.ListChannelByUserId=32]="ListChannelByUserId",u[u.ListUserClansByUserId=33]="ListUserClansByUserId",u[u.GetUserProfileOnClan=34]="GetUserProfileOnClan",u[u.RegistFCMDeviceToken=35]="RegistFCMDeviceToken",u[u.IsBanned=36]="IsBanned",u[u.ListThreadDescs=37]="ListThreadDescs",u[u.ListArchivedChannelDescs=38]="ListArchivedChannelDescs",u[u.ListChannelDetail=39]="ListChannelDetail",u[u.GetChannelCategoryNotiSettingsList=40]="GetChannelCategoryNotiSettingsList",u[u.ListRoleUsers=41]="ListRoleUsers",u[u.ListChannelUsers=42]="ListChannelUsers",u[u.ListChannelAttachment=43]="ListChannelAttachment",u[u.ListChannelVoiceUsers=44]="ListChannelVoiceUsers",u[u.ListUserOnline=45]="ListUserOnline",u[u.ListNotifications=46]="ListNotifications",u[u.ListChannelUsersUC=47]="ListChannelUsersUC",u[u.ListWebhookByChannelId=48]="ListWebhookByChannelId",u[u.GetPermissionByRoleIdChannelId=49]="GetPermissionByRoleIdChannelId",u[u.ListChannelSetting=50]="ListChannelSetting",u[u.ListApps=51]="ListApps",u[u.GetApp=52]="GetApp",u[u.ListForSaleItems=53]="ListForSaleItems",u[u.ListClanWebhook=54]="ListClanWebhook",u[u.GetUserStatus=55]="GetUserStatus",u[u.ListSdTopic=56]="ListSdTopic",u[u.AddFriends=57]="AddFriends",u[u.AddChannelUsers=58]="AddChannelUsers",u[u.RegistrationEmail=59]="RegistrationEmail",u[u.BlockFriends=60]="BlockFriends",u[u.UnblockFriends=61]="UnblockFriends",u[u.UploadAttachmentFile=62]="UploadAttachmentFile",u[u.UploadOauthFile=63]="UploadOauthFile",u[u.AddRolesChannelDesc=64]="AddRolesChannelDesc",u[u.CreateCategoryDesc=65]="CreateCategoryDesc",u[u.CreateChannelDesc=66]="CreateChannelDesc",u[u.CreateRole=67]="CreateRole",u[u.CreateEvent=68]="CreateEvent",u[u.DeleteRole=69]="DeleteRole",u[u.DeleteEvent=70]="DeleteEvent",u[u.DeleteRoleChannelDesc=71]="DeleteRoleChannelDesc",u[u.DeleteChannelDesc=72]="DeleteChannelDesc",u[u.CloseDMByChannelId=73]="CloseDMByChannelId",u[u.OpenDMByChannelId=74]="OpenDMByChannelId",u[u.DeleteAccount=75]="DeleteAccount",u[u.DeleteFriends=76]="DeleteFriends",u[u.DeleteCategoryDesc=77]="DeleteCategoryDesc",u[u.DeleteNotifications=78]="DeleteNotifications",u[u.DeleteClanDesc=79]="DeleteClanDesc",u[u.UpdateUser=80]="UpdateUser",u[u.UpdateUserProfileByClan=81]="UpdateUserProfileByClan",u[u.UpdateClanOrder=82]="UpdateClanOrder",u[u.RemoveChannelUsers=83]="RemoveChannelUsers",u[u.LeaveThread=84]="LeaveThread",u[u.ArchiveChannel=85]="ArchiveChannel",u[u.LinkSMS=86]="LinkSMS",u[u.ConfirmLinkMezonOTP=87]="ConfirmLinkMezonOTP",u[u.LinkEmail=88]="LinkEmail",u[u.CreateClanDesc=89]="CreateClanDesc",u[u.RemoveClanUsers=90]="RemoveClanUsers",u[u.BanClanUsers=91]="BanClanUsers",u[u.CreateLinkInviteUser=92]="CreateLinkInviteUser",u[u.InviteUser=93]="InviteUser",u[u.SetRoleChannelPermission=94]="SetRoleChannelPermission",u[u.SetNotificationChannelSetting=95]="SetNotificationChannelSetting",u[u.SetMuteChannel=96]="SetMuteChannel",u[u.SetMuteCategory=97]="SetMuteCategory",u[u.SetNotificationClanSetting=98]="SetNotificationClanSetting",u[u.SetNotificationCategorySetting=99]="SetNotificationCategorySetting",u[u.DeleteNotificationCategorySetting=100]="DeleteNotificationCategorySetting",u[u.DeleteNotificationChannel=101]="DeleteNotificationChannel",u[u.CreatePinMessage=102]="CreatePinMessage",u[u.CreateMessage2Inbox=103]="CreateMessage2Inbox",u[u.UnlinkMezon=104]="UnlinkMezon",u[u.UnlinkEmail=105]="UnlinkEmail",u[u.UpdateAccount=106]="UpdateAccount",u[u.UpdateUsername=107]="UpdateUsername",u[u.UpdateCategory=108]="UpdateCategory",u[u.UpdateCategoryOrder=109]="UpdateCategoryOrder",u[u.UpdateRoleOrder=110]="UpdateRoleOrder",u[u.UpdateClanDesc=111]="UpdateClanDesc",u[u.UpdateChannelDesc=112]="UpdateChannelDesc",u[u.UpdateChannelPrivate=113]="UpdateChannelPrivate",u[u.UpdateRole=114]="UpdateRole",u[u.UpdateEvent=115]="UpdateEvent",u[u.SearchMessage=116]="SearchMessage",u[u.CreateClanEmoji=117]="CreateClanEmoji",u[u.DeleteByIdClanEmoji=118]="DeleteByIdClanEmoji",u[u.UpdateClanEmojiById=119]="UpdateClanEmojiById",u[u.GenerateWebhook=120]="GenerateWebhook",u[u.HandleWebhook=121]="HandleWebhook",u[u.UpdateWebhookById=122]="UpdateWebhookById",u[u.DeleteWebhookById=123]="DeleteWebhookById",u[u.AddClanSticker=124]="AddClanSticker",u[u.UpdateClanStickerById=125]="UpdateClanStickerById",u[u.DeleteClanStickerById=126]="DeleteClanStickerById",u[u.ChangeChannelCategory=127]="ChangeChannelCategory",u[u.CheckDuplicateName=128]="CheckDuplicateName",u[u.AddApp=129]="AddApp",u[u.DeleteApp=130]="DeleteApp",u[u.UpdateApp=131]="UpdateApp",u[u.AddAppToClan=132]="AddAppToClan",u[u.CreateSystemMessage=133]="CreateSystemMessage",u[u.UpdateSystemMessage=134]="UpdateSystemMessage",u[u.DeleteSystemMessage=135]="DeleteSystemMessage",u[u.StreamingServerCallback=136]="StreamingServerCallback",u[u.EditChannelCanvases=137]="EditChannelCanvases",u[u.GetChannelCanvasDetail=138]="GetChannelCanvasDetail",u[u.DeleteChannelCanvas=139]="DeleteChannelCanvas",u[u.AddChannelFavorite=140]="AddChannelFavorite",u[u.RemoveChannelFavorite=141]="RemoveChannelFavorite",u[u.CreateActiviy=142]="CreateActiviy",u[u.GetPubKeys=143]="GetPubKeys",u[u.PushPubKey=144]="PushPubKey",u[u.GetChanEncryptionMethod=145]="GetChanEncryptionMethod",u[u.SetChanEncryptionMethod=146]="SetChanEncryptionMethod",u[u.GetKeyServer=147]="GetKeyServer",u[u.ListAuditLog=148]="ListAuditLog",u[u.GetOnboardingDetail=149]="GetOnboardingDetail",u[u.CreateOnboarding=150]="CreateOnboarding",u[u.UpdateOnboarding=151]="UpdateOnboarding",u[u.DeleteOnboarding=152]="DeleteOnboarding",u[u.ListOnboardingStep=153]="ListOnboardingStep",u[u.UpdateOnboardingStep=154]="UpdateOnboardingStep",u[u.GenerateClanWebhook=155]="GenerateClanWebhook",u[u.UpdateClanWebhookById=156]="UpdateClanWebhookById",u[u.DeleteClanWebhookById=157]="DeleteClanWebhookById",u[u.HandleClanWebhook=158]="HandleClanWebhook",u[u.UpdateUserStatus=159]="UpdateUserStatus",u[u.UpdateUserCustomStatus=160]="UpdateUserCustomStatus",u[u.GetTopicDetail=161]="GetTopicDetail",u[u.CreateSdTopic=162]="CreateSdTopic",u[u.DeleteSdTopic=163]="DeleteSdTopic",u[u.CreateExternalMezonMeet=164]="CreateExternalMezonMeet",u[u.GenerateMeetToken=165]="GenerateMeetToken",u[u.RemoveParticipantMezonMeet=166]="RemoveParticipantMezonMeet",u[u.MuteParticipantMezonMeet=167]="MuteParticipantMezonMeet",u[u.CreateRoomChannelApps=168]="CreateRoomChannelApps",u[u.GetMezonOauthClient=169]="GetMezonOauthClient",u[u.DeleteMezonOauthClient=170]="DeleteMezonOauthClient",u[u.UpdateMezonOauthClient=171]="UpdateMezonOauthClient",u[u.SearchThread=172]="SearchThread",u[u.GenerateHashChannelApps=173]="GenerateHashChannelApps",u[u.DeleteUserEvent=174]="DeleteUserEvent",u[u.AddUserEvent=175]="AddUserEvent",u[u.DeleteQuickMenuAccess=176]="DeleteQuickMenuAccess",u[u.AddQuickMenuAccess=177]="AddQuickMenuAccess",u[u.UpdateQuickMenuAccess=178]="UpdateQuickMenuAccess",u[u.TransferOwnership=179]="TransferOwnership",u[u.SendChannelMessage=180]="SendChannelMessage",u[u.UpdateChannelMessage=181]="UpdateChannelMessage",u[u.DeleteChannelMessage=182]="DeleteChannelMessage",u[u.ReportMessageAbuse=183]="ReportMessageAbuse",u[u.MessageButtonClick=184]="MessageButtonClick",u[u.DropdownBoxSelected=185]="DropdownBoxSelected",u[u.ActiveArchivedThread=186]="ActiveArchivedThread",u[u.UpdateChannelTimeline=187]="UpdateChannelTimeline",u[u.AddAgentToChannel=188]="AddAgentToChannel",u[u.DisconnectAgent=189]="DisconnectAgent",u[u.CreateChannelTimeline=190]="CreateChannelTimeline",u[u.DetailChannelTimeline=191]="DetailChannelTimeline",u[u.CreatePoll=192]="CreatePoll",u[u.VotePoll=193]="VotePoll",u[u.ClosePoll=194]="ClosePoll",u[u.GetPoll=195]="GetPoll",u[u.ReactChannelMessage=196]="ReactChannelMessage",u[u.MultipartUploadAttachmentFileStart=197]="MultipartUploadAttachmentFileStart",u[u.MultipartUploadAttachmentFileFinish=198]="MultipartUploadAttachmentFileFinish",u[u.SessionRefresh=199]="SessionRefresh",u[u.SessionLogout=200]="SessionLogout",u[u.Healthcheck=201]="Healthcheck",u[u.UnbanClanUsers=202]="UnbanClanUsers",u[u.ListBannedUsers=203]="ListBannedUsers",u[u.GetNotificationCategory=204]="GetNotificationCategory",u[u.ListRolePermissions=205]="ListRolePermissions",u[u.IsFollower=206]="IsFollower",u[u.DeletePinMessage=207]="DeletePinMessage",u[u.MarkAsRead=208]="MarkAsRead",u[u.UploadBatchAttachmentFile=209]="UploadBatchAttachmentFile",u[u.SearchCtrlK=210]="SearchCtrlK",u[u.SearchMentionUsers=211]="SearchMentionUsers",u[u.GenerateCDNSignature=212]="GenerateCDNSignature",u[u.GetStreamPlayback=213]="GetStreamPlayback",u[u.LinkCDNFile=214]="LinkCDNFile",u[u.SfuBreakoutRoom=215]="SfuBreakoutRoom",u[u.SfuBreakoutMerge=216]="SfuBreakoutMerge",u[u.SetOverrideEveryoneChannel=217]="SetOverrideEveryoneChannel",u[u.GetOverrideEveryoneChannel=218]="GetOverrideEveryoneChannel",u[u.GetDMSetting=219]="GetDMSetting",u[u.UpdateDMSetting=220]="UpdateDMSetting",u))(Z||{});function pe(){let y=new Error("The request was aborted.");return y.name="AbortError",y}var V=class V{constructor(e,t,n){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=n,this.adapter=new me.MezonNetworkAdapter,this.metricLatency=new j}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return this.nextCid>=65535?this.nextCid=1:++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in Z)return Z[e]}connect(e,t,n,r,a,o){let[i,c]=t.split(":");this.adapter.connect(i,c,n,e,o),this.adapter.onOpen=a.onOpen,this.adapter.onError=a.onError,this.adapter.onClose=a.onClose,this.adapter.onMessage=(d,h,f)=>l(this,null,function*(){if(r&&typeof console!="undefined"&&console.log("incomming message with cid %o and message %o",d,f),d!=0){let _=this.cIds[d];if(!_){r&&typeof console!="undefined"&&console.error("No promise executor for message: %o",f);return}delete this.cIds[d],f.error?(_.reject({code:h,error:f.error}),this.metricLatency.end(d,!0)):(_.resolve({code:h,message:f}),this.metricLatency.end(d))}else yield a.onMessage(0,0,f)})}send(e,t=V.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:r}=e,a=r==null?void 0:r.signal,o=r;if(n!=null&&n.includes("/mezon.api.Mezon/")){let i=n.substring(17);o={api_request_event:{api_index:this.getApiFromPath(i),api_name:i,body:r.body}}}return new Promise((i,c)=>l(this,null,function*(){var d,h,f;if(a!=null&&a.aborted)c(pe());else if(!this.adapter.isOpen())c("Socket connection has not been established yet.");else{o.channel_message_send?o.channel_message_send.content=JSON.stringify(o.channel_message_send.content):o.channel_message_update?o.channel_message_update.content=JSON.stringify(o.channel_message_update.content):o.ephemeral_message_send?o.ephemeral_message_send.message.content=JSON.stringify((d=o.ephemeral_message_send.message)==null?void 0:d.content):o.quick_menu_event&&(o.quick_menu_event.message.content=JSON.stringify((h=o.quick_menu_event.message)==null?void 0:h.content));let _=this.generatecid();this.metricLatency.start(_),this.cIds[_]={resolve:i,reject:c};let b,g=()=>{delete this.cIds[_],b&&clearTimeout(b),this.metricLatency.end(_,!0),c(pe())};(f=a==null?void 0:a.addEventListener)==null||f.call(a,"abort",g,{once:!0}),t!==1/0&&t>0&&(b=setTimeout(()=>{var A;(A=a==null?void 0:a.removeEventListener)==null||A.call(a,"abort",g),this.metricLatency.end(_,!0),c("The socket timed out while waiting for a response.")},t)),o.cid=_,this.adapter.send(o)}}))}deleteAccount(e={}){let t="/mezon.api.Mezon/DeleteAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return a})),new Promise((a,o)=>setTimeout(o,this.timeoutMs,"Request timed out."))])}getAccount(e={}){let t="/mezon.api.Mezon/GetAccount",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.Account.decode(a.message)})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateAccount",a=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/checklogin",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/v2/account/authenticate/confirmlogin",r=new Map,a="";a=JSON.stringify(e||{});let o=this.buildFullUrl(this.basePath,n,r),i=m("POST",t,a);return i.headers.Accept="application/x-protobuf",i.headers["Content-Type"]="application/json",Promise.race([fetch(o,i).then(c=>c),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/createqrlogin",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.LoginIDResponse.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/smsotp",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/emailotp",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/email",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,r,a,o,i={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/mezon",d=new Map;d.set("create",r),d.set("username",a),d.set("is_remember",o);let h="";h=JSON.stringify(n||{});let f=this.buildFullUrl(this.basePath,c,d),_=m("POST",i,h);return e&&(_.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),_.headers.Accept="application/x-protobuf",Promise.race([fetch(f,_).then(b=>l(this,null,function*(){if(!b.ok)throw b;let g=yield b.arrayBuffer();return s.Session.decode(new Uint8Array(g))})),new Promise((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkEmail",a=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkAccountConfirmRequest.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkSMS",a=s.AccountMezon.encode(s.AccountMezon.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkAccountConfirmRequest.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ConfirmLinkMezonOTP",a=s.LinkAccountConfirmRequest.encode(s.LinkAccountConfirmRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,o.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/account/authenticate/confirmotp",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.Session.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegistrationEmail",a=s.RegistrationEmailRequest.encode(s.RegistrationEmailRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SessionRefresh",i=s.SessionRefreshRequest.encode(s.SessionRefreshRequest.fromPartial(n)).finish(),c=m("POST",r,"");return c.body=i,e&&(c.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.Session.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkEmail",a=s.AccountEmail.encode(s.AccountEmail.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}unlinkMezon(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UnlinkMezon",a=s.AccountMezon.encode(s.AccountMezon.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listActivity(e={}){let t="/mezon.api.Mezon/ListActivity",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.ListUserActivity.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateActiviy",a=s.CreateActivityRequest.encode(s.CreateActivityRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UserActivity.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddApp",a=s.AddAppRequest.encode(s.AddAppRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.App.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,r={}){let a="/mezon.api.Mezon/ListApps",i=s.ListAppsRequest.encode(s.ListAppsRequest.fromPartial({filter:e,tombstones:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.AppList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n={}){if(e==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddAppToClan",o=s.AppClan.encode(s.AppClan.fromPartial({app_id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteApp",a=s.App.encode(s.App.fromPartial({id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getApp(e,t={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetApp",a=s.App.encode(s.App.fromPartial({id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.App.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateApp",o=s.UpdateAppRequest.encode(s.UpdateAppRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.App.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,r,a={}){let o="/mezon.api.Mezon/ListAuditLog",c=s.ListAuditLogRequest.encode(s.ListAuditLogRequest.fromPartial({clan_id:n,user_id:t,action_log:e,date_log:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListAuditLog.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateCategoryOrder",a=s.UpdateCategoryOrderRequest.encode(s.UpdateCategoryOrderRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,r,a,o={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/ListCategoryDescs",d=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:e,creator_id:t,category_name:n,category_id:r,category_order:a})).finish(),h=m("POST",o,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.CategoryDescList.decode(f.message)})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t={}){let n="/mezon.api.Mezon/ListChannelApps",a=s.ListChannelAppsRequest.encode(s.ListChannelAppsRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListChannelAppsResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,r,a={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/GetChannelCanvasList",c=s.ChannelCanvasListRequest.encode(s.ChannelCanvasListRequest.fromPartial({channel_id:e,clan_id:t,limit:n,page:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ChannelCanvasListResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddChannelFavorite",a=s.AddFavoriteChannelRequest.encode(s.AddFavoriteChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.AddFavoriteChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelFavorite",o=s.RemoveFavoriteChannelRequest.encode(s.RemoveFavoriteChannelRequest.fromPartial({channel_id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetListFavoriteChannel",a=s.ListFavoriteChannelRequest.encode(s.ListFavoriteChannelRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListFavoriteChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,r,a,o,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelMessages",h=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:e,channel_id:t,message_id:n,direction:r,limit:a,topic_id:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.ChannelMessageList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/AddChannelUsers",o=s.AddChannelUsersRequest.encode(s.AddChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,r,a,o,i,c,d={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let h="/mezon.api.Mezon/ListChannelAttachment",_=s.ListChannelAttachmentRequest.encode(s.ListChannelAttachmentRequest.fromPartial({channel_id:e,clan_id:t,file_type:n,limit:r,state:a,before:o,after:i,around:c})).finish(),b=m("POST",d,"");return b.body=_,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return s.ChannelAttachmentList.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetChanEncryptionMethod",o=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial({channel_id:e,method:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ChanEncryptionMethod.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/SetChanEncryptionMethod",o=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial(M(v({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/LeaveThread",o=s.LeaveThreadRequest.encode(s.LeaveThreadRequest.fromPartial({channel_id:t,clan_id:e})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ArchiveChannel",o=s.ArchiveChannelRequest.encode(s.ArchiveChannelRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListArchivedChannelDescs",a=s.ListArchivedChannelDescsRequest.encode(s.ListArchivedChannelDescsRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListArchivedChannelDescsResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveChannelUsers",o=s.RemoveChannelUsersRequest.encode(s.RemoveChannelUsersRequest.fromPartial({channel_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,r,a,o,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListChannelUsers",h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:a,cursor:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.ChannelUserList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/ListChannelDescs",h=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:e,state:t,page:n,clan_id:r,channel_type:a,is_mobile:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.ChannelDescList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelDesc",a=s.CreateChannelDescRequest.encode(s.CreateChannelDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelDescription.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n={}){let r="/mezon.api.Mezon/ListChannelUsersUC",o=s.AllUsersAddChannelRequest.encode(s.AllUsersAddChannelRequest.fromPartial({channel_id:e,limit:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.AllUsersAddChannelResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteChannelDesc",o=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateChannelDesc",o=s.UpdateChannelDescRequest.encode(s.UpdateChannelDescRequest.fromPartial(M(v({},t),{channel_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,r,a,o,i,c,d,h,f={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let _="/mezon.api.Mezon/ListChannelSetting",g=s.ChannelSettingListRequest.encode(s.ChannelSettingListRequest.fromPartial({clan_id:e,parent_id:t,category_id:n,active:a,private_channel:r,status:o,type:i,limit:c,page:d,channel_label:h})).finish(),A=m("POST",f,"");return A.body=g,Promise.race([this.send({urlPath:_,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return s.ChannelSettingListResponse.decode(C.message)})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n={}){let r="/mezon.api.Mezon/ListChannelVoiceUsers",o=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,limit:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.VoiceChannelUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,r={}){let a="/mezon.api.Mezon/ListClanDescs",i=s.ListClanDescRequest.encode(s.ListClanDescRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ClanDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanBadgeCount(){let e="/mezon.api.Mezon/ListClanBadgeCount",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return s.ListClanBadgeCountResponse.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,r={}){let a="/mezon.api.Mezon/ListChannelBadgeCount",i=s.ListChannelBadgeCountRequest.encode(s.ListChannelBadgeCountRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ListChannelBadgeCountResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,r={}){let a="/mezon.api.Mezon/ListUserOnline",i=s.ListUserOnlineRequest.encode(s.ListUserOnlineRequest.fromPartial({clan_id:e,limit:t!=null?t:0,page:n!=null?n:0})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ListUserOnlineResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanDesc",a=s.CreateClanDescRequest.encode(s.CreateClanDescRequest.fromPartial({clan_name:e.clan_name,logo:e.logo,banner:e.banner})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanDesc.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t={}){if(e==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteClanDesc",a=s.DeleteClanDescRequest.encode(s.DeleteClanDescRequest.fromPartial({clan_desc_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanDesc",o=s.UpdateClanDescRequest.encode(s.UpdateClanDescRequest.fromPartial(v({clan_id:e},t))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/RemoveClanUsers",o=s.RemoveClanUsersRequest.encode(s.RemoveClanUsersRequest.fromPartial({clan_id:e,user_ids:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n={}){let r="/mezon.api.Mezon/ListBannedUsers",o=s.BannedUserListRequest.encode(s.BannedUserListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.BannedUserList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,r,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/UnbanClanUsers",c=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,r,a={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/BanClanUsers",c=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:e,channel_id:t,user_ids:n,ban_time:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return{}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsers",a=s.ListClanUsersRequest.encode(s.ListClanUsersRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanUserList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanUsersStatus",a=s.ListClanUsersStatusRequest.encode(s.ListClanUsersStatusRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanUserStatusList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateCategoryDesc",a=s.CreateCategoryDescRequest.encode(s.CreateCategoryDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CategoryDesc.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CheckDuplicateName",a=s.CheckDuplicateNameRequest.encode(s.CheckDuplicateNameRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code==0)return s.CheckDuplicateNameResponse.decode(i.message);throw i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,r={}){if(e==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteCategoryDesc",i=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:e,clan_id:t,category_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,r,a={}){let o="/mezon.api.Mezon/RegistFCMDeviceToken",c=s.RegistFcmDeviceTokenRequest.encode(s.RegistFcmDeviceTokenRequest.fromPartial({token:e,device_id:t,platform:n,voip_token:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.RegistFcmDeviceTokenResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CloseDMByChannelId",a=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/OpenDMByChannelId",a=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateClanEmoji",a=s.ClanEmojiCreateRequest.encode(s.ClanEmojiCreateRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteByIdClanEmoji",i=s.ClanEmojiDeleteRequest.encode(s.ClanEmojiDeleteRequest.fromPartial({id:e,clan_id:t,emoji_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanEmojiById",o=s.ClanEmojiUpdateRequest.encode(s.ClanEmojiUpdateRequest.fromPartial({id:t.id,shortname:t.shortname,clan_id:t.clan_id})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e={}){let t="/mezon.api.Mezon/EmojiRecentList",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.EmojiRecentList.decode(a.message)})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e={}){let t="/mezon.api.Mezon/GetListEmojisByUserId",r=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return s.EmojiListedResponse.decode(a.message)})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMessage",a=s.SearchMessageRequest.encode(s.SearchMessageRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchMessageResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchCtrlK(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchCtrlK",a=s.SearchCtrlKRequest.encode(s.SearchCtrlKRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchCtrlKResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}searchMentionUsers(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SearchMentionUsers",a=s.SearchMentionUsersRequest.encode(s.SearchMentionUsersRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SearchMentionUsersResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateCDNSignature(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateCDNSignature",a=s.GenerateCDNSignatureRequest.encode(s.GenerateCDNSignatureRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GenerateCDNSignatureResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getStreamPlayback(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetStreamPlayback",a=s.GetStreamPlaybackRequest.encode(s.GetStreamPlaybackRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetStreamPlaybackResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setOverrideEveryoneChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetOverrideEveryoneChannel",a=s.SetOverrideEveryoneChannelRequest.encode(s.SetOverrideEveryoneChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getOverrideEveryoneChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetOverrideEveryoneChannel",a=s.GetOverrideEveryoneChannelRequest.encode(s.GetOverrideEveryoneChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetOverrideEveryoneChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getDMSetting(e={}){let t="/mezon.api.Mezon/GetDMSetting",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.DMSetting.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateDMSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateDMSetting",a=s.UpdateDMSettingRequest.encode(s.UpdateDMSettingRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.DMSetting.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}event(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",a=s.Event.encode(s.Event.fromPartial({external:e.external,name:e.name,properties:e.properties})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listEvents(e,t={}){let n="/mezon.api.Mezon/ListEvents",a=s.ListEventsRequest.encode(s.ListEventsRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EventList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateEvent",a=s.CreateEventRequest.encode(s.CreateEventRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EventManagement.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateEventUser",a=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,r,a,o={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteEvent",d=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:e,clan_id:t,creator_id:n,event_label:r,channel_id:a})).finish(),h=m("POST",o,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return{}})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n={}){if(e==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateEvent",o=s.UpdateEventRequest.encode(s.UpdateEventRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n={}){let r="/mezon.api.Mezon/DeleteFriends",o=s.DeleteFriendsRequest.encode(s.DeleteFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,r={}){let a="/mezon.api.Mezon/ListFriends",i=s.ListFriendsRequest.encode(s.ListFriendsRequest.fromPartial({limit:e,state:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.FriendList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n={}){let r="/mezon.api.Mezon/AddFriends",o=s.AddFriendsRequest.encode(s.AddFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.AddFriendsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n={}){let r="/mezon.api.Mezon/BlockFriends",o=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n={}){let r="/mezon.api.Mezon/UnblockFriends",o=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:e,usernames:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t={}){let n="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",a=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationChannelCategorySettingList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetUserProfileOnClan",a=s.ClanProfileRequest.encode(s.ClanProfileRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ClanProfile.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t={}){let n="/mezon.api.Mezon/GetNotificationCategory",a=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationUserChannel.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t={}){let n="/mezon.api.Mezon/GetNotificationChannel",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationUserChannel.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t={}){let n="/mezon.api.Mezon/GetNotificationClan",a=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotificationSetting.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t={}){let n="/mezon.api.Mezon/GetNotificationReactMessage",a=s.NotifiReactMessage.encode(s.NotifiReactMessage.fromPartial({channel_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.NotifiReactMessage.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e={}){let t="/mezon.api.Mezon/GetKeyServer",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.GetKeyServerResp.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateLinkInviteUser",a=s.LinkInviteUserRequest.encode(s.LinkInviteUserRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.LinkInviteUser.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t={}){if(e==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/InviteUser",a=s.InviteUserRequest.encode(s.InviteUserRequest.fromPartial({invite_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.InviteUserRes.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,r={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let a="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),o=new Map,i="",c=this.buildFullUrl(this.basePath,a,o),d=m("GET",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e={}){let t="/mezon.api.Mezon/ListChannelByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.ChannelDescList.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MarkAsRead",a=s.MarkAsReadRequest.encode(s.MarkAsReadRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e={}){let t="/mezon.api.Mezon/ListMezonOauthClient",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.MezonOauthClientList.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteCategory",a=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetMuteChannel",a=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n={}){let r="/mezon.api.Mezon/DeleteNotifications",o=s.DeleteNotificationsRequest.encode(s.DeleteNotificationsRequest.fromPartial({ids:e||[],category:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,r,a,o={}){let i="/mezon.api.Mezon/ListNotifications",d=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:e,clan_id:t,notification_id:n,category:r,direction:a})).finish(),h=m("POST",o,"");return h.body=d,Promise.race([this.send({urlPath:i,fetchOptions:h}).then(f=>l(this,null,function*(){if(f.code!=0)throw f;return s.NotificationList.decode(f.message)})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationChannelSetting",a=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationClanSetting",a=s.SetDefaultNotificationRequest.encode(s.SetDefaultNotificationRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationCategorySetting",a=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationCategorySetting",a=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t={}){let n="/mezon.api.Mezon/DeleteNotificationChannel",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t={}){let n="/mezon.api.Mezon/DeleteNotiReactMessage",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetNotificationReactMessage",a=s.NotificationChannel.encode(s.NotificationChannel.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SetRoleChannelPermission",a=s.UpdateRoleChannelRequest.encode(s.UpdateRoleChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}getListPermission(e={}){let t="/mezon.api.Mezon/GetListPermission",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.PermissionList.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,r={}){let a="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",i=s.PermissionRoleChannelListEventRequest.encode(s.PermissionRoleChannelListEventRequest.fromPartial({role_id:e,channel_id:t,user_id:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.PermissionRoleChannelListEventResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,r,a={}){let o="/mezon.api.Mezon/DeletePinMessage",c=s.DeletePinMessage.encode(s.DeletePinMessage.fromPartial({id:e,message_id:t,channel_id:n,clan_id:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,r={}){let a="/mezon.api.Mezon/GetPinMessagesList",i=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial({message_id:e,channel_id:t,clan_id:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.PinMessagesList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateMessage2Inbox",a=s.Message2InboxRequest.encode(s.Message2InboxRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelMessageHeader.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePinMessage",a=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelMessageHeader.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t={}){let n="/mezon.api.Mezon/GetPubKeys",a=s.GetPubKeysRequest.encode(s.GetPubKeysRequest.fromPartial({user_ids:e||[]})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GetPubKeysResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/PushPubKey",a=s.PushPubKeyRequest.encode(s.PushPubKeyRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddRolesChannelDesc",a=s.AddRoleChannelDescRequest.encode(s.AddRoleChannelDescRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n={}){if(e==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ChangeChannelCategory",o=s.ChangeChannelCategoryRequest.encode(s.ChangeChannelCategoryRequest.fromPartial(M(v({},t),{new_category_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteRoleChannelDesc",a=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,r,a={}){let o="/mezon.api.Mezon/ListRoles",c=s.RoleListEventRequest.encode(s.RoleListEventRequest.fromPartial({clan_id:e,limit:t,state:n,cursor:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.RoleListEventResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRole",a=s.CreateRoleRequest.encode(s.CreateRoleRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Role.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteRole",o=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,r,a={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteRole",c=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial({role_id:e,channel_id:t,clan_id:n,role_label:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateRole",o=s.UpdateRoleRequest.encode(s.UpdateRoleRequest.fromPartial(M(v({},t),{role_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListRolePermissions",a=s.ListPermissionsRequest.encode(s.ListPermissionsRequest.fromPartial({role_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.PermissionList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,r={}){if(e==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListRoleUsers",i=s.ListRoleUsersRequest.encode(s.ListRoleUsersRequest.fromPartial({role_id:e,limit:t,cursor:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.RoleUserList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetRoleOfUserInTheClan",o=s.ListPermissionOfUsersRequest.encode(s.ListPermissionOfUsersRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.RoleList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,r={}){let a="/mezon.api.Mezon/SearchThread",i=s.SearchThreadRequest.encode(s.SearchThreadRequest.fromPartial({clan_id:e,channel_id:t,label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ChannelDescList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SessionLogout",a=s.SessionLogoutRequest.encode(s.SessionLogoutRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddClanSticker",a=s.ClanStickerAddRequest.encode(s.ClanStickerAddRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteClanStickerById",i=s.ClanStickerDeleteRequest.encode(s.ClanStickerDeleteRequest.fromPartial({id:e,clan_id:t,sticker_label:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanStickerById",o=s.ClanStickerUpdateByIdRequest.encode(s.ClanStickerUpdateByIdRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e={}){let t="/mezon.api.Mezon/GetListStickersByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.StickerListedResponse.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RegisterStreamingChannel",a=s.RegisterStreamingChannelRequest.encode(s.RegisterStreamingChannelRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.RegisterStreamingChannelResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/ListStreamingChannelUsers",h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:e,channel_id:t,channel_type:n,limit:r,state:a,cursor:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.StreamingChannelUserList.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e={}){let t="/mezon.api.Mezon/GetSystemMessagesList",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.SystemMessagesList.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSystemMessage",a=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,r={}){let a="/mezon.api.Mezon/ListSdTopic",i=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.fromPartial({clan_id:e,limit:t,page:n})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.SdTopicList.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateSdTopic",a=s.SdTopicRequest.encode(s.SdTopicRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SdTopic.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSdTopic(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSdTopic",a=s.DeleteSdTopicRequest.encode(s.DeleteSdTopicRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DeleteSystemMessage",a=s.DeleteSystemMessage.encode(s.DeleteSystemMessage.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetSystemMessageByClanId",a=s.GetSystemMessage.encode(s.GetSystemMessage.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SystemMessage.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateSystemMessage",o=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,r,a,o,i={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListThreadDescs",h=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:e,limit:t,state:n,clan_id:r,thread_id:a,page:o})).finish(),f=m("POST",i,"");return f.body=h,Promise.race([this.send({urlPath:c,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return s.ChannelDescListNoPool.decode(_.message)})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateCategory",o=s.UpdateCategoryDescRequest.encode(s.UpdateCategoryDescRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelPrivate",a=s.ChangeChannelPrivateRequest.encode(s.ChangeChannelPrivateRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateUserProfileByClan",o=s.UpdateClanProfileRequest.encode(s.UpdateClanProfileRequest.fromPartial(M(v({},t),{clan_id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadOauthFile",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadAttachmentFile",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}uploadBatchAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UploadBatchAttachmentFile",a=s.UploadBatchAttachmentRequest.encode(s.UploadBatchAttachmentRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UploadAttachmentBatch.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",a=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MultipartUploadAttachment.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MultipartUploadAttachmentFileFinish",a=s.MultipartUploadAttachmentFinishRequest.encode(s.MultipartUploadAttachmentFinishRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}linkCDNFile(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/LinkCDNFile",a=s.LinkCDNFileRequest.encode(s.LinkCDNFileRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sfuBreakoutRoom(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SfuBreakoutRoom",a=s.SfuBreakoutRoomRequest.encode(s.SfuBreakoutRoomRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.SfuBreakoutRoomResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}sfuBreakoutMerge(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/SfuBreakoutMerge",a=s.SfuBreakoutMergeRequest.encode(s.SfuBreakoutMergeRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUser",a=s.UpdateUsersRequest.encode(s.UpdateUsersRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e={}){let t="/mezon.api.Mezon/ListUserClansByUserId",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.AllUserClans.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n={}){let r="/mezon.api.Mezon/ListUserPermissionInChannel",o=s.UserPermissionInChannelListRequest.encode(s.UserPermissionInChannelListRequest.fromPartial({clan_id:e,channel_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.UserPermissionInChannelListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e={}){let t="/mezon.api.Mezon/GetUserStatus",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.UserStatus.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserStatus",a=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUserCustomStatus",a=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateWebhook",a=s.WebhookCreateRequest.encode(s.WebhookCreateRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.WebhookGenerateResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateWebhookById",o=s.WebhookUpdateRequestById.encode(s.WebhookUpdateRequestById.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListWebhookByChannelId",o=s.WebhookListRequest.encode(s.WebhookListRequest.fromPartial({channel_id:e,clan_id:t||""})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.WebhookListResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteWebhookById",o=s.WebhookDeleteRequestById.encode(s.WebhookDeleteRequestById.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let r=e+t+"?";for(let[a,o]of n)o instanceof Array?r+=o.reduce((i,c)=>i+encodeURIComponent(a)+"="+encodeURIComponent(c)+"&",""):o!=null&&(r+=encodeURIComponent(a)+"="+encodeURIComponent(o)+"&");return r}editChannelCanvases(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/EditChannelCanvases",a=s.EditChannelCanvasRequest.encode(s.EditChannelCanvasRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.EditChannelCanvasResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,r={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetChannelCanvasDetail",i=s.ChannelCanvasDetailRequest.encode(s.ChannelCanvasDetailRequest.fromPartial({id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.ChannelCanvasDetailResponse.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,r={}){if(e==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteChannelCanvas",i=s.DeleteChannelCanvasRequest.encode(s.DeleteChannelCanvasRequest.fromPartial({canvas_id:e,clan_id:t||"",channel_id:n||""})).finish(),c=m("POST",r,"");return c.body=i,Promise.race([this.send({urlPath:a,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,r,a={}){let o="/mezon.api.Mezon/ListOnboarding",c=s.ListOnboardingRequest.encode(s.ListOnboardingRequest.fromPartial({clan_id:e,guide_type:t,limit:n,page:r})).finish(),d=m("POST",a,"");return d.body=c,Promise.race([this.send({urlPath:o,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListOnboardingResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateOnboarding",a=s.CreateOnboardingRequest.encode(s.CreateOnboardingRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListOnboardingResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteOnboarding",o=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/GetOnboardingDetail",o=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:e,clan_id:t||""})).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.OnboardingItem.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboarding",o=s.UpdateOnboardingRequest.encode(s.UpdateOnboardingRequest.fromPartial(M(v({},t),{id:e}))).finish(),i=m("POST",n,"");return i.body=o,Promise.race([this.send({urlPath:r,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return c})),new Promise((c,d)=>setTimeout(d,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateClanWebhook",a=s.GenerateClanWebhookRequest.encode(s.GenerateClanWebhookRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.GenerateClanWebhookResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListClanWebhook",a=s.ListClanWebhookRequest.encode(s.ListClanWebhookRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListClanWebhookResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/DeleteClanWebhookById",a={id:e,clan_id:t},i=s.ClanWebhookRequest.encode(s.ClanWebhookRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n={}){if(e==null)throw new Error("'id' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateClanWebhookById",a=M(v({},t),{id:e}),i=s.UpdateClanWebhookRequest.encode(s.UpdateClanWebhookRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t={}){let n="/mezon.api.Mezon/GetTopicDetail",r={topic_id:e},o=s.SdTopicDetailRequest.encode(s.SdTopicDetailRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.SdTopic.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,r={}){let a="/mezon.api.Mezon/ListOnboardingStep",o={clan_id:e,limit:t,page:n},c=s.ListOnboardingStepRequest.encode(s.ListOnboardingStepRequest.fromPartial(o)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.ListOnboardingStepResponse.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/UpdateOnboardingStep",a=M(v({},t),{clan_id:e}),i=s.UpdateOnboardingStepRequest.encode(s.UpdateOnboardingStepRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateRoomChannelApps",a=s.CreateRoomChannelApps.encode(s.CreateRoomChannelApps.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CreateRoomChannelApps.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GenerateMeetToken",a=s.GenerateMeetTokenRequest.encode(s.GenerateMeetTokenRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return console.log(i.message),Y(new Uint8Array(i.message))})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n={}){let r="/mezon.api.Mezon/GetMezonOauthClient",a={client_id:e,client_name:t},i=s.GetMezonOauthClientRequest.encode(s.GetMezonOauthClientRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return s.MezonOauthClient.decode(d.message)})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateMezonOauthClient",a=s.MezonOauthClient.encode(s.MezonOauthClient.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MezonOauthClient.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t={}){let n="/mezon.api.Mezon/GenerateHashChannelApps",r={app_id:e},o=s.GenerateHashChannelAppsRequest.encode(s.GenerateHashChannelAppsRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.GenerateHashChannelAppsResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddUserEvent",a=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n={}){let r="/mezon.api.Mezon/DeleteUserEvent",a={clan_id:e,event_id:t},i=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateRoleOrder",a=s.UpdateRoleOrderRequest.encode(s.UpdateRoleOrderRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e={}){let t="/mezon.api.Mezon/CreateExternalMezonMeet",n=m("POST",e,"");return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return s.GenerateMezonMeetResponse.decode(r.message)})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,r,a={}){if(e==null)throw new Error("'token' is a required parameter but is null or undefined.");let o="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(e))),i=new Map;i.set("username",t),i.set("metadata",n),i.set("is_guest",r);let c="",d=this.buildFullUrl(this.basePath,o,i),h=m("POST",a,c);return h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([fetch(d,h).then(f=>l(this,null,function*(){if(!f.ok)throw f;let _=yield f.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(_))})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/MuteParticipantMezonMeet",a=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/RemoveParticipantMezonMeet",a=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelDetail",r={channel_id:e},o=s.ListChannelDetailRequest.encode(s.ListChannelDetailRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ChannelDescription.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListChannelTimeline",a=s.ListChannelTimelineRequest.encode(s.ListChannelTimelineRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ListChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreateChannelTimeline",a=s.CreateChannelTimelineRequest.encode(s.CreateChannelTimelineRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.CreateChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateChannelTimeline",a=s.UpdateChannelTimelineRequest.encode(s.UpdateChannelTimelineRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.UpdateChannelTimelineResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t={}){if(!e)throw new Error("'request' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/DetailChannelTimeline",a=s.ChannelTimelineDetailRequest.encode(s.ChannelTimelineDetailRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.ChannelTimelineDetailResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateClanOrder",a=s.UpdateClanOrderRequest.encode(s.UpdateClanOrderRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,r={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/v2/clan/discover",o=new Map,i="";i=JSON.stringify(n||{});let c=this.buildFullUrl(this.basePath,a,o),d=m("POST",r,i);return e&&(d.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),d.headers.Accept="application/x-protobuf",d.headers["Content-Type"]="application/json",Promise.race([fetch(c,d).then(h=>l(this,null,function*(){if(!h.ok)throw h;let f=yield h.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(f))})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/DeleteQuickMenuAccess",d={id:e,clan_id:t,bot_id:n,menu_name:r,background:a,action_msg:o},f=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(d)).finish(),_=m("POST",i,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,r={}){let a="/mezon.api.Mezon/ListQuickMenuAccess",o={bot_id:e,channel_id:t,menu_type:n},c=s.ListQuickMenuAccessRequest.encode(s.ListQuickMenuAccessRequest.fromPartial(o)).finish(),d=m("POST",r,"");return d.body=c,Promise.race([this.send({urlPath:a,fetchOptions:d}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;return s.QuickMenuAccessList.decode(h.message)})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/AddQuickMenuAccess",a=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateQuickMenuAccess",a=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t={}){let n="/mezon.api.Mezon/ListForSaleItems",r={page:e},o=s.ListForSaleItemsRequest.encode(s.ListForSaleItemsRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.ForSaleItemList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsFollower",a=s.IsFollowerRequest.encode(s.IsFollowerRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.IsFollowerResponse.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/TransferOwnership",a=s.TransferOwnershipRequest.encode(s.TransferOwnershipRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return i})),new Promise((i,c)=>setTimeout(c,this.timeoutMs,"Request timed out."))])}updateUsername(e,t={}){if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/UpdateUsername",a=s.UpdateUsernameRequest.encode(s.UpdateUsernameRequest.fromPartial(e)).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.Session.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t={}){if(e==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/IsBanned",r={channel_id:e},o=s.IsBannedRequest.encode(s.IsBannedRequest.fromPartial(r)).finish(),i=m("POST",t,"");return i.body=o,Promise.race([this.send({urlPath:n,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return s.IsBannedResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n={}){let r="/mezon.api.Mezon/ReportMessageAbuse",a={message_id:e,abuse_type:t},i=s.ReportMessageAbuseReqest.encode(s.ReportMessageAbuseReqest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){let g="/mezon.api.Mezon/SendChannelMessage",C=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,content:a,mentions:o,attachments:i,references:c,anonymous_message:d,mention_everyone:h,avatar:f,code:_,topic_id:b})).finish(),R=m("POST",{},"");return R.body=C,Promise.race([this.send({urlPath:g,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return s.ChannelMessageAck.decode(w.message)})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}sendChannelMessageApi(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A={}){var te;let C="/mezon.api.Mezon/SendChannelMessage",R=new Map,w=typeof o=="string"?o:JSON.stringify(o!=null?o:{}),J=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:r,is_public:a,content:w,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g})).finish(),D=this.buildFullUrl((te=e.api_url)!=null?te:"",C,R),L=m("POST",A,"");return L.body=J,e.token&&(L.headers.Authorization="Bearer "+e.token),Promise.race([fetch(D,L).then(F=>l(this,null,function*(){if(!F.ok)throw F;if(F.status===204)return{};let Q=yield F.arrayBuffer();return s.ChannelMessageAck.decode(new Uint8Array(Q))})),new Promise((F,Q)=>setTimeout(()=>Q(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,r,a,o,i,c,d,h,f,_){let b="/mezon.api.Mezon/UpdateChannelMessage",A=s.ChannelMessageUpdate.encode(s.ChannelMessageUpdate.fromPartial({clan_id:e,channel_id:t,message_id:a,mode:n,is_public:r,content:o,mentions:i,attachments:c,create_time_seconds:d,hide_editted:h,topic_id:f,is_update_msg_topic:_})).finish(),C=m("POST",{},"");return C.body=A,Promise.race([this.send({urlPath:b,fetchOptions:C}).then(R=>l(this,null,function*(){if(R.code!=0)throw R;return s.ChannelMessageUpdate.decode(R.message)})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,r,a,o,i,c,d){let h="/mezon.api.Mezon/DeleteChannelMessage",_=s.ChannelMessageRemove.encode(s.ChannelMessageRemove.fromPartial({clan_id:e,channel_id:t,message_id:a,mode:n,is_public:r,has_attachment:o,mentions:c,references:d,topic_id:i})).finish(),b=m("POST",{},"");return b.body=_,Promise.race([this.send({urlPath:h,fetchOptions:b}).then(g=>l(this,null,function*(){if(g.code!=0)throw g;return s.ChannelMessageRemove.decode(g.message)})),new Promise((g,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,r,a,o={}){let i="/mezon.api.Mezon/UpdateMezonVoiceState",c={clan_id:e,channel_id:t,display_name:n,room_name:r,state:a},h=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(c)).finish(),f=m("POST",o,"");return f.body=h,Promise.race([this.send({urlPath:i,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return _})),new Promise((_,b)=>setTimeout(b,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/MessageButtonClick",d={message_id:e,channel_id:t,button_id:n,sender_id:r,user_id:a,extra_data:o},f=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(d)).finish(),_=m("POST",i,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,r,a,o,i={}){let c="/mezon.api.Mezon/DropdownBoxSelected",d={message_id:e,channel_id:t,selectbox_id:n,sender_id:r,user_id:a,values:o},f=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(d)).finish(),_=m("POST",i,"");return _.body=f,Promise.race([this.send({urlPath:c,fetchOptions:_}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;return b})),new Promise((b,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n={}){let r="/mezon.api.Mezon/ActiveArchivedThread",a={clan_id:e,channel_id:t},i=s.ActiveArchivedThread.encode(s.ActiveArchivedThread.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n={}){let r="/mezon.api.Mezon/AddAgentToChannel",a={room_name:e,channel_id:t},i=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n={}){let r="/mezon.api.Mezon/DisconnectAgent",a={room_name:e,channel_id:t},i=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(a)).finish(),c=m("POST",n,"");return c.body=i,Promise.race([this.send({urlPath:r,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return d})),new Promise((d,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t={}){if(e==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ListMutedChannel",a=s.ListMutedChannelRequest.encode(s.ListMutedChannelRequest.fromPartial({clan_id:e})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return s.MutedChannelList.decode(i.message)})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,r,a,o,i,c,d,h,f,_,b){let g="/mezon.api.Mezon/ReactChannelMessage",C=s.MessageReaction.encode(s.MessageReaction.fromPartial({clan_id:e,channel_id:t,mode:n,is_public:r,message_id:a,emoji_id:o,emoji:i,count:c,message_sender_id:d,action:h,emoji_recent_id:_,sender_name:b,topic_id:f})).finish(),R=m("POST",{},"");return R.body=C,Promise.race([this.send({urlPath:g,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return s.ChannelMessageSend.decode(w.message)})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t={}){var i,c,d,h,f,_;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/CreatePoll",a=s.CreatePollRequest.encode(s.CreatePollRequest.fromPartial({channel_id:(i=e.channel_id)!=null?i:"0",clan_id:(c=e.clan_id)!=null?c:"0",question:(d=e.question)!=null?d:"",answers:(h=e.answers)!=null?h:[],expire_hours:(f=e.expire_hours)!=null?f:0,type:(_=e.type)!=null?_:0})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(b=>l(this,null,function*(){if(b.code!=0)throw b;let g=s.CreatePollResponse.decode(b.message);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(A=>({index:A.index,label:A.label})),answer_counts:g.answer_counts,exp:g.exp,is_closed:g.is_closed,creator_id:g.creator_id,type:g.type,total_votes:g.total_votes}})),new Promise((b,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t={}){var i,c,d,h;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/VotePoll",a=s.VotePollRequest.encode(s.VotePollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0",answer_indices:(h=e.answer_indices)!=null?h:[]})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(f=>l(this,null,function*(){var b;let _=f.code==0?s.VotePollResponse.decode(f.message):{my_answer_indices:[]};return{my_answer_indices:Array.from((b=_.my_answer_indices)!=null?b:[])}})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t={}){var i,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/ClosePoll",a=s.ClosePollRequest.encode(s.ClosePollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(h=>{if(h.code==0)return{};throw h}),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t={}){var i,c,d;if(e==null)throw new Error("'body' is a required parameter but is null or undefined.");let n="/mezon.api.Mezon/GetPoll",a=s.GetPollRequest.encode(s.GetPollRequest.fromPartial({poll_id:(i=e.poll_id)!=null?i:"0",message_id:(c=e.message_id)!=null?c:"0",channel_id:(d=e.channel_id)!=null?d:"0"})).finish(),o=m("POST",t,"");return o.body=a,Promise.race([this.send({urlPath:n,fetchOptions:o}).then(h=>l(this,null,function*(){if(h.code!=0)throw h;let f=s.GetPollResponse.decode(h.message);return{poll_id:f.poll_id,message_id:f.message_id,question:f.question,answers:f.answers.map(_=>({index:_.index,label:_.label})),answer_counts:f.answer_counts,exp:f.exp,is_closed:f.is_closed,creator_id:f.creator_id,type:f.type,total_votes:f.total_votes,voter_details:f.voter_details.map(_=>({answer_index:_.answer_index,user_ids:_.user_ids}))}})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}followUsers(e){return l(this,null,function*(){let t="",n={status_follow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}joinClanChat(e){return l(this,null,function*(){let t="",n={clan_join:{clan_id:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}follower(){return l(this,null,function*(){let e="",t={follow_event:{}};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){if(n.code!=0)throw n;return{}})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,r){return l(this,null,function*(){let a="",o={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:a,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,r){let a="",o={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:r}};return Promise.race([this.send({urlPath:a,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,r,a,o,i,c,d){return l(this,null,function*(){let h="",f={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:a,is_public:r,has_attachment:o,topic_id:i,mentions:c,references:d}};return Promise.race([this.send({urlPath:h,fetchOptions:f}).then(_=>l(this,null,function*(){if(_.code!=0)throw _;return{}})),new Promise((_,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])})}unfollowUsers(e){let t="",n={status_unfollow:{user_ids:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,r,a,o,i,c,d,h,f,_){return l(this,null,function*(){let b="",g={channel_message_update:{clan_id:e,channel_id:t,message_id:a,content:o,mentions:i,attachments:c,create_time_seconds:d,mode:n,is_public:r,hide_editted:h,topic_id:f,is_update_msg_topic:_}};return Promise.race([this.send({urlPath:b,fetchOptions:g}).then(A=>l(this,null,function*(){if(A.code!=0)throw A;return{}})),new Promise((A,C)=>setTimeout(()=>C(new Error("Request timed out.")),this.timeoutMs))])})}updateStatus(e){let t="",n={status_update:{status:e}};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(r=>l(this,null,function*(){if(r.code!=0)throw r;return{}})),new Promise((r,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A,C){return l(this,null,function*(){let R="",w={clan_id:t,channel_id:n,mode:r,is_public:a,content:o,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g};A!=null&&String(A).length>0&&(w.id=A);let E={menu_name:e,message:w};C!=null&&String(C).length>0&&String(C)!=="0"&&(E.message_sender_id=C);let J={quick_menu_event:E};return Promise.race([this.send({urlPath:R,fetchOptions:J}).then(D=>l(this,null,function*(){if(D.code!=0)throw D;return{}})),new Promise((D,L)=>setTimeout(()=>L(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A){return l(this,null,function*(){let C="",R={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:r,is_public:a,content:o,mentions:i,attachments:c,references:d,anonymous_message:h,mention_everyone:f,avatar:_,code:b,topic_id:g,id:A}}};return Promise.race([this.send({urlPath:C,fetchOptions:R}).then(w=>l(this,null,function*(){if(w.code!=0)throw w;return{}})),new Promise((w,E)=>setTimeout(()=>E(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){return l(this,null,function*(){let g="",A={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:r,content:a,mentions:o,attachments:i,references:c,anonymous_message:d,mention_everyone:h,avatar:f,code:_,topic_id:b}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){var R;if(C.code!=0)throw C;return(R=C==null?void 0:C.message)==null?void 0:R.channel_message_ack})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){let A="",C={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:r,is_public:a,message_id:o,emoji_id:i,emoji:c,count:d,message_sender_id:h,action:f,topic_id:_,emoji_recent_id:b,sender_name:g}};return Promise.race([this.send({urlPath:A,fetchOptions:C}).then(R=>l(this,null,function*(){if(R.code!=0)throw R;return{}})),new Promise((R,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,r,a,o){return l(this,null,function*(){let i="",c={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:r,sender_display_name:a,topic_id:o}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,r,a,o){return l(this,null,function*(){let i="",c={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:r,timestamp_seconds:a,badge_count:o}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){return l(this,null,function*(){let g="",A={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:r,message_id:a,timestamp_seconds:o,operation:i,message_sender_avatar:c,message_sender_id:d,message_sender_username:h,message_content:f,message_attachment:_,message_created_time:b}};return Promise.race([this.send({urlPath:g,fetchOptions:A}).then(C=>l(this,null,function*(){if(C.code!=0)throw C;return{}})),new Promise((C,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,r){return l(this,null,function*(){let a="",o={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:r}};return Promise.race([this.send({urlPath:a,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return l(this,null,function*(){let n="",r={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a;return{}})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceInteractiveEvent(e,t,n,r,a,o){return l(this,null,function*(){let i="",c={voice_interactive_event:{clan_id:e,voice_channel_id:t,sender_id:n,receiver_id:r,event_type:a,params:o}};return Promise.race([this.send({urlPath:i,fetchOptions:c}).then(d=>l(this,null,function*(){if(d.code!=0)throw d;return{}})),new Promise((d,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,r,a){return l(this,null,function*(){let o="",i={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:r,caller_id:a}};return Promise.race([this.send({urlPath:o,fetchOptions:i}).then(c=>l(this,null,function*(){if(c.code!=0)throw c;return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,r){return l(this,null,function*(){let a="",o={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:r}};return Promise.race([this.send({urlPath:a,fetchOptions:o}).then(i=>l(this,null,function*(){if(i.code!=0)throw i;return{}})),new Promise((i,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return l(this,null,function*(){let r="",a={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:r,fetchOptions:a}).then(o=>l(this,null,function*(){if(o.code!=0)throw o;return{}})),new Promise((o,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}writeStreamingWatch(e,t){return l(this,null,function*(){let n="",r={streaming_watch:{channel_id:e,watching:t}};return Promise.race([this.send({urlPath:n,fetchOptions:r}).then(a=>l(this,null,function*(){if(a.code!=0)throw a})),new Promise((a,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}listLogedDevice(){return l(this,null,function*(){let e="/mezon.api.Mezon/ListLogedDevice",t={};return Promise.race([this.send({urlPath:e,fetchOptions:t}).then(n=>l(this,null,function*(){return n.code!=0?{}:s.LogedDeviceList.decode(n.message)})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])})}};V.DefaultSendTimeoutMs=1e4;var K=V;var Ue="127.0.0.1",De="7350",Le="defaultkey",Fe=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"};function U(y){return typeof Event=="function"?new Event(y):{type:y,target:null,currentTarget:null,bubbles:!1,cancelable:!1,defaultPrevented:!1,timeStamp:Date.now(),preventDefault:()=>{},stopPropagation:()=>{},stopImmediatePropagation:()=>{}}}var q=class q{constructor(e=Le,t=Ue,n=De,r=!1,a=Fe,o=!0){this.serverkey=e;this.timeout=a;this.autoFallbackHttp=o;this.verbose=!1;this._hasConnectedOnce=!1;this._connectAttemptSeq=0;this._heartbeatSuspended=!1;this._serverDisconnectStreak=0;this.host=t,this.port=n,this.useSSL=r;let c=`${r?"https://":"http://"}${t}:${n}`;this._heartbeatIntervalMs=q.DefaultHeartbeatIntervalMs,this._heartbeatTimeoutMs=q.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.serverDisconnectStreakLogoutThreshold=q.DefaultServerDisconnectStreakLogoutThreshold,this.transport=new K(e,a,c)}failConnect(e){let t=this._connectReject;this._connectReject=void 0,t&&t(e)}isOpen(){return this._connectionState===p.CONNECTED}connect(e,t,n=!1,r=!1,a=q.DefaultConnectTimeoutMs){var h,f;this.verbose=r;let o=((h=this._lastConnectArgs)==null?void 0:h.session_id)===e&&((f=this._lastConnectArgs)==null?void 0:f.url)===t;if(this._connectionState===p.CONNECTED&&this.transport.adapter.isOpen()&&o)return Promise.resolve();if(this._connectionState===p.CONNECTING&&this._connectPromise&&o)return this._connectPromise;(this._connectionState===p.CONNECTED||this._connectionState===p.CONNECTING)&&(this.failConnect(new Error("Connect superseded by new connect().")),this.transport.close(),this.markDisconnected("connect_superseded",U("close"),!1,!1)),this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this._connectAttemptSeq+=1,this._lastConnectArgs={session_id:e,url:t,createStatus:n,verbose:r,connectTimeoutMs:a};let i,c,d=new Promise((_,b)=>{i=_,c=b});this._connectPromise=d,this._connectReject=c,this._connectTimeoutTimer=setTimeout(()=>{this._connectionState===p.CONNECTING&&(this.markDisconnected("connect_timeout",U("timeout"),!0,!1),this.transport.close(),this.failConnect(new Error("TIME_OUT")))},a);try{this.transport.connect(e,t,n,r,{onMessage:(_,b,g)=>l(this,null,function*(){if(!g.cid)if(g.notifications)g.notifications.notifications.forEach(A=>{A.content=A.content?G(A.content):void 0,this.onnotification(A)});else if(g.voice_started_event)this.onvoicestarted(g.voice_started_event);else if(g.voice_ended_event)this.onvoiceended(g.voice_ended_event);else if(g.voice_joined_event)this.onvoicejoined(g.voice_joined_event);else if(g.voice_leaved_event)this.onvoiceleaved(g.voice_leaved_event);else if(g.channel_created_event)this.onchannelcreated(g.channel_created_event);else if(g.category_event)this.oncategoryevent(g.category_event);else if(g.role_event)this.onroleevent(g.role_event);else if(g.event_emoji)this.oneventemoji(g.event_emoji);else if(g.noti_user_channel)this.oneventnotiuserchannel(g.noti_user_channel);else if(g.webhook_event)this.oneventwebhook(g.webhook_event);else if(g.channel_deleted_event)this.onchanneldeleted(g.channel_deleted_event);else if(g.clan_deleted_event)this.onclandeleted(g.clan_deleted_event);else if(g.sticker_create_event)this.onstickercreated(g.sticker_create_event);else if(g.sticker_update_event)this.onstickerupdated(g.sticker_update_event);else if(g.sticker_delete_event)this.onstickerdeleted(g.sticker_delete_event);else if(g.channel_updated_event)this.onchannelupdated(g.channel_updated_event);else if(g.channel_archive_event)this.onchannelarchive(g.channel_archive_event);else if(g.delete_account_event)this.ondeleteaccount(g.delete_account_event);else if(g.clan_profile_updated_event)this.onclanprofileupdated(g.clan_profile_updated_event);else if(g.clan_updated_event)this.onclanupdated(g.clan_updated_event);else if(g.last_seen_message_event)this.onlastseenupdated(g.last_seen_message_event);else if(g.status_presence_event)this.onstatuspresence(g.status_presence_event);else if(g.channel_message){let A=$(g);this.onchannelmessage(A)}else g.message_typing_event?this.onmessagetyping(g.message_typing_event):g.message_reaction_event?this.onmessagereaction(g.message_reaction_event):g.channel_presence_event?this.onchannelpresence(g.channel_presence_event):g.last_pin_message_event?this.onpinmessage(g.last_pin_message_event):g.custom_status_event?this.oncustomstatus(g.custom_status_event):g.canvas_event?this.oncanvasevent(g.canvas_event):g.user_channel_added_event?this.onuserchanneladded(g.user_channel_added_event):g.add_clan_user_event?this.onuserclanadded(g.add_clan_user_event):g.user_profile_updated_event?this.onuserprofileupdate(g.user_profile_updated_event):g.user_channel_removed_event?this.onuserchannelremoved(g.user_channel_removed_event):g.block_friend?this.onblockfriend(g.block_friend):g.un_block_friend?this.onunblockfriend(g.un_block_friend):g.add_friend?this.onaddfriend(g.add_friend):g.remove_friend?this.onremovefriend(g.remove_friend):g.friend_state_updated?this.onfriendstateupdated(g.friend_state_updated):g.user_clan_removed_event?this.onuserclanremoved(g.user_clan_removed_event):g.clan_event_created?this.oneventcreated(g.clan_event_created):g.give_coffee_event?this.oncoffeegiven(g.give_coffee_event):g.role_assign_event?this.onroleassign(g.role_assign_event):g.streaming_started_event?this.onstreamingchannelstarted(g.streaming_started_event):g.streaming_ended_event?this.onstreamingchannelended(g.streaming_ended_event):g.streaming_joined_event?this.onstreamingchanneljoined(g.streaming_joined_event):g.streaming_leaved_event?this.onstreamingchannelleaved(g.streaming_leaved_event):g.streaming_viewer_count_event?this.onstreamingviewercount(g.streaming_viewer_count_event):g.permission_set_event?this.onpermissionset(g.permission_set_event):g.permission_changed_event?this.onpermissionchanged(g.permission_changed_event):g.unmute_event?this.onunmuteevent(g.unmute_event):g.token_sent_event?this.ontokensent(g.token_sent_event):g.message_button_clicked?this.onmessagebuttonclicked(g.message_button_clicked):g.dropdown_box_selected?this.onmessagedropdownboxselected(g.dropdown_box_selected):g.mark_as_read?this.onmarkasread(g.mark_as_read):g.voice_reaction_send?this.onvoicereactionmessage(g.voice_reaction_send):g.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(g.webrtc_signaling_fwd):g.list_activity?this.onactivityupdated(g.list_activity):g.sd_topic_event?this.onsdtopicevent(g.sd_topic_event):g.channel_app_event?this.onchannelappevent(g.channel_app_event):g.user_status_event?this.onuserstatusevent(g.user_status_event):g.join_channel_app_data?this.onjoinchannelappevent(g.join_channel_app_data):g.unpin_message_event?this.onunpinmessageevent(g.unpin_message_event):g.quick_menu_event?this.onquickmenuevent(g.quick_menu_event):g.meet_participant_event?this.onmeetparticipantevent(g.meet_participant_event):g.transfer_ownership_event?this.ontransferownership(g.transfer_ownership_event):g.ban_user_event?this.onbanneduser(g.ban_user_event):g.list_channel_users_banned_event?this.onlistchannelusersbanned(g.list_channel_users_banned_event):g.allow_anonymous_event?this.onallowanonymousevent(g.allow_anonymous_event):g.aiagent_enabled_event?this.onaiagentenabled(g.aiagent_enabled_event):g.refresh_session_event?this.onrefreshsession(g.refresh_session_event):g.topic_in_message_event?this.ontopicinmessage(g.topic_in_message_event):g.screen_share_event?this.onscreenshare(g.screen_share_event):g.voice_interactive_event?this.onvoiceinteractiveevent(g.voice_interactive_event):g.sfu_breakout_room_event?this.onsfubreakoutroomevent(g.sfu_breakout_room_event):g.pong?this.verbose&&typeof console!="undefined"&&console.log("Pong message received: %o",g):this.verbose&&typeof console!="undefined"&&console.log("Unrecognized message received: %o",g)}),onClose:_=>{let b=this._connectionState===p.CONNECTING;this.markDisconnected("transport_on_close",_,!0,!0),b&&this.failConnect(new Error("SOCKET_CLOSED_BEFORE_ESTABLISH"))},onOpen:_=>{this.verbose&&typeof console!="undefined"&&console.log(_);let b=this._hasConnectedOnce;this._hasConnectedOnce=!0,this.clearConnectTimeout(),this._serverDisconnectStreak=0,this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,i(),this._connectReject=void 0,b?this.onreconnect(_):this.onconnect(_)},onError:_=>{this.onerror(_),this._connectAttemptSeq+=1,this.failConnect(_ instanceof Error?_:new Error("Socket error during connect.")),this.transport.close(),this.markDisconnected("transport_on_error",_,!0,!1)}})}catch(_){let b=U("error");this.onerror(b),this.markDisconnected("connect_sync_throw",b,!0,!1),this.failConnect(_ instanceof Error?_:new Error(String(_)))}return d}setAutoReconnect(e){}disconnect(e=!0){this._lastConnectArgs=void 0,this.failConnect(new Error("Client disconnected.")),this.markDisconnected("client_disconnect",U("close"),e,!1),this.transport.close()}pingPong(){return l(this,null,function*(){if(!this.isOpen())return;let e=this._connectAttemptSeq;try{let t="",n={ping:{}};yield this.transport.send({urlPath:t,fetchOptions:n},this._heartbeatTimeoutMs)}catch(t){if(e!==this._connectAttemptSeq||this._connectionState!==p.CONNECTED)return;this.verbose&&typeof console!="undefined"&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this._connectAttemptSeq+=1,this.transport.adapter.isOpen()&&this.transport.close(),this.markDisconnected("heartbeat_unreachable",U("close"),!0,!1);return}e===this._connectAttemptSeq&&this.startHeartbeatLoop()})}startHeartbeatLoop(){this._heartbeatSuspended||(this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatIntervalMs))}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}markDisconnected(e,t=U("close"),n=!0,r=!1){this.verbose&&typeof console!="undefined"&&console.log(e);let a=this._connectionState===p.DISCONNECTED;if(this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this._connectPromise=void 0,a||n&&this.ondisconnect(t),r&&!a&&this.serverDisconnectStreakLogoutThreshold>0&&(this._serverDisconnectStreak+=1,this._serverDisconnectStreak>=this.serverDisconnectStreakLogoutThreshold)){let o=this._serverDisconnectStreak;this._serverDisconnectStreak=0,this.onserverdisconnectstreaklogout(t,o)}}onconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onreconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondisconnect(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onserverdisconnectstreaklogout(e,t){this.verbose&&typeof console!="undefined"&&console.log("Server disconnect streak reached: %o",t,e)}onerror(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagetyping(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagereaction(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelpresence(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserchanneladded(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserclanadded(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserprofileupdate(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserchannelremoved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onaddfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onremovefriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onfriendstateupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onblockfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunblockfriend(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserclanremoved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onnotification(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstatuspresence(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onpinmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceended(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicestarted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicejoined(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceleaved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelcreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncategoryevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onroleevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventemoji(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventnotiuserchannel(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventwebhook(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchanneldeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclandeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickercreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickerdeleted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstickerupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onchannelarchive(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ondeleteaccount(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclanprofileupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onclanupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onlastseenupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onheartbeattimeout(){this.verbose&&typeof console!="undefined"&&console.log("Heartbeat timeout.")}oncustomstatus(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncanvasevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oneventcreated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}oncoffeegiven(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onroleassign(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelstarted(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelended(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchanneljoined(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingchannelleaved(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onstreamingviewercount(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionset(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onpermissionchanged(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunmuteevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ontokensent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagebuttonclicked(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmessagedropdownboxselected(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmarkasread(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoicereactionmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onwebrtcsignalingfwd(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onactivityupdated(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onsdtopicevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onsfubreakoutroomevent(e){this.verbose&&window&&window.console&&console.log(e)}onchannelappevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onuserstatusevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onjoinchannelappevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onunpinmessageevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onquickmenuevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}ontransferownership(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onbanneduser(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onlistchannelusersbanned(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onmeetparticipantevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onallowanonymousevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onaiagentenabled(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onrefreshsession(e){this.verbose&&typeof console!="undefined"&&console.log(`Token refresh occurred. Token: ${e.token}`)}ontopicinmessage(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onscreenshare(e){this.verbose&&typeof console!="undefined"&&console.log(e)}onvoiceinteractiveevent(e){this.verbose&&typeof console!="undefined"&&console.log(e)}authenticateMezon(e,t,n,r,a={},o={}){let i={token:e,vars:a};return this.transport.authenticateMezon(this.serverkey,"",i,t,n,r,o).then(c=>({token:c.token||"",refresh_token:c.refresh_token||"",created:c.created||!1,api_url:c.api_url||"",ws_url:c.ws_url||"",id_token:c.id_token||"",is_remember:c.is_remember||!1,session_id:c.session_id||""}))}authenticateSMSOTPRequest(e,t,n){let r={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",r,t).then(a=>Promise.resolve(a))}authenticateEmailOTPRequest(e,t,n){let r={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",r,t).then(a=>Promise.resolve(a))}confirmAuthenticateOTP(e){return l(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}authenticateEmail(e,t,n,r){let a={username:n,account:{email:e,password:t,vars:r}};return this.transport.authenticateEmail(this.serverkey,"",a,n).then(o=>({token:o.token||"",refresh_token:o.refresh_token||"",created:o.created||!1,api_url:o.api_url||"",ws_url:o.ws_url||"",id_token:o.id_token||"",is_remember:o.is_remember||!1,session_id:o.session_id||""}))}addChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(t,n).then(r=>r!==void 0)})}addFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addFriends(t,n)})}blockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.blockFriends(t,n).then(r=>Promise.resolve(r!=null))})}unblockFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unblockFriends(t,n).then(r=>Promise.resolve(r!=null))})}uploadOauthFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(t)})}uploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(t)})}uploadBatchAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadBatchAttachmentFile(t)})}multipartUploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(t)})}multipartUploadAttachmentFileFinish(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(t)})}linkCDNFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkCDNFile(t)})}sfuBreakoutRoom(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sfuBreakoutRoom(t)})}sfuBreakoutMerge(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sfuBreakoutMerge(t)})}createChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(t).then(n=>Promise.resolve(n))})}createClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanDesc(t).then(n=>Promise.resolve(n))})}checkDuplicateName(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.checkDuplicateName(t)})}createCategoryDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(t).then(n=>Promise.resolve(n))})}createRole(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRole(t).then(n=>Promise.resolve(n))})}createEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createEvent(t).then(n=>Promise.resolve(n))})}addRolesChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addRolesChannelDesc(t).then(n=>n!==void 0)})}deleteRoleChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRoleChannelDesc(t).then(n=>n!==void 0)})}deleteApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteApp(t).then(n=>n!==void 0)})}deleteFriends(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteFriends(t,n).then(r=>r!==void 0)})}deleteChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelDesc(t,n).then(r=>r!==void 0)})}deleteClanDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanDesc(t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(t,n,r).then(a=>a!==void 0)})}deleteNotifications(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotifications(t,n).then(r=>Promise.resolve(r!=null))})}deleteRole(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(t,"0",n,r).then(()=>!0)})}deleteEvent(e,t,n,r,a,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(t,n,r,a,o).then(i=>i!==void 0)})}updateEventUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEventUser(t).then(n=>n!==void 0)})}emitEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.event(t).then(n=>Promise.resolve(n!=null))})}getAccount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getAccount(e.token)})}removeClanUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeClanUsers(t,n).then(r=>Promise.resolve(r!=null))})}listBannedUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listBannedUsers(t,n).then(r=>Promise.resolve(r))})}unbanClanUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(t,n,r).then(a=>Promise.resolve(a!=null))})}banClanUsers(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(t,n,r,a).then(o=>Promise.resolve(o!=null))})}removeChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelUsers(t,n).then(r=>Promise.resolve(r!=null))})}listChannelMessages(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(t,n,r,a,o,i).then(c=>{let d={messages:[],last_seen_message:c.last_seen_message,last_sent_message:c.last_sent_message};return c.messages==null||c.messages.forEach(h=>{let f,_,b,g,A;try{f=P(h.content)}catch(C){console.log("error parse content",C)}try{let C=N(h.reactions);_=(C==null?void 0:C.reactions)||C||P(h.reactions||"[]")}catch(C){_=P(h.reactions||"[]")}try{let C=B(h.mentions);b=(C==null?void 0:C.mentions)||C||P(h.mentions||"[]")}catch(C){b=P(h.mentions||"[]")}try{let C=x(h.attachments);g=(C==null?void 0:C.attachments)||C||P(h.attachments||"[]")}catch(C){g=P(h.attachments||"[]")}try{let C=W(h.references);A=(C==null?void 0:C.refs)||C||P(h.references||"[]")}catch(C){A=P(h.references||"[]")}d.messages.push({channel_id:h.channel_id,code:h.code?Number(h.code):0,id:h.message_id||"",sender_id:h.sender_id,username:h.username,display_name:h.display_name,avatar:h.avatar,content:f,channel_label:h.channel_label,clan_logo:h.clan_logo,category_name:h.category_name,clan_nick:h.clan_nick,clan_avatar:h.clan_avatar,attachments:g,mentions:b,reactions:_,references:A,clan_id:h.clan_id,create_time_seconds:h.create_time_seconds,update_time_seconds:h.update_time_seconds,hide_editted:h.hide_editted})}),Promise.resolve(d)})})}listChannelVoiceUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(t,n).then(r=>{let a={voice_channel_users:[]};return r.voice_channel_users==null||r.voice_channel_users.forEach(o=>{a.voice_channel_users.push({id:o.id,channel_id:o.channel_id,user_ids:o.user_ids,room_name:o.room_name,share_screen_ids:o.share_screen_ids})}),Promise.resolve(a)})})}listChannelUsers(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(t,n,r,o,a,i).then(c=>{let d={channel_users:[],cursor:c.cursor,channel_id:c.channel_id};return c.channel_users==null||c.channel_users.forEach(h=>{d.channel_users.push({user_id:h.user_id,role_id:h.role_id,thread_id:h.thread_id,clan_avatar:h.clan_avatar,clan_nick:h.clan_nick,id:h.id,clan_id:h.clan_id,added_by:h.added_by,is_banned:h.is_banned})}),Promise.resolve(d)})})}listChannelAttachments(e,t,n,r,a,o,i,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(n,t,r,o,a,i,c).then(d=>{let h={attachments:[]};return d.attachments==null||d.attachments.forEach(f=>{h.attachments.push({filename:f.filename,filesize:f.filesize,filetype:f.filetype,id:f.id,uploader:f.uploader,url:f.url,message_id:f.message_id,create_time_seconds:f.create_time_seconds,width:f.width,height:f.height})}),Promise.resolve(h)})})}listClanUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(t).then(n=>{let r={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(a=>{var o;r.clan_users.push({user:{avatar_url:a.user.avatar_url,create_time_seconds:a.user.create_time_seconds,display_name:a.user.display_name,edge_count:a.user.edge_count?Number(a.user.edge_count):0,id:a.user.id,lang_tag:a.user.lang_tag,location:a.user.location,online:a.user.online,is_mobile:(o=a.user)==null?void 0:o.is_mobile,timezone:a.user.timezone,update_time:a.user.update_time,username:a.user.username,user_status:a.user.user_status,status:a.user.status,about_me:a.user.about_me,mezon_id:a.user.mezon_id,list_nick_names:a.user.list_nick_names,phone_number:a.user.phone_number,join_time_seconds:a.user.join_time_seconds},role_id:a.role_id,clan_nick:a.clan_nick,clan_avatar:a.clan_avatar})}),Promise.resolve(r)})})}listClanUsersStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(t).then(n=>{let r={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(a=>{r.clan_user_statuses.push({user_id:a.user_id,user_status:a.user_status})}),Promise.resolve(r)})})}listChannelDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(t,n,r,a,o,i).then(c=>{let d={channeldesc:[],next_cursor:c.next_cursor,prev_cursor:c.prev_cursor,cacheable_cursor:c.cacheable_cursor};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listClanDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(t,n,r).then(a=>{let o={clandesc:[]};return a.clandesc==null||(o.clandesc=a.clandesc),Promise.resolve(o)})})}listClanBadgeCount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanBadgeCount().then(t=>{var n;return{list_badge:(n=t.list_badge)!=null?n:[]}})})}listChannelBadgeCount(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(t,n,r).then(a=>{var o;return{channeldesc:(o=a.channeldesc)!=null?o:[],total_count:a.total_count}})})}listUserOnline(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(t,n,r).then(a=>{var o;return{users:(o=a.users)!=null?o:[],total_count:a.total_count}})})}listCategoryDescs(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(t,n,r).then(a=>{let o={categorydesc:[]};return a.categorydesc==null||(o.categorydesc=a.categorydesc),Promise.resolve(o)})})}listEvents(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(t).then(n=>Promise.resolve(n))})}getListPermission(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRolePermissions(t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(t,n,r).then(a=>Promise.resolve(a))})}registFCMDeviceToken(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(t,n,r,a).then(o=>Promise.resolve(o))})}getUserProfileOnClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(t).then(n=>Promise.resolve(n))})}closeDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closeDirectMess(t).then(n=>n!==void 0)})}openDirectMess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.openDirectMess(t).then(n=>n!==void 0)})}confirmLinkMezonOTP(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLinkMezonOTP(t)})}linkSMS(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(t).then(n=>Promise.resolve(n))})}linkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkEmail(t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(n,t,r).then(a=>{let o={friends:[],cursor:a.cursor};return a.friends==null||a.friends.forEach(i=>{var c;o.friends.push({user:{avatar_url:i.user.avatar_url,create_time_seconds:i.user.create_time_seconds,display_name:i.user.display_name,edge_count:i.user.edge_count?Number(i.user.edge_count):0,id:i.user.id,lang_tag:i.user.lang_tag,location:i.user.location,online:i.user.online,timezone:i.user.timezone,update_time:i.user.update_time,username:i.user.username,is_mobile:(c=i.user)==null?void 0:c.is_mobile,user_status:i.user.user_status,status:i.user.status,mezon_id:i.user.mezon_id,list_nick_names:i.user.list_nick_names,phone_number:i.user.phone_number,about_me:i.user.about_me},state:i.state,source_id:i.source_id})}),Promise.resolve(o)})})}listNotifications(e,t,n,r,a,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(n,t,r,a,o).then(i=>{let c={cacheable_cursor:i.cacheable_cursor,notifications:[]};return i.notifications==null||i.notifications.forEach(d=>{c.notifications.push({id:d.id,subject:d.subject,content:d.content?G(d.content):void 0,code:d.code?Number(d.code):0,sender_id:d.sender_id,create_time_seconds:d.create_time_seconds,persistent:d.persistent,category:d.category})}),Promise.resolve(c)})})}sessionLogout(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout({refresh_token:n,token:t,device_id:r,platform:a}).then(o=>o!==void 0)})}unlinkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(t).then(n=>n!==void 0)})}unlinkMezon(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkMezon(t).then(n=>n!==void 0)})}updateUsername(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUsername(t).then(n=>Promise.resolve(n))})}updateAccount(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateAccount(t).then(n=>n!==void 0)})}updateChannelDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelDesc(t,n).then(r=>r!==void 0)})}updateClanDesc(e,t,n){return l(this,null,function*(){this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e));let r=v({},n);return r.hashtags!==void 0&&(r.hashtags=I(r.hashtags)),this.transport.updateClanDesc(t,r).then(a=>a!==void 0)})}updateCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategory(t,n).then(r=>r!==void 0)})}updateUserProfileByClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserProfileByClan(t,n).then(r=>r!==void 0)})}updateRole(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRole(t,n).then(()=>!0)})}updateEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateEvent(t,n).then(r=>r!==void 0)})}updateApp(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateApp(t,n).then(r=>Promise.resolve(r))})}createLinkInviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(t).then(n=>Promise.resolve(n))})}getLinkInvite(e){return l(this,null,function*(){return this.transport.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getRoleOfUserInTheClan(t).then(n=>Promise.resolve(n))})}inviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.inviteUser(t).then(n=>Promise.resolve(n))})}setNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationClanSetting(t).then(n=>n!==void 0)})}setNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationChannelSetting(t).then(n=>n!==void 0)})}setMuteCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteCategory(t).then(n=>n!==void 0)})}setMuteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setMuteChannel(t).then(n=>n!==void 0)})}updateChannelPrivate(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelPrivate(t).then(n=>n!==void 0)})}setNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationCategorySetting(t).then(n=>n!==void 0)})}deleteNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotificationChannel(t).then(n=>n!==void 0)})}setNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setNotificationReactMessage({channel_id:t}).then(n=>n!==void 0)})}deleteNotiReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteNotiReactMessage(t).then(n=>n!==void 0)})}searchMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMessage(t).then(n=>Promise.resolve(n))})}searchCtrlK(r,a){return l(this,arguments,function*(e,t,n={}){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchCtrlK(t,n).then(o=>Promise.resolve(o))})}searchMentionUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchMentionUsers(t).then(n=>Promise.resolve(n))})}generateCDNSignature(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateCDNSignature(t).then(n=>Promise.resolve(n))})}getStreamPlayback(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getStreamPlayback(t).then(n=>Promise.resolve(n))})}setOverrideEveryoneChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setOverrideEveryoneChannel(t).then(n=>Promise.resolve(n))})}getOverrideEveryoneChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOverrideEveryoneChannel(t).then(n=>Promise.resolve(n))})}getDMSetting(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getDMSetting().then(t=>Promise.resolve(t))})}updateDMSetting(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateDMSetting(t).then(n=>Promise.resolve(n))})}createMessage2Inbox(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createMessage2Inbox(t).then(n=>Promise.resolve(n))})}createPinMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPinMessage(t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(t,n,r).then(a=>{let o={pin_messages_list:[]};return a.pin_messages_list==null||a.pin_messages_list.forEach(i=>{o.pin_messages_list.push({id:i.id,avatar:i.avatar,channel_id:i.channel_id,content:i.content,create_time_seconds:i.create_time_seconds,message_id:i.message_id,sender_id:i.sender_id,username:i.username,attachment:i.attachment})}),Promise.resolve(o)})})}deletePinMessage(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(t,n,r,a).then(o=>o!==void 0)})}createClanEmoji(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createClanEmoji(t).then(n=>n!==void 0)})}updateClanEmojiById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanEmojiById(t,n).then(r=>r!==void 0)})}deleteByIdClanEmoji(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(t,n,r).then(a=>a!==void 0)})}generateWebhookLink(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateWebhook(t).then(n=>Promise.resolve(n))})}listWebhookByChannelId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listWebhookByChannelId(t,n).then(r=>Promise.resolve(r))})}updateWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(t,n).then(r=>r!==void 0)})}deleteWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteWebhookById(t,n).then(r=>r!==void 0)})}addClanSticker(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addClanSticker(t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(t,n,r).then(a=>a!==void 0)})}updateClanStickerById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanStickerById(t,n).then(r=>r!==void 0)})}changeChannelCategory(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.changeChannelCategory(t,n).then(r=>r!==void 0)})}setRoleChannelPermission(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setRoleChannelPermission(t).then(n=>n!==void 0)})}addApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addApp(t).then(n=>Promise.resolve(n))})}getApp(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getApp(t).then(n=>Promise.resolve(n))})}listApps(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAppToClan(t,n).then(r=>r!==void 0)})}getSystemMessagesList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getSystemMessageByClanId(t).then(n=>Promise.resolve(n))})}createSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSystemMessage(t).then(n=>Promise.resolve(n))})}updateSystemMessage(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateSystemMessage(t,n).then(r=>Promise.resolve(r))})}deleteSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(t).then(n=>Promise.resolve(n))})}updateCategoryOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateCategoryOrder(t).then(n=>Promise.resolve(n))})}listStreamingChannelUsers(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(t,n,r,o,a,i).then(c=>{let d={streaming_channel_users:[]};return c.streaming_channel_users==null||c.streaming_channel_users.forEach(h=>{d.streaming_channel_users.push({id:h.id,channel_id:h.channel_id,user_id:h.user_id,participant:h.participant,is_publisher:h.is_publisher})}),Promise.resolve(d)})})}registerStreamingChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(t).then(n=>n!==void 0)})}listChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelApps(t).then(n=>{let r={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(a=>{r.channel_apps.push({id:a.id,channel_id:a.channel_id,app_id:a.app_id,clan_id:a.clan_id,app_url:a.app_url,app_name:a.app_name,app_logo:a.app_logo})}),Promise.resolve(r)})})}getChannelCategoryNotiSettingsList(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(t).then(n=>Promise.resolve(n))})}getNotificationCategory(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationCategory(t).then(n=>Promise.resolve(n))})}getNotificationChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationChannel(t).then(n=>Promise.resolve(n))})}getNotificationClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationClan(t).then(n=>Promise.resolve(n))})}getNotificationReactMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getNotificationReactMessage(t).then(n=>Promise.resolve(n))})}listChannelByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsersUC(t,n).then(r=>Promise.resolve(r))})}getListEmojisByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(t,n,r,a).then(o=>{let i={clan_id:t,roles:o.roles};return Promise.resolve(i)})})}listUserPermissionInChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserPermissionInChannel(t,n).then(r=>{let a={clan_id:t,channel_id:n,permissions:r.permissions};return Promise.resolve(a)})})}getPermissionByRoleIdChannelId(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(t,n,r).then(a=>{let o={role_id:t,channel_id:n,permission_role_channel:a.permission_role_channel,user_id:r};return Promise.resolve(o)})})}markAsRead(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(t,n,r,a,o,i).then(c=>{let d={channeldesc:[]};return c.channeldesc==null||(d.channeldesc=c.channeldesc),Promise.resolve(d)})})}listChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(t).then(n=>{var r;return(r=n.events)==null||r.forEach(a=>{a.attachments=[];let o;try{let i=T(a.preview_imgs);o=(i==null?void 0:i.attachments)||i||P(a.preview_imgs||"[]")}catch(i){o=P(a.preview_imgs||"[]")}Array.isArray(o)?a.preview_imgs=o:a.preview_imgs=[]}),Promise.resolve(n)})})}createChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelTimeline(t).then(n=>{let r=n.event;if(r){let a,o;try{let i=T(r.attachments),c=T(r.preview_imgs);a=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),o=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){a=P(r.attachments||"[]"),o=P(r.preview_imgs||"[]")}Array.isArray(a)?r.attachments=a:r.attachments=[],Array.isArray(o)?r.preview_imgs=o:r.preview_imgs=[]}return Promise.resolve(n)})})}updateChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelTimeline(t).then(n=>{let r=n.event;if(r){let a,o;try{let i=T(r.attachments),c=T(r.preview_imgs);a=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),o=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){a=P(r.attachments||"[]"),o=P(r.preview_imgs||"[]")}Array.isArray(a)?r.attachments=a:r.attachments=[],Array.isArray(o)?r.preview_imgs=o:r.preview_imgs=[]}return Promise.resolve(n)})})}detailChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.detailChannelTimeline(t).then(n=>{let r=n.event;if(r){let a,o;try{let i=T(r.attachments),c=T(r.preview_imgs);a=(i==null?void 0:i.attachments)||i||P(r.attachments||"[]"),o=(c==null?void 0:c.attachments)||c||P(r.preview_imgs||"[]")}catch(i){a=P(r.attachments||"[]"),o=P(r.preview_imgs||"[]")}Array.isArray(a)?r.attachments=a:r.attachments=[],Array.isArray(o)?r.preview_imgs=o:r.preview_imgs=[]}return Promise.resolve(n)})})}leaveThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveThread(t,n).then(r=>Promise.resolve(r))})}archiveChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(t,n).then(r=>Promise.resolve(r))})}listArchivedChannelDescs(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,r,a,o,i,c,d,h,f){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(t,n,r,a,o,i,c,d,h,f).then(_=>Promise.resolve(_))})}getChannelCanvasList(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(t,n,r,a).then(o=>{let i={channel_canvases:[]};return o.channel_canvases==null||(i.clan_id=o.clan_id,i.channel_id=o.channel_id,i.channel_canvases=o.channel_canvases,i.count=o.count),Promise.resolve(i)})})}getChannelCanvasDetail(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(t,n,r).then(a=>Promise.resolve(a))})}editChannelCanvases(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(t,n,r).then(a=>a!==void 0)})}addFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelFavorite({channel_id:t,clan_id:n}).then(r=>r)})}removeFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(t,n).then(r=>r)})}getListFavoriteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(t).then(n=>n)})}listActivity(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createActiviy(t).then(n=>n)})}createQRLogin(e){return l(this,null,function*(){let t=yield this.transport.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return l(this,null,function*(){let t=yield this.transport.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?{token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}:null})}confirmLogin(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(t).then(n=>n)})}getChanEncryptionMethod(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(t).then(n=>n)})}setChanEncryptionMethod(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.setChanEncryptionMethod(t,{method:n}).then(r=>r)})}getPubKeys(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(t).then(n=>n)})}pushPubKey(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.pushPubKey({PK:t}).then(n=>n)})}getKeyServer(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(t,n,r,a).then(o=>o)})}listOnboarding(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(t,n,r,a).then(o=>o)})}getOnboardingDetail(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(t,n).then(r=>Promise.resolve(r))})}createOnboarding(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(t).then(n=>n)})}updateOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboarding(t,n).then(r=>r!==void 0)})}deleteOnboarding(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteOnboarding(t,n).then(r=>r!==void 0)})}generateClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateClanWebhook(t).then(n=>Promise.resolve(n))})}listClanWebhook(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanWebhook(t).then(n=>Promise.resolve(n))})}deleteClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanWebhookById(t,n).then(r=>r!==void 0)})}updateClanWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanWebhookById(t,n).then(r=>r!==void 0)})}listOnboardingStep(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(t,n,r).then(a=>Promise.resolve(a))})}updateOnboardingStepByClanId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(t,n).then(r=>r!==void 0)})}updateUserStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserStatus(t).then(n=>n!==void 0)})}updateUserCustomStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateUserCustomStatus(t).then(n=>n!==void 0)})}getUserStatus(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(t,n,r).then(a=>Promise.resolve(a))})}createSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(t).then(n=>n)})}deleteSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSdTopic(t)})}getTopicDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(t).then(n=>Promise.resolve(n))})}createRoomChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createRoomChannelApps(t).then(n=>Promise.resolve(n))})}generateMeetToken(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateMeetToken(t).then(n=>Promise.resolve(n))})}listMezonOauthClient(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getMezonOauthClient(t,n).then(r=>Promise.resolve(r))})}updateMezonOauthClient(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(t,n,r).then(a=>Promise.resolve(a))})}generateHashChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail({email:t,password:n,old_password:r}).then(a=>Promise.resolve(a))})}addUserEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(t).then(n=>n!==void 0)})}deleteUserEvent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteUserEvent(t,n).then(r=>r!==void 0)})}updateRoleOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateRoleOrder(t).then(n=>Promise.resolve(n))})}deleteAccount(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,n,r){return l(this,null,function*(){return this.transport.generateMeetTokenExternal(e,t,n,r).then(a=>Promise.resolve(a))})}removeMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}muteMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.muteParticipantMezonMeet(t).then(n=>Promise.resolve(n))})}updateClanOrder(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanOrder(t).then(n=>n!==void 0)})}listClanDiscover(e){return l(this,null,function*(){let t=v({},e);return t.hashtags!==void 0&&(t.hashtags=I(t.hashtags)),this.transport.clanDiscover(this.serverkey,"",t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(t,n,r).then(a=>Promise.resolve(a))})}deleteQuickMenuAccess(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(t,n).then(r=>r!==void 0)})}addQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addQuickMenuAccess(t).then(n=>n!==void 0)})}updateQuickMenuAccess(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateQuickMenuAccess(t).then(n=>n!==void 0)})}listForSaleItems(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listForSaleItems(t).then(n=>Promise.resolve(n))})}isFollower(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isFollower(t).then(n=>Promise.resolve(n))})}transferOwnership(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.transferOwnership(t).then(n=>n!==void 0)})}isBanned(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.isBanned(t).then(n=>Promise.resolve(n))})}reportMessageAbuse(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.reportMessageAbuse(t,n).then(r=>r!==void 0)})}updateMezonVoiceState(e,t,n,r,a,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(t,n,r,a,o).then(i=>i!==void 0)})}sendChannelMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(t,n,r,a,o,i,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}sendChannelMessageApi(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.transport.sendChannelMessageApi(e,t,n,r,a,o,i,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(t,n,r,a,o,i,c,d,h,f,_,b).then(g=>Promise.resolve(g))})}deleteChannelMessage(e,t,n,r,a,o,i,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(t,n,r,a,o,i,c,d,h).then(f=>Promise.resolve(f))})}messageButtonClick(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(t,n,r,a,o,i).then(c=>Promise.resolve(c))})}dropdownBoxSelected(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(t,n,r,a,o,i).then(c=>Promise.resolve(c))})}activeArchivedThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(t,n).then(r=>Promise.resolve(r))})}addAgentToChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(t,n).then(r=>Promise.resolve(r))})}disconnectAgent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(t,n).then(r=>Promise.resolve(r))})}listMutedChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(t,n,r,a,o,i,c,d,h,f,_,b,g).then(A=>Promise.resolve(A))})}createPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(t)})}votePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(t)})}closePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(t)})}getPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(t)})}followUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.followUsers(t)})}joinClanChat(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinClanChat(t)})}follower(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.follower()})}joinChat(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,r,a)})}leaveChat(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,r,a)})}removeChatMessage(e,t,n,r,a,o,i,c,d,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,r,a,o,i,c,d,h)})}unfollowUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unfollowUsers(t)})}updateChatMessage(e,t,n,r,a,o,i,c,d,h,f,_,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,r,a,o,i,c,d,h,f,_,b)})}updateStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateStatus(t)})}writeQuickMenuEvent(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A,C,R){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,r,a,o,i,c,d,h,f,_,b,g,A,C,R)})}writeEphemeralMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A,C){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,r,a,o,i,c,d,h,f,_,b,g,A,C)})}writeChatMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,r,a,o,i,c,d,h,f,_,b,g)})}writeMessageReaction(e,t,n,r,a,o,i,c,d,h,f,_,b,g,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,r,a,o,i,c,d,h,f,_,b,g,A)})}writeMessageTyping(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,r,a,o,i)})}writeLastSeenMessage(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,r,a,o,i)})}writeLastPinMessage(e,t,n,r,a,o,i,c,d,h,f,_,b,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,r,a,o,i,c,d,h,f,_,b,g)})}writeCustomStatus(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,r,a)})}writeVoiceReaction(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceReaction(t,n)})}writeVoiceInteractiveEvent(e,t,n,r,a,o,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeVoiceInteractiveEvent(t,n,r,a,o,i)})}forwardWebrtcSignaling(e,t,n,r,a,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,r,a,o)})}makeCallPush(e,t,n,r,a){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,r,a)})}writeChannelAppEvent(e,t,n,r){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,r)})}writeStreamingWatch(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeStreamingWatch(t,n)})}listLogedDevice(e){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listLogedDevice()})}refreshSession(e){return l(this,null,function*(){return this.transport.sessionRefresh(this.serverkey,"",e).then(t=>({token:t.token||"",refresh_token:t.refresh_token||"",created:t.created||!1,api_url:t.api_url||"",ws_url:t.ws_url||"",id_token:t.id_token||"",is_remember:t.is_remember||!1,session_id:t.session_id||""}))})}};q.DefaultHeartbeatIntervalMs=1e4,q.DefaultHeartbeatTimeoutMs=1e4,q.DefaultConnectTimeoutMs=3e4,q.DefaultServerDisconnectStreakLogoutThreshold=3;var ee=q;
|