mezon-js 2.15.19 → 2.15.21
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/README.md +244 -244
- package/dist/client.d.ts +119 -177
- package/dist/index.d.ts +1 -6
- 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/transport.d.ts +513 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{api.gen.d.ts → types.d.ts} +1188 -426
- package/package.json +71 -71
- package/dist/api.d.ts +0 -2604
- package/dist/config.d.ts +0 -13
- package/dist/socket.d.ts +0 -1194
package/dist/mezon-js.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var mezonjs=(()=>{var ce=Object.create;var W=Object.defineProperty,de=Object.defineProperties,he=Object.getOwnPropertyDescriptor,me=Object.getOwnPropertyDescriptors,fe=Object.getOwnPropertyNames,X=Object.getOwnPropertySymbols,pe=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var ee=(y,e,t)=>e in y?W(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,M=(y,e)=>{for(var t in e||(e={}))te.call(e,t)&&ee(y,t,e[t]);if(X)for(var t of X(e))ge.call(e,t)&&ee(y,t,e[t]);return y},S=(y,e)=>de(y,me(e));var L=(y=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(y,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):y)(function(y){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+y+'" is not supported')});var _e=(y,e)=>{for(var t in e)W(y,t,{get:e[t],enumerable:!0})},ne=(y,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of fe(e))!te.call(y,a)&&a!==t&&W(y,a,{get:()=>e[a],enumerable:!(i=he(e,a))||i.enumerable});return y};var K=(y,e,t)=>(t=y!=null?ce(pe(y)):{},ne(e||!y||!y.__esModule?W(t,"default",{value:y,enumerable:!0}):t,y)),ye=y=>ne(W({},"__esModule",{value:!0}),y);var m=(y,e,t)=>new Promise((i,a)=>{var l=u=>{try{c(t.next(u))}catch(o){a(o)}},d=u=>{try{c(t.throw(u))}catch(o){a(o)}},c=u=>u.done?i(u.value):Promise.resolve(u.value).then(l,d);c((t=t.apply(y,e)).next())});var ze={};_e(ze,{ChannelStreamMode:()=>oe,ChannelType:()=>ae,Client:()=>Z,ConnectionState:()=>q,DefaultSocket:()=>T,NotificationType:()=>ue,RefreshTokenManager:()=>H,Session:()=>O,WebrtcSignalingType:()=>le,b64DecodeUnicode:()=>Pe,b64EncodeUnicode:()=>Ae,buildFetchOptions:()=>p,decodeAttachments:()=>N,decodeChannelTimelineAttachments:()=>B,decodeMentions:()=>F,decodeNotificationFcm:()=>G,decodeReactions:()=>j,decodeRefs:()=>I,encodeAttachments:()=>we,encodeMentions:()=>be,encodeNotificationFcm:()=>ve,encodeReactions:()=>Ce,encodeRefs:()=>Re,getFetcher:()=>g,resetFetchStrategy:()=>Se,safeJSONParse:()=>b,setFetchStrategy:()=>Me});var wr=L("whatwg-fetch");var J=L("js-base64"),C=K(L("mezon-js-protobuf"));function p(y,e,t){let i=M({method:y},e);return i.headers=M({},e.headers),Object.keys(i.headers).includes("Accept")||(i.headers.Accept="application/proto"),Object.keys(i.headers).includes("Content-Type")||(i.headers["Content-Type"]="application/proto"),Object.keys(i.headers).forEach(a=>{i.headers[a]||delete i.headers[a]}),t&&(i.body=t),i}function Ae(y){return(0,J.encode)(encodeURIComponent(y).replace(/%([0-9A-F]{2})/g,function(t,i){return String.fromCharCode(+("0x"+i))}))}function Pe(y){return decodeURIComponent((0,J.decode)(y).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function b(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 i=e.replace(/\n/g,"\\n").replace(/\r/g,"\\r");return JSON.parse(i)}catch(i){return console.error("JSON Parse failed completely:",{original:e,error:i}),{t:e}}}}var D=y=>!y||y===null||y===void 0||y===""||y==="[]";function F(y){if(D(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,a=new Uint8Array(i);return C.MessageMentionList.decode(a)}catch(i){return b(y)}}function N(y){if(D(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,a=new Uint8Array(i);return C.MessageAttachmentList.decode(a)}catch(i){return b(y)}}function B(y){if(D(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,a=new Uint8Array(i);return C.ListChannelTimelineAttachment.decode(a)}catch(i){return b(y)}}function I(y){if(D(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,a=new Uint8Array(i);return C.MessageRefList.decode(a)}catch(i){return b(y)}}function j(y){if(D(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,a=new Uint8Array(i);return C.MessageReactionList.decode(a)}catch(i){return b(y)}}function G(y){if(D(y))return;let e=y[0];if(e===91||e===123)return b(y);try{let i=y,a=new Uint8Array(i);return C.DirectFcmProto.decode(a)}catch(i){return b(y)}}function be(y){return C.MessageMentionList.encode(C.MessageMentionList.fromPartial(y)).finish()}function we(y){return C.MessageAttachmentList.encode(C.MessageAttachmentList.fromPartial(y)).finish()}function Re(y){return C.MessageRefList.encode(C.MessageRefList.fromPartial(y)).finish()}function Ce(y){return C.MessageReactionList.encode(C.MessageReactionList.fromPartial(y)).finish()}function ve(y){return C.DirectFcmProto.encode(C.DirectFcmProto.fromPartial(y)).finish()}var k=L("js-base64"),s=K(L("mezon-js-protobuf"));var Q=fetch,Me=y=>{Q=y},Se=()=>{Q=fetch},g=()=>Q;var V=class{constructor(e,t,i){this.serverKey=e;this.timeoutMs=t;this.basePath=i}setBasePath(e){this.basePath=e}deleteAccount(e,t={}){let i="/mezon.api.Mezon/DeleteAccount",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>{if(u.status==204)return u;if(u.status>=200&&u.status<300)return u;throw u}),new Promise((u,o)=>setTimeout(o,this.timeoutMs,"Request timed out."))])}getAccount(e,t={}){let i="/mezon.api.Mezon/GetAccount",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.Account.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateAccount",l=new Map,c=s.UpdateAccountRequest.encode(s.UpdateAccountRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/checklogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/confirmlogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(t,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/createqrlogin",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LoginIDResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/smsotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/emailotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/email",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,i,a,l,d,c={}){if(i==null)throw new Error("'account' is a required parameter but is null or undefined.");let u="/v2/account/authenticate/mezon",o=new Map;o.set("create",a),o.set("username",l),o.set("is_remember",d);let n="";n=JSON.stringify(i||{});let r=this.buildFullUrl(this.basePath,u,o),h=p("POST",c,n);return e&&(h.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),h.headers.Accept="application/x-protobuf",Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.Session.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/LinkEmail",l=new Map,c=s.AccountEmail.encode(s.AccountEmail.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/LinkSMS",l=new Map,c=s.AccountMezon.encode(s.AccountMezon.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkAccountConfirmRequest.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ConfirmLinkMezonOTP",l=new Map,c=s.LinkAccountConfirmRequest.encode(s.LinkAccountConfirmRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),o.headers.Accept="application/x-protobuf",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/v2/account/authenticate/confirmotp",d=new Map,c="";c=JSON.stringify(i||{});let u=this.buildFullUrl(this.basePath,l,d),o=p("POST",a,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/RegistrationEmail",l=new Map,c=s.RegistrationEmailRequest.encode(s.RegistrationEmailRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,i,a={}){if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/SessionRefresh",d=new Map,u=s.SessionRefreshRequest.encode(s.SessionRefreshRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.Session.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UnlinkEmail",l=new Map,c=s.AccountEmail.encode(s.AccountEmail.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listActivity(e,t={}){let i="/mezon.api.Mezon/ListActivity",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.ListUserActivity.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateActiviy",l=new Map,c=s.CreateActivityRequest.encode(s.CreateActivityRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UserActivity.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddApp",l=new Map,c=s.AddAppRequest.encode(s.AddAppRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.App.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListApps",c=new Map,o=s.ListAppsRequest.encode(s.ListAppsRequest.fromPartial({filter:t,tombstones:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.AppList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,i,a={}){if(t==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/AddAppToClan",d=new Map,u=s.AppClan.encode(s.AppClan.fromPartial({app_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteApp(e,t,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteApp",l=new Map,c=s.App.encode(s.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return n;throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}getApp(e,t,i={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetApp",l=new Map,c=s.App.encode(s.App.fromPartial({id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.App.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateApp",d=new Map,u=s.UpdateAppRequest.encode(s.UpdateAppRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.App.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListAuditLog",u=new Map,n=s.ListAuditLogRequest.encode(s.ListAuditLogRequest.fromPartial({clan_id:a,user_id:i,action_log:t,date_log:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.ListAuditLog.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateCategoryOrder",l=new Map,c=s.UpdateCategoryOrderRequest.encode(s.UpdateCategoryOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return n;throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,i,a,l,d,c={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let u="/mezon.api.Mezon/ListCategoryDescs",o=new Map,r=s.CategoryDesc.encode(s.CategoryDesc.fromPartial({clan_id:t,creator_id:i,category_name:a,category_id:l,category_order:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let A=yield _.arrayBuffer();return s.CategoryDescList.decode(new Uint8Array(A))}else throw _})),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t,i={}){let a="/mezon.api.Mezon/ListChannelApps",l=new Map,c=s.ListChannelAppsRequest.encode(s.ListChannelAppsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListChannelAppsResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,i,a,l,d={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetChannelCanvasList",u=new Map,n=s.ChannelCanvasListRequest.encode(s.ChannelCanvasListRequest.fromPartial({channel_id:t,clan_id:i,limit:a,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.ChannelCanvasListResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddChannelFavorite",l=new Map,c=s.AddFavoriteChannelRequest.encode(s.AddFavoriteChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.AddFavoriteChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveChannelFavorite",d=new Map,u=s.RemoveFavoriteChannelRequest.encode(s.RemoveFavoriteChannelRequest.fromPartial({channel_id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetListFavoriteChannel",l=new Map,c=s.ListFavoriteChannelRequest.encode(s.ListFavoriteChannelRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListFavoriteChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,i,a,l,d,c,u={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListChannelMessages",n=new Map,h=s.ListChannelMessagesRequest.encode(s.ListChannelMessagesRequest.fromPartial({clan_id:t,channel_id:i,message_id:a,direction:l,limit:d,topic_id:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return s.ChannelMessageList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/AddChannelUsers",d=new Map,u=s.AddChannelUsersRequest.encode(s.AddChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,i,a,l,d,c,u,o,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let r="/mezon.api.Mezon/ListChannelAttachment",h=new Map,_=s.ListChannelAttachmentRequest.encode(s.ListChannelAttachmentRequest.fromPartial({channel_id:t,clan_id:i,file_type:a,limit:l,state:d,before:c,after:u,around:o})).finish(),A=this.buildFullUrl(this.basePath,r,h),P=p("POST",n,"");return P.body=_,e&&(P.headers.Authorization="Bearer "+e),Promise.race([g()(A,P).then(w=>m(this,null,function*(){if(w.status==204)return{};if(w.status>=200&&w.status<300){let R=yield w.arrayBuffer();return s.ChannelAttachmentList.decode(new Uint8Array(R))}else throw w})),new Promise((w,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetChanEncryptionMethod",d=new Map,u=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial({channel_id:t,method:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.ChanEncryptionMethod.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/SetChanEncryptionMethod",d=new Map,u=s.ChanEncryptionMethod.encode(s.ChanEncryptionMethod.fromPartial(S(M({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,i,a={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/LeaveThread",d=new Map,u=s.LeaveThreadRequest.encode(s.LeaveThreadRequest.fromPartial({channel_id:i,clan_id:t})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ArchiveChannel",d=new Map,u=s.ArchiveChannelRequest.encode(s.ArchiveChannelRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListArchivedChannelDescs",l=new Map,c=s.ListArchivedChannelDescsRequest.encode(s.ListArchivedChannelDescsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListArchivedChannelDescsResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveChannelUsers",d=new Map,u=s.RemoveChannelUsersRequest.encode(s.RemoveChannelUsersRequest.fromPartial({channel_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return r;throw r})),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,i,a,l,d,c,u={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListChannelUsers",n=new Map,h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:a,limit:l,state:d,cursor:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return s.ChannelUserList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/ListChannelDescs",n=new Map,h=s.ListChannelDescsRequest.encode(s.ListChannelDescsRequest.fromPartial({limit:t,state:i,page:a,clan_id:l,channel_type:d,is_mobile:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateChannelDesc",l=new Map,c=s.CreateChannelDescRequest.encode(s.CreateChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelDescription.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,i,a={}){let l="/mezon.api.Mezon/ListChannelUsersUC",d=new Map,u=s.AllUsersAddChannelRequest.encode(s.AllUsersAddChannelRequest.fromPartial({channel_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.AllUsersAddChannelResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,i,a={}){if(i==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteChannelDesc",d=new Map,u=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateChannelDesc",d=new Map,u=s.UpdateChannelDescRequest.encode(s.UpdateChannelDescRequest.fromPartial(S(M({},i),{channel_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,i,a,l,d,c,u,o,n,r,h={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",_=new Map,P=s.ChannelSettingListRequest.encode(s.ChannelSettingListRequest.fromPartial({clan_id:t,parent_id:i,category_id:a,active:d,private_channel:l,status:c,type:u,limit:o,page:n,channel_label:r})).finish(),w=this.buildFullUrl(this.basePath,f,_),R=p("POST",h,"");return R.body=P,e&&(R.headers.Authorization="Bearer "+e),Promise.race([g()(w,R).then(v=>m(this,null,function*(){if(v.status==204)return{};if(v.status>=200&&v.status<300){let U=yield v.arrayBuffer();return s.ChannelSettingListResponse.decode(new Uint8Array(U))}else throw v})),new Promise((v,U)=>setTimeout(()=>U(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,i,a={}){let l="/mezon.api.Mezon/ListChannelVoiceUsers",d=new Map,u=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.VoiceChannelUserList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListClanDescs",c=new Map,o=s.ListClanDescRequest.encode(s.ListClanDescRequest.fromPartial({limit:t,state:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.ClanDescList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListChannelBadgeCount",c=new Map,o=s.ListChannelBadgeCountRequest.encode(s.ListChannelBadgeCountRequest.fromPartial({clan_id:t,limit:i!=null?i:0,page:a!=null?a:0})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.ListChannelBadgeCountResponse.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListUserOnline",c=new Map,o=s.ListUserOnlineRequest.encode(s.ListUserOnlineRequest.fromPartial({clan_id:t,limit:i!=null?i:0,page:a!=null?a:0})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.ListUserOnlineResponse.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateClanDesc",l=new Map,c=s.CreateClanDescRequest.encode(s.CreateClanDescRequest.fromPartial({clan_name:t.clan_name,logo:t.logo,banner:t.banner})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanDesc.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t,i={}){if(t==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteClanDesc",l=new Map,c=s.DeleteClanDescRequest.encode(s.DeleteClanDescRequest.fromPartial({clan_desc_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanDesc",d=new Map,u=s.UpdateClanDescRequest.encode(s.UpdateClanDescRequest.fromPartial(M({clan_id:t},i))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/RemoveClanUsers",d=new Map,u=s.RemoveClanUsersRequest.encode(s.RemoveClanUsersRequest.fromPartial({clan_id:t,user_ids:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return(yield r.arrayBuffer()).byteLength>0?{}:{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,i,a={}){let l="/mezon.api.Mezon/ListBannedUsers",d=new Map,u=s.BannedUserListRequest.encode(s.BannedUserListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.BannedUserList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,i,a,l,d={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UnbanClanUsers",u=new Map,n=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:a,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300)return(yield f.arrayBuffer()).byteLength>0?{}:{};throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,i,a,l,d={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/BanClanUsers",u=new Map,n=s.BanClanUsersRequest.encode(s.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:i,user_ids:a,ban_time:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300)return(yield f.arrayBuffer()).byteLength>0?{}:{};throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanUsers",l=new Map,c=s.ListClanUsersRequest.encode(s.ListClanUsersRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanUserList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanUsersStatus",l=new Map,c=s.ListClanUsersStatusRequest.encode(s.ListClanUsersStatusRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer(),h=new Uint8Array(r);return s.ClanUserStatusList.decode(h,h.length)}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateCategoryDesc",l=new Map,c=s.CreateCategoryDescRequest.encode(s.CreateCategoryDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.CategoryDesc.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CheckDuplicateName",l=new Map,c=s.CheckDuplicateNameRequest.encode(s.CheckDuplicateNameRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.CheckDuplicateNameResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,i,a,l={}){if(t==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteCategoryDesc",c=new Map,o=s.DeleteCategoryDescRequest.encode(s.DeleteCategoryDescRequest.fromPartial({category_id:t,clan_id:i,category_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return(yield h.arrayBuffer()).byteLength>0?{}:{};throw h})),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/RegistFCMDeviceToken",u=new Map,n=s.RegistFcmDeviceTokenRequest.encode(s.RegistFcmDeviceTokenRequest.fromPartial({token:t,device_id:i,platform:a,voip_token:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.RegistFcmDeviceTokenResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CloseDMByChannelId",l=new Map,c=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/OpenDMByChannelId",l=new Map,c=s.DeleteChannelDescRequest.encode(s.DeleteChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateClanEmoji",l=new Map,c=s.ClanEmojiCreateRequest.encode(s.ClanEmojiCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return(yield n.arrayBuffer()).byteLength>0?{}:{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteByIdClanEmoji",c=new Map,o=s.ClanEmojiDeleteRequest.encode(s.ClanEmojiDeleteRequest.fromPartial({id:t,clan_id:i,emoji_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return(yield h.arrayBuffer()).byteLength>0?{}:{};throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanEmojiById",d=new Map,u=s.ClanEmojiUpdateRequest.encode(s.ClanEmojiUpdateRequest.fromPartial({id:i.id,shortname:i.shortname,clan_id:i.clan_id})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return(yield r.arrayBuffer()).byteLength>0?{}:{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e,t={}){let i="/mezon.api.Mezon/EmojiRecentList",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.EmojiRecentList.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e,t={}){let i="/mezon.api.Mezon/GetListEmojisByUserId",a=new Map,l="",d=this.buildFullUrl(this.basePath,i,a),c=p("POST",t,l);return e&&(c.headers.Authorization="Bearer "+e),Promise.race([g()(d,c).then(u=>m(this,null,function*(){if(u.status==204)return{};if(u.status>=200&&u.status<300){let o=yield u.arrayBuffer();return s.EmojiListedResponse.decode(new Uint8Array(o))}else throw u})),new Promise((u,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SearchMessage",l=new Map,c=s.SearchMessageRequest.encode(s.SearchMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SearchMessageResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}event(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateEvent",l=new Map,c=s.Event.encode(s.Event.fromPartial({external:t.external,name:t.name,properties:t.properties})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listEvents(e,t,i={}){let a="/mezon.api.Mezon/ListEvents",l=new Map,c=s.ListEventsRequest.encode(s.ListEventsRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EventList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateEvent",l=new Map,c=s.CreateEventRequest.encode(s.CreateEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EventManagement.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateEventUser",l=new Map,c=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,i,a,l,d,c={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let u="/mezon.api.Mezon/DeleteEvent",o=new Map,r=s.DeleteEventRequest.encode(s.DeleteEventRequest.fromPartial({event_id:t,clan_id:i,creator_id:a,event_label:l,channel_id:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300)return{};throw _})),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,i,a={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateEvent",d=new Map,u=s.UpdateEventRequest.encode(s.UpdateEventRequest.fromPartial(i)).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteFriends",d=new Map,u=s.DeleteFriendsRequest.encode(s.DeleteFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listFriends(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListFriends",c=new Map,o=s.ListFriendsRequest.encode(s.ListFriendsRequest.fromPartial({limit:t,state:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.FriendList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,i,a={}){let l="/mezon.api.Mezon/AddFriends",d=new Map,u=s.AddFriendsRequest.encode(s.AddFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.AddFriendsResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,i,a={}){let l="/mezon.api.Mezon/BlockFriends",d=new Map,u=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,i,a={}){let l="/mezon.api.Mezon/UnblockFriends",d=new Map,u=s.BlockFriendsRequest.encode(s.BlockFriendsRequest.fromPartial({ids:t,usernames:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t,i={}){let a="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",l=new Map,c=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationChannelCategorySettingList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetUserProfileOnClan",l=new Map,c=s.ClanProfileRequest.encode(s.ClanProfileRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ClanProfile.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationCategory",l=new Map,c=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationUserChannel.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationChannel",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationUserChannel.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationClan",l=new Map,c=s.NotificationClan.encode(s.NotificationClan.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotificationSetting.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t,i={}){let a="/mezon.api.Mezon/GetNotificationReactMessage",l=new Map,c=s.NotifiReactMessage.encode(s.NotifiReactMessage.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.NotifiReactMessage.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}giveMeACoffee(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GiveMeACoffee",l=new Map,c=s.GiveCoffeeEvent.encode(s.GiveCoffeeEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e,t={}){let i="/mezon.api.Mezon/GetKeyServer",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.GetKeyServerResp.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateLinkInviteUser",l=new Map,c=s.LinkInviteUserRequest.encode(s.LinkInviteUserRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.LinkInviteUser.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t,i={}){if(t==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/InviteUser",l=new Map,c=s.InviteUserRequest.encode(s.InviteUserRequest.fromPartial({invite_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,i,a={}){if(i==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let l="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(i))),d=new Map,c="",u=this.buildFullUrl(this.basePath,l,d),o=p("GET",a,c);return e&&(o.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),o.headers.Accept="application/x-protobuf",o.headers["Content-Type"]="application/json",Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.InviteUserRes.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e,t={}){let i="/mezon.api.Mezon/ListChannelByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/MarkAsRead",l=new Map,c=s.MarkAsReadRequest.encode(s.MarkAsReadRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e,t={}){let i="/mezon.api.Mezon/ListMezonOauthClient",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.MezonOauthClientList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetMuteCategory",l=new Map,c=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetMuteChannel",l=new Map,c=s.SetMuteRequest.encode(s.SetMuteRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteNotifications",d=new Map,u=s.DeleteNotificationsRequest.encode(s.DeleteNotificationsRequest.fromPartial({ids:t||[],category:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,i,a,l,d,c={}){let u="/mezon.api.Mezon/ListNotifications",o=new Map,r=s.ListNotificationsRequest.encode(s.ListNotificationsRequest.fromPartial({limit:t,clan_id:i,notification_id:a,category:l,direction:d})).finish(),h=this.buildFullUrl(this.basePath,u,o),f=p("POST",c,"");return f.body=r,e&&(f.headers.Authorization="Bearer "+e),Promise.race([g()(h,f).then(_=>m(this,null,function*(){if(_.status==204)return{};if(_.status>=200&&_.status<300){let A=yield _.arrayBuffer();return s.NotificationList.decode(new Uint8Array(A))}else throw _})),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationChannelSetting",l=new Map,c=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationClanSetting",l=new Map,c=s.SetDefaultNotificationRequest.encode(s.SetDefaultNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationCategorySetting",l=new Map,c=s.SetNotificationRequest.encode(s.SetNotificationRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotificationCategorySetting",l=new Map,c=s.DefaultNotificationCategory.encode(s.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotificationChannel",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t,i={}){let a="/mezon.api.Mezon/DeleteNotiReactMessage",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial({channel_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetNotificationReactMessage",l=new Map,c=s.NotificationChannel.encode(s.NotificationChannel.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SetRoleChannelPermission",l=new Map,c=s.UpdateRoleChannelRequest.encode(s.UpdateRoleChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}getListPermission(e,t={}){let i="/mezon.api.Mezon/GetListPermission",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.PermissionList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,i,a,l={}){let d="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",c=new Map,o=s.PermissionRoleChannelListEventRequest.encode(s.PermissionRoleChannelListEventRequest.fromPartial({role_id:t,channel_id:i,user_id:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.PermissionRoleChannelListEventResponse.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/DeletePinMessage",u=new Map,n=s.DeletePinMessage.encode(s.DeletePinMessage.fromPartial({id:t,message_id:i,channel_id:a,clan_id:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,i,a,l={}){let d="/mezon.api.Mezon/GetPinMessagesList",c=new Map,o=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial({message_id:t,channel_id:i,clan_id:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.PinMessagesList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateMessage2Inbox",l=new Map,c=s.Message2InboxRequest.encode(s.Message2InboxRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelMessageHeader.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreatePinMessage",l=new Map,c=s.PinMessageRequest.encode(s.PinMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelMessageHeader.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t,i={}){let a="/mezon.api.Mezon/GetPubKeys",l=new Map,c=s.GetPubKeysRequest.encode(s.GetPubKeysRequest.fromPartial({user_ids:t||[]})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GetPubKeysResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/PushPubKey",l=new Map,c=s.PushPubKeyRequest.encode(s.PushPubKeyRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddRolesChannelDesc",l=new Map,c=s.AddRoleChannelDescRequest.encode(s.AddRoleChannelDescRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,i,a={}){if(t==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ChangeChannelCategory",d=new Map,u=s.ChangeChannelCategoryRequest.encode(s.ChangeChannelCategoryRequest.fromPartial(S(M({},i),{new_category_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteRoleChannelDesc",l=new Map,c=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listRoles(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListRoles",u=new Map,n=s.RoleListEventRequest.encode(s.RoleListEventRequest.fromPartial({clan_id:t,limit:i,state:a,cursor:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.RoleListEventResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateRole",l=new Map,c=s.CreateRoleRequest.encode(s.CreateRoleRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Role.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,i,a={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteRole",d=new Map,u=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial(S(M({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,i,a,l,d={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteRole",u=new Map,n=s.DeleteRoleRequest.encode(s.DeleteRoleRequest.fromPartial({role_id:t,channel_id:i,clan_id:a,role_label:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>{if(f.status==204)return f;if(f.status>=200&&f.status<300)return f;throw f}),new Promise((f,_)=>setTimeout(_,this.timeoutMs,"Request timed out."))])}updateRole(e,t,i,a={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateRole",d=new Map,u=s.UpdateRoleRequest.encode(s.UpdateRoleRequest.fromPartial(S(M({},i),{role_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t,i={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListRolePermissions",l=new Map,c=s.ListPermissionsRequest.encode(s.ListPermissionsRequest.fromPartial({role_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.PermissionList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,i,a,l={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/ListRoleUsers",c=new Map,o=s.ListRoleUsersRequest.encode(s.ListRoleUsersRequest.fromPartial({role_id:t,limit:i,cursor:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.RoleUserList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetRoleOfUserInTheClan",d=new Map,u=s.ListPermissionOfUsersRequest.encode(s.ListPermissionOfUsersRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.RoleList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,i,a,l={}){let d="/mezon.api.Mezon/SearchThread",c=new Map,o=s.SearchThreadRequest.encode(s.SearchThreadRequest.fromPartial({clan_id:t,channel_id:i,label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.ChannelDescList.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}sendToken(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SendToken",l=new Map,c=s.TokenSentEvent.encode(s.TokenSentEvent.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/SessionLogout",l=new Map,c=s.SessionLogoutRequest.encode(s.SessionLogoutRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddClanSticker",l=new Map,c=s.ClanStickerAddRequest.encode(s.ClanStickerAddRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteClanStickerById",c=new Map,o=s.ClanStickerDeleteRequest.encode(s.ClanStickerDeleteRequest.fromPartial({id:t,clan_id:i,sticker_label:a})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300)return{};throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanStickerById",d=new Map,u=s.ClanStickerUpdateByIdRequest.encode(s.ClanStickerUpdateByIdRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e,t={}){let i="/mezon.api.Mezon/GetListStickersByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.StickerListedResponse.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/RegisterStreamingChannel",l=new Map,c=s.RegisterStreamingChannelRequest.encode(s.RegisterStreamingChannelRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.RegisterStreamingChannelResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/ListStreamingChannelUsers",n=new Map,h=s.ListChannelUsersRequest.encode(s.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:i,channel_type:a,limit:l,state:d,cursor:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return s.StreamingChannelUserList.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e,t={}){let i="/mezon.api.Mezon/GetSystemMessagesList",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.SystemMessagesList.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateSystemMessage",l=new Map,c=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,i,a={}){let l="/mezon.api.Mezon/ListSdTopic",d=new Map,u=s.ListSdTopicRequest.encode(s.ListSdTopicRequest.fromPartial({clan_id:t,limit:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.SdTopicList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateSdTopic",l=new Map,c=s.SdTopicRequest.encode(s.SdTopicRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SdTopic.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DeleteSystemMessage",l=new Map,c=s.DeleteSystemMessage.encode(s.DeleteSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetSystemMessageByClanId",l=new Map,c=s.GetSystemMessage.encode(s.GetSystemMessage.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.SystemMessage.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateSystemMessage",d=new Map,u=s.SystemMessageRequest.encode(s.SystemMessageRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,i,a,l,d,c,u={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListThreadDescs",n=new Map,h=s.ListThreadRequest.encode(s.ListThreadRequest.fromPartial({channel_id:t,limit:i,state:a,clan_id:l,thread_id:d,page:c})).finish(),f=this.buildFullUrl(this.basePath,o,n),_=p("POST",u,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>m(this,null,function*(){if(A.status==204)return{};if(A.status>=200&&A.status<300){let P=yield A.arrayBuffer();return s.ChannelDescListNoPool.decode(new Uint8Array(P))}else throw A})),new Promise((A,P)=>setTimeout(()=>P(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateCategory",d=new Map,u=s.UpdateCategoryDescRequest.encode(s.UpdateCategoryDescRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateChannelPrivate",l=new Map,c=s.ChangeChannelPrivateRequest.encode(s.ChangeChannelPrivateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300)return{};throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateUserProfileByClan",d=new Map,u=s.UpdateClanProfileRequest.encode(s.UpdateClanProfileRequest.fromPartial(S(M({},i),{clan_id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300)return{};throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadOauthFile",l=new Map,c=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UploadAttachmentFile",l=new Map,c=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=new Map,c=s.UploadAttachmentRequest.encode(s.UploadAttachmentRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.MultipartUploadAttachment.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",l=new Map,c=s.MultipartUploadAttachmentFinishRequest.encode(s.MultipartUploadAttachmentFinishRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUser",l=new Map,c=s.UpdateUsersRequest.encode(s.UpdateUsersRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e,t={}){let i="/mezon.api.Mezon/ListUserClansByUserId",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.AllUserClans.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,i,a={}){let l="/mezon.api.Mezon/ListUserPermissionInChannel",d=new Map,u=s.UserPermissionInChannelListRequest.encode(s.UserPermissionInChannelListRequest.fromPartial({clan_id:t,channel_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.UserPermissionInChannelListResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e,t={}){let i="/mezon.api.Mezon/GetUserStatus",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.UserStatus.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUserStatus",l=new Map,c=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUserCustomStatus",l=new Map,c=s.UserStatusUpdate.encode(s.UserStatusUpdate.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateWebhook",l=new Map,c=s.WebhookCreateRequest.encode(s.WebhookCreateRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.WebhookGenerateResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateWebhookById",d=new Map,u=s.WebhookUpdateRequestById.encode(s.WebhookUpdateRequestById.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,i,a={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/ListWebhookByChannelId",d=new Map,u=s.WebhookListRequest.encode(s.WebhookListRequest.fromPartial({channel_id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.WebhookListResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteWebhookById",d=new Map,u=s.WebhookDeleteRequestById.encode(s.WebhookDeleteRequestById.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,i){let a=e+t+"?";for(let[l,d]of i)d instanceof Array?a+=d.reduce((c,u)=>c+encodeURIComponent(l)+"="+encodeURIComponent(u)+"&",""):d!=null&&(a+=encodeURIComponent(l)+"="+encodeURIComponent(d)+"&");return a}editChannelCanvases(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/EditChannelCanvases",l=new Map,c=s.EditChannelCanvasRequest.encode(s.EditChannelCanvasRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.EditChannelCanvasResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,i,a,l={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/GetChannelCanvasDetail",c=new Map,o=s.ChannelCanvasDetailRequest.encode(s.ChannelCanvasDetailRequest.fromPartial({id:t,clan_id:i||"",channel_id:a||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.ChannelCanvasDetailResponse.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,i,a,l={}){if(t==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteChannelCanvas",c=new Map,o=s.DeleteChannelCanvasRequest.encode(s.DeleteChannelCanvasRequest.fromPartial({canvas_id:t,clan_id:i||"",channel_id:a||""})).finish(),n=this.buildFullUrl(this.basePath,d,c),r=p("POST",l,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,i,a,l,d={}){let c="/mezon.api.Mezon/ListOnboarding",u=new Map,n=s.ListOnboardingRequest.encode(s.ListOnboardingRequest.fromPartial({clan_id:t,guide_type:i,limit:a,page:l})).finish(),r=this.buildFullUrl(this.basePath,c,u),h=p("POST",d,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.ListOnboardingResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateOnboarding",l=new Map,c=s.CreateOnboardingRequest.encode(s.CreateOnboardingRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListOnboardingResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteOnboarding",d=new Map,u=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:t,clan_id:i})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/GetOnboardingDetail",d=new Map,u=s.OnboardingRequest.encode(s.OnboardingRequest.fromPartial({id:t,clan_id:i||""})).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.OnboardingItem.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateOnboarding",d=new Map,u=s.UpdateOnboardingRequest.encode(s.UpdateOnboardingRequest.fromPartial(S(M({},i),{id:t}))).finish(),o=this.buildFullUrl(this.basePath,l,d),n=p("POST",a,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>{if(r.status==204)return r;if(r.status>=200&&r.status<300)return r;throw r}),new Promise((r,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateClanWebhook",l=new Map,c=s.GenerateClanWebhookRequest.encode(s.GenerateClanWebhookRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GenerateClanWebhookResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListClanWebhook",l=new Map,c=s.ListClanWebhookRequest.encode(s.ListClanWebhookRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListClanWebhookResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/DeleteClanWebhookById",d=new Map,c={id:t,clan_id:i},o=s.ClanWebhookRequest.encode(s.ClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,i,a={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateClanWebhookById",d=new Map,c=S(M({},i),{id:t}),o=s.UpdateClanWebhookRequest.encode(s.UpdateClanWebhookRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t,i={}){let a="/mezon.api.Mezon/GetTopicDetail",l=new Map,d={topic_id:t},u=s.SdTopicDetailRequest.encode(s.SdTopicDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.SdTopic.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListOnboardingStep",c=new Map,u={clan_id:t,limit:i,page:a},n=s.ListOnboardingStepRequest.encode(s.ListOnboardingStepRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),h=p("POST",l,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.ListOnboardingStepResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,i,a={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(i==null)throw new Error("'body' is a required parameter but is null or undefined.");let l="/mezon.api.Mezon/UpdateOnboardingStep",d=new Map,c=S(M({},i),{clan_id:t}),o=s.UpdateOnboardingStepRequest.encode(s.UpdateOnboardingStepRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateRoomChannelApps",l=new Map,c=s.CreateRoomChannelApps.encode(s.CreateRoomChannelApps.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.CreateRoomChannelApps.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GenerateMeetToken",l=new Map,c=s.GenerateMeetTokenRequest.encode(s.GenerateMeetTokenRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.GenerateMeetTokenResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,i,a={}){let l="/mezon.api.Mezon/GetMezonOauthClient",d=new Map,c={client_id:t,client_name:i},o=s.GetMezonOauthClientRequest.encode(s.GetMezonOauthClientRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>m(this,null,function*(){if(h.status==204)return{};if(h.status>=200&&h.status<300){let f=yield h.arrayBuffer();return s.MezonOauthClient.decode(new Uint8Array(f))}else throw h})),new Promise((h,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateMezonOauthClient",l=new Map,c=s.MezonOauthClient.encode(s.MezonOauthClient.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.MezonOauthClient.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t,i={}){let a="/mezon.api.Mezon/GenerateHashChannelApps",l=new Map,d={app_id:t},u=s.GenerateHashChannelAppsRequest.encode(s.GenerateHashChannelAppsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.GenerateHashChannelAppsResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddUserEvent",l=new Map,c=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,i,a={}){let l="/mezon.api.Mezon/DeleteUserEvent",d=new Map,c={clan_id:t,event_id:i},o=s.UserEventRequest.encode(s.UserEventRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateRoleOrder",l=new Map,c=s.UpdateRoleOrderRequest.encode(s.UpdateRoleOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e,t={}){let i="/mezon.api.Mezon/CreateExternalMezonMeet",a=new Map,l=this.buildFullUrl(this.basePath,i,a),d=p("POST",t,"");return e&&(d.headers.Authorization="Bearer "+e),Promise.race([g()(l,d).then(c=>m(this,null,function*(){if(c.status==204)return{};if(c.status>=200&&c.status<300){let u=yield c.arrayBuffer();return s.GenerateMezonMeetResponse.decode(new Uint8Array(u))}else throw c})),new Promise((c,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,i,a,l,d,c={}){if(i==null)throw new Error("'token' is a required parameter but is null or undefined.");let u="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(i))),o=new Map;o.set("username",a),o.set("metadata",l),o.set("is_guest",d);let n="",r=this.buildFullUrl(t,u,o),h=p("POST",c,n);return e&&(h.headers.Authorization="Bearer "+e),h.headers.Accept="application/x-protobuf",h.headers["Content-Type"]="application/json",Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.GenerateMeetTokenExternalResponse.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/MuteParticipantMezonMeet",l=new Map,c=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/RemoveParticipantMezonMeet",l=new Map,c=s.MeetParticipantRequest.encode(s.MeetParticipantRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelDetail",l=new Map,d={channel_id:t},u=s.ListChannelDetailRequest.encode(s.ListChannelDetailRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.ChannelDescription.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelTimeline",l=new Map,c=s.ListChannelTimelineRequest.encode(s.ListChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ListChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreateChannelTimeline",l=new Map,c=s.CreateChannelTimelineRequest.encode(s.CreateChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.CreateChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateChannelTimeline",l=new Map,c=s.UpdateChannelTimelineRequest.encode(s.UpdateChannelTimelineRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.UpdateChannelTimelineResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t,i={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/DetailChannelTimeline",l=new Map,c=s.ChannelTimelineDetailRequest.encode(s.ChannelTimelineDetailRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.ChannelTimelineDetailResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateClanOrder",l=new Map,c=s.UpdateClanOrderRequest.encode(s.UpdateClanOrderRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,i,a,l={}){if(a==null)throw new Error("'body' is a required parameter but is null or undefined.");let d="/v2/clan/discover",c=new Map,u="";u=JSON.stringify(a||{});let o=this.buildFullUrl(i,d,c),n=p("POST",l,u);return e&&(n.headers.Authorization="Basic "+(0,k.encode)(e+":"+t)),n.headers.Accept="application/x-protobuf",n.headers["Content-Type"]="application/json",Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.ListClanDiscover.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/DeleteQuickMenuAccess",n=new Map,r={id:t,clan_id:i,bot_id:a,menu_name:l,background:d,action_msg:c},f=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,w)=>setTimeout(w,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,i,a,l={}){let d="/mezon.api.Mezon/ListQuickMenuAccess",c=new Map,u={bot_id:t,channel_id:i,menu_type:a},n=s.ListQuickMenuAccessRequest.encode(s.ListQuickMenuAccessRequest.fromPartial(u)).finish(),r=this.buildFullUrl(this.basePath,d,c),h=p("POST",l,"");return h.body=n,e&&(h.headers.Authorization="Bearer "+e),Promise.race([g()(r,h).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer();return s.QuickMenuAccessList.decode(new Uint8Array(_))}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/AddQuickMenuAccess",l=new Map,c=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateQuickMenuAccess",l=new Map,c=s.QuickMenuAccess.encode(s.QuickMenuAccess.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t,i={}){let a="/mezon.api.Mezon/ListForSaleItems",l=new Map,d={page:t},u=s.ListForSaleItemsRequest.encode(s.ListForSaleItemsRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.ForSaleItemList.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/IsFollower",l=new Map,c=s.IsFollowerRequest.encode(s.IsFollowerRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.IsFollowerResponse.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/TransferOwnership",l=new Map,c=s.TransferOwnershipRequest.encode(s.TransferOwnershipRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>{if(n.status==204)return n;if(n.status>=200&&n.status<300)return n;throw n}),new Promise((n,r)=>setTimeout(r,this.timeoutMs,"Request timed out."))])}updateUsername(e,t,i={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/UpdateUsername",l=new Map,c=s.UpdateUsernameRequest.encode(s.UpdateUsernameRequest.fromPartial(t)).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.Session.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t,i={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/IsBanned",l=new Map,d={channel_id:t},u=s.IsBannedRequest.encode(s.IsBannedRequest.fromPartial(d)).finish(),o=this.buildFullUrl(this.basePath,a,l),n=p("POST",i,"");return n.body=u,e&&(n.headers.Authorization="Bearer "+e),Promise.race([g()(o,n).then(r=>m(this,null,function*(){if(r.status==204)return{};if(r.status>=200&&r.status<300){let h=yield r.arrayBuffer();return s.IsBannedResponse.decode(new Uint8Array(h))}else throw r})),new Promise((r,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,i,a={}){let l="/mezon.api.Mezon/ReportMessageAbuse",d=new Map,c={message_id:t,abuse_type:i},o=s.ReportMessageAbuseReqest.encode(s.ReportMessageAbuseReqest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,i,a,l,d,c,u,o,n,r,h,f,_){let A="/mezon.api.Mezon/SendChannelMessage",P=new Map,R=s.ChannelMessageSend.encode(s.ChannelMessageSend.fromPartial({clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_})).finish(),v=this.buildFullUrl(this.basePath,A,P),U=p("POST",{},"");return U.body=R,e&&(U.headers.Authorization="Bearer "+e),Promise.race([g()(v,U).then(E=>m(this,null,function*(){if(E.status==204)return{};if(E.status>=200&&E.status<300){let x=yield E.arrayBuffer();return s.ChannelMessageSend.decode(new Uint8Array(x))}else throw E})),new Promise((E,x)=>setTimeout(()=>x(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,i,a,l,d,c,u,o,n,r,h){let f="/mezon.api.Mezon/UpdateChannelMessage",_=new Map,P=s.ChannelMessageUpdate.encode(s.ChannelMessageUpdate.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:a,is_public:l,content:c,mentions:u,attachments:o,hide_editted:n,topic_id:r,is_update_msg_topic:h})).finish(),w=this.buildFullUrl(this.basePath,f,_),R=p("POST",{},"");return R.body=P,e&&(R.headers.Authorization="Bearer "+e),Promise.race([g()(w,R).then(v=>m(this,null,function*(){if(v.status==204)return{};if(v.status>=200&&v.status<300){let U=yield v.arrayBuffer();return s.ChannelMessageUpdate.decode(new Uint8Array(U))}else throw v})),new Promise((v,U)=>setTimeout(()=>U(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,i,a,l,d,c,u,o,n){let r="/mezon.api.Mezon/DeleteChannelMessage",h=new Map,_=s.ChannelMessageRemove.encode(s.ChannelMessageRemove.fromPartial({clan_id:t,channel_id:i,message_id:d,mode:a,is_public:l,has_attachment:c,mentions:o,references:n,topic_id:u})).finish(),A=this.buildFullUrl(this.basePath,r,h),P=p("POST",{},"");return P.body=_,e&&(P.headers.Authorization="Bearer "+e),Promise.race([g()(A,P).then(w=>m(this,null,function*(){if(w.status==204)return{};if(w.status>=200&&w.status<300){let R=yield w.arrayBuffer();return s.ChannelMessageRemove.decode(new Uint8Array(R))}else throw w})),new Promise((w,R)=>setTimeout(()=>R(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,i,a,l,d,c={}){let u="/mezon.api.Mezon/UpdateMezonVoiceState",o=new Map,n={clan_id:t,channel_id:i,display_name:a,room_name:l,state:d},h=s.HandleParticipantMeetStateEvent.encode(s.HandleParticipantMeetStateEvent.fromPartial(n)).finish(),f=this.buildFullUrl(this.basePath,u,o),_=p("POST",c,"");return _.body=h,e&&(_.headers.Authorization="Bearer "+e),Promise.race([g()(f,_).then(A=>{if(A.status==204)return A;if(A.status>=200&&A.status<300)return A;throw A}),new Promise((A,P)=>setTimeout(P,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/MessageButtonClick",n=new Map,r={message_id:t,channel_id:i,button_id:a,sender_id:l,user_id:d,extra_data:c},f=s.MessageButtonClicked.encode(s.MessageButtonClicked.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,w)=>setTimeout(w,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,i,a,l,d,c,u={}){let o="/mezon.api.Mezon/DropdownBoxSelected",n=new Map,r={message_id:t,channel_id:i,selectbox_id:a,sender_id:l,user_id:d,values:c},f=s.DropdownBoxSelected.encode(s.DropdownBoxSelected.fromPartial(r)).finish(),_=this.buildFullUrl(this.basePath,o,n),A=p("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([g()(_,A).then(P=>{if(P.status==204)return P;if(P.status>=200&&P.status<300)return P;throw P}),new Promise((P,w)=>setTimeout(w,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,i,a={}){let l="/mezon.api.Mezon/ActiveArchivedThread",d=new Map,c={clan_id:t,channel_id:i},o=s.ActiveArchivedThread.encode(s.ActiveArchivedThread.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,i,a={}){let l="/mezon.api.Mezon/AddAgentToChannel",d=new Map,c={room_name:t,channel_id:i},o=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,i,a={}){let l="/mezon.api.Mezon/DisconnectAgent",d=new Map,c={room_name:t,channel_id:i},o=s.UpdateAIAgentRequest.encode(s.UpdateAIAgentRequest.fromPartial(c)).finish(),n=this.buildFullUrl(this.basePath,l,d),r=p("POST",a,"");return r.body=o,e&&(r.headers.Authorization="Bearer "+e),Promise.race([g()(n,r).then(h=>{if(h.status==204)return h;if(h.status>=200&&h.status<300)return h;throw h}),new Promise((h,f)=>setTimeout(f,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListMutedChannel",l=new Map,c=s.ListMutedChannelRequest.encode(s.ListMutedChannelRequest.fromPartial({clan_id:t})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(n=>m(this,null,function*(){if(n.status==204)return{};if(n.status>=200&&n.status<300){let r=yield n.arrayBuffer();return s.MutedChannelList.decode(new Uint8Array(r))}else throw n})),new Promise((n,r)=>setTimeout(()=>r(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,i,a,l,d,c,u,o,n,r,h,f,_){let A="/mezon.api.Mezon/ReactChannelMessage",P=new Map,R=s.MessageReaction.encode(s.MessageReaction.fromPartial({clan_id:t,channel_id:i,mode:a,is_public:l,message_id:d,emoji_id:c,emoji:u,count:o,message_sender_id:n,action:r,emoji_recent_id:f,sender_name:_,topic_id:h})).finish(),v=this.buildFullUrl(this.basePath,A,P),U=p("POST",{},"");return U.body=R,e&&(U.headers.Authorization="Bearer "+e),Promise.race([g()(v,U).then(E=>m(this,null,function*(){if(E.status==204)return{};if(E.status>=200&&E.status<300){let x=yield E.arrayBuffer();return s.ChannelMessageSend.decode(new Uint8Array(x))}else throw E})),new Promise((E,x)=>setTimeout(()=>x(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t,i={}){var n,r,h,f,_,A;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/CreatePoll",l=new Map,c=s.CreatePollRequest.encode(s.CreatePollRequest.fromPartial({channel_id:(n=t.channel_id)!=null?n:"0",clan_id:(r=t.clan_id)!=null?r:"0",question:(h=t.question)!=null?h:"",answers:(f=t.answers)!=null?f:[],expire_hours:(_=t.expire_hours)!=null?_:0,type:(A=t.type)!=null?A:0})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(P=>m(this,null,function*(){if(P.status==204)return{};if(P.status>=200&&P.status<300){let w=yield P.arrayBuffer(),R=s.CreatePollResponse.decode(new Uint8Array(w));return{poll_id:R.poll_id,message_id:R.message_id,question:R.question,answers:R.answers.map(v=>({index:v.index,label:v.label})),answer_counts:R.answer_counts,exp:R.exp,is_closed:R.is_closed,creator_id:R.creator_id,type:R.type,total_votes:R.total_votes}}else throw P})),new Promise((P,w)=>setTimeout(()=>w(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t,i={}){var n,r,h,f;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/VotePoll",l=new Map,c=s.VotePollRequest.encode(s.VotePollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0",answer_indices:(f=t.answer_indices)!=null?f:[]})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(_=>m(this,null,function*(){var A;if(_.status==204)return{my_answer_indices:[]};if(_.status>=200&&_.status<300){let P=yield _.arrayBuffer(),w=new Uint8Array(P),R=w.length>0?s.VotePollResponse.decode(w):{my_answer_indices:[]};return{my_answer_indices:Array.from((A=R.my_answer_indices)!=null?A:[])}}else throw _})),new Promise((_,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t,i={}){var n,r,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ClosePoll",l=new Map,c=s.ClosePollRequest.encode(s.ClosePollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(f=>{if(f.status==204||f.status>=200&&f.status<300)return{};throw f}),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t,i={}){var n,r,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/GetPoll",l=new Map,c=s.GetPollRequest.encode(s.GetPollRequest.fromPartial({poll_id:(n=t.poll_id)!=null?n:"0",message_id:(r=t.message_id)!=null?r:"0",channel_id:(h=t.channel_id)!=null?h:"0"})).finish(),u=this.buildFullUrl(this.basePath,a,l),o=p("POST",i,"");return o.body=c,e&&(o.headers.Authorization="Bearer "+e),Promise.race([g()(u,o).then(f=>m(this,null,function*(){if(f.status==204)return{};if(f.status>=200&&f.status<300){let _=yield f.arrayBuffer(),A=s.GetPollResponse.decode(new Uint8Array(_));return{poll_id:A.poll_id,message_id:A.message_id,question:A.question,answers:A.answers.map(P=>({index:P.index,label:P.label})),answer_counts:A.answer_counts,exp:A.exp,is_closed:A.is_closed,creator_id:A.creator_id,type:A.type,total_votes:A.total_votes,voter_details:A.voter_details.map(P=>({answer_index:P.answer_index,user_ids:P.user_ids}))}}else throw f})),new Promise((f,_)=>setTimeout(()=>_(new Error("Request timed out.")),this.timeoutMs))])}};var Y=K(L("js-base64")),O=class y{constructor(e,t,i,a,l,d,c){this.created=i;this.api_url=a;this.ws_url=l;this.id_token=d;this.token=e,this.refresh_token=t,this.id_token=d,this.api_url=a,this.ws_url=l,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=c,this.update(e,t,c)}isexpired(e){return this.expires_at-e<=0}isrefreshexpired(e){return this.refresh_expires_at-e<=0}update(e,t,i){let a=e.split(".");if(a.length!=3)throw"jwt is not valid.";let l=JSON.parse(Y.atob(a[1])),d=Math.floor(parseInt(l.exp));if(t){let c=t.split(".");if(c.length!=3)throw"refresh jwt is not valid.";let u=JSON.parse(Y.atob(c[1])),o=Math.floor(parseInt(u.exp));this.refresh_expires_at=o,this.refresh_token=t,this.is_remember=i}this.token=e,this.expires_at=d,this.username=l.usn,this.user_id=l.uid,this.vars=l.vrs}static restore(e,t,i,a,l){return new y(e,t,!1,i,a,"",l)}};var $=Symbol.for("mezon.refreshTokenManager"),H=class y{constructor(){this.pendingRefreshes=new Map}static getInstance(){let e=globalThis;return e[$]||(e[$]=new y),e[$]}refresh(e,t){return m(this,null,function*(){let i=this.pendingRefreshes.get(e);if(i)return i;let a=t().finally(()=>{this.pendingRefreshes.delete(e)});return this.pendingRefreshes.set(e,a),a})}isRefreshing(e){return this.pendingRefreshes.has(e)}get pendingCount(){return this.pendingRefreshes.size}};var re=L("mezon-js-protobuf");function Ue(y){let e,t,i,a,l,d;try{e=b(y.channel_message.content)}catch(u){console.log("content is invalid",u)}try{t=j(y.channel_message.reactions)}catch(u){console.log("reactions is invalid",u)}try{i=F(y.channel_message.mentions)}catch(u){console.log("mentions is invalid",u)}try{a=N(y.channel_message.attachments)}catch(u){console.log("attachments is invalid",u)}try{l=I(y.channel_message.references)}catch(u){console.log("references is invalid",u)}try{d=y.channel_message.referenced_message}catch(u){console.log("referenced messages is invalid",u)}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:i==null?void 0:i.mentions,attachments:a==null?void 0:a.attachments,referenced_message:d,references:l==null?void 0:l.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 ie=!1,q={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},z=class z{constructor(e,t,i=!1,a=!1,l=new re.WebSocketAdapterPb,d=z.DefaultSendTimeoutMs){this.host=e;this.port=t;this.useSSL=i;this.verbose=a;this.adapter=l;this.sendTimeoutMs=d;this.cIds={},this.nextCid=1,this._heartbeatTimeoutMs=z.DefaultHeartbeatTimeoutMs,this._connectionState=q.DISCONNECTED}generatecid(){let e=this.nextCid.toString();return++this.nextCid,e}isOpen(){return this._connectionState===q.CONNECTED}connect(e,t=!1,i="",a=z.DefaultConnectTimeoutMs,l){if(this._connectionState===q.CONNECTED)return Promise.resolve(e);if(this._connectionState===q.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=q.CONNECTING;let d=this.useSSL?"wss://":"ws://";this.adapter.connect(d,this.host,this.port,t,e.token,i,l),this.adapter.onClose=u=>{this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(u)},this.adapter.onMessage=u=>m(this,null,function*(){if(this.verbose&&window&&window.console&&console.log("Response: %o",JSON.stringify(u)),u.cid){let o=this.cIds[u.cid];if(!o){this.verbose&&window&&window.console&&console.error("No promise executor for message: %o",u);return}delete this.cIds[u.cid],u.error?o.reject(u.error):o.resolve(u)}else if(u.notifications)u.notifications.notifications.forEach(o=>{o.content=o.content?G(o.content):void 0,this.onnotification(o)});else if(u.voice_started_event)this.onvoicestarted(u.voice_started_event);else if(u.voice_ended_event)this.onvoiceended(u.voice_ended_event);else if(u.voice_joined_event)this.onvoicejoined(u.voice_joined_event);else if(u.voice_leaved_event)this.onvoiceleaved(u.voice_leaved_event);else if(u.channel_created_event)this.onchannelcreated(u.channel_created_event);else if(u.category_event)this.oncategoryevent(u.category_event);else if(u.role_event)this.onroleevent(u.role_event);else if(u.event_emoji)this.oneventemoji(u.event_emoji);else if(u.noti_user_channel)this.oneventnotiuserchannel(u.noti_user_channel);else if(u.webhook_event)this.oneventwebhook(u.webhook_event);else if(u.channel_deleted_event)this.onchanneldeleted(u.channel_deleted_event);else if(u.clan_deleted_event)this.onclandeleted(u.clan_deleted_event);else if(u.sticker_create_event)this.onstickercreated(u.sticker_create_event);else if(u.sticker_update_event)this.onstickerupdated(u.sticker_update_event);else if(u.sticker_delete_event)this.onstickerdeleted(u.sticker_delete_event);else if(u.channel_updated_event)this.onchannelupdated(u.channel_updated_event);else if(u.delete_account_event)this.ondeleteaccount(u.delete_account_event);else if(u.clan_profile_updated_event)this.onclanprofileupdated(u.clan_profile_updated_event);else if(u.clan_updated_event)this.onclanupdated(u.clan_updated_event);else if(u.last_seen_message_event)this.onlastseenupdated(u.last_seen_message_event);else if(u.status_presence_event)this.onstatuspresence(u.status_presence_event);else if(u.stream_presence_event)this.onstreampresence(u.stream_presence_event);else if(u.stream_data)this.onstreamdata(u.stream_data);else if(u.channel_message){let o=Ue(u);this.onchannelmessage(o)}else u.message_typing_event?this.onmessagetyping(u.message_typing_event):u.message_reaction_event?this.onmessagereaction(u.message_reaction_event):u.channel_presence_event?this.onchannelpresence(u.channel_presence_event):u.last_pin_message_event?this.onpinmessage(u.last_pin_message_event):u.custom_status_event?this.oncustomstatus(u.custom_status_event):u.canvas_event?this.oncanvasevent(u.canvas_event):u.user_channel_added_event?this.onuserchanneladded(u.user_channel_added_event):u.add_clan_user_event?this.onuserclanadded(u.add_clan_user_event):u.user_profile_updated_event?this.onuserprofileupdate(u.user_profile_updated_event):u.user_channel_removed_event?this.onuserchannelremoved(u.user_channel_removed_event):u.block_friend?this.onblockfriend(u.block_friend):u.un_block_friend?this.onunblockfriend(u.un_block_friend):u.add_friend?this.onaddfriend(u.add_friend):u.remove_friend?this.onremovefriend(u.remove_friend):u.user_clan_removed_event?this.onuserclanremoved(u.user_clan_removed_event):u.clan_event_created?this.oneventcreated(u.clan_event_created):u.give_coffee_event?this.oncoffeegiven(u.give_coffee_event):u.role_assign_event?this.onroleassign(u.role_assign_event):u.streaming_started_event?this.onstreamingchannelstarted(u.streaming_started_event):u.streaming_ended_event?this.onstreamingchannelended(u.streaming_ended_event):u.streaming_joined_event?this.onstreamingchanneljoined(u.streaming_joined_event):u.streaming_leaved_event?this.onstreamingchannelleaved(u.streaming_leaved_event):u.permission_set_event?this.onpermissionset(u.permission_set_event):u.permission_changed_event?this.onpermissionchanged(u.permission_changed_event):u.unmute_event?this.onunmuteevent(u.unmute_event):u.token_sent_event?this.ontokensent(u.token_sent_event):u.message_button_clicked?this.onmessagebuttonclicked(u.message_button_clicked):u.dropdown_box_selected?this.onmessagedropdownboxselected(u.dropdown_box_selected):u.mark_as_read?this.onmarkasread(u.mark_as_read):u.voice_reaction_send?this.onvoicereactionmessage(u.voice_reaction_send):u.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(u.webrtc_signaling_fwd):u.list_activity?this.onactivityupdated(u.list_activity):u.sd_topic_event?this.onsdtopicevent(u.sd_topic_event):u.channel_app_event?this.onchannelappevent(u.channel_app_event):u.user_status_event?this.onuserstatusevent(u.user_status_event):u.join_channel_app_data?this.onjoinchannelappevent(u.join_channel_app_data):u.unpin_message_event?this.onunpinmessageevent(u.unpin_message_event):u.quick_menu_event?this.onquickmenuevent(u.quick_menu_event):u.meet_participant_event?this.onmeetparticipantevent(u.meet_participant_event):u.transfer_ownership_event?this.ontransferownership(u.transfer_ownership_event):u.ban_user_event?this.onbanneduser(u.ban_user_event):u.list_channel_users_banned_event?this.onlistchannelusersbanned(u.list_channel_users_banned_event):u.allow_anonymous_event?this.onallowanonymousevent(u.allow_anonymous_event):u.aiagent_enabled_event?this.onaiagentenabled(u.aiagent_enabled_event):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",u)});let c=new Promise((u,o)=>{this.adapter.onOpen=n=>{this.verbose&&window&&window.console&&console.log(n);let r=ie;ie=!0,this.clearConnectTimeout(),this._connectionState=q.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,u(e),r&&this.onreconnect(n)},this.adapter.onError=n=>{this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(n),this._connectPromise=void 0,this.adapter.close(),o(n)},this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.close(),this._connectPromise=void 0,o("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},a)});return this._connectPromise=c,this._connectPromise}disconnect(e=!0){this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&this.adapter.close(),e&&this.ondisconnect({})}setHeartbeatTimeoutMs(e){this._heartbeatTimeoutMs=e}getHeartbeatTimeoutMs(){return this._heartbeatTimeoutMs}onreconnect(e){this.verbose&&window&&window.console&&console.log(e)}ondisconnect(e){this.verbose&&window&&window.console&&console.log(e)}onerror(e){this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&console.log(e)}onmessagetyping(e){this.verbose&&window&&window.console&&console.log(e)}onmessagereaction(e){this.verbose&&window&&window.console&&console.log(e)}onchannelmessage(e){this.verbose&&window&&window.console&&console.log(e)}onchannelpresence(e){this.verbose&&window&&window.console&&console.log(e)}onuserchanneladded(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanadded(e){this.verbose&&window&&window.console&&console.log(e)}onuserprofileupdate(e){this.verbose&&window&&window.console&&console.log(e)}onuserchannelremoved(e){this.verbose&&window&&window.console&&console.log(e)}onaddfriend(e){this.verbose&&window&&window.console&&console.log(e)}onremovefriend(e){this.verbose&&window&&window.console&&console.log(e)}onblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onunblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanremoved(e){this.verbose&&window&&window.console&&console.log(e)}onnotification(e){this.verbose&&window&&window.console&&console.log(e)}onstatuspresence(e){this.verbose&&window&&window.console&&console.log(e)}onpinmessage(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceended(e){this.verbose&&window&&window.console&&console.log(e)}onvoicestarted(e){this.verbose&&window&&window.console&&console.log(e)}onvoicejoined(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceleaved(e){this.verbose&&window&&window.console&&console.log(e)}onchannelcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncategoryevent(e){this.verbose&&window&&window.console&&console.log(e)}onroleevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventemoji(e){this.verbose&&window&&window.console&&console.log(e)}oneventnotiuserchannel(e){this.verbose&&window&&window.console&&console.log(e)}oneventwebhook(e){this.verbose&&window&&window.console&&console.log(e)}onchanneldeleted(e){this.verbose&&window&&window.console&&console.log(e)}onclandeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickercreated(e){this.verbose&&window&&window.console&&console.log(e)}onstickerdeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickerupdated(e){this.verbose&&window&&window.console&&console.log(e)}onchannelupdated(e){this.verbose&&window&&window.console&&console.log(e)}ondeleteaccount(e){this.verbose&&window&&window.console&&console.log(e)}onclanprofileupdated(e){this.verbose&&window&&window.console&&console.log(e)}onclanupdated(e){this.verbose&&window&&window.console&&console.log(e)}onlastseenupdated(e){this.verbose&&window&&window.console&&console.log(e)}onstreampresence(e){this.verbose&&window&&window.console&&console.log(e)}onstreamdata(e){this.verbose&&window&&window.console&&console.log(e)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}oncustomstatus(e){this.verbose&&window&&window.console&&console.log(e)}oncanvasevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncoffeegiven(e){this.verbose&&window&&window.console&&console.log(e)}onroleassign(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelstarted(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelended(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchanneljoined(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelleaved(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionset(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionchanged(e){this.verbose&&window&&window.console&&console.log(e)}onunmuteevent(e){this.verbose&&window&&window.console&&console.log(e)}ontokensent(e){this.verbose&&window&&window.console&&console.log(e)}onmessagebuttonclicked(e){this.verbose&&window&&window.console&&console.log(e)}onmessagedropdownboxselected(e){this.verbose&&window&&window.console&&console.log(e)}onmarkasread(e){this.verbose&&window&&window.console&&console.log(e)}onvoicereactionmessage(e){this.verbose&&window&&window.console&&console.log(e)}onwebrtcsignalingfwd(e){this.verbose&&window&&window.console&&console.log(e)}onactivityupdated(e){this.verbose&&window&&window.console&&console.log(e)}onsdtopicevent(e){this.verbose&&window&&window.console&&console.log(e)}onchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onuserstatusevent(e){this.verbose&&window&&window.console&&console.log(e)}onjoinchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onunpinmessageevent(e){this.verbose&&window&&window.console&&console.log(e)}onquickmenuevent(e){this.verbose&&window&&window.console&&console.log(e)}ontransferownership(e){this.verbose&&window&&window.console&&console.log(e)}onbanneduser(e){this.verbose&&window&&window.console&&console.log(e)}onlistchannelusersbanned(e){this.verbose&&window&&window.console&&console.log(e)}onmeetparticipantevent(e){this.verbose&&window&&window.console&&console.log(e)}onallowanonymousevent(e){this.verbose&&window&&window.console&&console.log(e)}onaiagentenabled(e){this.verbose&&window&&window.console&&console.log(e)}send(e,t=z.DefaultSendTimeoutMs){let i=e;return new Promise((a,l)=>{var d,c;if(!this.adapter.isOpen())l("Socket connection has not been established yet.");else{i.channel_message_send?i.channel_message_send.content=JSON.stringify(i.channel_message_send.content):i.channel_message_update?i.channel_message_update.content=JSON.stringify(i.channel_message_update.content):i.ephemeral_message_send?i.ephemeral_message_send.message.content=JSON.stringify((d=i.ephemeral_message_send.message)==null?void 0:d.content):i.quick_menu_event&&(i.quick_menu_event.message.content=JSON.stringify((c=i.quick_menu_event.message)==null?void 0:c.content));let u=this.generatecid();this.cIds[u]={resolve:a,reject:l},t!==1/0&&t>0&&setTimeout(()=>{l("The socket timed out while waiting for a response.")},t),i.cid=u,this.adapter.send(i)}})}followUsers(e){return m(this,null,function*(){return(yield this.send({status_follow:{user_ids:e}})).status})}joinClanChat(e){return m(this,null,function*(){return(yield this.send({clan_join:{clan_id:e}})).clan_join})}follower(){return m(this,null,function*(){return(yield this.send({follow_event:{}})).follow_event})}joinChat(e,t,i,a){return m(this,null,function*(){return(yield this.send({channel_join:{clan_id:e,channel_id:t,channel_type:i,is_public:a}})).channel})}leaveChat(e,t,i,a){return this.send({channel_leave:{clan_id:e,channel_id:t,channel_type:i,is_public:a}})}removeChatMessage(e,t,i,a,l,d,c,u,o){return m(this,null,function*(){return(yield this.send({channel_message_remove:{clan_id:e,channel_id:t,mode:i,message_id:l,is_public:a,has_attachment:d,topic_id:c,mentions:u,references:o}})).channel_message_ack})}rpc(e,t,i){return m(this,null,function*(){return(yield this.send({rpc:{id:e,payload:t,http_key:i}})).rpc})}unfollowUsers(e){return this.send({status_unfollow:{user_ids:e}})}updateChatMessage(e,t,i,a,l,d,c,u,o,n,r){return m(this,null,function*(){return(yield this.send({channel_message_update:{clan_id:e,channel_id:t,message_id:l,content:d,mentions:c,attachments:u,mode:i,is_public:a,hide_editted:o,topic_id:n,is_update_msg_topic:r}})).channel_message_ack})}updateStatus(e){return this.send({status_update:{status:e}})}writeQuickMenuEvent(e,t,i,a,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return(yield this.send({quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_}}})).ephemeral_message_send})}writeEphemeralMessage(e,t,i,a,l,d,c,u,o,n,r,h,f,_,A){return m(this,null,function*(){return(yield this.send({ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:i,mode:a,is_public:l,content:d,mentions:c,attachments:u,references:o,anonymous_message:n,mention_everyone:r,avatar:h,code:f,topic_id:_,id:A}}})).ephemeral_message_send})}writeChatMessage(e,t,i,a,l,d,c,u,o,n,r,h,f){return m(this,null,function*(){return(yield this.send({channel_message_send:{clan_id:e,channel_id:t,mode:i,is_public:a,content:l,mentions:d,attachments:c,references:u,anonymous_message:o,mention_everyone:n,avatar:r,code:h,topic_id:f}},1/0)).channel_message_ack})}writeMessageReaction(e,t,i,a,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return(yield this.send({message_reaction_event:{id:e,clan_id:t,channel_id:i,mode:a,is_public:l,message_id:d,emoji_id:c,emoji:u,count:o,message_sender_id:n,action:r,topic_id:h,emoji_recent_id:f,sender_name:_}})).message_reaction_event})}writeMessageTyping(e,t,i,a,l,d){return m(this,null,function*(){return(yield this.send({message_typing_event:{clan_id:e,channel_id:t,mode:i,is_public:a,sender_display_name:l,topic_id:d}})).message_typing_event})}writeLastSeenMessage(e,t,i,a,l,d){return m(this,null,function*(){return(yield this.send({last_seen_message_event:{clan_id:e,channel_id:t,mode:i,message_id:a,timestamp_seconds:l,badge_count:d}})).last_seen_message_event})}writeLastPinMessage(e,t,i,a,l,d,c,u,o,n,r,h,f){return m(this,null,function*(){return(yield this.send({last_pin_message_event:{clan_id:e,channel_id:t,mode:i,is_public:a,message_id:l,timestamp_seconds:d,operation:c,message_sender_avatar:u,message_sender_id:o,message_sender_username:n,message_content:r,message_attachment:h,message_created_time:f}})).last_pin_message_event})}writeCustomStatus(e,t,i,a){return m(this,null,function*(){return(yield this.send({custom_status_event:{clan_id:e,status:t,time_reset:i,no_clear:a}})).custom_status_event})}checkDuplicateName(e,t,i,a){return m(this,null,function*(){return(yield this.send({check_name_existed_event:{name:e,condition_id:t,type:i,clan_id:a}})).check_name_existed_event})}writeVoiceReaction(e,t){return m(this,null,function*(){return(yield this.send({voice_reaction_send:{emojis:e,channel_id:t}})).voice_reaction_send})}forwardWebrtcSignaling(e,t,i,a,l){return m(this,null,function*(){return(yield this.send({webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:i,channel_id:a,caller_id:l}})).webrtc_signaling_fwd})}makeCallPush(e,t,i,a){return m(this,null,function*(){return(yield this.send({incoming_call_push:{receiver_id:e,json_data:t,channel_id:i,caller_id:a}})).incoming_call_push})}writeChannelAppEvent(e,t,i){return m(this,null,function*(){return(yield this.send({channel_app_event:{clan_id:e,channel_id:t,action:i}})).channel_app_event})}listDataSocket(e){return m(this,null,function*(){return(yield this.send({list_data_socket:e})).list_data_socket})}pingPong(){return m(this,null,function*(){if(!this.isOpen()){this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop();return}try{yield this.send({ping:{}},this._heartbeatTimeoutMs)}catch(e){this._connectionState=q.DISCONNECTED,this.stopHeartbeatLoop(),this.adapter.isOpen()&&(window&&window.console&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this.adapter.close());return}this.startHeartbeatLoop()})}startHeartbeatLoop(){this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatTimeoutMs)}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}};z.DefaultHeartbeatTimeoutMs=1e4,z.DefaultSendTimeoutMs=1e4,z.DefaultConnectTimeoutMs=3e4;var T=z;var se=L("mezon-js-protobuf");var qe="127.0.0.1",Ee="7350",ke="defaultkey",Be=3e4,ae=(o=>(o[o.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",o[o.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",o[o.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",o[o.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",o[o.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",o[o.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",o[o.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",o[o.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",o[o.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",o))(ae||{}),oe=(l=>(l[l.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",l[l.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",l[l.STREAM_MODE_DM=4]="STREAM_MODE_DM",l[l.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",l[l.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",l))(oe||{}),ue=(i=>(i[i.ALL_MESSAGE=1]="ALL_MESSAGE",i[i.MENTION_MESSAGE=2]="MENTION_MESSAGE",i[i.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",i))(ue||{}),le=(o=>(o[o.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",o[o.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",o[o.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",o[o.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",o[o.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",o[o.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",o[o.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",o[o.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",o[o.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",o))(le||{}),Z=class{constructor(e=ke,t=qe,i=Ee,a=!1,l=Be,d=!0){this.serverkey=e;this.timeout=l;this.autoRefreshSession=d;this.refreshTokenManager=H.getInstance();this.host=t,this.port=i,this.useSSL=a;let u=`${a?"https://":"http://"}${t}:${i}`;this.apiClient=new V(e,l,u)}onRefreshSession(e){console.log(`Token refresh occurred. Token: ${e.token}`)}isexpired(e){return e.isexpired(Date.now()/1e3)}authenticateMezon(e,t,i,a,l={},d={}){let c={token:e,vars:l};return this.apiClient.authenticateMezon(this.serverkey,"",c,t,i,a,d).then(u=>new O(u.token||"",u.refresh_token||"",u.created||!1,u.api_url||"",u.ws_url||"",u.id_token||"",u.is_remember||!1))}authenticateSMSOTPRequest(e,t,i){let a={username:t,account:{phoneno:e,vars:i}};return this.apiClient.AuthenticateSMSOTPRequest(this.serverkey,"",a,t).then(l=>Promise.resolve(l))}authenticateEmailOTPRequest(e,t,i){let a={username:t,account:{email:e,vars:i}};return this.apiClient.AuthenticateEmailOTPRequest(this.serverkey,"",a,t).then(l=>Promise.resolve(l))}confirmAuthenticateOTP(e){return m(this,null,function*(){return this.apiClient.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>new O(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1))})}authenticateEmail(e,t,i,a){let l={username:i,account:{email:e,password:t,vars:a}};return this.apiClient.authenticateEmail(this.serverkey,"",l,i).then(d=>new O(d.token||"",d.refresh_token||"",d.created||!1,d.api_url||"",d.ws_url||"",d.id_token||"",d.is_remember||!1))}setBasePath(e,t,i){this.host=e,this.port=t,this.useSSL=i;let l=`${i?"https://":"http://"}${e}:${t}`;return this.apiClient.setBasePath(l)}addChannelUsers(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addChannelUsers(e.token,t,i).then(a=>a!==void 0)})}addFriends(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addFriends(e.token,t,i)})}blockFriends(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.blockFriends(e.token,t,i).then(a=>Promise.resolve(a!=null))})}unblockFriends(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unblockFriends(e.token,t,i).then(a=>Promise.resolve(a!=null))})}uploadOauthFile(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.uploadOauthFile(e.token,t)})}uploadAttachmentFile(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.uploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFile(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.multipartUploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFileFinish(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.multipartUploadAttachmentFileFinsih(e.token,t)})}createChannelDesc(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createChannelDesc(e.token,t).then(i=>Promise.resolve(i))})}createClanDesc(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createClanDesc(e.token,t).then(i=>Promise.resolve(i))})}checkDuplicateName(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.checkDuplicateName(e.token,t)})}createCategoryDesc(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createCategoryDesc(e.token,t).then(i=>Promise.resolve(i))})}createRole(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createRole(e.token,t).then(i=>Promise.resolve(i))})}createEvent(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createEvent(e.token,t).then(i=>Promise.resolve(i))})}addRolesChannelDesc(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addRolesChannelDesc(e.token,t).then(i=>i!==void 0)})}deleteRoleChannelDesc(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteRoleChannelDesc(e.token,t).then(i=>i!==void 0)})}deleteApp(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteApp(e.token,t).then(i=>i!==void 0)})}createSocket(e=!1,t,i,a=!1,l=new se.WebSocketAdapterPb,d=T.DefaultSendTimeoutMs){return new T(t,i,e,a,l,d)}deleteFriends(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteFriends(e.token,t,i).then(a=>a!==void 0)})}deleteChannelDesc(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelDesc(e.token,t,i).then(a=>a!==void 0)})}deleteClanDesc(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanDesc(e.token,t).then(i=>i!==void 0)})}deleteCategoryDesc(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteCategoryDesc(e.token,t,i,a).then(l=>l!==void 0)})}deleteNotifications(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotifications(e.token,t,i).then(a=>Promise.resolve(a!=null))})}deleteRole(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteRole(e.token,t,"0",i,a).then(l=>l!==void 0)})}deleteEvent(e,t,i,a,l,d){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteEvent(e.token,t,i,a,l,d).then(c=>c!==void 0)})}updateEventUser(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateEventUser(e.token,t).then(i=>i!==void 0)})}emitEvent(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.event(e.token,t).then(i=>Promise.resolve(i!=null))})}getAccount(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getAccount(e.token)})}removeClanUsers(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeClanUsers(e.token,t,i).then(a=>Promise.resolve(a!=null))})}listBannedUsers(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listBannedUsers(e.token,t,i).then(a=>Promise.resolve(a))})}unbanClanUsers(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unbanClanUsers(e.token,t,i,a).then(l=>Promise.resolve(l!=null))})}banClanUsers(e,t,i,a,l){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.banClanUsers(e.token,t,i,a,l).then(d=>Promise.resolve(d!=null))})}removeChannelUsers(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeChannelUsers(e.token,t,i).then(a=>Promise.resolve(a!=null))})}listChannelMessages(e,t,i,a,l,d,c){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelMessages(e.token,t,i,a,l,d,c).then(u=>{let o={messages:[],last_seen_message:u.last_seen_message,last_sent_message:u.last_sent_message};return u.messages==null||u.messages.forEach(n=>{let r,h,f,_,A;try{r=b(n.content)}catch(P){console.log("error parse content",P)}try{let P=j(n.reactions);h=(P==null?void 0:P.reactions)||P||b(n.reactions||"[]")}catch(P){h=b(n.reactions||"[]")}try{let P=F(n.mentions);f=(P==null?void 0:P.mentions)||P||b(n.mentions||"[]")}catch(P){f=b(n.mentions||"[]")}try{let P=N(n.attachments);_=(P==null?void 0:P.attachments)||P||b(n.attachments||"[]")}catch(P){_=b(n.attachments||"[]")}try{let P=I(n.references);A=(P==null?void 0:P.refs)||P||b(n.references||"[]")}catch(P){A=b(n.references||"[]")}o.messages.push({channel_id:n.channel_id,code:n.code?Number(n.code):0,id:n.message_id||"",sender_id:n.sender_id,username:n.username,display_name:n.display_name,avatar:n.avatar,content:r,channel_label:n.channel_label,clan_logo:n.clan_logo,category_name:n.category_name,clan_nick:n.clan_nick,clan_avatar:n.clan_avatar,attachments:_,mentions:f,reactions:h,references:A,clan_id:n.clan_id,create_time_seconds:n.create_time_seconds,update_time_seconds:n.update_time_seconds,hide_editted:n.hide_editted})}),Promise.resolve(o)})})}listChannelVoiceUsers(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelVoiceUsers(e.token,t,i).then(a=>{let l={voice_channel_users:[]};return a.voice_channel_users==null||a.voice_channel_users.forEach(d=>{l.voice_channel_users.push({id:d.id,channel_id:d.channel_id,user_ids:d.user_ids,participant:d.participant})}),Promise.resolve(l)})})}listChannelUsers(e,t,i,a,l,d,c){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelUsers(e.token,t,i,a,d,l,c).then(u=>{let o={channel_users:[],cursor:u.cursor,channel_id:u.channel_id};return u.channel_users==null||u.channel_users.forEach(n=>{o.channel_users.push({user_id:n.user_id,role_id:n.role_id,thread_id:n.thread_id,clan_avatar:n.clan_avatar,clan_nick:n.clan_nick,id:n.id,clan_id:n.clan_id,added_by:n.added_by,is_banned:n.is_banned})}),Promise.resolve(o)})})}listChannelAttachments(e,t,i,a,l,d,c,u){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelAttachment(e.token,i,t,a,d,l,c,u).then(o=>{let n={attachments:[]};return o.attachments==null||o.attachments.forEach(r=>{n.attachments.push({filename:r.filename,filesize:r.filesize,filetype:r.filetype,id:r.id,uploader:r.uploader,url:r.url,message_id:r.message_id,create_time_seconds:r.create_time_seconds,width:r.width,height:r.height})}),Promise.resolve(n)})})}listClanUsers(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanUsers(e.token,t).then(i=>{let a={clan_users:[],cursor:i.cursor,clan_id:i.clan_id};return i.clan_users==null||i.clan_users.forEach(l=>{var d;a.clan_users.push({user:{avatar_url:l.user.avatar_url,create_time_seconds:l.user.create_time_seconds,display_name:l.user.display_name,edge_count:l.user.edge_count?Number(l.user.edge_count):0,id:l.user.id,lang_tag:l.user.lang_tag,location:l.user.location,online:l.user.online,is_mobile:(d=l.user)==null?void 0:d.is_mobile,timezone:l.user.timezone,update_time:l.user.update_time,username:l.user.username,user_status:l.user.user_status,status:l.user.status,about_me:l.user.about_me,mezon_id:l.user.mezon_id,list_nick_names:l.user.list_nick_names,phone_number:l.user.phone_number,join_time_seconds:l.user.join_time_seconds},role_id:l.role_id,clan_nick:l.clan_nick,clan_avatar:l.clan_avatar})}),Promise.resolve(a)})})}listClanUsersStatus(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanUsersStatus(e.token,t).then(i=>{let a={clan_user_statuses:[]};return i.clan_user_statuses==null||i.clan_user_statuses.forEach(l=>{a.clan_user_statuses.push({user_id:l.user_id,user_status:l.user_status})}),Promise.resolve(a)})})}listChannelDetail(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelDetail(e.token,t).then(i=>Promise.resolve(i))})}listChannelDescs(e,t,i,a,l,d,c){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelDescs(e.token,t,i,a,l,d,c).then(u=>{let o={channeldesc:[],next_cursor:u.next_cursor,prev_cursor:u.prev_cursor,cacheable_cursor:u.cacheable_cursor};return u.channeldesc==null||(o.channeldesc=u.channeldesc),Promise.resolve(o)})})}listClanDescs(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanDescs(e.token,t,i,a).then(l=>{let d={clandesc:[]};return l.clandesc==null||(d.clandesc=l.clandesc),Promise.resolve(d)})})}listChannelBadgeCount(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelBadgeCount(e.token,t,i,a).then(l=>{var d;return{channeldesc:(d=l.channeldesc)!=null?d:[],total_count:l.total_count}})})}listUserOnline(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listUserOnline(e.token,t,i,a).then(l=>{var d;return{users:(d=l.users)!=null?d:[],total_count:l.total_count}})})}listCategoryDescs(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listCategoryDescs(e.token,t,i,a).then(l=>{let d={categorydesc:[]};return l.categorydesc==null||(d.categorydesc=l.categorydesc),Promise.resolve(d)})})}listEvents(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listEvents(e.token,t).then(i=>Promise.resolve(i))})}getListPermission(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListPermission(e.token).then(t=>Promise.resolve(t))})}listRolePermissions(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRolePermissions(e.token,t).then(i=>Promise.resolve(i))})}listRoleUsers(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRoleUsers(e.token,t,i,a).then(l=>Promise.resolve(l))})}registFCMDeviceToken(e,t,i,a,l){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registFCMDeviceToken(e.token,t,i,a,l).then(d=>Promise.resolve(d))})}getUserProfileOnClan(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getUserProfileOnClan(e.token,t).then(i=>Promise.resolve(i))})}closeDirectMess(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.closeDirectMess(e.token,t).then(i=>i!==void 0)})}openDirectMess(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.openDirectMess(e.token,t).then(i=>i!==void 0)})}confirmLinkMezonOTP(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.confirmLinkMezonOTP(e.token,t)})}linkSMS(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.linkSMS(e.token,t).then(i=>Promise.resolve(i))})}linkEmail(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.linkEmail(e.token,t).then(i=>Promise.resolve(i))})}listFriends(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listFriends(e.token,i,t,a).then(l=>{let d={friends:[],cursor:l.cursor};return l.friends==null||l.friends.forEach(c=>{var u;d.friends.push({user:{avatar_url:c.user.avatar_url,create_time_seconds:c.user.create_time_seconds,display_name:c.user.display_name,edge_count:c.user.edge_count?Number(c.user.edge_count):0,id:c.user.id,lang_tag:c.user.lang_tag,location:c.user.location,online:c.user.online,timezone:c.user.timezone,update_time:c.user.update_time,username:c.user.username,is_mobile:(u=c.user)==null?void 0:u.is_mobile,user_status:c.user.user_status,status:c.user.status,mezon_id:c.user.mezon_id,list_nick_names:c.user.list_nick_names,phone_number:c.user.phone_number,about_me:c.user.about_me},state:c.state,source_id:c.source_id})}),Promise.resolve(d)})})}listNotifications(e,t,i,a,l,d){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listNotifications(e.token,i,t,a,l,d).then(c=>{let u={cacheable_cursor:c.cacheable_cursor,notifications:[]};return c.notifications==null||c.notifications.forEach(o=>{u.notifications.push({id:o.id,subject:o.subject,content:o.content?G(o.content):void 0,code:o.code?Number(o.code):0,sender_id:o.sender_id,create_time_seconds:o.create_time_seconds,persistent:o.persistent,category:o.category})}),Promise.resolve(u)})})}sessionLogout(e,t,i,a,l){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sessionLogout(e.token,{refresh_token:i,token:t,device_id:a,platform:l}).then(d=>d!==void 0)})}sessionRefresh(i){return m(this,arguments,function*(e,t={}){if(!e)return console.error("Cannot refresh a null session."),e;e.created&&e.expires_at-e.created_at<70&&console.warn("Session lifetime too short, please set '--session.token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),e.created&&e.refresh_expires_at-e.created_at<3700&&console.warn("Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session");let a=yield this.refreshTokenManager.refresh(e.refresh_token,()=>m(this,null,function*(){try{let l=yield this.apiClient.sessionRefresh(this.serverkey,"",{token:e.refresh_token,vars:t,is_remember:e.is_remember});return{token:l.token,refresh_token:l.refresh_token,is_remember:l.is_remember||!1}}catch(l){throw console.error("Session refresh failed:",l),l}}));return e.update(a.token,a.refresh_token,a.is_remember),this.onRefreshSession(a),e})}unlinkEmail(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.unlinkEmail(e.token,t).then(i=>i!==void 0)})}updateUsername(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUsername(e.token,t).then(i=>Promise.resolve(i))})}updateAccount(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateAccount(e.token,t).then(i=>i!==void 0)})}updateChannelDesc(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelDesc(e.token,t,i).then(a=>a!==void 0)})}updateClanDesc(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanDesc(e.token,t,i).then(a=>a!==void 0)})}updateCategory(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateCategory(e.token,t,i).then(a=>a!==void 0)})}updateUserProfileByClan(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUserProfileByClan(e.token,t,i).then(a=>a!==void 0)})}updateRole(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateRole(e.token,t,i).then(a=>a!==void 0)})}updateEvent(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateEvent(e.token,t,i).then(a=>a!==void 0)})}updateApp(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateApp(e.token,t,i).then(a=>Promise.resolve(a))})}createLinkInviteUser(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createLinkInviteUser(e.token,t).then(i=>Promise.resolve(i))})}getLinkInvite(e){return m(this,null,function*(){return this.apiClient.getLinkInvite(this.serverkey,"",e).then(t=>Promise.resolve(t))})}GetRoleOfUserInTheClan(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getRoleOfUserInTheClan(e.token,t).then(i=>Promise.resolve(i))})}inviteUser(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.inviteUser(e.token,t).then(i=>Promise.resolve(i))})}setNotificationClan(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationClanSetting(e.token,t).then(i=>i!==void 0)})}setNotificationChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationChannelSetting(e.token,t).then(i=>i!==void 0)})}setMuteCategory(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setMuteCategory(e.token,t).then(i=>i!==void 0)})}setMuteChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setMuteChannel(e.token,t).then(i=>i!==void 0)})}updateChannelPrivate(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelPrivate(e.token,t).then(i=>i!==void 0)})}setNotificationCategory(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationCategorySetting(e.token,t).then(i=>i!==void 0)})}deleteNotificationCategory(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotificationCategorySetting(e.token,t).then(i=>i!==void 0)})}deleteNotificationChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotificationChannel(e.token,t).then(i=>i!==void 0)})}setNotificationReactMessage(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setNotificationReactMessage(e.token,{channel_id:t}).then(i=>i!==void 0)})}deleteNotiReactMessage(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteNotiReactMessage(e.token,t).then(i=>i!==void 0)})}searchMessage(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.searchMessage(e.token,t).then(i=>Promise.resolve(i))})}createMessage2Inbox(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createMessage2Inbox(e.token,t).then(i=>Promise.resolve(i))})}createPinMessage(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createPinMessage(e.token,t).then(i=>Promise.resolve(i))})}pinMessagesList(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPinMessagesList(e.token,t,i,a).then(l=>{let d={pin_messages_list:[]};return l.pin_messages_list==null||l.pin_messages_list.forEach(c=>{d.pin_messages_list.push({id:c.id,avatar:c.avatar,channel_id:c.channel_id,content:c.content,create_time_seconds:c.create_time_seconds,message_id:c.message_id,sender_id:c.sender_id,username:c.username,attachment:c.attachment})}),Promise.resolve(d)})})}deletePinMessage(e,t,i,a,l){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deletePinMessage(e.token,t,i,a,l).then(d=>d!==void 0)})}createClanEmoji(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createClanEmoji(e.token,t).then(i=>i!==void 0)})}updateClanEmojiById(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanEmojiById(e.token,t,i).then(a=>a!==void 0)})}deleteByIdClanEmoji(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanEmojiById(e.token,t,i,a).then(l=>l!==void 0)})}generateWebhookLink(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateWebhook(e.token,t).then(i=>Promise.resolve(i))})}listWebhookByChannelId(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listWebhookByChannelId(e.token,t,i).then(a=>Promise.resolve(a))})}updateWebhookById(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateWebhookById(e.token,t,i).then(a=>a!==void 0)})}deleteWebhookById(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteWebhookById(e.token,t,i).then(a=>a!==void 0)})}addClanSticker(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addClanSticker(e.token,t).then(i=>i!==void 0)})}deleteClanStickerById(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanStickerById(e.token,t,i,a).then(l=>l!==void 0)})}updateClanStickerById(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanStickerById(e.token,t,i).then(a=>a!==void 0)})}changeChannelCategory(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.changeChannelCategory(e.token,t,i).then(a=>a!==void 0)})}setRoleChannelPermission(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setRoleChannelPermission(e.token,t).then(i=>i!==void 0)})}addApp(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addApp(e.token,t).then(i=>Promise.resolve(i))})}getApp(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getApp(e.token,t).then(i=>Promise.resolve(i))})}listApps(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listApps(e.token).then(t=>Promise.resolve(t))})}addAppToClan(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addAppToClan(e.token,t,i).then(a=>a!==void 0)})}getSystemMessagesList(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getSystemMessagesList(e.token).then(t=>Promise.resolve(t))})}getSystemMessageByClanId(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getSystemMessageByClanId(e.token,t).then(i=>Promise.resolve(i))})}createSystemMessage(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createSystemMessage(e.token,t).then(i=>Promise.resolve(i))})}updateSystemMessage(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateSystemMessage(e.token,t,i).then(a=>Promise.resolve(a))})}deleteSystemMessage(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteSystemMessage(e.token,t).then(i=>Promise.resolve(i))})}updateCategoryOrder(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateCategoryOrder(e.token,t).then(i=>Promise.resolve(i))})}givecoffee(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.giveMeACoffee(e.token,t).then(i=>i!==void 0)})}sendToken(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sendToken(e.token,t).then(i=>i!==void 0)})}listStreamingChannelUsers(e,t,i,a,l,d,c){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listStreamingChannelUsers(e.token,t,i,a,d,l,c).then(u=>{let o={streaming_channel_users:[]};return u.streaming_channel_users==null||u.streaming_channel_users.forEach(n=>{o.streaming_channel_users.push({id:n.id,channel_id:n.channel_id,user_id:n.user_id,participant:n.participant})}),Promise.resolve(o)})})}registerStreamingChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registerStreamingChannel(e.token,t).then(i=>i!==void 0)})}listChannelApps(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelApps(e.token,t).then(i=>{let a={channel_apps:[]};return i.channel_apps==null||i.channel_apps.forEach(l=>{a.channel_apps.push({id:l.id,channel_id:l.channel_id,app_id:l.app_id,clan_id:l.clan_id,app_url:l.app_url,app_name:l.app_name,app_logo:l.app_logo})}),Promise.resolve(a)})})}getChannelCategoryNotiSettingsList(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCategoryNotiSettingsList(e.token,t).then(i=>Promise.resolve(i))})}getNotificationCategory(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationCategory(e.token,t).then(i=>Promise.resolve(i))})}getNotificationChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationChannel(e.token,t).then(i=>Promise.resolve(i))})}getNotificationClan(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationClan(e.token,t).then(i=>Promise.resolve(i))})}getNotificationReactMessage(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getNotificationReactMessage(e.token,t).then(i=>Promise.resolve(i))})}listChannelByUserId(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelByUserId(e.token).then(t=>Promise.resolve(t))})}listChannelUsersUC(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelUsersUC(e.token,t,i).then(a=>Promise.resolve(a))})}getListEmojisByUserId(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListEmojisByUserId(e.token).then(t=>Promise.resolve(t))})}emojiRecentList(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.emojiRecentList(e.token).then(t=>Promise.resolve(t))})}getListStickersByUserId(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListStickersByUserId(e.token).then(t=>Promise.resolve(t))})}listUserClansByUserId(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listUserClansByUserId(e.token).then(t=>Promise.resolve(t))})}listRoles(e,t,i,a,l){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listRoles(e.token,t,i,a,l).then(d=>{let c={clan_id:t,roles:d.roles};return Promise.resolve(c)})})}listUserPermissionInChannel(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listUserPermissionInChannel(e.token,t,i).then(a=>{let l={clan_id:t,channel_id:i,permissions:a.permissions};return Promise.resolve(l)})})}getPermissionByRoleIdChannelId(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPermissionByRoleIdChannelId(e.token,t,i,a).then(l=>{let d={role_id:t,channel_id:i,permission_role_channel:l.permission_role_channel,user_id:a};return Promise.resolve(d)})})}markAsRead(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.markAsRead(e.token,t).then(i=>Promise.resolve(i))})}listThreadDescs(e,t,i,a,l,d,c){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listThreadDescs(e.token,t,i,a,l,d,c).then(u=>{let o={channeldesc:[]};return u.channeldesc==null||(o.channeldesc=u.channeldesc),Promise.resolve(o)})})}listChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelTimeline(e.token,t).then(i=>{var a;return(a=i.events)==null||a.forEach(l=>{l.attachments=[];let d;try{let c=B(l.preview_imgs);d=(c==null?void 0:c.attachments)||c||b(l.preview_imgs||"[]")}catch(c){d=b(l.preview_imgs||"[]")}Array.isArray(d)?l.preview_imgs=d:l.preview_imgs=[]}),Promise.resolve(i)})})}createChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createChannelTimeline(e.token,t).then(i=>{let a=i.event;if(a){let l,d;try{let c=B(a.attachments),u=B(a.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(a.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(a.preview_imgs||"[]")}catch(c){l=b(a.attachments||"[]"),d=b(a.preview_imgs||"[]")}Array.isArray(l)?a.attachments=l:a.attachments=[],Array.isArray(d)?a.preview_imgs=d:a.preview_imgs=[]}return Promise.resolve(i)})})}updateChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelTimeline(e.token,t).then(i=>{let a=i.event;if(a){let l,d;try{let c=B(a.attachments),u=B(a.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(a.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(a.preview_imgs||"[]")}catch(c){l=b(a.attachments||"[]"),d=b(a.preview_imgs||"[]")}Array.isArray(l)?a.attachments=l:a.attachments=[],Array.isArray(d)?a.preview_imgs=d:a.preview_imgs=[]}return Promise.resolve(i)})})}detailChannelTimeline(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.detailChannelTimeline(e.token,t).then(i=>{let a=i.event;if(a){let l,d;try{let c=B(a.attachments),u=B(a.preview_imgs);l=(c==null?void 0:c.attachments)||c||b(a.attachments||"[]"),d=(u==null?void 0:u.attachments)||u||b(a.preview_imgs||"[]")}catch(c){l=b(a.attachments||"[]"),d=b(a.preview_imgs||"[]")}Array.isArray(l)?a.attachments=l:a.attachments=[],Array.isArray(d)?a.preview_imgs=d:a.preview_imgs=[]}return Promise.resolve(i)})})}leaveThread(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.leaveThread(e.token,t,i).then(a=>Promise.resolve(a))})}archiveChannel(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.archiveChannel(e.token,t,i).then(a=>Promise.resolve(a))})}listArchivedChannelDescs(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listArchivedChannelDescs(e.token,t).then(i=>Promise.resolve(i))})}getChannelSettingInClan(e,t,i,a,l,d,c,u,o,n,r){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listChannelSetting(e.token,t,i,a,l,d,c,u,o,n,r).then(h=>Promise.resolve(h))})}getChannelCanvasList(e,t,i,a,l){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCanvasList(e.token,t,i,a,l).then(d=>{let c={channel_canvases:[]};return d.channel_canvases==null||(c.clan_id=d.clan_id,c.channel_id=d.channel_id,c.channel_canvases=d.channel_canvases,c.count=d.count),Promise.resolve(c)})})}getChannelCanvasDetail(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChannelCanvasDetail(e.token,t,i,a).then(l=>Promise.resolve(l))})}editChannelCanvases(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.editChannelCanvases(e.token,t).then(i=>Promise.resolve(i))})}deleteChannelCanvas(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelCanvas(e.token,t,i,a).then(l=>l!==void 0)})}addFavoriteChannel(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addChannelFavorite(e.token,{channel_id:t,clan_id:i}).then(a=>a)})}removeFavoriteChannel(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeChannelFavorite(e.token,t,i).then(a=>a)})}getListFavoriteChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getListFavoriteChannel(e.token,t).then(i=>i)})}listActivity(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listActivity(e.token).then(t=>t)})}createActiviy(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createActiviy(e.token,t).then(i=>i)})}createQRLogin(e){return m(this,null,function*(){let t=yield this.apiClient.createQRLogin(this.serverkey,"",e);return{login_id:t.login_id,create_time_second:t.create_time_second}})}checkLoginRequest(e){return m(this,null,function*(){let t=yield this.apiClient.checkLoginRequest(this.serverkey,"",e);return t!=null&&t.token?new O(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1):null})}confirmLogin(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.confirmLogin(e.token,t,i).then(a=>a)})}getChanEncryptionMethod(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getChanEncryptionMethod(e.token,t).then(i=>i)})}setChanEncryptionMethod(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.setChanEncryptionMethod(e.token,t,{method:i}).then(a=>a)})}getPubKeys(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPubKeys(e.token,t).then(i=>i)})}pushPubKey(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.pushPubKey(e.token,{PK:t}).then(i=>i)})}getKeyServer(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getKeyServer(e.token).then(t=>t)})}listAuditLog(e,t,i,a,l){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listAuditLog(e.token,t,i,a,l).then(d=>d)})}listOnboarding(e,t,i,a,l){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listOnboarding(e.token,t,i,a,l).then(d=>d)})}getOnboardingDetail(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getOnboardingDetail(e.token,t,i).then(a=>Promise.resolve(a))})}createOnboarding(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createOnboarding(e.token,t).then(i=>i)})}updateOnboarding(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateOnboarding(e.token,t,i).then(a=>a!==void 0)})}deleteOnboarding(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteOnboarding(e.token,t,i).then(a=>a!==void 0)})}generateClanWebhook(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateClanWebhook(e.token,t).then(i=>Promise.resolve(i))})}listClanWebhook(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listClanWebhook(e.token,t).then(i=>Promise.resolve(i))})}deleteClanWebhookById(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteClanWebhookById(e.token,t,i).then(a=>a!==void 0)})}updateClanWebhookById(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanWebhookById(e.token,t,i).then(a=>a!==void 0)})}listOnboardingStep(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listOnboardingStep(e.token,t,i,a).then(l=>Promise.resolve(l))})}updateOnboardingStepByClanId(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateOnboardingStepByClanId(e.token,t,i).then(a=>a!==void 0)})}updateUserStatus(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUserStatus(e.token,t).then(i=>i!==void 0)})}updateUserCustomStatus(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateUserCustomStatus(e.token,t).then(i=>i!==void 0)})}getUserStatus(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getUserStatus(e.token).then(t=>Promise.resolve(t))})}listSdTopic(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listSdTopic(e.token,t,i).then(a=>Promise.resolve(a))})}createSdTopic(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createSdTopic(e.token,t).then(i=>i)})}getTopicDetail(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getTopicDetail(e.token,t).then(i=>Promise.resolve(i))})}createRoomChannelApps(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createRoomChannelApps(e.token,t).then(i=>Promise.resolve(i))})}generateMeetToken(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateMeetToken(e.token,t).then(i=>Promise.resolve(i))})}listMezonOauthClient(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listMezonOauthClient(e.token).then(t=>Promise.resolve(t))})}getMezonOauthClient(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getMezonOauthClient(e.token,t,i).then(a=>Promise.resolve(a))})}updateMezonOauthClient(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateMezonOauthClient(e.token,t).then(i=>Promise.resolve(i))})}searchThread(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.searchThread(e.token,t,i,a).then(l=>Promise.resolve(l))})}generateHashChannelApps(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.generateHashChannelApps(e.token,t).then(i=>Promise.resolve(i))})}registrationPassword(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.registrationEmail(e.token,{email:t,password:i,old_password:a}).then(l=>Promise.resolve(l))})}addUserEvent(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addUserEvent(e.token,t).then(i=>i!==void 0)})}deleteUserEvent(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteUserEvent(e.token,t,i).then(a=>a!==void 0)})}updateRoleOrder(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateRoleOrder(e.token,t).then(i=>Promise.resolve(i))})}deleteAccount(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteAccount(e.token).then(t=>Promise.resolve(t))})}createExternalMezonMeet(e){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createExternalMezonMeet(e.token).then(t=>Promise.resolve(t))})}generateMeetTokenExternal(e,t,i,a,l){return m(this,null,function*(){return this.apiClient.generateMeetTokenExternal("",e,t,i,a,l).then(d=>Promise.resolve(d))})}removeMezonMeetParticipant(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.removeParticipantMezonMeet(e.token,t).then(i=>Promise.resolve(i))})}muteMezonMeetParticipant(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.muteParticipantMezonMeet(e.token,t).then(i=>Promise.resolve(i))})}updateClanOrder(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateClanOrder(e.token,t).then(i=>i!==void 0)})}listClanDiscover(e,t){return m(this,null,function*(){return this.apiClient.clanDiscover(this.serverkey,"",e,t).then(i=>Promise.resolve(i))})}listQuickMenuAccess(e,t,i,a){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listQuickMenuAccess(e.token,t,i,a).then(l=>Promise.resolve(l))})}deleteQuickMenuAccess(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteQuickMenuAccess(e.token,t,i).then(a=>a!==void 0)})}addQuickMenuAccess(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addQuickMenuAccess(e.token,t).then(i=>i!==void 0)})}updateQuickMenuAccess(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateQuickMenuAccess(e.token,t).then(i=>i!==void 0)})}listForSaleItems(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listForSaleItems(e.token,t).then(i=>Promise.resolve(i))})}isFollower(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.isFollower(e.token,t).then(i=>Promise.resolve(i))})}transferOwnership(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.transferOwnership(e.token,t).then(i=>i!==void 0)})}isBanned(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.isBanned(e.token,t).then(i=>Promise.resolve(i))})}reportMessageAbuse(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.reportMessageAbuse(e.token,t,i).then(a=>a!==void 0)})}updateMezonVoiceState(e,t,i,a,l,d){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateMezonVoiceState(e.token,t,i,a,l,d).then(c=>c!==void 0)})}sendChannelMessage(e,t,i,a,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.sendChannelMessage(e.token,t,i,a,l,d,c,u,o,n,r,h,f,_).then(A=>Promise.resolve(A))})}updateChannelMessage(e,t,i,a,l,d,c,u,o,n,r,h){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.updateChannelMessage(e.token,t,i,a,l,d,c,u,o,n,r,h).then(f=>Promise.resolve(f))})}deleteChannelMessage(e,t,i,a,l,d,c,u,o,n){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.deleteChannelMessage(e.token,t,i,a,l,d,c,u,o,n).then(r=>Promise.resolve(r))})}messageButtonClick(e,t,i,a,l,d,c){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.messageButtonClick(e.token,t,i,a,l,d,c).then(u=>Promise.resolve(u))})}dropdownBoxSelected(e,t,i,a,l,d,c){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.dropdownBoxSelected(e.token,t,i,a,l,d,c).then(u=>Promise.resolve(u))})}activeArchivedThread(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.activeArchivedThread(e.token,t,i).then(a=>Promise.resolve(a))})}addAgentToChannel(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.addAgentToChannel(e.token,t,i).then(a=>Promise.resolve(a))})}disconnectAgent(e,t,i){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.disconnectAgent(e.token,t,i).then(a=>Promise.resolve(a))})}listMutedChannel(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.listMutedChannel(e.token,t).then(i=>Promise.resolve(i))})}channelMessageReact(e,t,i,a,l,d,c,u,o,n,r,h,f,_){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.channelMessageReact(e.token,t,i,a,l,d,c,u,o,n,r,h,f,_).then(A=>Promise.resolve(A))})}createPoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.createPoll(e.token,t)})}votePoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.votePoll(e.token,t)})}closePoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.closePoll(e.token,t)})}getPoll(e,t){return m(this,null,function*(){return this.autoRefreshSession&&e.refresh_token&&e.isexpired(Date.now()/1e3)&&(yield this.sessionRefresh(e)),this.apiClient.getPoll(e.token,t)})}};return ye(ze);})();
|
|
1
|
+
"use strict";var mezonjs=(()=>{var de=Object.create;var T=Object.defineProperty,le=Object.defineProperties,ue=Object.getOwnPropertyDescriptor,pe=Object.getOwnPropertyDescriptors,he=Object.getOwnPropertyNames,Z=Object.getOwnPropertySymbols,me=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable;var X=(_,e,t)=>e in _?T(_,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):_[e]=t,w=(_,e)=>{for(var t in e||(e={}))ee.call(e,t)&&X(_,t,e[t]);if(Z)for(var t of Z(e))ge.call(e,t)&&X(_,t,e[t]);return _},E=(_,e)=>le(_,pe(e));var L=(_=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(_,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):_)(function(_){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+_+'" is not supported')});var _e=(_,e)=>{for(var t in e)T(_,t,{get:e[t],enumerable:!0})},te=(_,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of he(e))!ee.call(_,s)&&s!==t&&T(_,s,{get:()=>e[s],enumerable:!(n=ue(e,s))||n.enumerable});return _};var J=(_,e,t)=>(t=_!=null?de(me(_)):{},te(e||!_||!_.__esModule?T(t,"default",{value:_,enumerable:!0}):t,_)),fe=_=>te(T({},"__esModule",{value:!0}),_);var l=(_,e,t)=>new Promise((n,s)=>{var c=o=>{try{i(t.next(o))}catch(a){s(a)}},d=o=>{try{i(t.throw(o))}catch(a){s(a)}},i=o=>o.done?n(o.value):Promise.resolve(o.value).then(c,d);i((t=t.apply(_,e)).next())});var ke={};_e(ke,{ApiAppRole:()=>ne,ChannelStreamMode:()=>se,ChannelType:()=>ie,Client:()=>$,ConnectionState:()=>p,CreateChannelMessageFromEvent:()=>V,NotificationType:()=>re,RefreshTokenManager:()=>x,Session:()=>q,WebrtcSignalingType:()=>oe,b64DecodeUnicode:()=>ye,b64EncodeUnicode:()=>Ae,buildFetchOptions:()=>m,decodeAttachments:()=>B,decodeChannelTimelineAttachments:()=>k,decodeMentions:()=>D,decodeNotificationFcm:()=>H,decodeReactions:()=>F,decodeRefs:()=>N,encodeAttachments:()=>Ce,encodeMentions:()=>be,encodeNotificationFcm:()=>Se,encodeReactions:()=>Re,encodeRefs:()=>Pe,safeJSONParse:()=>P});var wr=L("whatwg-fetch");var W=L("js-base64"),R=J(L("mezon-js-protobuf"));function m(_,e,t){let n=w({method:_},e);return n.headers=w({},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(s=>{n.headers[s]||delete n.headers[s]}),t&&(n.body=t),n}function Ae(_){return(0,W.encode)(encodeURIComponent(_).replace(/%([0-9A-F]{2})/g,function(t,n){return String.fromCharCode(+("0x"+n))}))}function ye(_){return decodeURIComponent((0,W.decode)(_).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function P(_){if(_==null)return{t:_};let e;if(_ instanceof Uint8Array)e=new TextDecoder().decode(_);else if(typeof _=="string")e=_;else return typeof _=="object"?_:{t:_};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 z=_=>!_||_===null||_===void 0||_===""||_==="[]";function D(_){if(z(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,s=new Uint8Array(n);return R.MessageMentionList.decode(s)}catch(n){return P(_)}}function B(_){if(z(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,s=new Uint8Array(n);return R.MessageAttachmentList.decode(s)}catch(n){return P(_)}}function k(_){if(z(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,s=new Uint8Array(n);return R.ListChannelTimelineAttachment.decode(s)}catch(n){return P(_)}}function N(_){if(z(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,s=new Uint8Array(n);return R.MessageRefList.decode(s)}catch(n){return P(_)}}function F(_){if(z(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,s=new Uint8Array(n);return R.MessageReactionList.decode(s)}catch(n){return P(_)}}function H(_){if(z(_))return;let e=_[0];if(e===91||e===123)return P(_);try{let n=_,s=new Uint8Array(n);return R.DirectFcmProto.decode(s)}catch(n){return P(_)}}function be(_){return R.MessageMentionList.encode(R.MessageMentionList.fromPartial(_)).finish()}function Ce(_){return R.MessageAttachmentList.encode(R.MessageAttachmentList.fromPartial(_)).finish()}function Pe(_){return R.MessageRefList.encode(R.MessageRefList.fromPartial(_)).finish()}function Re(_){return R.MessageReactionList.encode(R.MessageReactionList.fromPartial(_)).finish()}function Se(_){return R.DirectFcmProto.encode(R.DirectFcmProto.fromPartial(_)).finish()}var ne=(c=>(c[c.USER_ROLE_UNKNOWN=0]="USER_ROLE_UNKNOWN",c[c.USER_ROLE_ADMIN=1]="USER_ROLE_ADMIN",c[c.USER_ROLE_DEVELOPER=2]="USER_ROLE_DEVELOPER",c[c.USER_ROLE_MAINTAINER=3]="USER_ROLE_MAINTAINER",c[c.USER_ROLE_READONLY=4]="USER_ROLE_READONLY",c))(ne||{}),ie=(a=>(a[a.CHANNEL_TYPE_CHANNEL=1]="CHANNEL_TYPE_CHANNEL",a[a.CHANNEL_TYPE_GROUP=2]="CHANNEL_TYPE_GROUP",a[a.CHANNEL_TYPE_DM=3]="CHANNEL_TYPE_DM",a[a.CHANNEL_TYPE_FORUM=5]="CHANNEL_TYPE_FORUM",a[a.CHANNEL_TYPE_STREAMING=6]="CHANNEL_TYPE_STREAMING",a[a.CHANNEL_TYPE_THREAD=7]="CHANNEL_TYPE_THREAD",a[a.CHANNEL_TYPE_APP=8]="CHANNEL_TYPE_APP",a[a.CHANNEL_TYPE_ANNOUNCEMENT=9]="CHANNEL_TYPE_ANNOUNCEMENT",a[a.CHANNEL_TYPE_MEZON_VOICE=10]="CHANNEL_TYPE_MEZON_VOICE",a))(ie||{}),se=(c=>(c[c.STREAM_MODE_CHANNEL=2]="STREAM_MODE_CHANNEL",c[c.STREAM_MODE_GROUP=3]="STREAM_MODE_GROUP",c[c.STREAM_MODE_DM=4]="STREAM_MODE_DM",c[c.STREAM_MODE_CLAN=5]="STREAM_MODE_CLAN",c[c.STREAM_MODE_THREAD=6]="STREAM_MODE_THREAD",c))(se||{}),re=(n=>(n[n.ALL_MESSAGE=1]="ALL_MESSAGE",n[n.MENTION_MESSAGE=2]="MENTION_MESSAGE",n[n.NOTHING_MESSAGE=3]="NOTHING_MESSAGE",n))(re||{}),oe=(a=>(a[a.WEBRTC_SDP_INIT=0]="WEBRTC_SDP_INIT",a[a.WEBRTC_SDP_OFFER=1]="WEBRTC_SDP_OFFER",a[a.WEBRTC_SDP_ANSWER=2]="WEBRTC_SDP_ANSWER",a[a.WEBRTC_ICE_CANDIDATE=3]="WEBRTC_ICE_CANDIDATE",a[a.WEBRTC_SDP_QUIT=4]="WEBRTC_SDP_QUIT",a[a.WEBRTC_SDP_TIMEOUT=5]="WEBRTC_SDP_TIMEOUT",a[a.WEBRTC_SDP_NOT_AVAILABLE=6]="WEBRTC_SDP_NOT_AVAILABLE",a[a.WEBRTC_SDP_JOINED_OTHER_CALL=7]="WEBRTC_SDP_JOINED_OTHER_CALL",a[a.WEBRTC_SDP_STATUS_REMOTE_MEDIA=8]="WEBRTC_SDP_STATUS_REMOTE_MEDIA",a))(oe||{});function V(_){let e,t,n,s,c,d;try{e=P(_.channel_message.content)}catch(o){console.log("content is invalid",o)}try{t=F(_.channel_message.reactions)}catch(o){console.log("reactions is invalid",o)}try{n=D(_.channel_message.mentions)}catch(o){console.log("mentions is invalid",o)}try{s=B(_.channel_message.attachments)}catch(o){console.log("attachments is invalid",o)}try{c=N(_.channel_message.references)}catch(o){console.log("references is invalid",o)}try{d=_.channel_message.referenced_message}catch(o){console.log("referenced messages is invalid",o)}return{id:_.id||_.channel_message.message_id,avatar:_.channel_message.avatar,channel_id:_.channel_message.channel_id,mode:_.channel_message.mode,channel_label:_.channel_message.channel_label,clan_id:_.channel_message.clan_id,code:_.channel_message.code,message_id:_.channel_message.message_id,sender_id:_.channel_message.sender_id,update_time:_.channel_message.update_time,clan_logo:_.channel_message.clan_logo,category_name:_.channel_message.category_name,username:_.channel_message.username,clan_nick:_.channel_message.clan_nick,clan_avatar:_.channel_message.clan_avatar,display_name:_.channel_message.display_name,content:e,reactions:t==null?void 0:t.reactions,mentions:n==null?void 0:n.mentions,attachments:s==null?void 0:s.attachments,referenced_message:d,references:c==null?void 0:c.refs,hide_editted:_.channel_message.hide_editted,is_public:_.channel_message.is_public,create_time_seconds:_.channel_message.create_time_seconds,update_time_seconds:_.channel_message.update_time_seconds,topic_id:_.channel_message.topic_id}}var Q=J(L("js-base64")),q=class _{constructor(e,t,n,s,c,d,i){this.created=n;this.api_url=s;this.ws_url=c;this.id_token=d;this.token=e,this.refresh_token=t,this.id_token=d,this.api_url=s,this.ws_url=c,this.created_at=Math.floor(new Date().getTime()/1e3),this.is_remember=i,this.update(e,t,i)}isexpired(e){return this.expires_at-e<=0}isrefreshexpired(e){return this.refresh_expires_at-e<=0}update(e,t,n){let s=e.split(".");if(s.length!=3)throw"jwt is not valid.";let c=JSON.parse(Q.atob(s[1])),d=Math.floor(parseInt(c.exp));if(t){let i=t.split(".");if(i.length!=3)throw"refresh jwt is not valid.";let o=JSON.parse(Q.atob(i[1])),a=Math.floor(parseInt(o.exp));this.refresh_expires_at=a,this.refresh_token=t,this.is_remember=n}this.token=e,this.expires_at=d,this.username=c.usn,this.user_id=c.uid,this.vars=c.vrs}static restore(e,t,n,s,c){return new _(e,t,!1,n,s,"",c)}};var K=Symbol.for("mezon.refreshTokenManager"),x=class _{constructor(){this.pendingRefreshes=new Map}static getInstance(){let e=globalThis;return e[K]||(e[K]=new _),e[K]}refresh(e,t){return l(this,null,function*(){let n=this.pendingRefreshes.get(e);if(n)return n;let s=t().finally(()=>{this.pendingRefreshes.delete(e)});return this.pendingRefreshes.set(e,s),s})}isRefreshing(e){return this.pendingRefreshes.has(e)}get pendingCount(){return this.pendingRefreshes.size}};var M=L("js-base64"),r=J(L("mezon-js-protobuf")),ae=L("mezon-js-protobuf");var Y=(C=>(C[C.ListRoles=0]="ListRoles",C[C.ListEvents=1]="ListEvents",C[C.GetRoleOfUserInTheClan=2]="GetRoleOfUserInTheClan",C[C.GetListPermission=3]="GetListPermission",C[C.ListUserPermissionInChannel=4]="ListUserPermissionInChannel",C[C.GetNotificationClan=5]="GetNotificationClan",C[C.ListMutedChannel=6]="ListMutedChannel",C[C.ListStreamingChannelUsers=7]="ListStreamingChannelUsers",C[C.ListQuickMenuAccess=8]="ListQuickMenuAccess",C[C.GetNotificationChannel=9]="GetNotificationChannel",C[C.ListFriends=10]="ListFriends",C[C.EmojiRecentList=11]="EmojiRecentList",C[C.GetListEmojisByUserId=12]="GetListEmojisByUserId",C[C.ListChannelBadgeCount=13]="ListChannelBadgeCount",C[C.ListClanUsersStatus=14]="ListClanUsersStatus",C[C.ListChannelApps=15]="ListChannelApps",C[C.GetListFavoriteChannel=16]="GetListFavoriteChannel",C[C.ListCategoryDescs=17]="ListCategoryDescs",C[C.ListOnboarding=18]="ListOnboarding",C[C.GetListStickersByUserId=19]="GetListStickersByUserId",C[C.GetSystemMessageByClanId=20]="GetSystemMessageByClanId",C[C.GetPinMessagesList=21]="GetPinMessagesList",C[C.GetChannelCanvasList=22]="GetChannelCanvasList",C[C.ListChannelTimeline=23]="ListChannelTimeline",C[C.ListChannelMessages=24]="ListChannelMessages",C))(Y||{}),j=class j{constructor(e,t,n,s){this.serverKey=e;this.timeoutMs=t;this.cIds={},this.nextCid=1,this.basePath=s,n?this.adapter=n:this.adapter=new ae.WebSocketAdapter}setOnOpen(e){this.adapter.onOpen=e}setOnError(e){this.adapter.onError=e}close(){this.adapter.close()}generatecid(){let e=this.nextCid;return++this.nextCid,e}setTransportAdapter(e){this.adapter=e}setFallbackSession(e){}getApiFromPath(e){if(e in Y)return Y[e]}connect(e,t=!1,n=!1,s,c,d){let[i,o]=e.ws_url.split(":");this.adapter.connect(i,o,t,e.token,d),this.adapter.onClose=c,this.adapter.onMessage=(a,u,h)=>l(this,null,function*(){if(n&&window&&window.console&&console.log("incomming message with cid %o and message %o",a,h),a!=0){let g=this.cIds[a];if(!g){console.error("No promise executor for message: %o",h);return}delete this.cIds[a],h.error?g.reject(h.error):g.resolve({code:u,message:h})}else yield s(0,0,h)})}send(e,t=j.DefaultSendTimeoutMs){let{urlPath:n,fetchOptions:s}=e,c=s;if(n!=null&&n.includes("/mezon.api.Mezon/")){let d=n.substring(17);c={api_request_event:{api_index:this.getApiFromPath(d),api_name:d,body:s.body}}}return new Promise((d,i)=>{var o,a;if(!this.adapter.isOpen())i("Socket connection has not been established yet.");else{c.channel_message_send?c.channel_message_send.content=JSON.stringify(c.channel_message_send.content):c.channel_message_update?c.channel_message_update.content=JSON.stringify(c.channel_message_update.content):c.ephemeral_message_send?c.ephemeral_message_send.message.content=JSON.stringify((o=c.ephemeral_message_send.message)==null?void 0:o.content):c.quick_menu_event&&(c.quick_menu_event.message.content=JSON.stringify((a=c.quick_menu_event.message)==null?void 0:a.content));let u=this.generatecid();this.cIds[u]={resolve:d,reject:i},t!==1/0&&t>0&&setTimeout(()=>{i("The socket timed out while waiting for a response.")},t),c.cid=u.toString(),this.adapter.send(c)}})}setBasePath(e){this.basePath=e}deleteAccount(e,t={}){let n="/mezon.api.Mezon/DeleteAccount",c=m("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(d=>d),new Promise((d,i)=>setTimeout(i,this.timeoutMs,"Request timed out."))])}getAccount(e,t={}){let n="/mezon.api.Mezon/GetAccount",c=m("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(d=>l(this,null,function*(){return d.code!=0?{}:r.Account.decode(d.message)})),new Promise((d,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}updateAccount(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateAccount",d=r.UpdateAccountRequest.encode(r.UpdateAccountRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}checkLoginRequest(e,t,n,s={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/checklogin",d=new Map,i="";i=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,d),a=m("POST",s,i);return e&&(a.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(u=>l(this,null,function*(){let h=yield u.arrayBuffer();return r.Session.decode(new Uint8Array(h))})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}confirmLogin(e,t,n,s={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/confirmlogin",d=new Map,i="";i=JSON.stringify(n||{});let o=this.buildFullUrl(t,c,d),a=m("POST",s,i);return e&&(a.headers.Authorization="Bearer "+e),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(u=>u),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createQRLogin(e,t,n,s={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/createqrlogin",d=new Map,i="";i=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,d),a=m("POST",s,i);return e&&(a.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(u=>l(this,null,function*(){let h=yield u.arrayBuffer();return r.LoginIDResponse.decode(new Uint8Array(h))})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateSMSOTPRequest(e,t,n,s={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/smsotp",d=new Map,i="";i=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,d),a=m("POST",s,i);return e&&(a.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(u=>l(this,null,function*(){let h=yield u.arrayBuffer();return r.LinkAccountConfirmRequest.decode(new Uint8Array(h))})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}AuthenticateEmailOTPRequest(e,t,n,s={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/emailotp",d=new Map,i="";i=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,d),a=m("POST",s,i);return e&&(a.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(u=>l(this,null,function*(){let h=yield u.arrayBuffer();return r.LinkAccountConfirmRequest.decode(new Uint8Array(h))})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}authenticateEmail(e,t,n,s={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/email",d=new Map,i="";i=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,d),a=m("POST",s,i);return e&&(a.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(u=>l(this,null,function*(){let h=yield u.arrayBuffer();return r.Session.decode(new Uint8Array(h))})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}authenticateMezon(e,t,n,s,c,d,i={}){if(n==null)throw new Error("'account' is a required parameter but is null or undefined.");let o="/v2/account/authenticate/mezon",a=new Map;a.set("create",s),a.set("username",c),a.set("is_remember",d);let u="";u=JSON.stringify(n||{});let h=this.buildFullUrl(this.basePath,o,a),g=m("POST",i,u);return e&&(g.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),g.headers.Accept="application/x-protobuf",Promise.race([fetch(h,g).then(f=>l(this,null,function*(){let A=yield f.arrayBuffer();return r.Session.decode(new Uint8Array(A))})),new Promise((f,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}linkEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/LinkEmail",d=r.AccountEmail.encode(r.AccountEmail.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.LinkAccountConfirmRequest.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}linkSMS(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/LinkSMS",d=r.AccountMezon.encode(r.AccountMezon.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.LinkAccountConfirmRequest.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}confirmLinkMezonOTP(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ConfirmLinkMezonOTP",d=r.LinkAccountConfirmRequest.encode(r.LinkAccountConfirmRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),i.headers.Accept="application/x-protobuf",Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.Session.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}confirmAuthenticateOTP(e,t,n,s={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/v2/account/authenticate/confirmotp",d=new Map,i="";i=JSON.stringify(n||{});let o=this.buildFullUrl(this.basePath,c,d),a=m("POST",s,i);return e&&(a.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(u=>l(this,null,function*(){let h=yield u.arrayBuffer();return r.Session.decode(new Uint8Array(h))})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}registrationEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/RegistrationEmail",d=r.RegistrationEmailRequest.encode(r.RegistrationEmailRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.Session.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}sessionRefresh(e,t,n,s={}){if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/SessionRefresh",i=r.SessionRefreshRequest.encode(r.SessionRefreshRequest.fromPartial(n)).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.Session.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}unlinkEmail(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UnlinkEmail",d=r.AccountEmail.encode(r.AccountEmail.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listActivity(e,t={}){let n="/mezon.api.Mezon/ListActivity",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.ListUserActivity.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createActiviy(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateActiviy",d=r.CreateActivityRequest.encode(r.CreateActivityRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.UserActivity.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}addApp(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/AddApp",d=r.AddAppRequest.encode(r.AddAppRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.App.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listApps(e,t,n,s,c={}){let d="/mezon.api.Mezon/ListApps",o=r.ListAppsRequest.encode(r.ListAppsRequest.fromPartial({filter:t,tombstones:n,cursor:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.AppList.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addAppToClan(e,t,n,s={}){if(t==null)throw new Error("'appId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/AddAppToClan",i=r.AppClan.encode(r.AppClan.fromPartial({app_id:t,clan_id:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a})),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}deleteApp(e,t,n={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteApp",d=r.App.encode(r.App.fromPartial({id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o})),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getApp(e,t,n={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GetApp",d=r.App.encode(r.App.fromPartial({id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.App.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateApp(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateApp",i=r.UpdateAppRequest.encode(r.UpdateAppRequest.fromPartial(E(w({},n),{id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.App.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listAuditLog(e,t,n,s,c,d={}){let i="/mezon.api.Mezon/ListAuditLog",a=r.ListAuditLogRequest.encode(r.ListAuditLogRequest.fromPartial({clan_id:s,user_id:n,action_log:t,date_log:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>l(this,null,function*(){return r.ListAuditLog.decode(h)})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}updateCategoryOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateCategoryOrder",d=r.UpdateCategoryOrderRequest.encode(r.UpdateCategoryOrderRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o})),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listCategoryDescs(e,t,n,s,c,d,i={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/ListCategoryDescs",u=r.CategoryDesc.encode(r.CategoryDesc.fromPartial({clan_id:t,creator_id:n,category_name:s,category_id:c,category_order:d})).finish(),h=m("POST",i,"");return h.body=u,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(g=>l(this,null,function*(){return g.code!=0?{}:r.CategoryDescList.decode(g.message)})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}listChannelApps(e,t,n={}){let s="/mezon.api.Mezon/ListChannelApps",d=r.ListChannelAppsRequest.encode(r.ListChannelAppsRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ListChannelAppsResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasList(e,t,n,s,c,d={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/GetChannelCanvasList",a=r.ChannelCanvasListRequest.encode(r.ChannelCanvasListRequest.fromPartial({channel_id:t,clan_id:n,limit:s,page:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>l(this,null,function*(){return h.code!=0?{}:r.ChannelCanvasListResponse.decode(h.message)})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}addChannelFavorite(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/AddChannelFavorite",d=r.AddFavoriteChannelRequest.encode(r.AddFavoriteChannelRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return r.AddFavoriteChannelResponse.decode(o)})),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}removeChannelFavorite(e,t,n,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveChannelFavorite",i=r.RemoveFavoriteChannelRequest.encode(r.RemoveFavoriteChannelRequest.fromPartial({channel_id:t,clan_id:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a})),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}getListFavoriteChannel(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GetListFavoriteChannel",d=r.ListFavoriteChannelRequest.encode(r.ListFavoriteChannelRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ListFavoriteChannelResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelMessages(e,t,n,s,c,d,i,o={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelMessages",h=r.ListChannelMessagesRequest.encode(r.ListChannelMessagesRequest.fromPartial({clan_id:t,channel_id:n,message_id:s,direction:c,limit:d,topic_id:i})).finish(),g=m("POST",o,"");return g.body=h,e&&(g.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:g}).then(f=>l(this,null,function*(){return r.ChannelMessageList.decode(f)})),new Promise((f,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}addChannelUsers(e,t,n,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/AddChannelUsers",i=r.AddChannelUsersRequest.encode(r.AddChannelUsersRequest.fromPartial({channel_id:t,user_ids:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a})),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}listChannelAttachment(e,t,n,s,c,d,i,o,a,u={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let h="/mezon.api.Mezon/ListChannelAttachment",f=r.ListChannelAttachmentRequest.encode(r.ListChannelAttachmentRequest.fromPartial({channel_id:t,clan_id:n,file_type:s,limit:c,state:d,before:i,after:o,around:a})).finish(),A=m("POST",u,"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:h,fetchOptions:A}).then(y=>l(this,null,function*(){return y.code!=0?{}:r.ChannelAttachmentList.decode(y.message)})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}getChanEncryptionMethod(e,t,n,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetChanEncryptionMethod",i=r.ChanEncryptionMethod.encode(r.ChanEncryptionMethod.fromPartial({channel_id:t,method:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.ChanEncryptionMethod.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}setChanEncryptionMethod(e,t,n,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/SetChanEncryptionMethod",i=r.ChanEncryptionMethod.encode(r.ChanEncryptionMethod.fromPartial(E(w({},n),{channel_id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a})),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}leaveThread(e,t,n,s={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/LeaveThread",i=r.LeaveThreadRequest.encode(r.LeaveThreadRequest.fromPartial({channel_id:n,clan_id:t})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a})),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}archiveChannel(e,t,n,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ArchiveChannel",i=r.ArchiveChannelRequest.encode(r.ArchiveChannelRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a})),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}listArchivedChannelDescs(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListArchivedChannelDescs",d=r.ListArchivedChannelDescsRequest.encode(r.ListArchivedChannelDescsRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ListArchivedChannelDescsResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}removeChannelUsers(e,t,n,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveChannelUsers",i=r.RemoveChannelUsersRequest.encode(r.RemoveChannelUsersRequest.fromPartial({channel_id:t,user_ids:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a})),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}listChannelUsers(e,t,n,s,c,d,i,o={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListChannelUsers",h=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:n,channel_type:s,limit:c,state:d,cursor:i})).finish(),g=m("POST",o,"");return g.body=h,e&&(g.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:g}).then(f=>l(this,null,function*(){return f.code!=0?{}:r.ChannelUserList.decode(f.message)})),new Promise((f,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}listChannelDescs(e,t,n,s,c,d,i,o={}){let a="/mezon.api.Mezon/ListChannelDescs",h=r.ListChannelDescsRequest.encode(r.ListChannelDescsRequest.fromPartial({limit:t,state:n,page:s,clan_id:c,channel_type:d,is_mobile:i})).finish(),g=m("POST",o,"");return g.body=h,e&&(g.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:g}).then(f=>l(this,null,function*(){return f.code!=0?{}:r.ChannelDescList.decode(f.message)})),new Promise((f,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}createChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateChannelDesc",d=r.CreateChannelDescRequest.encode(r.CreateChannelDescRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ChannelDescription.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listChannelUsersUC(e,t,n,s={}){let c="/mezon.api.Mezon/ListChannelUsersUC",i=r.AllUsersAddChannelRequest.encode(r.AllUsersAddChannelRequest.fromPartial({channel_id:t,limit:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.AllUsersAddChannelResponse.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelDesc(e,t,n,s={}){if(n==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteChannelDesc",i=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}updateChannelDesc(e,t,n,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateChannelDesc",i=r.UpdateChannelDescRequest.encode(r.UpdateChannelDescRequest.fromPartial(E(w({},n),{channel_id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}listChannelSetting(e,t,n,s,c,d,i,o,a,u,h,g={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let f="/mezon.api.Mezon/ListChannelSetting",y=r.ChannelSettingListRequest.encode(r.ChannelSettingListRequest.fromPartial({clan_id:t,parent_id:n,category_id:s,active:d,private_channel:c,status:i,type:o,limit:a,page:u,channel_label:h})).finish(),b=m("POST",g,"");return b.body=y,e&&(b.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:f,fetchOptions:b}).then(S=>l(this,null,function*(){return S.code!=0?{}:r.ChannelSettingListResponse.decode(S.message)})),new Promise((S,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}listChannelVoiceUsers(e,t,n,s={}){let c="/mezon.api.Mezon/ListChannelVoiceUsers",i=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,limit:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.VoiceChannelUserList.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listClanDescs(e,t,n,s,c={}){let d="/mezon.api.Mezon/ListClanDescs",o=r.ListClanDescRequest.encode(r.ListClanDescRequest.fromPartial({limit:t,state:n,cursor:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.ClanDescList.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listChannelBadgeCount(e,t,n,s,c={}){let d="/mezon.api.Mezon/ListChannelBadgeCount",o=r.ListChannelBadgeCountRequest.encode(r.ListChannelBadgeCountRequest.fromPartial({clan_id:t,limit:n!=null?n:0,page:s!=null?s:0})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.ListChannelBadgeCountResponse.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listUserOnline(e,t,n,s,c={}){let d="/mezon.api.Mezon/ListUserOnline",o=r.ListUserOnlineRequest.encode(r.ListUserOnlineRequest.fromPartial({clan_id:t,limit:n!=null?n:0,page:s!=null?s:0})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.ListUserOnlineResponse.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createClanDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateClanDesc",d=r.CreateClanDescRequest.encode(r.CreateClanDescRequest.fromPartial({clan_name:t.clan_name,logo:t.logo,banner:t.banner})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ClanDesc.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanDesc(e,t,n={}){if(t==null)throw new Error("'clanDescId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteClanDesc",d=r.DeleteClanDescRequest.encode(r.DeleteClanDescRequest.fromPartial({clan_desc_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateClanDesc(e,t,n,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanDesc",i=r.UpdateClanDescRequest.encode(r.UpdateClanDescRequest.fromPartial(w({clan_id:t},n))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}removeClanUsers(e,t,n,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/RemoveClanUsers",i=r.RemoveClanUsersRequest.encode(r.RemoveClanUsersRequest.fromPartial({clan_id:t,user_ids:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listBannedUsers(e,t,n,s={}){let c="/mezon.api.Mezon/ListBannedUsers",i=r.BannedUserListRequest.encode(r.BannedUserListRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.BannedUserList.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}unbanClanUsers(e,t,n,s,c,d={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/UnbanClanUsers",a=r.BanClanUsersRequest.encode(r.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:n,user_ids:s,ban_time:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>l(this,null,function*(){return{}})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}banClanUsers(e,t,n,s,c,d={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/BanClanUsers",a=r.BanClanUsersRequest.encode(r.BanClanUsersRequest.fromPartial({clan_id:t,channel_id:n,user_ids:s,ban_time:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>l(this,null,function*(){return{}})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}listClanUsers(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListClanUsers",d=r.ListClanUsersRequest.encode(r.ListClanUsersRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ClanUserList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listClanUsersStatus(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListClanUsersStatus",d=r.ListClanUsersStatusRequest.encode(r.ListClanUsersStatusRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ClanUserStatusList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createCategoryDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateCategoryDesc",d=r.CreateCategoryDescRequest.encode(r.CreateCategoryDescRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.CategoryDesc.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}checkDuplicateName(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CheckDuplicateName",d=r.CheckDuplicateNameRequest.encode(r.CheckDuplicateNameRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){if(o.status>=200&&o.status<300)return r.CheckDuplicateNameResponse.decode(o);throw o})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteCategoryDesc(e,t,n,s,c={}){if(t==null)throw new Error("'categoryId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteCategoryDesc",o=r.DeleteCategoryDescRequest.encode(r.DeleteCategoryDescRequest.fromPartial({category_id:t,clan_id:n,category_label:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return{}})),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}registFCMDeviceToken(e,t,n,s,c,d={}){let i="/mezon.api.Mezon/RegistFCMDeviceToken",a=r.RegistFcmDeviceTokenRequest.encode(r.RegistFcmDeviceTokenRequest.fromPartial({token:t,device_id:n,platform:s,voip_token:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>l(this,null,function*(){return h.code!=0?{}:r.RegistFcmDeviceTokenResponse.decode(h.message)})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}closeDirectMess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CloseDMByChannelId",d=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}openDirectMess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/OpenDMByChannelId",d=r.DeleteChannelDescRequest.encode(r.DeleteChannelDescRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createClanEmoji(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateClanEmoji",d=r.ClanEmojiCreateRequest.encode(r.ClanEmojiCreateRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanEmojiById(e,t,n,s,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteByIdClanEmoji",o=r.ClanEmojiDeleteRequest.encode(r.ClanEmojiDeleteRequest.fromPartial({id:t,clan_id:n,emoji_label:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return{}})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanEmojiById(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanEmojiById",i=r.ClanEmojiUpdateRequest.encode(r.ClanEmojiUpdateRequest.fromPartial({id:n.id,shortname:n.shortname,clan_id:n.clan_id})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}emojiRecentList(e,t={}){let n="/mezon.api.Mezon/EmojiRecentList",c=m("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(d=>l(this,null,function*(){return d.code!=0?{}:r.EmojiRecentList.decode(d.message)})),new Promise((d,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}getListEmojisByUserId(e,t={}){let n="/mezon.api.Mezon/GetListEmojisByUserId",c=m("POST",t,"");return e&&(c.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:c}).then(d=>l(this,null,function*(){return d.code!=0?{}:r.EmojiListedResponse.decode(d.message)})),new Promise((d,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])}searchMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SearchMessage",d=r.SearchMessageRequest.encode(r.SearchMessageRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.SearchMessageResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}event(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateEvent",d=r.Event.encode(r.Event.fromPartial({external:t.external,name:t.name,properties:t.properties})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listEvents(e,t,n={}){let s="/mezon.api.Mezon/ListEvents",d=r.ListEventsRequest.encode(r.ListEventsRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.EventList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createEvent(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateEvent",d=r.CreateEventRequest.encode(r.CreateEventRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.EventManagement.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateEventUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateEventUser",d=r.DeleteEventRequest.encode(r.DeleteEventRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteEvent(e,t,n,s,c,d,i={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");let o="/mezon.api.Mezon/DeleteEvent",u=r.DeleteEventRequest.encode(r.DeleteEventRequest.fromPartial({event_id:t,clan_id:n,creator_id:s,event_label:c,channel_id:d})).finish(),h=m("POST",i,"");return h.body=u,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(g=>l(this,null,function*(){return{}})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}updateEvent(e,t,n,s={}){if(t==null)throw new Error("'eventId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateEvent",i=r.UpdateEventRequest.encode(r.UpdateEventRequest.fromPartial(n)).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}deleteFriends(e,t,n,s={}){let c="/mezon.api.Mezon/DeleteFriends",i=r.DeleteFriendsRequest.encode(r.DeleteFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}listFriends(e,t,n,s,c={}){let d="/mezon.api.Mezon/ListFriends",o=r.ListFriendsRequest.encode(r.ListFriendsRequest.fromPartial({limit:t,state:n,cursor:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.FriendList.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}addFriends(e,t,n,s={}){let c="/mezon.api.Mezon/AddFriends",i=r.AddFriendsRequest.encode(r.AddFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.AddFriendsResponse.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}blockFriends(e,t,n,s={}){let c="/mezon.api.Mezon/BlockFriends",i=r.BlockFriendsRequest.encode(r.BlockFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}unblockFriends(e,t,n,s={}){let c="/mezon.api.Mezon/UnblockFriends",i=r.BlockFriendsRequest.encode(r.BlockFriendsRequest.fromPartial({ids:t,usernames:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}getChannelCategoryNotiSettingsList(e,t,n={}){let s="/mezon.api.Mezon/GetChannelCategoryNotiSettingsList",d=r.NotificationClan.encode(r.NotificationClan.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.NotificationChannelCategorySettingList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getUserProfileOnClan(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GetUserProfileOnClan",d=r.ClanProfileRequest.encode(r.ClanProfileRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ClanProfile.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationCategory(e,t,n={}){let s="/mezon.api.Mezon/GetNotificationCategory",d=r.DefaultNotificationCategory.encode(r.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.NotificationUserChannel.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationChannel(e,t,n={}){let s="/mezon.api.Mezon/GetNotificationChannel",d=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.NotificationUserChannel.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationClan(e,t,n={}){let s="/mezon.api.Mezon/GetNotificationClan",d=r.NotificationClan.encode(r.NotificationClan.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.NotificationSetting.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getNotificationReactMessage(e,t,n={}){let s="/mezon.api.Mezon/GetNotificationReactMessage",d=r.NotifiReactMessage.encode(r.NotifiReactMessage.fromPartial({channel_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.NotifiReactMessage.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}giveMeACoffee(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GiveMeACoffee",d=r.GiveCoffeeEvent.encode(r.GiveCoffeeEvent.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getKeyServer(e,t={}){let n="/mezon.api.Mezon/GetKeyServer",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.GetKeyServerResp.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createLinkInviteUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateLinkInviteUser",d=r.LinkInviteUserRequest.encode(r.LinkInviteUserRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.LinkInviteUser.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}inviteUser(e,t,n={}){if(t==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/InviteUser",d=r.InviteUserRequest.encode(r.InviteUserRequest.fromPartial({invite_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.InviteUserRes.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getLinkInvite(e,t,n,s={}){if(n==null)throw new Error("'inviteId' is a required parameter but is null or undefined.");let c="/v2/invite/{inviteId}".replace("{inviteId}",encodeURIComponent(String(n))),d=new Map,i="",o=this.buildFullUrl(this.basePath,c,d),a=m("GET",s,i);return e&&(a.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),a.headers.Accept="application/x-protobuf",a.headers["Content-Type"]="application/json",Promise.race([fetch(o,a).then(u=>l(this,null,function*(){let h=yield u.arrayBuffer();return r.InviteUserRes.decode(new Uint8Array(h))})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}listChannelByUserId(e,t={}){let n="/mezon.api.Mezon/ListChannelByUserId",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.ChannelDescList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}markAsRead(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/MarkAsRead",d=r.MarkAsReadRequest.encode(r.MarkAsReadRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listMezonOauthClient(e,t={}){let n="/mezon.api.Mezon/ListMezonOauthClient",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.MezonOauthClientList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}setMuteCategory(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SetMuteCategory",d=r.SetMuteRequest.encode(r.SetMuteRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}setMuteChannel(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SetMuteChannel",d=r.SetMuteRequest.encode(r.SetMuteRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteNotifications(e,t,n,s={}){let c="/mezon.api.Mezon/DeleteNotifications",i=r.DeleteNotificationsRequest.encode(r.DeleteNotificationsRequest.fromPartial({ids:t||[],category:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}listNotifications(e,t,n,s,c,d,i={}){let o="/mezon.api.Mezon/ListNotifications",u=r.ListNotificationsRequest.encode(r.ListNotificationsRequest.fromPartial({limit:t,clan_id:n,notification_id:s,category:c,direction:d})).finish(),h=m("POST",i,"");return h.body=u,e&&(h.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:h}).then(g=>l(this,null,function*(){return r.NotificationList.decode(g)})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}setNotificationChannelSetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SetNotificationChannelSetting",d=r.SetNotificationRequest.encode(r.SetNotificationRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationClanSetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SetNotificationClanSetting",d=r.SetDefaultNotificationRequest.encode(r.SetDefaultNotificationRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationCategorySetting(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SetNotificationCategorySetting",d=r.SetNotificationRequest.encode(r.SetNotificationRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotificationCategorySetting(e,t,n={}){let s="/mezon.api.Mezon/DeleteNotificationCategorySetting",d=r.DefaultNotificationCategory.encode(r.DefaultNotificationCategory.fromPartial({category_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotificationChannel(e,t,n={}){let s="/mezon.api.Mezon/DeleteNotificationChannel",d=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteNotiReactMessage(e,t,n={}){let s="/mezon.api.Mezon/DeleteNotiReactMessage",d=r.NotificationChannel.encode(r.NotificationChannel.fromPartial({channel_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setNotificationReactMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SetNotificationReactMessage",d=r.NotificationChannel.encode(r.NotificationChannel.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}setRoleChannelPermission(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SetRoleChannelPermission",d=r.UpdateRoleChannelRequest.encode(r.UpdateRoleChannelRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}getListPermission(e,t={}){let n="/mezon.api.Mezon/GetListPermission",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.PermissionList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}getPermissionByRoleIdChannelId(e,t,n,s,c={}){let d="/mezon.api.Mezon/GetPermissionByRoleIdChannelId",o=r.PermissionRoleChannelListEventRequest.encode(r.PermissionRoleChannelListEventRequest.fromPartial({role_id:t,channel_id:n,user_id:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.PermissionRoleChannelListEventResponse.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deletePinMessage(e,t,n,s,c,d={}){let i="/mezon.api.Mezon/DeletePinMessage",a=r.DeletePinMessage.encode(r.DeletePinMessage.fromPartial({id:t,message_id:n,channel_id:s,clan_id:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>h),new Promise((h,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}getPinMessagesList(e,t,n,s,c={}){let d="/mezon.api.Mezon/GetPinMessagesList",o=r.PinMessageRequest.encode(r.PinMessageRequest.fromPartial({message_id:t,channel_id:n,clan_id:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return r.PinMessagesList.decode(u)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}createMessage2Inbox(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateMessage2Inbox",d=r.Message2InboxRequest.encode(r.Message2InboxRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ChannelMessageHeader.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createPinMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreatePinMessage",d=r.PinMessageRequest.encode(r.PinMessageRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ChannelMessageHeader.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getPubKeys(e,t,n={}){let s="/mezon.api.Mezon/GetPubKeys",d=r.GetPubKeysRequest.encode(r.GetPubKeysRequest.fromPartial({user_ids:t||[]})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.GetPubKeysResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}pushPubKey(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/PushPubKey",d=r.PushPubKeyRequest.encode(r.PushPubKeyRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}addRolesChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/AddRolesChannelDesc",d=r.AddRoleChannelDescRequest.encode(r.AddRoleChannelDescRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}changeChannelCategory(e,t,n,s={}){if(t==null)throw new Error("'newCategoryId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ChangeChannelCategory",i=r.ChangeChannelCategoryRequest.encode(r.ChangeChannelCategoryRequest.fromPartial(E(w({},n),{new_category_id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}deleteRoleChannelDesc(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteRoleChannelDesc",d=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listRoles(e,t,n,s,c,d={}){let i="/mezon.api.Mezon/ListRoles",a=r.RoleListEventRequest.encode(r.RoleListEventRequest.fromPartial({clan_id:t,limit:n,state:s,cursor:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>l(this,null,function*(){return h.code!=0?{}:r.RoleListEventResponse.decode(h.message)})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}createRole(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateRole",d=r.CreateRoleRequest.encode(r.CreateRoleRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.Role.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateRoleDelete(e,t,n,s={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteRole",i=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial(E(w({},n),{role_id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}deleteRole(e,t,n,s,c,d={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let i="/mezon.api.Mezon/DeleteRole",a=r.DeleteRoleRequest.encode(r.DeleteRoleRequest.fromPartial({role_id:t,channel_id:n,clan_id:s,role_label:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>h),new Promise((h,g)=>setTimeout(g,this.timeoutMs,"Request timed out."))])}updateRole(e,t,n,s={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateRole",i=r.UpdateRoleRequest.encode(r.UpdateRoleRequest.fromPartial(E(w({},n),{role_id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}listRolePermissions(e,t,n={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListRolePermissions",d=r.ListPermissionsRequest.encode(r.ListPermissionsRequest.fromPartial({role_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.PermissionList.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listRoleUsers(e,t,n,s,c={}){if(t==null)throw new Error("'roleId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/ListRoleUsers",o=r.ListRoleUsersRequest.encode(r.ListRoleUsersRequest.fromPartial({role_id:t,limit:n,cursor:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.RoleUserList.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}getRoleOfUserInTheClan(e,t,n,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetRoleOfUserInTheClan",i=r.ListPermissionOfUsersRequest.encode(r.ListPermissionOfUsersRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.RoleList.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}searchThread(e,t,n,s,c={}){let d="/mezon.api.Mezon/SearchThread",o=r.SearchThreadRequest.encode(r.SearchThreadRequest.fromPartial({clan_id:t,channel_id:n,label:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.ChannelDescList.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}sendToken(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SendToken",d=r.TokenSentEvent.encode(r.TokenSentEvent.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}sessionLogout(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/SessionLogout",d=r.SessionLogoutRequest.encode(r.SessionLogoutRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}addClanSticker(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/AddClanSticker",d=r.ClanStickerAddRequest.encode(r.ClanStickerAddRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanStickerById(e,t,n,s,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteClanStickerById",o=r.ClanStickerDeleteRequest.encode(r.ClanStickerDeleteRequest.fromPartial({id:t,clan_id:n,sticker_label:s})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return{}})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateClanStickerById(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanStickerById",i=r.ClanStickerUpdateByIdRequest.encode(r.ClanStickerUpdateByIdRequest.fromPartial(E(w({},n),{id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}getListStickersByUserId(e,t={}){let n="/mezon.api.Mezon/GetListStickersByUserId",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.StickerListedResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}registerStreamingChannel(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/RegisterStreamingChannel",d=r.RegisterStreamingChannelRequest.encode(r.RegisterStreamingChannelRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.RegisterStreamingChannelResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listStreamingChannelUsers(e,t,n,s,c,d,i,o={}){let a="/mezon.api.Mezon/ListStreamingChannelUsers",h=r.ListChannelUsersRequest.encode(r.ListChannelUsersRequest.fromPartial({clan_id:t,channel_id:n,channel_type:s,limit:c,state:d,cursor:i})).finish(),g=m("POST",o,"");return g.body=h,e&&(g.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:g}).then(f=>l(this,null,function*(){return f.code!=0?{}:r.StreamingChannelUserList.decode(f.message)})),new Promise((f,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessagesList(e,t={}){let n="/mezon.api.Mezon/GetSystemMessagesList",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.SystemMessagesList.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}createSystemMessage(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateSystemMessage",d=r.SystemMessageRequest.encode(r.SystemMessageRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listSdTopic(e,t,n,s={}){let c="/mezon.api.Mezon/ListSdTopic",i=r.ListSdTopicRequest.encode(r.ListSdTopicRequest.fromPartial({clan_id:t,limit:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.SdTopicList.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}createSdTopic(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateSdTopic",d=r.SdTopicRequest.encode(r.SdTopicRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.SdTopic.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteSystemMessage(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DeleteSystemMessage",d=r.DeleteSystemMessage.encode(r.DeleteSystemMessage.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getSystemMessageByClanId(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GetSystemMessageByClanId",d=r.GetSystemMessage.encode(r.GetSystemMessage.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.SystemMessage.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateSystemMessage(e,t,n,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateSystemMessage",i=r.SystemMessageRequest.encode(r.SystemMessageRequest.fromPartial(E(w({},n),{clan_id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listThreadDescs(e,t,n,s,c,d,i,o={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let a="/mezon.api.Mezon/ListThreadDescs",h=r.ListThreadRequest.encode(r.ListThreadRequest.fromPartial({channel_id:t,limit:n,state:s,clan_id:c,thread_id:d,page:i})).finish(),g=m("POST",o,"");return g.body=h,e&&(g.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:g}).then(f=>l(this,null,function*(){return f.code!=0?{}:r.ChannelDescListNoPool.decode(f.message)})),new Promise((f,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}updateCategory(e,t,n,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateCategory",i=r.UpdateCategoryDescRequest.encode(r.UpdateCategoryDescRequest.fromPartial(E(w({},n),{clan_id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}updateChannelPrivate(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateChannelPrivate",d=r.ChangeChannelPrivateRequest.encode(r.ChangeChannelPrivateRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateUserProfileByClan(e,t,n,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateUserProfileByClan",i=r.UpdateClanProfileRequest.encode(r.UpdateClanProfileRequest.fromPartial(E(w({},n),{clan_id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}uploadOauthFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UploadOauthFile",d=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.UploadAttachment.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}uploadAttachmentFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UploadAttachmentFile",d=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.UploadAttachment.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFile(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",d=r.UploadAttachmentRequest.encode(r.UploadAttachmentRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.MultipartUploadAttachment.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}multipartUploadAttachmentFileFinsih(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/MultipartUploadAttachmentFileStart",d=r.MultipartUploadAttachmentFinishRequest.encode(r.MultipartUploadAttachmentFinishRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateUser(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateUser",d=r.UpdateUsersRequest.encode(r.UpdateUsersRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listUserClansByUserId(e,t={}){let n="/mezon.api.Mezon/ListUserClansByUserId",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.AllUserClans.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}listUserPermissionInChannel(e,t,n,s={}){let c="/mezon.api.Mezon/ListUserPermissionInChannel",i=r.UserPermissionInChannelListRequest.encode(r.UserPermissionInChannelListRequest.fromPartial({clan_id:t,channel_id:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.UserPermissionInChannelListResponse.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}getUserStatus(e,t={}){let n="/mezon.api.Mezon/GetUserStatus",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.UserStatus.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}updateUserStatus(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateUserStatus",d=r.UserStatusUpdate.encode(r.UserStatusUpdate.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateUserCustomStatus(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateUserCustomStatus",d=r.UserStatusUpdate.encode(r.UserStatusUpdate.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}generateWebhook(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GenerateWebhook",d=r.WebhookCreateRequest.encode(r.WebhookCreateRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return r.WebhookGenerateResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateWebhookById(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateWebhookById",i=r.WebhookUpdateRequestById.encode(r.WebhookUpdateRequestById.fromPartial(E(w({},n),{id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}listWebhookByChannelId(e,t,n,s={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/ListWebhookByChannelId",i=r.WebhookListRequest.encode(r.WebhookListRequest.fromPartial({channel_id:t,clan_id:n||""})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.WebhookListResponse.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}deleteWebhookById(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteWebhookById",i=r.WebhookDeleteRequestById.encode(r.WebhookDeleteRequestById.fromPartial(E(w({},n),{id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}buildFullUrl(e,t,n){let s=e+t+"?";for(let[c,d]of n)d instanceof Array?s+=d.reduce((i,o)=>i+encodeURIComponent(c)+"="+encodeURIComponent(o)+"&",""):d!=null&&(s+=encodeURIComponent(c)+"="+encodeURIComponent(d)+"&");return s}editChannelCanvases(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/EditChannelCanvases",d=r.EditChannelCanvasRequest.encode(r.EditChannelCanvasRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.EditChannelCanvasResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getChannelCanvasDetail(e,t,n,s,c={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/GetChannelCanvasDetail",o=r.ChannelCanvasDetailRequest.encode(r.ChannelCanvasDetailRequest.fromPartial({id:t,clan_id:n||"",channel_id:s||""})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.ChannelCanvasDetailResponse.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelCanvas(e,t,n,s,c={}){if(t==null)throw new Error("'canvasId' is a required parameter but is null or undefined.");let d="/mezon.api.Mezon/DeleteChannelCanvas",o=r.DeleteChannelCanvasRequest.encode(r.DeleteChannelCanvasRequest.fromPartial({canvas_id:t,clan_id:n||"",channel_id:s||""})).finish(),a=m("POST",c,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listOnboarding(e,t,n,s,c,d={}){let i="/mezon.api.Mezon/ListOnboarding",a=r.ListOnboardingRequest.encode(r.ListOnboardingRequest.fromPartial({clan_id:t,guide_type:n,limit:s,page:c})).finish(),u=m("POST",d,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:i,fetchOptions:u}).then(h=>l(this,null,function*(){return h.code!=0?{}:r.ListOnboardingResponse.decode(h.message)})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}createOnboarding(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateOnboarding",d=r.CreateOnboardingRequest.encode(r.CreateOnboardingRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ListOnboardingResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteOnboarding(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteOnboarding",i=r.OnboardingRequest.encode(r.OnboardingRequest.fromPartial({id:t,clan_id:n})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}getOnboardingDetail(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/GetOnboardingDetail",i=r.OnboardingRequest.encode(r.OnboardingRequest.fromPartial({id:t,clan_id:n||""})).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.OnboardingItem.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}updateOnboarding(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateOnboarding",i=r.UpdateOnboardingRequest.encode(r.UpdateOnboardingRequest.fromPartial(E(w({},n),{id:t}))).finish(),o=m("POST",s,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:o}).then(a=>a),new Promise((a,u)=>setTimeout(u,this.timeoutMs,"Request timed out."))])}generateClanWebhook(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GenerateClanWebhook",d=r.GenerateClanWebhookRequest.encode(r.GenerateClanWebhookRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.GenerateClanWebhookResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}listClanWebhook(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListClanWebhook",d=r.ListClanWebhookRequest.encode(r.ListClanWebhookRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.ListClanWebhookResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}deleteClanWebhookById(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/DeleteClanWebhookById",d={id:t,clan_id:n},o=r.ClanWebhookRequest.encode(r.ClanWebhookRequest.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateClanWebhookById(e,t,n,s={}){if(t==null)throw new Error("'id' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateClanWebhookById",d=E(w({},n),{id:t}),o=r.UpdateClanWebhookRequest.encode(r.UpdateClanWebhookRequest.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}getTopicDetail(e,t,n={}){let s="/mezon.api.Mezon/GetTopicDetail",c={topic_id:t},i=r.SdTopicDetailRequest.encode(r.SdTopicDetailRequest.fromPartial(c)).finish(),o=m("POST",n,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.SdTopic.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listOnboardingStep(e,t,n,s,c={}){let d="/mezon.api.Mezon/ListOnboardingStep",i={clan_id:t,limit:n,page:s},a=r.ListOnboardingStepRequest.encode(r.ListOnboardingStepRequest.fromPartial(i)).finish(),u=m("POST",c,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:u}).then(h=>l(this,null,function*(){return h.code!=0?{}:r.ListOnboardingStepResponse.decode(h.message)})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}updateOnboardingStepByClanId(e,t,n,s={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");if(n==null)throw new Error("'body' is a required parameter but is null or undefined.");let c="/mezon.api.Mezon/UpdateOnboardingStep",d=E(w({},n),{clan_id:t}),o=r.UpdateOnboardingStepRequest.encode(r.UpdateOnboardingStepRequest.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}createRoomChannelApps(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateRoomChannelApps",d=r.CreateRoomChannelApps.encode(r.CreateRoomChannelApps.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return r.CreateRoomChannelApps.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateMeetToken(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GenerateMeetToken",d=r.GenerateMeetTokenRequest.encode(r.GenerateMeetTokenRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.GenerateMeetTokenResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}getMezonOauthClient(e,t,n,s={}){let c="/mezon.api.Mezon/GetMezonOauthClient",d={client_id:t,client_name:n},o=r.GetMezonOauthClientRequest.encode(r.GetMezonOauthClientRequest.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>l(this,null,function*(){return u.code!=0?{}:r.MezonOauthClient.decode(u.message)})),new Promise((u,h)=>setTimeout(()=>h(new Error("Request timed out.")),this.timeoutMs))])}updateMezonOauthClient(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateMezonOauthClient",d=r.MezonOauthClient.encode(r.MezonOauthClient.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.MezonOauthClient.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}generateHashChannelApps(e,t,n={}){let s="/mezon.api.Mezon/GenerateHashChannelApps",c={app_id:t},i=r.GenerateHashChannelAppsRequest.encode(r.GenerateHashChannelAppsRequest.fromPartial(c)).finish(),o=m("POST",n,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.GenerateHashChannelAppsResponse.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}addUserEvent(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/AddUserEvent",d=r.UserEventRequest.encode(r.UserEventRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}deleteUserEvent(e,t,n,s={}){let c="/mezon.api.Mezon/DeleteUserEvent",d={clan_id:t,event_id:n},o=r.UserEventRequest.encode(r.UserEventRequest.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}updateRoleOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateRoleOrder",d=r.UpdateRoleOrderRequest.encode(r.UpdateRoleOrderRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}createExternalMezonMeet(e,t={}){let n="/mezon.api.Mezon/CreateExternalMezonMeet",s=m("POST",t,"");return e&&(s.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return c.code!=0?{}:r.GenerateMezonMeetResponse.decode(c.message)})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])}generateMeetTokenExternal(e,t,n,s,c,d,i={}){if(n==null)throw new Error("'token' is a required parameter but is null or undefined.");let o="/v2/meet/external/{token}".replace("{token}",encodeURIComponent(String(n))),a=new Map;a.set("username",s),a.set("metadata",c),a.set("is_guest",d);let u="",h=this.buildFullUrl(t,o,a),g=m("POST",i,u);return e&&(g.headers.Authorization="Bearer "+e),g.headers.Accept="application/x-protobuf",g.headers["Content-Type"]="application/json",Promise.race([fetch(h,g).then(f=>l(this,null,function*(){let A=yield f.arrayBuffer();return r.GenerateMeetTokenExternalResponse.decode(new Uint8Array(A))})),new Promise((f,A)=>setTimeout(()=>A(new Error("Request timed out.")),this.timeoutMs))])}muteParticipantMezonMeet(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/MuteParticipantMezonMeet",d=r.MeetParticipantRequest.encode(r.MeetParticipantRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}removeParticipantMezonMeet(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/RemoveParticipantMezonMeet",d=r.MeetParticipantRequest.encode(r.MeetParticipantRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listChannelDetail(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListChannelDetail",c={channel_id:t},i=r.ListChannelDetailRequest.encode(r.ListChannelDetailRequest.fromPartial(c)).finish(),o=m("POST",n,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.ChannelDescription.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}listChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListChannelTimeline",d=r.ListChannelTimelineRequest.encode(r.ListChannelTimelineRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return r.ListChannelTimelineResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}createChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreateChannelTimeline",d=r.CreateChannelTimelineRequest.encode(r.CreateChannelTimelineRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return r.CreateChannelTimelineResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateChannelTimeline",d=r.UpdateChannelTimelineRequest.encode(r.UpdateChannelTimelineRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return r.UpdateChannelTimelineResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}detailChannelTimeline(e,t,n={}){if(!t)throw new Error("'request' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/DetailChannelTimeline",d=r.ChannelTimelineDetailRequest.encode(r.ChannelTimelineDetailRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return r.ChannelTimelineDetailResponse.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}updateClanOrder(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateClanOrder",d=r.UpdateClanOrderRequest.encode(r.UpdateClanOrderRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}clanDiscover(e,t,n,s,c={}){if(s==null)throw new Error("'body' is a required parameter but is null or undefined.");let d="/v2/clan/discover",i=new Map,o="";o=JSON.stringify(s||{});let a=this.buildFullUrl(n,d,i),u=m("POST",c,o);return e&&(u.headers.Authorization="Basic "+(0,M.encode)(e+":"+t)),u.headers.Accept="application/x-protobuf",u.headers["Content-Type"]="application/json",Promise.race([fetch(a,u).then(h=>l(this,null,function*(){let g=yield h.arrayBuffer();return r.ListClanDiscover.decode(new Uint8Array(g))})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}deleteQuickMenuAccess(e,t,n,s,c,d,i,o={}){let a="/mezon.api.Mezon/DeleteQuickMenuAccess",u={id:t,clan_id:n,bot_id:s,menu_name:c,background:d,action_msg:i},g=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(u)).finish(),f=m("POST",o,"");return f.body=g,e&&(f.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:f}).then(A=>A),new Promise((A,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}listQuickMenuAccess(e,t,n,s,c={}){let d="/mezon.api.Mezon/ListQuickMenuAccess",i={bot_id:t,channel_id:n,menu_type:s},a=r.ListQuickMenuAccessRequest.encode(r.ListQuickMenuAccessRequest.fromPartial(i)).finish(),u=m("POST",c,"");return u.body=a,e&&(u.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:d,fetchOptions:u}).then(h=>l(this,null,function*(){return h.code!=0?{}:r.QuickMenuAccessList.decode(h.message)})),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}addQuickMenuAccess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/AddQuickMenuAccess",d=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateQuickMenuAccess(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateQuickMenuAccess",d=r.QuickMenuAccess.encode(r.QuickMenuAccess.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}listForSaleItems(e,t,n={}){let s="/mezon.api.Mezon/ListForSaleItems",c={page:t},i=r.ListForSaleItemsRequest.encode(r.ListForSaleItemsRequest.fromPartial(c)).finish(),o=m("POST",n,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.ForSaleItemList.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}isFollower(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/IsFollower",d=r.IsFollowerRequest.encode(r.IsFollowerRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.IsFollowerResponse.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}transferOwnership(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/TransferOwnership",d=r.TransferOwnershipRequest.encode(r.TransferOwnershipRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>o),new Promise((o,a)=>setTimeout(a,this.timeoutMs,"Request timed out."))])}updateUsername(e,t,n={}){if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/UpdateUsername",d=r.UpdateUsernameRequest.encode(r.UpdateUsernameRequest.fromPartial(t)).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return o.code!=0?{}:r.Session.decode(o.message)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}isBanned(e,t,n={}){if(t==null)throw new Error("'channelId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/IsBanned",c={channel_id:t},i=r.IsBannedRequest.encode(r.IsBannedRequest.fromPartial(c)).finish(),o=m("POST",n,"");return o.body=i,e&&(o.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:o}).then(a=>l(this,null,function*(){return a.code!=0?{}:r.IsBannedResponse.decode(a.message)})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])}reportMessageAbuse(e,t,n,s={}){let c="/mezon.api.Mezon/ReportMessageAbuse",d={message_id:t,abuse_type:n},o=r.ReportMessageAbuseReqest.encode(r.ReportMessageAbuseReqest.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}sendChannelMessage(e,t,n,s,c,d,i,o,a,u,h,g,f,A){let y="/mezon.api.Mezon/SendChannelMessage",S=r.ChannelMessageSend.encode(r.ChannelMessageSend.fromPartial({clan_id:t,channel_id:n,mode:s,is_public:c,content:d,mentions:i,attachments:o,references:a,anonymous_message:u,mention_everyone:h,avatar:g,code:f,topic_id:A})).finish(),v=m("POST",{},"");return v.body=S,e&&(v.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:y,fetchOptions:v}).then(O=>l(this,null,function*(){return r.ChannelMessageAck.decode(O)})),new Promise((O,G)=>setTimeout(()=>G(new Error("Request timed out.")),this.timeoutMs))])}updateChannelMessage(e,t,n,s,c,d,i,o,a,u,h,g){let f="/mezon.api.Mezon/UpdateChannelMessage",y=r.ChannelMessageUpdate.encode(r.ChannelMessageUpdate.fromPartial({clan_id:t,channel_id:n,message_id:d,mode:s,is_public:c,content:i,mentions:o,attachments:a,hide_editted:u,topic_id:h,is_update_msg_topic:g})).finish(),b=m("POST",{},"");return b.body=y,e&&(b.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:f,fetchOptions:b}).then(S=>l(this,null,function*(){return S.code!=0?{}:r.ChannelMessageUpdate.decode(S.message)})),new Promise((S,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])}deleteChannelMessage(e,t,n,s,c,d,i,o,a,u){let h="/mezon.api.Mezon/DeleteChannelMessage",f=r.ChannelMessageRemove.encode(r.ChannelMessageRemove.fromPartial({clan_id:t,channel_id:n,message_id:d,mode:s,is_public:c,has_attachment:i,mentions:a,references:u,topic_id:o})).finish(),A=m("POST",{},"");return A.body=f,e&&(A.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:h,fetchOptions:A}).then(y=>l(this,null,function*(){return y.code!=0?{}:r.ChannelMessageRemove.decode(y.message)})),new Promise((y,b)=>setTimeout(()=>b(new Error("Request timed out.")),this.timeoutMs))])}updateMezonVoiceState(e,t,n,s,c,d,i={}){let o="/mezon.api.Mezon/UpdateMezonVoiceState",a={clan_id:t,channel_id:n,display_name:s,room_name:c,state:d},h=r.HandleParticipantMeetStateEvent.encode(r.HandleParticipantMeetStateEvent.fromPartial(a)).finish(),g=m("POST",i,"");return g.body=h,e&&(g.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:o,fetchOptions:g}).then(f=>f),new Promise((f,A)=>setTimeout(A,this.timeoutMs,"Request timed out."))])}messageButtonClick(e,t,n,s,c,d,i,o={}){let a="/mezon.api.Mezon/MessageButtonClick",u={message_id:t,channel_id:n,button_id:s,sender_id:c,user_id:d,extra_data:i},g=r.MessageButtonClicked.encode(r.MessageButtonClicked.fromPartial(u)).finish(),f=m("POST",o,"");return f.body=g,e&&(f.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:f}).then(A=>A),new Promise((A,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}dropdownBoxSelected(e,t,n,s,c,d,i,o={}){let a="/mezon.api.Mezon/DropdownBoxSelected",u={message_id:t,channel_id:n,selectbox_id:s,sender_id:c,user_id:d,values:i},g=r.DropdownBoxSelected.encode(r.DropdownBoxSelected.fromPartial(u)).finish(),f=m("POST",o,"");return f.body=g,e&&(f.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:a,fetchOptions:f}).then(A=>A),new Promise((A,y)=>setTimeout(y,this.timeoutMs,"Request timed out."))])}activeArchivedThread(e,t,n,s={}){let c="/mezon.api.Mezon/ActiveArchivedThread",d={clan_id:t,channel_id:n},o=r.ActiveArchivedThread.encode(r.ActiveArchivedThread.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}addAgentToChannel(e,t,n,s={}){let c="/mezon.api.Mezon/AddAgentToChannel",d={room_name:t,channel_id:n},o=r.UpdateAIAgentRequest.encode(r.UpdateAIAgentRequest.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}disconnectAgent(e,t,n,s={}){let c="/mezon.api.Mezon/DisconnectAgent",d={room_name:t,channel_id:n},o=r.UpdateAIAgentRequest.encode(r.UpdateAIAgentRequest.fromPartial(d)).finish(),a=m("POST",s,"");return a.body=o,e&&(a.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:c,fetchOptions:a}).then(u=>u),new Promise((u,h)=>setTimeout(h,this.timeoutMs,"Request timed out."))])}listMutedChannel(e,t,n={}){if(t==null)throw new Error("'clanId' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ListMutedChannel",d=r.ListMutedChannelRequest.encode(r.ListMutedChannelRequest.fromPartial({clan_id:t})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(o=>l(this,null,function*(){return r.MutedChannelList.decode(o)})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])}channelMessageReact(e,t,n,s,c,d,i,o,a,u,h,g,f,A){let y="/mezon.api.Mezon/ReactChannelMessage",S=r.MessageReaction.encode(r.MessageReaction.fromPartial({clan_id:t,channel_id:n,mode:s,is_public:c,message_id:d,emoji_id:i,emoji:o,count:a,message_sender_id:u,action:h,emoji_recent_id:f,sender_name:A,topic_id:g})).finish(),v=m("POST",{},"");return v.body=S,e&&(v.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:y,fetchOptions:v}).then(O=>l(this,null,function*(){return r.ChannelMessageSend.decode(O)})),new Promise((O,G)=>setTimeout(()=>G(new Error("Request timed out.")),this.timeoutMs))])}createPoll(e,t,n={}){var o,a,u,h,g,f;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/CreatePoll",d=r.CreatePollRequest.encode(r.CreatePollRequest.fromPartial({channel_id:(o=t.channel_id)!=null?o:"0",clan_id:(a=t.clan_id)!=null?a:"0",question:(u=t.question)!=null?u:"",answers:(h=t.answers)!=null?h:[],expire_hours:(g=t.expire_hours)!=null?g:0,type:(f=t.type)!=null?f:0})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(A=>l(this,null,function*(){let y=r.CreatePollResponse.decode(A);return{poll_id:y.poll_id,message_id:y.message_id,question:y.question,answers:y.answers.map(b=>({index:b.index,label:b.label})),answer_counts:y.answer_counts,exp:y.exp,is_closed:y.is_closed,creator_id:y.creator_id,type:y.type,total_votes:y.total_votes}})),new Promise((A,y)=>setTimeout(()=>y(new Error("Request timed out.")),this.timeoutMs))])}votePoll(e,t,n={}){var o,a,u,h;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/VotePoll",d=r.VotePollRequest.encode(r.VotePollRequest.fromPartial({poll_id:(o=t.poll_id)!=null?o:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(u=t.channel_id)!=null?u:"0",answer_indices:(h=t.answer_indices)!=null?h:[]})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(g=>l(this,null,function*(){var A;let f=g.length>0?r.VotePollResponse.decode(g):{my_answer_indices:[]};return{my_answer_indices:Array.from((A=f.my_answer_indices)!=null?A:[])}})),new Promise((g,f)=>setTimeout(()=>f(new Error("Request timed out.")),this.timeoutMs))])}closePoll(e,t,n={}){var o,a,u;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/ClosePoll",d=r.ClosePollRequest.encode(r.ClosePollRequest.fromPartial({poll_id:(o=t.poll_id)!=null?o:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(u=t.channel_id)!=null?u:"0"})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(h=>{if(h.status==204||h.status>=200&&h.status<300)return{};throw h}),new Promise((h,g)=>setTimeout(()=>g(new Error("Request timed out.")),this.timeoutMs))])}getPoll(e,t,n={}){var o,a,u;if(t==null)throw new Error("'body' is a required parameter but is null or undefined.");let s="/mezon.api.Mezon/GetPoll",d=r.GetPollRequest.encode(r.GetPollRequest.fromPartial({poll_id:(o=t.poll_id)!=null?o:"0",message_id:(a=t.message_id)!=null?a:"0",channel_id:(u=t.channel_id)!=null?u:"0"})).finish(),i=m("POST",n,"");return i.body=d,e&&(i.headers.Authorization="Bearer "+e),Promise.race([this.send({urlPath:s,fetchOptions:i}).then(h=>l(this,null,function*(){let g=r.GetPollResponse.decode(h);return{poll_id:g.poll_id,message_id:g.message_id,question:g.question,answers:g.answers.map(f=>({index:f.index,label:f.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,voter_details:g.voter_details.map(f=>({answer_index:f.answer_index,user_ids:f.user_ids}))}})),new Promise((h,g)=>setTimeout(()=>g(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(s=>l(this,null,function*(){return{}})),new Promise((s,c)=>setTimeout(()=>c(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(s=>l(this,null,function*(){return{}})),new Promise((s,c)=>setTimeout(()=>c(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*(){return{}})),new Promise((n,s)=>setTimeout(()=>s(new Error("Request timed out.")),this.timeoutMs))])})}joinChat(e,t,n,s){return l(this,null,function*(){let c="",d={channel_join:{clan_id:e,channel_id:t,channel_type:n,is_public:s}};return Promise.race([this.send({urlPath:c,fetchOptions:d}).then(i=>l(this,null,function*(){return{}})),new Promise((i,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}leaveChat(e,t,n,s){let c="",d={channel_leave:{clan_id:e,channel_id:t,channel_type:n,is_public:s}};return Promise.race([this.send({urlPath:c,fetchOptions:d}).then(i=>l(this,null,function*(){return{}})),new Promise((i,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])}removeChatMessage(e,t,n,s,c,d,i,o,a){return l(this,null,function*(){let u="",h={channel_message_remove:{clan_id:e,channel_id:t,mode:n,message_id:c,is_public:s,has_attachment:d,topic_id:i,mentions:o,references:a}};return Promise.race([this.send({urlPath:u,fetchOptions:h}).then(g=>l(this,null,function*(){return{}})),new Promise((g,f)=>setTimeout(()=>f(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(s=>l(this,null,function*(){return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}updateChatMessage(e,t,n,s,c,d,i,o,a,u,h){return l(this,null,function*(){let g="",f={channel_message_update:{clan_id:e,channel_id:t,message_id:c,content:d,mentions:i,attachments:o,mode:n,is_public:s,hide_editted:a,topic_id:u,is_update_msg_topic:h}};return Promise.race([this.send({urlPath:g,fetchOptions:f}).then(A=>l(this,null,function*(){return{}})),new Promise((A,y)=>setTimeout(()=>y(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(s=>l(this,null,function*(){return{}})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])}writeQuickMenuEvent(e,t,n,s,c,d,i,o,a,u,h,g,f,A){return l(this,null,function*(){let y="",b={quick_menu_event:{menu_name:e,message:{clan_id:t,channel_id:n,mode:s,is_public:c,content:d,mentions:i,attachments:o,references:a,anonymous_message:u,mention_everyone:h,avatar:g,code:f,topic_id:A}}};return Promise.race([this.send({urlPath:y,fetchOptions:b}).then(S=>l(this,null,function*(){return{}})),new Promise((S,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])})}writeEphemeralMessage(e,t,n,s,c,d,i,o,a,u,h,g,f,A,y){return l(this,null,function*(){let b="",S={ephemeral_message_send:{receiver_ids:e,message:{clan_id:t,channel_id:n,mode:s,is_public:c,content:d,mentions:i,attachments:o,references:a,anonymous_message:u,mention_everyone:h,avatar:g,code:f,topic_id:A,id:y}}};return Promise.race([this.send({urlPath:b,fetchOptions:S}).then(v=>l(this,null,function*(){return{}})),new Promise((v,O)=>setTimeout(()=>O(new Error("Request timed out.")),this.timeoutMs))])})}writeChatMessage(e,t,n,s,c,d,i,o,a,u,h,g,f){return l(this,null,function*(){let A="",y={channel_message_send:{clan_id:e,channel_id:t,mode:n,is_public:s,content:c,mentions:d,attachments:i,references:o,anonymous_message:a,mention_everyone:u,avatar:h,code:g,topic_id:f}};return Promise.race([this.send({urlPath:A,fetchOptions:y}).then(b=>l(this,null,function*(){return{}})),new Promise((b,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageReaction(e,t,n,s,c,d,i,o,a,u,h,g,f,A){return l(this,null,function*(){let y="",b={message_reaction_event:{id:e,clan_id:t,channel_id:n,mode:s,is_public:c,message_id:d,emoji_id:i,emoji:o,count:a,message_sender_id:u,action:h,topic_id:g,emoji_recent_id:f,sender_name:A}};return Promise.race([this.send({urlPath:y,fetchOptions:b}).then(S=>l(this,null,function*(){return{}})),new Promise((S,v)=>setTimeout(()=>v(new Error("Request timed out.")),this.timeoutMs))])})}writeMessageTyping(e,t,n,s,c,d){return l(this,null,function*(){let i="",o={message_typing_event:{clan_id:e,channel_id:t,mode:n,is_public:s,sender_display_name:c,topic_id:d}};return Promise.race([this.send({urlPath:i,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])})}writeLastSeenMessage(e,t,n,s,c,d){return l(this,null,function*(){let i="",o={last_seen_message_event:{clan_id:e,channel_id:t,mode:n,message_id:s,timestamp_seconds:c,badge_count:d}};return Promise.race([this.send({urlPath:i,fetchOptions:o}).then(a=>l(this,null,function*(){return{}})),new Promise((a,u)=>setTimeout(()=>u(new Error("Request timed out.")),this.timeoutMs))])})}writeLastPinMessage(e,t,n,s,c,d,i,o,a,u,h,g,f){return l(this,null,function*(){let A="",y={last_pin_message_event:{clan_id:e,channel_id:t,mode:n,is_public:s,message_id:c,timestamp_seconds:d,operation:i,message_sender_avatar:o,message_sender_id:a,message_sender_username:u,message_content:h,message_attachment:g,message_created_time:f}};return Promise.race([this.send({urlPath:A,fetchOptions:y}).then(b=>l(this,null,function*(){return{}})),new Promise((b,S)=>setTimeout(()=>S(new Error("Request timed out.")),this.timeoutMs))])})}writeCustomStatus(e,t,n,s){return l(this,null,function*(){let c="",d={custom_status_event:{clan_id:e,status:t,time_reset:n,no_clear:s}};return Promise.race([this.send({urlPath:c,fetchOptions:d}).then(i=>l(this,null,function*(){return{}})),new Promise((i,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}writeVoiceReaction(e,t){return l(this,null,function*(){let n="",s={voice_reaction_send:{emojis:e,channel_id:t}};return Promise.race([this.send({urlPath:n,fetchOptions:s}).then(c=>l(this,null,function*(){return{}})),new Promise((c,d)=>setTimeout(()=>d(new Error("Request timed out.")),this.timeoutMs))])})}forwardWebrtcSignaling(e,t,n,s,c){return l(this,null,function*(){let d="",i={webrtc_signaling_fwd:{receiver_id:e,data_type:t,json_data:n,channel_id:s,caller_id:c}};return Promise.race([this.send({urlPath:d,fetchOptions:i}).then(o=>l(this,null,function*(){return{}})),new Promise((o,a)=>setTimeout(()=>a(new Error("Request timed out.")),this.timeoutMs))])})}makeCallPush(e,t,n,s){return l(this,null,function*(){let c="",d={incoming_call_push:{receiver_id:e,json_data:t,channel_id:n,caller_id:s}};return Promise.race([this.send({urlPath:c,fetchOptions:d}).then(i=>l(this,null,function*(){return{}})),new Promise((i,o)=>setTimeout(()=>o(new Error("Request timed out.")),this.timeoutMs))])})}writeChannelAppEvent(e,t,n){return l(this,null,function*(){let s="",c={channel_app_event:{clan_id:e,channel_id:t,action:n}};return Promise.race([this.send({urlPath:s,fetchOptions:c}).then(d=>l(this,null,function*(){return{}})),new Promise((d,i)=>setTimeout(()=>i(new Error("Request timed out.")),this.timeoutMs))])})}listDataSocket(e){return l(this,null,function*(){let t="",n={list_data_socket:e};return Promise.race([this.send({urlPath:t,fetchOptions:n}).then(s=>l(this,null,function*(){return s})),new Promise((s,c)=>setTimeout(()=>c(new Error("Request timed out.")),this.timeoutMs))])})}};j.DefaultSendTimeoutMs=1e4;var I=j;var we="127.0.0.1",ve="7350",Ee="defaultkey",Me=3e4,p={DISCONNECTED:"disconnected",CONNECTING:"connecting",CONNECTED:"connected"},ce=!1,U=class U{constructor(e=Ee,t=we,n=ve,s=!1,c=null,d=Me,i=!0){this.serverkey=e;this.timeout=d;this.autoFallbackHttp=i;this.verbose=!1;this.refreshTokenManager=x.getInstance();this.host=t,this.port=n,this.useSSL=s;let a=`${s?"https://":"http://"}${t}:${n}`;this._heartbeatTimeoutMs=U.DefaultHeartbeatTimeoutMs,this._connectionState=p.DISCONNECTED,this.transport=new I(e,d,c,a)}isOpen(){return this._connectionState===p.CONNECTED}setTransportAdapter(e){this.transport.setTransportAdapter(e)}connect(e,t=!1,n=!1,s=U.DefaultConnectTimeoutMs){if(this.verbose=n,this._connectionState===p.CONNECTED)return Promise.resolve(e);if(this._connectionState===p.CONNECTING&&this._connectPromise)return this._connectPromise;this.clearConnectTimeout(),this._connectionState=p.CONNECTING,this.transport.connect(e,t,n,(d,i)=>l(this,null,function*(){if(!i.cid)if(i.notifications)i.notifications.notifications.forEach(o=>{o.content=o.content?H(o.content):void 0,this.onnotification(o)});else if(i.voice_started_event)this.onvoicestarted(i.voice_started_event);else if(i.voice_ended_event)this.onvoiceended(i.voice_ended_event);else if(i.voice_joined_event)this.onvoicejoined(i.voice_joined_event);else if(i.voice_leaved_event)this.onvoiceleaved(i.voice_leaved_event);else if(i.channel_created_event)this.onchannelcreated(i.channel_created_event);else if(i.category_event)this.oncategoryevent(i.category_event);else if(i.role_event)this.onroleevent(i.role_event);else if(i.event_emoji)this.oneventemoji(i.event_emoji);else if(i.noti_user_channel)this.oneventnotiuserchannel(i.noti_user_channel);else if(i.webhook_event)this.oneventwebhook(i.webhook_event);else if(i.channel_deleted_event)this.onchanneldeleted(i.channel_deleted_event);else if(i.clan_deleted_event)this.onclandeleted(i.clan_deleted_event);else if(i.sticker_create_event)this.onstickercreated(i.sticker_create_event);else if(i.sticker_update_event)this.onstickerupdated(i.sticker_update_event);else if(i.sticker_delete_event)this.onstickerdeleted(i.sticker_delete_event);else if(i.channel_updated_event)this.onchannelupdated(i.channel_updated_event);else if(i.delete_account_event)this.ondeleteaccount(i.delete_account_event);else if(i.clan_profile_updated_event)this.onclanprofileupdated(i.clan_profile_updated_event);else if(i.clan_updated_event)this.onclanupdated(i.clan_updated_event);else if(i.last_seen_message_event)this.onlastseenupdated(i.last_seen_message_event);else if(i.status_presence_event)this.onstatuspresence(i.status_presence_event);else if(i.channel_message){let o=V(i);this.onchannelmessage(o)}else i.message_typing_event?this.onmessagetyping(i.message_typing_event):i.message_reaction_event?this.onmessagereaction(i.message_reaction_event):i.channel_presence_event?this.onchannelpresence(i.channel_presence_event):i.last_pin_message_event?this.onpinmessage(i.last_pin_message_event):i.custom_status_event?this.oncustomstatus(i.custom_status_event):i.canvas_event?this.oncanvasevent(i.canvas_event):i.user_channel_added_event?this.onuserchanneladded(i.user_channel_added_event):i.add_clan_user_event?this.onuserclanadded(i.add_clan_user_event):i.user_profile_updated_event?this.onuserprofileupdate(i.user_profile_updated_event):i.user_channel_removed_event?this.onuserchannelremoved(i.user_channel_removed_event):i.block_friend?this.onblockfriend(i.block_friend):i.un_block_friend?this.onunblockfriend(i.un_block_friend):i.add_friend?this.onaddfriend(i.add_friend):i.remove_friend?this.onremovefriend(i.remove_friend):i.user_clan_removed_event?this.onuserclanremoved(i.user_clan_removed_event):i.clan_event_created?this.oneventcreated(i.clan_event_created):i.give_coffee_event?this.oncoffeegiven(i.give_coffee_event):i.role_assign_event?this.onroleassign(i.role_assign_event):i.streaming_started_event?this.onstreamingchannelstarted(i.streaming_started_event):i.streaming_ended_event?this.onstreamingchannelended(i.streaming_ended_event):i.streaming_joined_event?this.onstreamingchanneljoined(i.streaming_joined_event):i.streaming_leaved_event?this.onstreamingchannelleaved(i.streaming_leaved_event):i.permission_set_event?this.onpermissionset(i.permission_set_event):i.permission_changed_event?this.onpermissionchanged(i.permission_changed_event):i.unmute_event?this.onunmuteevent(i.unmute_event):i.token_sent_event?this.ontokensent(i.token_sent_event):i.message_button_clicked?this.onmessagebuttonclicked(i.message_button_clicked):i.dropdown_box_selected?this.onmessagedropdownboxselected(i.dropdown_box_selected):i.mark_as_read?this.onmarkasread(i.mark_as_read):i.voice_reaction_send?this.onvoicereactionmessage(i.voice_reaction_send):i.webrtc_signaling_fwd?this.onwebrtcsignalingfwd(i.webrtc_signaling_fwd):i.list_activity?this.onactivityupdated(i.list_activity):i.sd_topic_event?this.onsdtopicevent(i.sd_topic_event):i.channel_app_event?this.onchannelappevent(i.channel_app_event):i.user_status_event?this.onuserstatusevent(i.user_status_event):i.join_channel_app_data?this.onjoinchannelappevent(i.join_channel_app_data):i.unpin_message_event?this.onunpinmessageevent(i.unpin_message_event):i.quick_menu_event?this.onquickmenuevent(i.quick_menu_event):i.meet_participant_event?this.onmeetparticipantevent(i.meet_participant_event):i.transfer_ownership_event?this.ontransferownership(i.transfer_ownership_event):i.ban_user_event?this.onbanneduser(i.ban_user_event):i.list_channel_users_banned_event?this.onlistchannelusersbanned(i.list_channel_users_banned_event):i.allow_anonymous_event?this.onallowanonymousevent(i.allow_anonymous_event):i.aiagent_enabled_event?this.onaiagentenabled(i.aiagent_enabled_event):i.pong?this.verbose&&window&&window.console&&console.log("Pong message received: %o",i):this.verbose&&window&&window.console&&console.log("Unrecognized message received: %o",i)}),d=>l(this,null,function*(){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.ondisconnect(d)}));let c=new Promise((d,i)=>{this.transport.setOnOpen(o=>{this.verbose&&window&&window.console&&console.log(o);let a=ce;ce=!0,this.clearConnectTimeout(),this._connectionState=p.CONNECTED,this.startHeartbeatLoop(),this._connectPromise=void 0,d(e),a&&this.onreconnect(o)}),this.transport.setOnError(o=>{this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.clearConnectTimeout(),this.onerror(o),this._connectPromise=void 0,this.transport.close(),i(o)}),this._connectTimeoutTimer=setTimeout(()=>{this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.transport.close(),this._connectPromise=void 0,i("The socket timed out when trying to connect."),this._connectTimeoutTimer=void 0},s)});return this._connectPromise=c,this._connectPromise}pingPong(){return l(this,null,function*(){if(!this.isOpen()){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop();return}try{let e="",t={ping:{}};yield this.transport.send({urlPath:e,fetchOptions:t},this._heartbeatTimeoutMs)}catch(e){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.isOpen()&&(window&&window.console&&console.error("Server unreachable from heartbeat."),this.onheartbeattimeout(),this.transport.close());return}this.startHeartbeatLoop()})}startHeartbeatLoop(){this.stopHeartbeatLoop(),this._heartbeatTimer=setTimeout(()=>this.pingPong(),this._heartbeatTimeoutMs)}stopHeartbeatLoop(){this._heartbeatTimer!==void 0&&(clearTimeout(this._heartbeatTimer),this._heartbeatTimer=void 0)}clearConnectTimeout(){this._connectTimeoutTimer!==void 0&&(clearTimeout(this._connectTimeoutTimer),this._connectTimeoutTimer=void 0)}onreconnect(e){this.verbose&&window&&window.console&&console.log(e)}ondisconnect(e){this.verbose&&window&&window.console&&console.log(e)}onerror(e){this._connectionState=p.DISCONNECTED,this.stopHeartbeatLoop(),this.verbose&&window&&window.console&&console.log(e)}onmessagetyping(e){this.verbose&&window&&window.console&&console.log(e)}onmessagereaction(e){this.verbose&&window&&window.console&&console.log(e)}onchannelmessage(e){this.verbose&&window&&window.console&&console.log(e)}onchannelpresence(e){this.verbose&&window&&window.console&&console.log(e)}onuserchanneladded(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanadded(e){this.verbose&&window&&window.console&&console.log(e)}onuserprofileupdate(e){this.verbose&&window&&window.console&&console.log(e)}onuserchannelremoved(e){this.verbose&&window&&window.console&&console.log(e)}onaddfriend(e){this.verbose&&window&&window.console&&console.log(e)}onremovefriend(e){this.verbose&&window&&window.console&&console.log(e)}onblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onunblockfriend(e){this.verbose&&window&&window.console&&console.log(e)}onuserclanremoved(e){this.verbose&&window&&window.console&&console.log(e)}onnotification(e){this.verbose&&window&&window.console&&console.log(e)}onstatuspresence(e){this.verbose&&window&&window.console&&console.log(e)}onpinmessage(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceended(e){this.verbose&&window&&window.console&&console.log(e)}onvoicestarted(e){this.verbose&&window&&window.console&&console.log(e)}onvoicejoined(e){this.verbose&&window&&window.console&&console.log(e)}onvoiceleaved(e){this.verbose&&window&&window.console&&console.log(e)}onchannelcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncategoryevent(e){this.verbose&&window&&window.console&&console.log(e)}onroleevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventemoji(e){this.verbose&&window&&window.console&&console.log(e)}oneventnotiuserchannel(e){this.verbose&&window&&window.console&&console.log(e)}oneventwebhook(e){this.verbose&&window&&window.console&&console.log(e)}onchanneldeleted(e){this.verbose&&window&&window.console&&console.log(e)}onclandeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickercreated(e){this.verbose&&window&&window.console&&console.log(e)}onstickerdeleted(e){this.verbose&&window&&window.console&&console.log(e)}onstickerupdated(e){this.verbose&&window&&window.console&&console.log(e)}onchannelupdated(e){this.verbose&&window&&window.console&&console.log(e)}ondeleteaccount(e){this.verbose&&window&&window.console&&console.log(e)}onclanprofileupdated(e){this.verbose&&window&&window.console&&console.log(e)}onclanupdated(e){this.verbose&&window&&window.console&&console.log(e)}onlastseenupdated(e){this.verbose&&window&&window.console&&console.log(e)}onheartbeattimeout(){this.verbose&&window&&window.console&&console.log("Heartbeat timeout.")}oncustomstatus(e){this.verbose&&window&&window.console&&console.log(e)}oncanvasevent(e){this.verbose&&window&&window.console&&console.log(e)}oneventcreated(e){this.verbose&&window&&window.console&&console.log(e)}oncoffeegiven(e){this.verbose&&window&&window.console&&console.log(e)}onroleassign(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelstarted(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelended(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchanneljoined(e){this.verbose&&window&&window.console&&console.log(e)}onstreamingchannelleaved(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionset(e){this.verbose&&window&&window.console&&console.log(e)}onpermissionchanged(e){this.verbose&&window&&window.console&&console.log(e)}onunmuteevent(e){this.verbose&&window&&window.console&&console.log(e)}ontokensent(e){this.verbose&&window&&window.console&&console.log(e)}onmessagebuttonclicked(e){this.verbose&&window&&window.console&&console.log(e)}onmessagedropdownboxselected(e){this.verbose&&window&&window.console&&console.log(e)}onmarkasread(e){this.verbose&&window&&window.console&&console.log(e)}onvoicereactionmessage(e){this.verbose&&window&&window.console&&console.log(e)}onwebrtcsignalingfwd(e){this.verbose&&window&&window.console&&console.log(e)}onactivityupdated(e){this.verbose&&window&&window.console&&console.log(e)}onsdtopicevent(e){this.verbose&&window&&window.console&&console.log(e)}onchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onuserstatusevent(e){this.verbose&&window&&window.console&&console.log(e)}onjoinchannelappevent(e){this.verbose&&window&&window.console&&console.log(e)}onunpinmessageevent(e){this.verbose&&window&&window.console&&console.log(e)}onquickmenuevent(e){this.verbose&&window&&window.console&&console.log(e)}ontransferownership(e){this.verbose&&window&&window.console&&console.log(e)}onbanneduser(e){this.verbose&&window&&window.console&&console.log(e)}onlistchannelusersbanned(e){this.verbose&&window&&window.console&&console.log(e)}onmeetparticipantevent(e){this.verbose&&window&&window.console&&console.log(e)}onallowanonymousevent(e){this.verbose&&window&&window.console&&console.log(e)}onaiagentenabled(e){this.verbose&&window&&window.console&&console.log(e)}onRefreshSession(e){console.log(`Token refresh occurred. Token: ${e.token}`)}isexpired(e){return e.isexpired(Date.now()/1e3)}authenticateMezon(e,t,n,s,c={},d={}){let i={token:e,vars:c};return this.transport.authenticateMezon(this.serverkey,"",i,t,n,s,d).then(o=>new q(o.token||"",o.refresh_token||"",o.created||!1,o.api_url||"",o.ws_url||"",o.id_token||"",o.is_remember||!1))}authenticateSMSOTPRequest(e,t,n){let s={username:t,account:{phoneno:e,vars:n}};return this.transport.AuthenticateSMSOTPRequest(this.serverkey,"",s,t).then(c=>Promise.resolve(c))}authenticateEmailOTPRequest(e,t,n){let s={username:t,account:{email:e,vars:n}};return this.transport.AuthenticateEmailOTPRequest(this.serverkey,"",s,t).then(c=>Promise.resolve(c))}confirmAuthenticateOTP(e){return l(this,null,function*(){return this.transport.confirmAuthenticateOTP(this.serverkey,"",e).then(t=>new q(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1))})}authenticateEmail(e,t,n,s){let c={username:n,account:{email:e,password:t,vars:s}};return this.transport.authenticateEmail(this.serverkey,"",c,n).then(d=>new q(d.token||"",d.refresh_token||"",d.created||!1,d.api_url||"",d.ws_url||"",d.id_token||"",d.is_remember||!1))}setBasePath(e,t,n){this.host=e,this.port=t,this.useSSL=n;let c=`${n?"https://":"http://"}${e}:${t}`;return this.transport.setBasePath(c)}addChannelUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addChannelUsers(e.token,t,n).then(s=>s!==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(e.token,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(e.token,t,n).then(s=>Promise.resolve(s!=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(e.token,t,n).then(s=>Promise.resolve(s!=null))})}uploadOauthFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadOauthFile(e.token,t)})}uploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.uploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFile(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFile(e.token,t)})}multipartUploadAttachmentFileFinish(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.multipartUploadAttachmentFileFinsih(e.token,t)})}createChannelDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createChannelDesc(e.token,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(e.token,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(e.token,t)})}createCategoryDesc(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createCategoryDesc(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>s!==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(e.token,t).then(n=>n!==void 0)})}deleteCategoryDesc(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteCategoryDesc(e.token,t,n,s).then(c=>c!==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(e.token,t,n).then(s=>Promise.resolve(s!=null))})}deleteRole(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteRole(e.token,t,"0",n,s).then(c=>c!==void 0)})}deleteEvent(e,t,n,s,c,d){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteEvent(e.token,t,n,s,c,d).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(e.token,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(e.token,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(e.token,t,n).then(s=>Promise.resolve(s!=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(e.token,t,n).then(s=>Promise.resolve(s))})}unbanClanUsers(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unbanClanUsers(e.token,t,n,s).then(c=>Promise.resolve(c!=null))})}banClanUsers(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.banClanUsers(e.token,t,n,s,c).then(d=>Promise.resolve(d!=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(e.token,t,n).then(s=>Promise.resolve(s!=null))})}listChannelMessages(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelMessages(e.token,t,n,s,c,d,i).then(o=>{let a={messages:[],last_seen_message:o.last_seen_message,last_sent_message:o.last_sent_message};return o.messages==null||o.messages.forEach(u=>{let h,g,f,A,y;try{h=P(u.content)}catch(b){console.log("error parse content",b)}try{let b=F(u.reactions);g=(b==null?void 0:b.reactions)||b||P(u.reactions||"[]")}catch(b){g=P(u.reactions||"[]")}try{let b=D(u.mentions);f=(b==null?void 0:b.mentions)||b||P(u.mentions||"[]")}catch(b){f=P(u.mentions||"[]")}try{let b=B(u.attachments);A=(b==null?void 0:b.attachments)||b||P(u.attachments||"[]")}catch(b){A=P(u.attachments||"[]")}try{let b=N(u.references);y=(b==null?void 0:b.refs)||b||P(u.references||"[]")}catch(b){y=P(u.references||"[]")}a.messages.push({channel_id:u.channel_id,code:u.code?Number(u.code):0,id:u.message_id||"",sender_id:u.sender_id,username:u.username,display_name:u.display_name,avatar:u.avatar,content:h,channel_label:u.channel_label,clan_logo:u.clan_logo,category_name:u.category_name,clan_nick:u.clan_nick,clan_avatar:u.clan_avatar,attachments:A,mentions:f,reactions:g,references:y,clan_id:u.clan_id,create_time_seconds:u.create_time_seconds,update_time_seconds:u.update_time_seconds,hide_editted:u.hide_editted})}),Promise.resolve(a)})})}listChannelVoiceUsers(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelVoiceUsers(e.token,t,n).then(s=>{let c={voice_channel_users:[]};return s.voice_channel_users==null||s.voice_channel_users.forEach(d=>{c.voice_channel_users.push({id:d.id,channel_id:d.channel_id,user_ids:d.user_ids,participant:d.participant})}),Promise.resolve(c)})})}listChannelUsers(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelUsers(e.token,t,n,s,d,c,i).then(o=>{let a={channel_users:[],cursor:o.cursor,channel_id:o.channel_id};return o.channel_users==null||o.channel_users.forEach(u=>{a.channel_users.push({user_id:u.user_id,role_id:u.role_id,thread_id:u.thread_id,clan_avatar:u.clan_avatar,clan_nick:u.clan_nick,id:u.id,clan_id:u.clan_id,added_by:u.added_by,is_banned:u.is_banned})}),Promise.resolve(a)})})}listChannelAttachments(e,t,n,s,c,d,i,o){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelAttachment(e.token,n,t,s,d,c,i,o).then(a=>{let u={attachments:[]};return a.attachments==null||a.attachments.forEach(h=>{u.attachments.push({filename:h.filename,filesize:h.filesize,filetype:h.filetype,id:h.id,uploader:h.uploader,url:h.url,message_id:h.message_id,create_time_seconds:h.create_time_seconds,width:h.width,height:h.height})}),Promise.resolve(u)})})}listClanUsers(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsers(e.token,t).then(n=>{let s={clan_users:[],cursor:n.cursor,clan_id:n.clan_id};return n.clan_users==null||n.clan_users.forEach(c=>{var d;s.clan_users.push({user:{avatar_url:c.user.avatar_url,create_time_seconds:c.user.create_time_seconds,display_name:c.user.display_name,edge_count:c.user.edge_count?Number(c.user.edge_count):0,id:c.user.id,lang_tag:c.user.lang_tag,location:c.user.location,online:c.user.online,is_mobile:(d=c.user)==null?void 0:d.is_mobile,timezone:c.user.timezone,update_time:c.user.update_time,username:c.user.username,user_status:c.user.user_status,status:c.user.status,about_me:c.user.about_me,mezon_id:c.user.mezon_id,list_nick_names:c.user.list_nick_names,phone_number:c.user.phone_number,join_time_seconds:c.user.join_time_seconds},role_id:c.role_id,clan_nick:c.clan_nick,clan_avatar:c.clan_avatar})}),Promise.resolve(s)})})}listClanUsersStatus(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanUsersStatus(e.token,t).then(n=>{let s={clan_user_statuses:[]};return n.clan_user_statuses==null||n.clan_user_statuses.forEach(c=>{s.clan_user_statuses.push({user_id:c.user_id,user_status:c.user_status})}),Promise.resolve(s)})})}listChannelDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDetail(e.token,t).then(n=>Promise.resolve(n))})}listChannelDescs(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelDescs(e.token,t,n,s,c,d,i).then(o=>{let a={channeldesc:[],next_cursor:o.next_cursor,prev_cursor:o.prev_cursor,cacheable_cursor:o.cacheable_cursor};return o.channeldesc==null||(a.channeldesc=o.channeldesc),Promise.resolve(a)})})}listClanDescs(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listClanDescs(e.token,t,n,s).then(c=>{let d={clandesc:[]};return c.clandesc==null||(d.clandesc=c.clandesc),Promise.resolve(d)})})}listChannelBadgeCount(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelBadgeCount(e.token,t,n,s).then(c=>{var d;return{channeldesc:(d=c.channeldesc)!=null?d:[],total_count:c.total_count}})})}listUserOnline(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listUserOnline(e.token,t,n,s).then(c=>{var d;return{users:(d=c.users)!=null?d:[],total_count:c.total_count}})})}listCategoryDescs(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listCategoryDescs(e.token,t,n,s).then(c=>{let d={categorydesc:[]};return c.categorydesc==null||(d.categorydesc=c.categorydesc),Promise.resolve(d)})})}listEvents(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listEvents(e.token,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(e.token,t).then(n=>Promise.resolve(n))})}listRoleUsers(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoleUsers(e.token,t,n,s).then(c=>Promise.resolve(c))})}registFCMDeviceToken(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registFCMDeviceToken(e.token,t,n,s,c).then(d=>Promise.resolve(d))})}getUserProfileOnClan(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getUserProfileOnClan(e.token,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(e.token,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(e.token,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(e.token,t)})}linkSMS(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.linkSMS(e.token,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(e.token,t).then(n=>Promise.resolve(n))})}listFriends(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listFriends(e.token,n,t,s).then(c=>{let d={friends:[],cursor:c.cursor};return c.friends==null||c.friends.forEach(i=>{var o;d.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:(o=i.user)==null?void 0:o.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(d)})})}listNotifications(e,t,n,s,c,d){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listNotifications(e.token,n,t,s,c,d).then(i=>{let o={cacheable_cursor:i.cacheable_cursor,notifications:[]};return i.notifications==null||i.notifications.forEach(a=>{o.notifications.push({id:a.id,subject:a.subject,content:a.content?H(a.content):void 0,code:a.code?Number(a.code):0,sender_id:a.sender_id,create_time_seconds:a.create_time_seconds,persistent:a.persistent,category:a.category})}),Promise.resolve(o)})})}sessionLogout(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sessionLogout(e.token,{refresh_token:n,token:t,device_id:s,platform:c}).then(d=>d!==void 0)})}sessionRefresh(n){return l(this,arguments,function*(e,t={}){if(!e)return console.error("Cannot refresh a null session."),e;e.created&&e.expires_at-e.created_at<70&&console.warn("Session lifetime too short, please set '--session.token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session"),e.created&&e.refresh_expires_at-e.created_at<3700&&console.warn("Session refresh lifetime too short, please set '--session.refresh_token_expiry_sec' option. See the documentation for more info: https://mezon.vn/docs/mezon/getting-started/configuration/#session");let s=yield this.refreshTokenManager.refresh(e.refresh_token,()=>l(this,null,function*(){try{let c=yield this.transport.sessionRefresh(this.serverkey,"",{token:e.refresh_token,vars:t,is_remember:e.is_remember});return{token:c.token,refresh_token:c.refresh_token,is_remember:c.is_remember||!1}}catch(c){throw console.error("Session refresh failed:",c),c}}));return e.update(s.token,s.refresh_token,s.is_remember),this.onRefreshSession(s),e})}unlinkEmail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.unlinkEmail(e.token,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(e.token,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(e.token,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(e.token,t,n).then(s=>s!==void 0)})}updateClanDesc(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateClanDesc(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>s!==void 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(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>Promise.resolve(s))})}createLinkInviteUser(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createLinkInviteUser(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,{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(e.token,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(e.token,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(e.token,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(e.token,t).then(n=>Promise.resolve(n))})}pinMessagesList(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPinMessagesList(e.token,t,n,s).then(c=>{let d={pin_messages_list:[]};return c.pin_messages_list==null||c.pin_messages_list.forEach(i=>{d.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(d)})})}deletePinMessage(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deletePinMessage(e.token,t,n,s,c).then(d=>d!==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(e.token,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(e.token,t,n).then(s=>s!==void 0)})}deleteByIdClanEmoji(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanEmojiById(e.token,t,n,s).then(c=>c!==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(e.token,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(e.token,t,n).then(s=>Promise.resolve(s))})}updateWebhookById(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateWebhookById(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>s!==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(e.token,t).then(n=>n!==void 0)})}deleteClanStickerById(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteClanStickerById(e.token,t,n,s).then(c=>c!==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(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>s!==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(e.token,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(e.token,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(e.token,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(e.token,t,n).then(s=>s!==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(e.token,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(e.token,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(e.token,t,n).then(s=>Promise.resolve(s))})}deleteSystemMessage(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteSystemMessage(e.token,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(e.token,t).then(n=>Promise.resolve(n))})}givecoffee(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.giveMeACoffee(e.token,t).then(n=>n!==void 0)})}sendToken(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendToken(e.token,t).then(n=>n!==void 0)})}listStreamingChannelUsers(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listStreamingChannelUsers(e.token,t,n,s,d,c,i).then(o=>{let a={streaming_channel_users:[]};return o.streaming_channel_users==null||o.streaming_channel_users.forEach(u=>{a.streaming_channel_users.push({id:u.id,channel_id:u.channel_id,user_id:u.user_id,participant:u.participant})}),Promise.resolve(a)})})}registerStreamingChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registerStreamingChannel(e.token,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(e.token,t).then(n=>{let s={channel_apps:[]};return n.channel_apps==null||n.channel_apps.forEach(c=>{s.channel_apps.push({id:c.id,channel_id:c.channel_id,app_id:c.app_id,clan_id:c.clan_id,app_url:c.app_url,app_name:c.app_name,app_logo:c.app_logo})}),Promise.resolve(s)})})}getChannelCategoryNotiSettingsList(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCategoryNotiSettingsList(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,t,n).then(s=>Promise.resolve(s))})}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,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listRoles(e.token,t,n,s,c).then(d=>{let i={clan_id:t,roles:d.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(e.token,t,n).then(s=>{let c={clan_id:t,channel_id:n,permissions:s.permissions};return Promise.resolve(c)})})}getPermissionByRoleIdChannelId(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPermissionByRoleIdChannelId(e.token,t,n,s).then(c=>{let d={role_id:t,channel_id:n,permission_role_channel:c.permission_role_channel,user_id:s};return Promise.resolve(d)})})}markAsRead(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.markAsRead(e.token,t).then(n=>Promise.resolve(n))})}listThreadDescs(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listThreadDescs(e.token,t,n,s,c,d,i).then(o=>{let a={channeldesc:[]};return o.channeldesc==null||(a.channeldesc=o.channeldesc),Promise.resolve(a)})})}listChannelTimeline(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelTimeline(e.token,t).then(n=>{var s;return(s=n.events)==null||s.forEach(c=>{c.attachments=[];let d;try{let i=k(c.preview_imgs);d=(i==null?void 0:i.attachments)||i||P(c.preview_imgs||"[]")}catch(i){d=P(c.preview_imgs||"[]")}Array.isArray(d)?c.preview_imgs=d:c.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(e.token,t).then(n=>{let s=n.event;if(s){let c,d;try{let i=k(s.attachments),o=k(s.preview_imgs);c=(i==null?void 0:i.attachments)||i||P(s.attachments||"[]"),d=(o==null?void 0:o.attachments)||o||P(s.preview_imgs||"[]")}catch(i){c=P(s.attachments||"[]"),d=P(s.preview_imgs||"[]")}Array.isArray(c)?s.attachments=c:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.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(e.token,t).then(n=>{let s=n.event;if(s){let c,d;try{let i=k(s.attachments),o=k(s.preview_imgs);c=(i==null?void 0:i.attachments)||i||P(s.attachments||"[]"),d=(o==null?void 0:o.attachments)||o||P(s.preview_imgs||"[]")}catch(i){c=P(s.attachments||"[]"),d=P(s.preview_imgs||"[]")}Array.isArray(c)?s.attachments=c:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.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(e.token,t).then(n=>{let s=n.event;if(s){let c,d;try{let i=k(s.attachments),o=k(s.preview_imgs);c=(i==null?void 0:i.attachments)||i||P(s.attachments||"[]"),d=(o==null?void 0:o.attachments)||o||P(s.preview_imgs||"[]")}catch(i){c=P(s.attachments||"[]"),d=P(s.preview_imgs||"[]")}Array.isArray(c)?s.attachments=c:s.attachments=[],Array.isArray(d)?s.preview_imgs=d:s.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(e.token,t,n).then(s=>Promise.resolve(s))})}archiveChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.archiveChannel(e.token,t,n).then(s=>Promise.resolve(s))})}listArchivedChannelDescs(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listArchivedChannelDescs(e.token,t).then(n=>Promise.resolve(n))})}getChannelSettingInClan(e,t,n,s,c,d,i,o,a,u,h){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listChannelSetting(e.token,t,n,s,c,d,i,o,a,u,h).then(g=>Promise.resolve(g))})}getChannelCanvasList(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasList(e.token,t,n,s,c).then(d=>{let i={channel_canvases:[]};return d.channel_canvases==null||(i.clan_id=d.clan_id,i.channel_id=d.channel_id,i.channel_canvases=d.channel_canvases,i.count=d.count),Promise.resolve(i)})})}getChannelCanvasDetail(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChannelCanvasDetail(e.token,t,n,s).then(c=>Promise.resolve(c))})}editChannelCanvases(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.editChannelCanvases(e.token,t).then(n=>Promise.resolve(n))})}deleteChannelCanvas(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelCanvas(e.token,t,n,s).then(c=>c!==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(e.token,{channel_id:t,clan_id:n}).then(s=>s)})}removeFavoriteChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChannelFavorite(e.token,t,n).then(s=>s)})}getListFavoriteChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getListFavoriteChannel(e.token,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(e.token,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?new q(t.token||"",t.refresh_token||"",t.created||!1,t.api_url||"",t.ws_url||"",t.id_token||"",t.is_remember||!1):null})}confirmLogin(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.confirmLogin(e.token,t,n).then(s=>s)})}getChanEncryptionMethod(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getChanEncryptionMethod(e.token,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(e.token,t,{method:n}).then(s=>s)})}getPubKeys(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPubKeys(e.token,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(e.token,{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,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listAuditLog(e.token,t,n,s,c).then(d=>d)})}listOnboarding(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboarding(e.token,t,n,s,c).then(d=>d)})}getOnboardingDetail(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getOnboardingDetail(e.token,t,n).then(s=>Promise.resolve(s))})}createOnboarding(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createOnboarding(e.token,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(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>s!==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(e.token,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(e.token,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(e.token,t,n).then(s=>s!==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(e.token,t,n).then(s=>s!==void 0)})}listOnboardingStep(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listOnboardingStep(e.token,t,n,s).then(c=>Promise.resolve(c))})}updateOnboardingStepByClanId(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateOnboardingStepByClanId(e.token,t,n).then(s=>s!==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(e.token,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(e.token,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){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listSdTopic(e.token,t,n).then(s=>Promise.resolve(s))})}createSdTopic(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createSdTopic(e.token,t).then(n=>n)})}getTopicDetail(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getTopicDetail(e.token,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(e.token,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(e.token,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(e.token,t,n).then(s=>Promise.resolve(s))})}updateMezonOauthClient(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonOauthClient(e.token,t).then(n=>Promise.resolve(n))})}searchThread(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.searchThread(e.token,t,n,s).then(c=>Promise.resolve(c))})}generateHashChannelApps(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.generateHashChannelApps(e.token,t).then(n=>Promise.resolve(n))})}registrationPassword(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.registrationEmail(e.token,{email:t,password:n,old_password:s}).then(c=>Promise.resolve(c))})}addUserEvent(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addUserEvent(e.token,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(e.token,t,n).then(s=>s!==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(e.token,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,s,c){return l(this,null,function*(){return this.transport.generateMeetTokenExternal("",e,t,n,s,c).then(d=>Promise.resolve(d))})}removeMezonMeetParticipant(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeParticipantMezonMeet(e.token,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(e.token,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(e.token,t).then(n=>n!==void 0)})}listClanDiscover(e,t){return l(this,null,function*(){return this.transport.clanDiscover(this.serverkey,"",e,t).then(n=>Promise.resolve(n))})}listQuickMenuAccess(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listQuickMenuAccess(e.token,t,n,s).then(c=>Promise.resolve(c))})}deleteQuickMenuAccess(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteQuickMenuAccess(e.token,t,n).then(s=>s!==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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,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(e.token,t,n).then(s=>s!==void 0)})}updateMezonVoiceState(e,t,n,s,c,d){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateMezonVoiceState(e.token,t,n,s,c,d).then(i=>i!==void 0)})}sendChannelMessage(e,t,n,s,c,d,i,o,a,u,h,g,f,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.sendChannelMessage(e.token,t,n,s,c,d,i,o,a,u,h,g,f,A).then(y=>Promise.resolve(y))})}updateChannelMessage(e,t,n,s,c,d,i,o,a,u,h,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChannelMessage(e.token,t,n,s,c,d,i,o,a,u,h,g).then(f=>Promise.resolve(f))})}deleteChannelMessage(e,t,n,s,c,d,i,o,a,u){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.deleteChannelMessage(e.token,t,n,s,c,d,i,o,a,u).then(h=>Promise.resolve(h))})}messageButtonClick(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.messageButtonClick(e.token,t,n,s,c,d,i).then(o=>Promise.resolve(o))})}dropdownBoxSelected(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.dropdownBoxSelected(e.token,t,n,s,c,d,i).then(o=>Promise.resolve(o))})}activeArchivedThread(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.activeArchivedThread(e.token,t,n).then(s=>Promise.resolve(s))})}addAgentToChannel(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.addAgentToChannel(e.token,t,n).then(s=>Promise.resolve(s))})}disconnectAgent(e,t,n){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.disconnectAgent(e.token,t,n).then(s=>Promise.resolve(s))})}listMutedChannel(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listMutedChannel(e.token,t).then(n=>Promise.resolve(n))})}channelMessageReact(e,t,n,s,c,d,i,o,a,u,h,g,f,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.channelMessageReact(e.token,t,n,s,c,d,i,o,a,u,h,g,f,A).then(y=>Promise.resolve(y))})}createPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.createPoll(e.token,t)})}votePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.votePoll(e.token,t)})}closePoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.closePoll(e.token,t)})}getPoll(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.getPoll(e.token,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,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.joinChat(t,n,s,c)})}leaveChat(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.leaveChat(t,n,s,c)})}removeChatMessage(e,t,n,s,c,d,i,o,a,u){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.removeChatMessage(t,n,s,c,d,i,o,a,u)})}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,s,c,d,i,o,a,u,h,g){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.updateChatMessage(t,n,s,c,d,i,o,a,u,h,g)})}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,s,c,d,i,o,a,u,h,g,f,A,y){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeQuickMenuEvent(t,n,s,c,d,i,o,a,u,h,g,f,A,y)})}writeEphemeralMessage(e,t,n,s,c,d,i,o,a,u,h,g,f,A,y,b){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeEphemeralMessage(t,n,s,c,d,i,o,a,u,h,g,f,A,y,b)})}writeChatMessage(e,t,n,s,c,d,i,o,a,u,h,g,f,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChatMessage(t,n,s,c,d,i,o,a,u,h,g,f,A)})}writeMessageReaction(e,t,n,s,c,d,i,o,a,u,h,g,f,A,y){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageReaction(t,n,s,c,d,i,o,a,u,h,g,f,A,y)})}writeMessageTyping(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeMessageTyping(t,n,s,c,d,i)})}writeLastSeenMessage(e,t,n,s,c,d,i){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastSeenMessage(t,n,s,c,d,i)})}writeLastPinMessage(e,t,n,s,c,d,i,o,a,u,h,g,f,A){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeLastPinMessage(t,n,s,c,d,i,o,a,u,h,g,f,A)})}writeCustomStatus(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeCustomStatus(t,n,s,c)})}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)})}forwardWebrtcSignaling(e,t,n,s,c,d){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.forwardWebrtcSignaling(t,n,s,c,d)})}makeCallPush(e,t,n,s,c){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.makeCallPush(t,n,s,c)})}writeChannelAppEvent(e,t,n,s){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.writeChannelAppEvent(t,n,s)})}listDataSocket(e,t){return l(this,null,function*(){return this.autoFallbackHttp&&this._connectionState!==p.CONNECTED&&(yield this.transport.setFallbackSession(e)),this.transport.listDataSocket(t)})}};U.DefaultHeartbeatTimeoutMs=1e4,U.DefaultConnectTimeoutMs=3e4;var $=U;return fe(ke);})();
|