hummer-chatroom-svc-sdk
Version:
hummer chatroom svc js-sdk
20 lines • 495 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Hummer=t():e.Hummer=t()}(window,function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=60)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(40),r=n(5);t.default=class{constructor(e=!0){this.hasHeader=e,this.segments=[],this.data=null,this.totalLen=0,this.uri=0,this.hasHeader&&(this.pushUInt32(10),this.pushUInt32(this.uri),this.pushUInt16(200))}destroy(){}marshall(){if(0===this.segments.length)return null;this.data=new Uint8Array(this.totalLen);let e=0;for(let t=0;t<this.segments.length;++t){let n=this.segments[t];this.data.set(n,e),e+=n.length}return this.hasHeader&&(this.replaceUInt32(0,this.totalLen),this.replaceUInt32(4,this.uri)),this.data}setUri(e){this.uri=e}replaceUInt32(e,t){new DataView(this.data.buffer).setUint32(e,t,!0)}pushUInt8(e){let t=new Uint8Array(1);new DataView(t.buffer).setUint8(0,e),this.segments.push(t),this.totalLen++}pushBool(e){this.pushUInt8(e?1:0)}pushUInt16(e){let t=new Uint8Array(2);new DataView(t.buffer).setUint16(0,e,!0),this.segments.push(t),this.totalLen+=2}pushUInt32(e){let t=new Uint8Array(4);new DataView(t.buffer).setUint32(0,e,!0),this.segments.push(t),this.totalLen+=4}pushUInt64(e){let t=new Uint8Array(8),n=new DataView(t.buffer);n.setUint32(0,e.low,!0),n.setUint32(4,e.high,!0),this.segments.push(t),this.totalLen+=8}pushUInt64String(e){const{low:t,high:n}=r.fromString(e,!0);this.pushUInt64({low:t,high:n})}pushNumber(e){const{low:t,high:n}=r.fromNumber(e,!0);this.pushUInt64({low:t,high:n})}pushUGID(e){this.pushUInt16(12),this.pushUInt32(e.sid),this.pushUInt32(e.appId),this.pushUInt32(e.channelId)}pushUint8Array(e){if(e.length>=65536)throw{rescode:2001,msg:"Invalid Parameter"};this.pushUInt16(e.length),this.segments.push(e),this.totalLen+=e.length}pushUint8ArrayWithoutLen(e){this.segments.push(e),this.totalLen+=e.length}pushUint8Array32(e){this.pushUInt32(e.length),this.segments.push(e),this.totalLen+=e.length}pushUIntArray(e){this.pushUInt32(e.length);for(let t=0;t<e.length;t++)this.pushUInt32(e[t])}pushString(e){this.pushUInt16(e.length);let t=new Uint8Array(e.length),n=new DataView(t.buffer);for(let t=0;t<e.length;++t)n.setUint8(t,e.charCodeAt(t));this.segments.push(t),this.totalLen+=e.length}pushString32(e){this.pushUInt32(e.length);let t=new Uint8Array(e.length),n=new DataView(t.buffer);for(let t=0;t<e.length;++t)n.setUint8(t,e.charCodeAt(t));this.segments.push(t),this.totalLen+=e.length}pushUInt32AndUInt32Map(e){this.pushUInt32(e.size);for(let t of e)this.pushUInt32(t[0]),this.pushUInt32(t[1])}pushUtf8String(e){let t=o.default.encodeUtf8(e);this.pushUint8Array(t)}pushUtf8String32(e){let t=o.default.encodeUtf8(e);this.pushUint8Array32(t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(5),r=n(39),i=n(3),s=n(62),a=new i.Logger("Utils");class u{static getHiidoHost(e=!0){return e?"mlog.hiido.com":"hlog.hiido.com"}static MAX(e,t){return e>t?e:t}static MIN(e,t){return e<t?e:t}static isUint64String(e){return!!/^\d+(\.\d+)?$/.test(e)}static hasOwn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}static inet_ntoa(e){let t,n,o,r,i="",s=new Uint8Array(4),a=new DataView(s.buffer);return a.setUint32(0,e),t=a.getUint8(0),n=a.getUint8(1),o=a.getUint8(2),i=(r=a.getUint8(3))+"."+o+"."+n+"."+t}static isBiggerUint(e,t){if(e===t)return!1;if(e>t){return e-t<2147483647}return!(t-e<2147483647)}static isEqualOrBiggerUint(e,t){if(e===t)return!0;if(e>t){return e-t<2147483647}return!(t-e<2147483647)}static isBiggerUint8(e,t){if(e===t)return!1;if(e>t){return e-t<127}return!(t-e<127)}static getUintMax(){return 4294967295}static isUintMax(e){return 4294967295===e}static getIntMax(){return 2147483647}static getIntMin(){return-1*this.getIntMax()}static isUint64Max(e){return 4294967295===e.high&&4294967295===e.low}static uint2ip(e){let t,n,o,r;return(t=255&e)+"."+(n=e>>8&255)+"."+(o=e>>16&255)+"."+(r=e>>24&255)}static ip2uint(e){let t=e.split(".");return(parseInt(t[3])<<24)+(parseInt(t[2])<<16)+(parseInt(t[1])<<8)+parseInt(t[0])>>>0}static isNumber(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)}static isString(e){return"string"==Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()}static isEmpty(e){return void 0===e||null==e||""==e}static isMap(e){return"map"==Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()}static isObject(e){return"object"==Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()}static toMap(e){if(u.isMap(e))return e;if(u.isObject(e)){let t=new Map;for(let n of Object.keys(e))t.set(n,e[n].toString());return t}return null}static toPlainObject(e){if(u.isMap(e)){let t={};for(let[n,o]of e)t[n]=o;return t}return{}}static bin2hex(e){var t,n,o,r="";for(t=0,n=(e+="").length;t<n;t++)r+=(o=e.charCodeAt(t).toString(16)).length<2?"0"+o:o;return r}static getUUID(e){var t="";try{var n=document.createElement("canvas"),o=n.getContext("2d"),r=e;o.fillStyle="#f60",o.fillRect(0,0,8,10),o.fillStyle="#FF0000",o.fillText(r,4,17);var i=n.toDataURL().replace("data:image/png;base64,",""),s=atob(i);t=u.bin2hex(s.slice(-16,-12))}catch(e){var a=[];for(let e=0;e<8;e++)a[e]="0123456789abcdef".substr(Math.floor(16*Math.random()),1);t=a.join("")}var l=[];for(let e=0;e<28;e++)l[e]="0123456789abcdef".substr(Math.floor(16*Math.random()),1);return l[6]="4",l[11]="0123456789abcdef".substr(3&l[19]|8,1),l[0]=l[5]=l[10]=l[15]="-",t+l.join("")}static getCookie(e,t=!1){if(t)return wx.getStorageSync(e.toString());if(document.cookie.length>0){var n=document.cookie.indexOf(e+"=");if(-1!=n){n=n+e.length+1;var o=document.cookie.indexOf(";",n);return-1==o&&(o=document.cookie.length),decodeURI(document.cookie.substring(n,o))}}return""}static setCookie(e,t,n,o,r,i){n||(n=24);var s=new Date;s.setTime(s.getTime()+60*n*60*1e3),document.cookie=e+"="+window.encodeURI(t)+";expires="+s.toUTCString()+(r?";domain="+r:"")+(o?";path="+o:"")+(!0===i?";secure":"")}static setWxCookie(e,t){wx.setStorageSync(e,t),wx.setStorageSync("oscookieDate",Date.now())}static getUidInCertainInterval(){return parseInt(""+(1125e4*Math.random()+4283717296),10)}static getOrGenerateUid(e,t){if(!t)return u.getUidInCertainInterval();let n=u.getCookie("svc_anonymous_uid");if(!n){let t=u.getUidInCertainInterval(),n="https:"==document.location.protocol;return u.setCookie("svc_anonymous_uid",t.toString(),168,"/",e,n),a.warn("Utils.getOrGenerateUid save uid to cookie uid="+t),t}return a.warn("Utils.getOrGenerateUid get uid from cookie uid="+n),parseInt(n)}static DelayPromise(e){return new Promise(function(t){setTimeout(t,e)})}static number2ProtoUInt64(e){if(e<=u.getUintMax())return new r.default(0,e);let t=o.fromString(e.toString());return new r.default(t.high,t.low)}static wxPromise(e,t){return new Promise(function(n,o){let r=Object.assign({},t,{success(e){n(e),t&&t.success&&t.success(e)},fail(n){a.error(e+" "+JSON.stringify(n)),o(n),t&&t.fail&&t.fail(n)}});wx[e](r)})}static yFetch(e){let t=s.default(!0,{},{method:"GET"},e);return u.wxPromise("request",t)}static payload2DataView(e){let t=new Uint8Array(e.byteLength);return t.set(e,0),e=null,new DataView(t.buffer)}static stringfyMap(e){let t=u.map2Object(e);return JSON.stringify(t)}static map2Object(e){let t={};for(let[n,o]of e)u.isMap(o)?t[n]=u.map2Object(o):t[n]=o;return t}static unique(e){return e.reduce((e,t)=>e.includes(t)?e:[...e,t],[])}static LongToUint64StringArray(e){let t=[];for(let n of e)t.push(n.toString());return this.unique(t)}static Uint64StringToLongArray(e){let t=[];for(let n of e)t.push(o.fromString(n,!0));return this.unique(t)}}t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(5),r=n(39),i=n(63),s=n(40);t.default=class{constructor(e,t=!0){this.view=e,this.pos=0,this.len=0,this.uri=0,this.resCode=0,!0===t&&(this.len=this.popUInt32(),this.uri=this.popUInt32(),this.resCode=this.popUInt16())}destroy(){}bytesAvailable(){return this.view.byteLength-this.pos}popBool(){if(this.pos+1>this.view.byteLength)return!1;let e=this.view.getUint8(this.pos);return this.pos++,"1"===e.toString()}popUInt8(){if(this.pos+1>this.view.byteLength)return 0;let e=this.view.getUint8(this.pos);return this.pos++,e}popUInt16(){if(this.pos+2>this.view.byteLength)return 0;let e=this.view.getUint16(this.pos,!0);return this.pos+=2,e}popUInt32(){if(this.pos+4>this.view.byteLength)return 0;let e=this.view.getUint32(this.pos,!0);return this.pos+=4,e}popUInt64(){if(this.pos+8>this.view.byteLength)return new r.default;let e=this.view.getUint32(this.pos,!0);this.pos+=4;let t=this.view.getUint32(this.pos,!0);return this.pos+=4,new r.default(t,e)}popUInt64String(){if(this.pos+8>this.view.byteLength)return"0";let e=this.view.getUint32(this.pos,!0);this.pos+=4;let t=this.view.getUint32(this.pos,!0);return this.pos+=4,new o(e,t,!0).toString(10)}popNumber(){if(this.pos+8>this.view.byteLength)return 0;let e=this.view.getUint32(this.pos,!0);this.pos+=4;let t=this.view.getUint32(this.pos,!0);return this.pos+=4,new o(e,t,!0).toNumber()}popUGID(){this.popUInt16();let e=this.popUInt32(),t=this.popUInt32(),n=this.popUInt32();return new i.default(e,t,n)}popUint8Array(){let e=this.popUInt16();if(this.pos+e>this.view.byteLength)return null;let t=new Uint8Array(this.view.buffer,this.pos,e);return this.pos+=e,t}popUint8Array32(){let e=this.popUInt32();if(this.pos+e>this.view.byteLength)return null;let t=new Uint8Array(this.view.buffer,this.pos,e);return this.pos+=e,t}popUInt32Vector(){let e=this.popUInt32();if(this.pos+4*e>this.view.byteLength)return null;let t=[];for(let n=0;n<e;n++)t.push(this.popUInt32());return t}popUInt16Vector(){let e=this.popUInt32();if(this.pos+2*e>this.view.byteLength)return null;let t=[];for(let n=0;n<e;n++)t.push(this.popUInt16());return t}popString(){let e=this.popUInt16();if(this.pos+e>this.view.byteLength)return null;let t="";for(let n=0;n<e;++n)t+=String.fromCharCode(this.popUInt8());return t}popUtf8String(){let e=this.popUint8Array();return s.default.decodeUtf8(e)}popUtf8String32(){let e=this.popUint8Array32();return s.default.decodeUtf8(e)}}},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.DEBUG=-1]="DEBUG",e[e.LOG=0]="LOG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(o=t.LOGLEVEL||(t.LOGLEVEL={}));const r=1e3,i="hummer";class s{constructor(e){this._module=e||""}get canIUseWxLog(){if("undefined"==typeof window){const e=wx.getSystemInfoSync().SDKVersion;if(s.compareVersion(e,"2.1.0")>=0)return wx.getLogManager().log("I can use wx log. SDKVersion="+e),!0}return!1}debug(...e){s.globalLevel<=o.DEBUG&&(console.debug(this._prefix,...e),this.canIUseWxLog&&wx.getLogManager().debug(e))}log(...e){s.globalLevel<=o.LOG&&(s.record(e,"log"),console.log(this._prefix,...e),this.canIUseWxLog&&wx.getLogManager().log(e))}info(...e){s.globalLevel<=o.INFO&&(s.record(e,"info"),console.info(this._prefix,...e),this.canIUseWxLog&&wx.getLogManager().info(e))}warn(...e){s.globalLevel<=o.WARN&&(s.record(e,"warn"),console.warn(this._prefix,...e),this.canIUseWxLog&&wx.getLogManager().warn(e))}error(...e){s.globalLevel<=o.ERROR&&(s.record(e,"error"),console.error(this._prefix,...e),this.canIUseWxLog&&wx.getLogManager().warn(e))}static setLevel(e=o.LOG){console.log(s.getPrefix()+"set level from "+s.globalLevel+" to "+e),s.globalLevel=e}static record(e,t){this._length===r+100&&(this._data.splice(0,100),this._length=r),this._length++;let n=[`[${t}]`,...e];this._data.push(n)}static getLog(){return this._data}static padMs(e){let t;switch(e.toString().length){case 1:t="00"+e;break;case 2:t="0"+e;break;default:t=e}return t}get _prefix(){return s.getPrefix()+" "+this._module}static getPrefix(){let e=new Date;return i+" "+e.toLocaleTimeString("en-US",{hour12:!1})+"."+s.padMs(e.getMilliseconds())+":"}static compareVersion(e,t){e=e.split("."),t=t.split(".");const n=Math.max(e.length,t.length);for(;e.length<n;)e.push("0");for(;t.length<n;)t.push("0");for(let o=0;o<n;o++){const n=parseInt(e[o]),r=parseInt(t[o]);if(n>r)return 1;if(n<r)return-1}return 0}}s._data=[],s._length=0,s.globalLevel=o.LOG,t.Logger=s},function(e,t,n){"use strict";var o,r,i=e.exports=n(9),s=n(47);i.codegen=n(88),i.fetch=n(89),i.path=n(90),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),n=new Array(t.length),o=0;o<t.length;)n[o]=e[t[o++]];return n}return[]},i.toObject=function(e){for(var t={},n=0;n<e.length;){var o=e[n++],r=e[n++];void 0!==r&&(t[o]=r)}return t};var a=/\\/g,u=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(a,"\\\\").replace(u,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var l=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(l,function(e,t){return t.toUpperCase()})},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;o||(o=n(29));var r=new o(t||e.name);return i.decorateRoot.add(r),r.ctor=e,Object.defineProperty(e,"$type",{value:r,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:r,enumerable:!1}),r};var c=0;i.decorateEnum=function(e){if(e.$type)return e.$type;r||(r=n(8));var t=new r("Enum"+c++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,n){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,n,o){var r=n.shift();if(n.length>0)t[r]=e(t[r]||{},n,o);else{var i=t[r];i&&(o=[].concat(i).concat(o)),t[r]=o}return t}(e,t=t.split("."),n)},Object.defineProperty(i,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(n(34)))}})},function(e,t){e.exports=o;var n=null;try{n=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function o(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function r(e){return!0===(e&&e.__isLong__)}o.prototype.__isLong__,Object.defineProperty(o.prototype,"__isLong__",{value:!0}),o.isLong=r;var i={},s={};function a(e,t){var n,o,r;return t?(r=0<=(e>>>=0)&&e<256)&&(o=s[e])?o:(n=l(e,(0|e)<0?-1:0,!0),r&&(s[e]=n),n):(r=-128<=(e|=0)&&e<128)&&(o=i[e])?o:(n=l(e,e<0?-1:0,!1),r&&(i[e]=n),n)}function u(e,t){if(isNaN(e))return t?b:y;if(t){if(e<0)return b;if(e>=f)return S}else{if(e<=-g)return k;if(e+1>=g)return w}return e<0?u(-e,t).neg():l(e%h|0,e/h|0,t)}function l(e,t,n){return new o(e,t,n)}o.fromInt=a,o.fromNumber=u,o.fromBits=l;var c=Math.pow;function p(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return y;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||36<n)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return p(e.substring(1),t,n).neg();for(var r=u(c(n,8)),i=y,s=0;s<e.length;s+=8){var a=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+a),n);if(a<8){var d=u(c(n,a));i=i.mul(d).add(u(l))}else i=(i=i.mul(r)).add(u(l))}return i.unsigned=t,i}function d(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?p(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}o.fromString=p,o.fromValue=d;var h=4294967296,f=h*h,g=f/2,m=a(1<<24),y=a(0);o.ZERO=y;var b=a(0,!0);o.UZERO=b;var I=a(1);o.ONE=I;var v=a(1,!0);o.UONE=v;var O=a(-1);o.NEG_ONE=O;var w=l(-1,2147483647,!1);o.MAX_VALUE=w;var S=l(-1,-1,!0);o.MAX_UNSIGNED_VALUE=S;var k=l(0,-2147483648,!1);o.MIN_VALUE=k;var _=o.prototype;_.toInt=function(){return this.unsigned?this.low>>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(k)){var t=u(e),n=this.div(t),o=n.mul(t).sub(this);return n.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var r=u(c(e,6),this.unsigned),i=this,s="";;){var a=i.div(r),l=(i.sub(a.mul(r)).toInt()>>>0).toString(e);if((i=a).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(k)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},_.isZero=function(){return 0===this.high&&0===this.low},_.eqz=_.isZero,_.isNegative=function(){return!this.unsigned&&this.high<0},_.isPositive=function(){return this.unsigned||this.high>=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return r(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.ne=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.le=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.ge=_.greaterThanOrEqual,_.compare=function(e){if(r(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(k)?k:this.not().add(I)},_.neg=_.negate,_.add=function(e){r(e)||(e=d(e));var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,c=0,p=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,p+=(h+=o+u)>>>16,c+=(p+=n+a)>>>16,c+=t+s,l((h&=65535)<<16|(f&=65535),(c&=65535)<<16|(p&=65535),this.unsigned)},_.subtract=function(e){return r(e)||(e=d(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return y;if(r(e)||(e=d(e)),n)return l(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(k))return e.isOdd()?k:y;if(e.eq(k))return this.isOdd()?k:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,o=65535&this.high,i=this.low>>>16,s=65535&this.low,a=e.high>>>16,c=65535&e.high,p=e.low>>>16,h=65535&e.low,f=0,g=0,b=0,I=0;return b+=(I+=s*h)>>>16,g+=(b+=i*h)>>>16,b&=65535,g+=(b+=s*p)>>>16,f+=(g+=o*h)>>>16,g&=65535,f+=(g+=i*p)>>>16,g&=65535,f+=(g+=s*c)>>>16,f+=t*h+o*p+i*c+s*a,l((b&=65535)<<16|(I&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(r(e)||(e=d(e)),e.isZero())throw Error("division by zero");var t,o,i;if(n)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:y;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return v;i=b}else{if(this.eq(k))return e.eq(I)||e.eq(O)?k:e.eq(k)?I:(t=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?I:O:(o=this.sub(e.mul(t)),i=t.add(o.div(e)));if(e.eq(k))return this.unsigned?b:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=y}for(o=this;o.gte(e);){t=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),a=s<=48?1:c(2,s-48),p=u(t),h=p.mul(e);h.isNegative()||h.gt(o);)h=(p=u(t-=a,this.unsigned)).mul(e);p.isZero()&&(p=I),i=i.add(p),o=o.sub(h)}return i},_.div=_.divide,_.modulo=function(e){return r(e)||(e=d(e)),n?l((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.rem=_.modulo,_.not=function(){return l(~this.low,~this.high,this.unsigned)},_.and=function(e){return r(e)||(e=d(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return r(e)||(e=d(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return r(e)||(e=d(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},_.shl=_.shiftLeft,_.shiftRight=function(e){return r(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(r(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.shr_u=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},o.fromBytes=function(e,t,n){return n?o.fromBytesLE(e,t):o.fromBytesBE(e,t)},o.fromBytesLE=function(e,t){return new o(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},o.fromBytesBE=function(e,t){return new o(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={PSvcLoginReqURI:1446744,PSvcLoginResURI:1447e3,PSvcLogoutReqURI:1447256,PSvcLogoutResURI:1447512,PSvcTokenReqURI:1702744,PSvcTokenResURI:1703e3,PSvcPingURI:1447768,PSvcPongURI:1448024,PAPForceOutURI:1448280,PSvcRouteReqURI:1449304,PSvcRouteResURI:1449560,PSvcUnicastURI:1449816,PSvcUnicastResURI:1450072,PSvcSubsGroupReqURI:1450328,PSvcSubsGroupResURI:1450584,PSvcBroadcastURI:1450840,PCS_ServiceSubcribeUserGroupV2URI:1452376,PCS_ServiceSubcribeUserGroupResV2URI:1452632,PCS_ServiceBroadCastV2URI:1452888,PCS_UserGroupChangeBcURI:3424461,CommonAuthOpsResURI:256205,PJoinChannelReqURI:256461,PLeaveChannelReqURI:256973,PTextChatReqURI:261325,PTextChatBroadResURI:261581,PChlInfoUpdateBcURI:269005,PKickOffUserBcURI:269773,DisableUserTextBcURI:270285,DisableChannelTextBcURI:270797,PAnonJoinChannelReqURI:281805,PAnonLeaveChannelReqURI:282061,PCS_DismissChatRoomBcURI:270285,PCS_UpdateChatRoomInfoBcURI:270541,PCS_UpdateChatRoomRolerBcURI:270797,PCS_KickOffUserBcURI:271053,PCS_SendBroadcastBcURI:271565,PCS_TextChatBcURI:773837,PCS_DisableUserTextBcURI:272077,PCS_ChatRoomUserCountBcURI:3421389,PCS_ChatRoomUserBcURI:3423949,PCS_SendUnicastUcURI:526029,PCS_UserInfoChangeBcURI:272333,PGetApInfoReqURI:29470,PGetApInfoResURI:29726,PGetUserInfoReqURI:26115,PGetUserInfoResURI:26371,PGetChannelInfoReqURI:23815,PGetChannelInfoResURI:24071,PPushChannelUserCountURI:3139586,PLoginUdbResURI:4294967295}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(41),r=n(1),i=n(5);var s;t.WSHOST="wss://web-ap-service.jocloud.com",t.Utify={encodeStringToUtf8Bytes:o.encodeStringToUtf8Bytes,decodeUtf8BytesToString:o.decodeUtf8BytesToString},function(e){e[e.ANONYMOUS=0]="ANONYMOUS",e[e.NON_ANONYMOUS=1]="NON_ANONYMOUS"}(t.UserType||(t.UserType={})),function(e){e[e.UNKOWN=-1]="UNKOWN",e[e.OTP_TOKEN=0]="OTP_TOKEN",e[e.TOKEN_3RD=1]="TOKEN_3RD",e[e.YY_TOKEN=2]="YY_TOKEN"}(t.TokenType||(t.TokenType={})),function(e){e[e.UNKOWN=-1]="UNKOWN",e[e.LOGIN=0]="LOGIN",e[e.LOGOUT=1]="LOGOUT"}(t.LoginState||(t.LoginState={})),function(e){e.UNAVAILABLE="UNAVAILABLE",e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.RECONNECTING="RECONNECTING"}(t.ConnectionState||(t.ConnectionState={})),function(e){e.INIT="INIT",e.LOGIN="LOGIN",e.LOGIN_SUCCESS="LOGIN_SUCCESS",e.LOGIN_FAILURE="LOGIN_FAILURE",e.LOGIN_TIMEOUT="LOGIN_TIMEOUT",e.INTERRUPTED="INTERRUPTED",e.LOGOUT="LOGOUT",e.REMOTE_LOGIN="REMOTE_LOGIN"}(t.ConnectionChangeReason||(t.ConnectionChangeReason={})),function(e){e[e.OS_TEXTCHAT=2147483648]="OS_TEXTCHAT",e[e.OS_CHAN_AUTHER=2147483649]="OS_CHAN_AUTHER",e[e.OS_CHAN_USER_COUNT=2147483650]="OS_CHAN_USER_COUNT"}(t.EGroupType||(t.EGroupType={})),function(e){e[e.TOKEN_VALID=1]="TOKEN_VALID",e[e.TOKEN_INVALID=2]="TOKEN_INVALID",e[e.TOKEN_EXPIRED=3]="TOKEN_EXPIRED"}(t.TokenState||(t.TokenState={})),function(e){e[e.LOGIN=0]="LOGIN",e[e.REFRESH=1]="REFRESH"}(t.TokenOpType||(t.TokenOpType={})),t.OK="OK",t.SUCCESS=0,t.UNKOWN=1,t.kAnonymousOperation=1011,t.kAnonymousTips="User not login",t.kUnknownError=1,t.kOperationTimeout=1005,t.OPERATION_TIMEOUT="Operation Timeout",t.kInvalid_Parameters=2001,t.INVALID_PARAMETERS="Invalid Parameters",t.INVALID_UID="Invalid Uid",t.INVALID_OPERATED_UID="Invalid Operated Uid",t.INVALID_ROOMID="Invalid RoomId",t.TIME_OUT=11e3,t.ExpiredTokenException=2003,t.QUEUE_COUNT=2,t.MAX_QUEUE_SIZE=5,t.SIZE_LIMIT=100,t.EXPIRED_DELTA=3e4,t.UPPER_LIMIT=2147483648,function(e){e[e.UNKOWN=-1]="UNKOWN",e[e.ONLINE=0]="ONLINE",e[e.OFFLINE=1]="OFFLINE",e[e.TOTAL_SIZE=2]="TOTAL_SIZE"}(t.LineState||(t.LineState={})),function(e){e.AREA_CN="china",e.AREA_AP_SOUTHEAST="indonesia",e.AREA_AP_SOUTH="india",e.AREA_US="america",e.AREA_ME_EAST="me_east",e.AREA_SA_EAST="brazil"}(s||(s={})),t.parseEnvParams=function(e){const t=new Map([["CN-INNER",{area:"china",region:s.AREA_CN,type:"private",name:"share",innerFlag:!0}],["CN-INNER1",{area:"chn",region:s.AREA_CN,type:"private",name:"share",innerFlag:!0}],["CN-TEST",{area:"shenzhen",region:"shenzhen",type:"test",name:"2",innerFlag:!0}],["CN-TEST1",{area:"shenzhen",region:"shenzhen",type:"test",name:"1",innerFlag:!0}],["chn",{area:"chn",region:s.AREA_CN,type:"private",name:"share",innerFlag:!0}],["idn",{area:"idn",region:s.AREA_AP_SOUTHEAST,type:"private",name:"share",innerFlag:!1}],["ind",{area:"ind",region:s.AREA_AP_SOUTH,type:"private",name:"share",innerFlag:!1}],["are",{area:"are",region:"are",type:"private",name:"share",innerFlag:!1}],["usa",{area:"usa",region:s.AREA_US,type:"private",name:"share",innerFlag:!1}],["bra",{area:"bra",region:s.AREA_SA_EAST,type:"private",name:"share",innerFlag:!1}],["cn",{area:"cn",region:s.AREA_CN,type:"private",name:"share",innerFlag:!0}],["ap_southeast",{area:"ap_southeast",region:s.AREA_AP_SOUTHEAST,type:"private",name:"share",innerFlag:!1}],["ap_south",{area:"ap_south",region:s.AREA_AP_SOUTH,type:"private",name:"share",innerFlag:!1}],["us",{area:"us",region:s.AREA_US,type:"private",name:"share",innerFlag:!1}],["me_east",{area:"me_east",region:s.AREA_ME_EAST,type:"private",name:"share",innerFlag:!1}],["sa_east",{area:"sa_east",region:s.AREA_SA_EAST,type:"private",name:"share",innerFlag:!1}]]);if(!e)return null;let n=e.split("/");if(3===n.length){let e=n[0];return{area:e,region:e,type:n[1],name:n[2],innerFlag:!0}}if(1===n.length){let e=n[0],o=t.get(e);return void 0!==o?{area:o.area,region:o.region,type:o.type,name:o.name,innerFlag:o.innerFlag}:{area:e,region:e,type:"private",name:"share",innerFlag:!1}}return null},t.getHiidoHost=(e=!0)=>e?"mlog.hiido.com":"hlog.hiido.com",function(e){e.login="login",e.logout="logout",e.joinChatRoom="chatroom.joinChatRoom",e.leaveChatRoom="chatroom.leaveChatRoom",e.chatPullMsg="chatroom.pullMsg",e.chatPullMsgIfAny="chatroom.pullMsgIfAny",e.chatGetMaxSeqId="chatroom.getMaxSeqId",e.chatGetGroupMaxSeqId="chatroom.getGroupMaxSeqId",e.imPullMsg="im.pullMsg",e.pullMsgIfAny="im.pullMsgIfAny",e.processIMPushMsg="im.processIMPushMsg",e.maxAcquiredSeqID="im.maxAcquiredSeqID",e.getMaxSeqId="room.getMaxSeqId",e.getGroupMaxSeqId="room.getGroupMaxSeqId",e.getChannelMaxSeqId="channel.getChannelMaxSeqId",e.join="room.joinChannel",e.leave="room.leaveChannel",e.pullMsg="room.pullMsg",e.pullPeerMsg="peer.pullMsg",e.joinChannel="channel.joinChannel",e.leaveChannel="channel.leaveChannel"}(t.MutexKey||(t.MutexKey={})),t.getMutexKey=(e,t)=>`${e}:${t}`,t.applyMixins=(e,t)=>{t&&Array.isArray(t)&&t.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(n=>{Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})})},t.checkUid=e=>{if(!/^[0-9]{1,19}$/.test(e))return!1;const t=i.fromString(e,!0);return t.greaterThanOrEqual("1")&&t.lessThanOrEqual("9223372036854775806")},t.checkRoomid=e=>{if("number"!=typeof e)return!1;return e>=1&&e<=4294967294},t.isUint64StringArray=e=>{if(0===e.length)return!1;for(let n of e)if(!r.default.isUint64String(n)||!t.checkUid(n))return!1;return!0},t.checkChannelId=e=>{return!!/^[0-9a-zA-Z_-]{1,64}$/.test(e)}},function(e,t,n){"use strict";e.exports=s;var o=n(11);((s.prototype=Object.create(o.prototype)).constructor=s).className="Enum";var r=n(15),i=n(4);function s(e,t,n,r,i){if(o.call(this,e,n),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=r,this.comments=i||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var n=new s(e,t.values,t.options,t.comment,t.comments);return n.reserved=t.reserved,n},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,n){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=n||null,this},s.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return r.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return r.isReservedName(this.reserved,e)}},function(e,t,n){"use strict";(function(e){var o=t;function r(e,t,n){for(var o=Object.keys(t),r=0;r<o.length;++r)void 0!==e[o[r]]&&n||(e[o[r]]=t[o[r]]);return e}function i(e){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),n&&r(this,n)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}o.asPromise=n(44),o.base64=n(78),o.EventEmitter=n(79),o.float=n(80),o.inquire=n(45),o.utf8=n(42),o.pool=n(81),o.LongBits=n(82),o.isNode=Boolean(void 0!==e&&e&&e.process&&e.process.versions&&e.process.versions.node),o.global=o.isNode&&e||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isObject=function(e){return e&&"object"==typeof e},o.isset=o.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},o.Buffer=function(){try{var e=o.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(e){return"number"==typeof e?o.Buffer?o._Buffer_allocUnsafe(e):new o.Array(e):o.Buffer?o._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.Long=o.global.dcodeIO&&o.global.dcodeIO.Long||o.global.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.longFromHash=function(e,t){var n=o.LongBits.fromHash(e);return o.Long?o.Long.fromBits(n.lo,n.hi,t):n.toNumber(Boolean(t))},o.merge=r,o.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},o.newError=i,o.ProtocolError=i("ProtocolError"),o.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;n>-1;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},o.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o._configure=function(){var e=o.Buffer;e?(o._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},o._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):o._Buffer_from=o._Buffer_allocUnsafe=null}}).call(this,n(18))},function(e,t,n){"use strict";e.exports=l;var o=n(11);((l.prototype=Object.create(o.prototype)).constructor=l).className="Field";var r,i=n(8),s=n(12),a=n(4),u=/^required|optional|repeated$/;function l(e,t,n,r,i,l,c){if(a.isObject(r)?(c=i,l=r,r=i=void 0):a.isObject(i)&&(c=l,l=i,i=void 0),o.call(this,e,l),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(n))throw TypeError("type must be a string");if(void 0!==r&&!u.test(r=r.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!a.isString(i))throw TypeError("extend must be a string");this.rule=r&&"optional"!==r?r:void 0,this.type=n,this.id=t,this.extend=i||void 0,this.required="required"===r,this.optional=!this.required,this.repeated="repeated"===r,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[n],this.bytes="bytes"===n,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=c}l.fromJSON=function(e,t){return new l(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(l.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),l.prototype.setOption=function(e,t,n){return"packed"===e&&(this._packed=null),o.prototype.setOption.call(this,e,t,n)},l.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},l.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof r?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof i&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof r&&(this.parent.ctor.prototype[this.name]=this.defaultValue),o.prototype.resolve.call(this)},l.d=function(e,t,n,o){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(r,i){a.decorateType(r.constructor).add(new l(i,e,t,n,{default:o}))}},l._configure=function(e){r=e}},function(e,t,n){"use strict";e.exports=i,i.className="ReflectionObject";var o,r=n(4);function i(e,t){if(!r.isString(e))throw TypeError("name must be a string");if(t&&!r.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof o&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof o&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved?this:(this.root instanceof o&&(this.resolved=!0),this)},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,n){return n&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,n){this.parsedOptions||(this.parsedOptions=[]);var o=this.parsedOptions;if(n){var i=o.find(function(t){return Object.prototype.hasOwnProperty.call(t,e)});if(i){var s=i[e];r.setProperty(s,n,t)}else(i={})[e]=r.setProperty({},n,t),o.push(i)}else{var a={};a[e]=t,o.push(a)}return this},i.prototype.setOptions=function(e,t){if(e)for(var n=Object.keys(e),o=0;o<n.length;++o)this.setOption(n[o],e[n[o]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){o=e}},function(e,t,n){"use strict";var o=t,r=n(4),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var n=0,o={};for(t|=0;n<e.length;)o[i[n+t]]=e[n++];return o}o.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),o.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",r.emptyArray,null]),o.long=s([0,0,0,1,1],7),o.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),o.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Emitter=class{constructor(){this.handlers={}}on(e,t){this.handlers||(this.handlers={}),this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(t)}once(e,t){this.handlers||(this.handlers={}),this.handlers[e]=this.handlers[e]||[];const n=()=>{t(),this.off(e,n)};return this.handlers[e].push(n),this}off(e,t){let n=this.handlers&&this.handlers[e];if(n)for(let e=0;e<n.length;e++)n[e]===t&&n.splice(e--,1)}emit(e,...t){if(this.handlers&&this.handlers[e])for(const n of this.handlers[e])n(...t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HUMMER_EVENTS={CONNECTION_STATE_CHANGED:"ConnectionStateChanged",TOKEN_EXPIRED:"TokenExpired",TOKEN_WILL_EXPIRE:"TokenWillExpire",FORCEOUT_OFFLINE:"ForceoutOffline",P2P_MESSAGE:"P2PMessageReceived"},t.ROOM_EVENTS={ROOM_MESSAGE:"RoomMessage",MEMBER_JOINED:"MemberJoined",MEMBER_LEFT:"MemberLeft",MEMBER_COUNT_UPDATED:"MemberCountUpdated",MEMBER_ATTRIBUTES_SET:"MemberAttributesSet",MEMBER_ATTRIBUTES_DELETED:"MemberAttributesDeleted",MEMBER_ATTRIBUTES_CLEARED:"MemberAttributesCleared",MEMBER_ATTRIBUTES_ADDED_OR_UPDATED:"MemberAttributesAddedOrUpdated",ROOM_ATTRIBUTES_SET:"RoomAttributesSet",ROOM_ATTRIBUTES_DELETED:"RoomAttributesDeleted",ROOM_ATTRIBUTES_CLEARED:"RoomAttributesCleared",ROOM_ATTRIBUTES_ADDED_OR_UPDATED:"RoomAttributesAddedOrUpdated",ROOM_MEMBER_OFFLINE:"RoomMemberOffline"},t.CHANNEL_EVENTS={CHANNEL_MESSAGE:"P2CMessageReceived"},t.PEER_EVENTS={MESSAGE_FROM_USER:"MessageFromUser"},t.CHATROOM_EVENTS={SINGLE_USER_MESSAGE:"SingleUserMessage",CHATROOM_DISMISSED:"ChatRoomDismissed",ROOM_ATTRIBUTES_UPDATED:"ChatRoomAttributesUpdated",USER_KICKED_OFF:"UserKickedOff",ROLER_UPDATED:"RolerUpdated",GROUP_MESSAGE:"GroupMessage",TEXTCHAT:"TextChat",USER_COUNT_UPDATED:"UserCountUpdated",USER_ONLINE_UPDATED:"UserOnlineUpdated",USER_ATTRIBUTES_SET:"UserAttributesSet",USERS_MUTED:"UsersMuted",USERS_UNMUTED:"UsersUnMuted",CHATROOM_USER_OFFLINE:"ChatRoomUserOffline",ROOM_EXTRA_ATTRIBUTES_SET:"RoomExtraAttributesSet",ROOM_EXTRA_ATTRIBUTES_UPDATED:"RoomExtraAttributesUpdated",ROOM_EXTRA_ATTRIBUTES_DELETED:"RoomExtraAttributesDeleted",ROOM_EXTRA_ATTRIBUTES_CLEARED:"RoomExtraAttributesCleared"},t.AP_EVENTS={TRY_LOGOUT:"TryLogout",CONNECTION_STATE_CHANGED:"ConnectionStateChanged",TOKEN_WILL_EXPIRE:"TokenWillExpire",TOKEN_EXPIRED:"TokenExpired",BROADCAST:"broadcast",INNER_BROADCAST:"inner_broadcast",BROADCAST_V2:"broadcast_v2",UNICAST:"unicast",FORCEOUT_OFFLINE:"ForceoutOffline"},t.SVC_EVENTS={BROADCAST_MESSAGE:"BroadcastMessage",BROADCAST_MESSAGE_V2:"BroadcastMessageV2",UNICAST_MESSAGE:"UnicastMessage"}},function(e,t,n){"use strict";e.exports=c;var o=n(11);((c.prototype=Object.create(o.prototype)).constructor=c).className="Namespace";var r,i,s,a=n(10),u=n(4);function l(e,t){if(e&&e.length){for(var n={},o=0;o<e.length;++o)n[e[o].name]=e[o].toJSON(t);return n}}function c(e,t){o.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}c.fromJSON=function(e,t){return new c(e,t.options).addJSON(t.nested)},c.arrayToJSON=l,c.isReservedId=function(e,t){if(e)for(var n=0;n<e.length;++n)if("string"!=typeof e[n]&&e[n][0]<=t&&e[n][1]>t)return!0;return!1},c.isReservedName=function(e,t){if(e)for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1},Object.defineProperty(c.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),c.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},c.prototype.addJSON=function(e){if(e)for(var t,n=Object.keys(e),o=0;o<n.length;++o)t=e[n[o]],this.add((void 0!==t.fields?r.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?a.fromJSON:c.fromJSON)(n[o],t));return this},c.prototype.get=function(e){return this.nested&&this.nested[e]||null},c.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},c.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof r||e instanceof s||e instanceof i||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof c&&e instanceof c)||t instanceof r||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var n=t.nestedArray,o=0;o<n.length;++o)e.add(n[o]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},c.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),p(this)},c.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var n=this;e.length>0;){var o=e.shift();if(n.nested&&n.nested[o]){if(!((n=n.nested[o])instanceof c))throw Error("path conflicts with non-namespace objects")}else n.add(n=new c(o))}return t&&n.addJSON(t),n},c.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof c?e[t++].resolveAll():e[t++].resolve();return this.resolve()},c.prototype.lookup=function(e,t,n){if("boolean"==typeof t?(n=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var o=this.get(e[0]);if(o){if(1===e.length){if(!t||t.indexOf(o.constructor)>-1)return o}else if(o instanceof c&&(o=o.lookup(e.slice(1),t,!0)))return o}else for(var r=0;r<this.nestedArray.length;++r)if(this._nestedArray[r]instanceof c&&(o=this._nestedArray[r].lookup(e,t,!0)))return o;return null===this.parent||n?null:this.parent.lookup(e,t)},c.prototype.lookupType=function(e){var t=this.lookup(e,[r]);if(!t)throw Error("no such type: "+e);return t},c.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},c.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[r,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},c.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},c._configure=function(e,t,n){r=e,i=t,s=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(41);var r;t.Utify={encodeStringToUtf8Bytes:o.encodeStringToUtf8Bytes,decodeUtf8BytesToString:o.decodeUtf8BytesToString},function(e){e[e.TEXT=0]="TEXT",e[e.IMAGE=1]="IMAGE",e[e.BINARY=2]="BINARY"}(r=t.MsgType||(t.MsgType={})),t.createMessage=(e,t)=>{switch(e){case r.TEXT:return{msgType:e,content:t};default:return null}}},function(e,t,n){"use strict";e.exports=n(43)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";e.exports=s;var o=n(11);((s.prototype=Object.create(o.prototype)).constructor=s).className="OneOf";var r=n(10),i=n(4);function s(e,t,n,r){if(Array.isArray(t)||(n=t,t=void 0),o.call(this,e,n),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=r}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof r))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof r))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){o.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var n=e.get(this.oneof[t]);n&&!n.partOf&&(n.partOf=this,this.fieldsArray.push(n))}a(this)},s.prototype.onRemove=function(e){for(var t,n=0;n<this.fieldsArray.length;++n)(t=this.fieldsArray[n]).parent&&t.parent.remove(t);o.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,n){i.decorateType(t.constructor).add(new s(n,e)),Object.defineProperty(t,n,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(5),r=n(116),i=n(7);new(n(3).Logger)("Base");class s{constructor(){}getTokenType(e){if(!e)return i.TokenType.TOKEN_3RD;let t=new Map([["OTP_TOKEN",i.TokenType.OTP_TOKEN],["TOKEN_3RD",i.TokenType.TOKEN_3RD],["YY_TOKEN",i.TokenType.YY_TOKEN]]).get(e);return void 0===t?i.TokenType.UNKOWN:t}getRegionRoomId(e,t){return`${e}:${t}`}calcDJBHash(e){const t=r.Base64.encode(e);let n=o.fromInt(5381,!0);for(let e=0;e<t.length;++e){let r=n.shl(5);n=(n=n.add(r)).add(o.fromInt(t.charCodeAt(e),!0))}return new o(n.getLowBitsUnsigned(),0,!0)}getRoomIdFromTopic(e){let t=e.split("/");return 2==t.length&&"SignalService"===t[0]?t[1]:null}getChannelIdFromTopic(e){let t=e.split("/");if(3===t.length){if("Online"==t[0]&&"RTChannel"==t[1])return{state:i.LineState.ONLINE,channelId:t[2]}}else if(2===t.length&&"RTChannel"==t[0])return{state:i.LineState.OFFLINE,channelId:t[1]};return{state:i.LineState.UNKOWN,channelId:null}}generateLogId(){let e=Math.round(Date.now()/1e3);return new o(this.getCounter(),e,!0)}getCounter(){return s.counter+=1,s.counter}}s.counter=0,t.Base=s},function(e,t,n){var o=n(127),r=n(128),i=r;i.v1=o,i.v4=r,e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(1),i=n(2);t.default=class{constructor(){this.text=""}marshall(){let e=new o.default(!1);return e.pushUtf8String(this.text),e.marshall()}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new i.default(t,!1);this.text=n.popUtf8String()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.rescode=0,this.props={},this.msg=""}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),n.popUInt32(),this.uid=n.popUInt64String(),this.roomid=n.popUInt32(),this.rescode=n.popUInt32();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popString(),t=n.popUtf8String();this.props[e]=t}this.msg=0==this.rescode?"OK":n.popUtf8String()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.roomid=0,this.totalCount=0,this.rescode=0}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.roomid=n.popUInt32(),this.totalCount=n.popUInt32(),this.rescode=n.popUInt32()}}},function(e,t,n){"use strict";var o,r,i,s=n(17),a=s.Reader,u=s.Writer,l=s.util,c=s.roots.default||(s.roots.default={});c.chatroomProto=((i={}).Action=(o={},(r=Object.create(o))[o[0]="kLogin"]=0,r[o[3e3]="kP2PChat"]=3e3,r[o[3004]="kMultiCastAppSessionChat"]=3004,r[o[1e6]="kNotifySignalMessage"]=1e6,r[o[1000001]="kNotifyJoinSignalGroup"]=1000001,r[o[1000002]="kNotifyLeaveSignalGroup"]=1000002,r[o[1000003]="kNotifyUinfoChange"]=1000003,r[o[1000004]="kNotifyUserOnlineStatusChange"]=1000004,r[o[1200001]="kSendUnicastUc"]=1200001,r[o[1250001]="kDismissChatRoomBc"]=1250001,r[o[1250002]="kUpdateChatRoomInfoBc"]=1250002,r[o[1250003]="kUpdateRolerBc"]=1250003,r[o[1250004]="kKickOffUserBc"]=1250004,r[o[1250005]="kSendBroadcastBc"]=1250005,r[o[1250006]="kUserInfoChangeBc"]=1250006,r[o[1250007]="kNotifyRoomInfoChange"]=1250007,r[o[1250008]="kDisableUserTextBc"]=1250008,r[o[1250009]="kSetRoomExtraAttributesBc"]=1250009,r[o[1250010]="kUpdateRoomExtraAttributesBc"]=1250010,r[o[1250011]="kDeleteRoomExtraAttributesBc"]=1250011,r[o[1250012]="kClearRoomExtraAttributesBc"]=1250012,r[o[1260001]="kTextChatBc"]=1260001,r[o[1270001]="kUserCountBc"]=1270001,r[o[1270002]="kUserOnlineChangeBc"]=1270002,r),i.GetMaxSeqIdRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(34).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(40).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.GetMaxSeqIdRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.topic=e.string();break;case 5:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.GetMaxSeqIdResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.maxSeqId&&Object.hasOwnProperty.call(e,"maxSeqId")&&t.uint32(32).int64(e.maxSeqId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.GetMaxSeqIdResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.maxSeqId=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.GetGrpSysMaxSeqIdRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.queueId=0,e.prototype.groupRegion="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(32).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(42).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(48).int32(e.queueId),null!=e.groupRegion&&Object.hasOwnProperty.call(e,"groupRegion")&&t.uint32(58).string(e.groupRegion),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.GetGrpSysMaxSeqIdRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.topic=e.string();break;case 6:o.queueId=e.int32();break;case 7:o.groupRegion=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.GetGrpSysMaxSeqIdResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.maxSeqId&&Object.hasOwnProperty.call(e,"maxSeqId")&&t.uint32(32).int64(e.maxSeqId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.GetGrpSysMaxSeqIdResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.maxSeqId=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushMsgRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(16).int64(e.uid),null!=e.seqId&&Object.hasOwnProperty.call(e,"seqId")&&t.uint32(24).int64(e.seqId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(32).int64(e.groupId),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(42).string(e.region),null!=e.envType&&Object.hasOwnProperty.call(e,"envType")&&t.uint32(50).string(e.envType),null!=e.envName&&Object.hasOwnProperty.call(e,"envName")&&t.uint32(58).string(e.envName),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(66).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(72).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.IMPushMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.uid=e.int64();break;case 3:o.seqId=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.region=e.string();break;case 6:o.envType=e.string();break;case 7:o.envName=e.string();break;case 8:o.topic=e.string();break;case 9:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.IMPushMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushGroupSysMsgRequest=function(){function e(e){if(this.targetUserTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.topic="",e.prototype.prevSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.msg=null,e.prototype.targetUserTags=l.emptyArray,e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(16).int64(e.groupId),null!=e.seqId&&Object.hasOwnProperty.call(e,"seqId")&&t.uint32(24).int64(e.seqId),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(34).string(e.region),null!=e.envType&&Object.hasOwnProperty.call(e,"envType")&&t.uint32(42).string(e.envType),null!=e.envName&&Object.hasOwnProperty.call(e,"envName")&&t.uint32(50).string(e.envName),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(58).string(e.topic),null!=e.prevSeqId&&Object.hasOwnProperty.call(e,"prevSeqId")&&t.uint32(64).int64(e.prevSeqId),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&c.chatroomProto.Msg.encode(e.msg,t.uint32(74).fork()).ldelim(),null!=e.targetUserTags&&e.targetUserTags.length)for(var n=0;n<e.targetUserTags.length;++n)t.uint32(82).string(e.targetUserTags[n]);return null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(88).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.IMPushGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.groupId=e.int64();break;case 3:o.seqId=e.int64();break;case 4:o.region=e.string();break;case 5:o.envType=e.string();break;case 6:o.envName=e.string();break;case 7:o.topic=e.string();break;case 8:o.prevSeqId=e.int64();break;case 9:o.msg=c.chatroomProto.Msg.decode(e,e.uint32());break;case 10:o.targetUserTags&&o.targetUserTags.length||(o.targetUserTags=[]),o.targetUserTags.push(e.string());break;case 11:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushGroupSysMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.IMPushGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.PullMsgRequest=function(){function e(e){if(this.userTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.exclusiveStartSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.limit=0,e.prototype.userTags=l.emptyArray,e.prototype.statisDeliveryDelay=!1,e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.exclusiveStartSeqId&&Object.hasOwnProperty.call(e,"exclusiveStartSeqId")&&t.uint32(32).int64(e.exclusiveStartSeqId),null!=e.limit&&Object.hasOwnProperty.call(e,"limit")&&t.uint32(40).int32(e.limit),null!=e.userTags&&e.userTags.length)for(var n=0;n<e.userTags.length;++n)t.uint32(50).string(e.userTags[n]);return null!=e.statisDeliveryDelay&&Object.hasOwnProperty.call(e,"statisDeliveryDelay")&&t.uint32(56).bool(e.statisDeliveryDelay),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(66).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(72).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.PullMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.exclusiveStartSeqId=e.int64();break;case 5:o.limit=e.int32();break;case 6:o.userTags&&o.userTags.length||(o.userTags=[]),o.userTags.push(e.string());break;case 7:o.statisDeliveryDelay=e.bool();break;case 8:o.topic=e.string();break;case 9:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.PullMsgResponse=function(){function e(e){if(this.msgs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.msgs=l.emptyArray,e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.hasMore=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.msgs&&e.msgs.length)for(var n=0;n<e.msgs.length;++n)c.chatroomProto.Msg.encode(e.msgs[n],t.uint32(34).fork()).ldelim();return null!=e.maxSeqId&&Object.hasOwnProperty.call(e,"maxSeqId")&&t.uint32(40).int64(e.maxSeqId),null!=e.hasMore&&Object.hasOwnProperty.call(e,"hasMore")&&t.uint32(48).bool(e.hasMore),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.PullMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.msgs&&o.msgs.length||(o.msgs=[]),o.msgs.push(c.chatroomProto.Msg.decode(e,e.uint32()));break;case 5:o.maxSeqId=e.int64();break;case 6:o.hasMore=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.PullGroupSysMsgRequest=function(){function e(e){if(this.userTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.exclusiveStartSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.limit=0,e.prototype.userTags=l.emptyArray,e.prototype.statisDeliveryDelay=!1,e.prototype.topic="",e.prototype.queueId=0,e.prototype.groupRegion="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(32).int64(e.groupId),null!=e.exclusiveStartSeqId&&Object.hasOwnProperty.call(e,"exclusiveStartSeqId")&&t.uint32(40).int64(e.exclusiveStartSeqId),null!=e.limit&&Object.hasOwnProperty.call(e,"limit")&&t.uint32(48).int32(e.limit),null!=e.userTags&&e.userTags.length)for(var n=0;n<e.userTags.length;++n)t.uint32(58).string(e.userTags[n]);return null!=e.statisDeliveryDelay&&Object.hasOwnProperty.call(e,"statisDeliveryDelay")&&t.uint32(64).bool(e.statisDeliveryDelay),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(74).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(80).int32(e.queueId),null!=e.groupRegion&&Object.hasOwnProperty.call(e,"groupRegion")&&t.uint32(90).string(e.groupRegion),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.PullGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.exclusiveStartSeqId=e.int64();break;case 6:o.limit=e.int32();break;case 7:o.userTags&&o.userTags.length||(o.userTags=[]),o.userTags.push(e.string());break;case 8:o.statisDeliveryDelay=e.bool();break;case 9:o.topic=e.string();break;case 10:o.queueId=e.int32();break;case 11:o.groupRegion=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.PullGroupSysMsgResponse=function(){function e(e){if(this.msgs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.msgs=l.emptyArray,e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.hasMore=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.msgs&&e.msgs.length)for(var n=0;n<e.msgs.length;++n)c.chatroomProto.Msg.encode(e.msgs[n],t.uint32(34).fork()).ldelim();return null!=e.maxSeqId&&Object.hasOwnProperty.call(e,"maxSeqId")&&t.uint32(40).int64(e.maxSeqId),null!=e.hasMore&&Object.hasOwnProperty.call(e,"hasMore")&&t.uint32(48).bool(e.hasMore),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.PullGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.msgs&&o.msgs.length||(o.msgs=[]),o.msgs.push(c.chatroomProto.Msg.decode(e,e.uint32()));break;case 5:o.maxSeqId=e.int64();break;case 6:o.hasMore=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyUserStatusChange=function(){function e(e){if(this.joinuids=[],this.leaveuids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.joinuids=l.emptyArray,e.prototype.leaveuids=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(26).string(e.groupId),null!=e.joinuids&&e.joinuids.length){t.uint32(34).fork();for(var n=0;n<e.joinuids.length;++n)t.uint64(e.joinuids[n]);t.ldelim()}if(null!=e.leaveuids&&e.leaveuids.length){for(t.uint32(42).fork(),n=0;n<e.leaveuids.length;++n)t.uint64(e.leaveuids[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.NotifyUserStatusChange;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.groupId=e.string();break;case 4:if(o.joinuids&&o.joinuids.length||(o.joinuids=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos<i;)o.joinuids.push(e.uint64());else o.joinuids.push(e.uint64());break;case 5:if(o.leaveuids&&o.leaveuids.length||(o.leaveuids=[]),2==(7&r))for(i=e.uint32()+e.pos;e.pos<i;)o.leaveuids.push(e.uint64());else o.leaveuids.push(e.uint64());break;default:e.skipType(7&r)}}return o},e}(),i.NotifyJoinSignalGroup=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(24).int64(e.uid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(34).string(e.groupId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.NotifyJoinSignalGroup;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.uid=e.int64();break;case 4:o.groupId=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyLeaveSignalGroup=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(24).int64(e.uid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(34).string(e.groupId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.NotifyLeaveSignalGroup;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.uid=e.int64();break;case 4:o.groupId=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.Msg=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.action=0,e.prototype.content=l.newBuffer([]),e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.seqId&&Object.hasOwnProperty.call(e,"seqId")&&t.uint32(8).int64(e.seqId),null!=e.action&&Object.hasOwnProperty.call(e,"action")&&t.uint32(16).int32(e.action),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).bytes(e.content),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(32).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.Msg;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.seqId=e.int64();break;case 2:o.action=e.int32();break;case 3:o.content=e.bytes();break;case 4:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.SignalMessageOption=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.reliable="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.reliable&&Object.hasOwnProperty.call(e,"reliable")&&t.uint32(10).string(e.reliable),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.SignalMessageOption;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.reliable=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.P2PSignalRequest=function(){function e(e){if(this.extensions={},this.internalExtensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.toUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.option=null,e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.prototype.internalExtensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&Object.hasOwnProperty.call(e,"fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.toUid&&Object.hasOwnProperty.call(e,"toUid")&&t.uint32(32).int64(e.toUid),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(42).string(e.type),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(50).bytes(e.content),null!=e.option&&Object.hasOwnProperty.call(e,"option")&&c.chatroomProto.SignalMessageOption.encode(e.option,t.uint32(58).fork()).ldelim(),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&t.uint32(66).string(e.uuid),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&t.uint32(74).string(e.extension),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(82).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();if(null!=e.internalExtensions&&Object.hasOwnProperty.call(e,"internalExtensions"))for(n=Object.keys(e.internalExtensions),o=0;o<n.length;++o)t.uint32(90).fork().uint32(10).string(n[o]).uint32(18).string(e.internalExtensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.chatroomProto.P2PSignalRequest;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.fromUid=e.int64();break;case 4:i.toUid=e.int64();break;case 5:i.type=e.string();break;case 6:i.content=e.bytes();break;case 7:i.option=c.chatroomProto.SignalMessageOption.decode(e,e.uint32());break;case 8:i.uuid=e.string();break;case 9:i.extension=e.string();break;case 10:i.extensions===l.emptyObject&&(i.extensions={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;)switch((p=e.uint32())>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}i.extensions[n]=o;break;case 11:for(i.internalExtensions===l.emptyObject&&(i.internalExtensions={}),u=e.uint32()+e.pos,n="",o="";e.pos<u;){var p;switch((p=e.uint32())>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.internalExtensions[n]=o;break;default:e.skipType(7&s)}}return i},e}(),i.P2PSignalResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(18).string(e.msg),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.P2PSignalResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.SignalMessage=function(){function e(e){if(this.extensions={},this.internalExtensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.prototype.internalExtensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&Object.hasOwnProperty.call(e,"fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(34).string(e.type),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(42).bytes(e.content),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&t.uint32(50).string(e.uuid),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&t.uint32(58).string(e.extension),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(66).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();if(null!=e.internalExtensions&&Object.hasOwnProperty.call(e,"internalExtensions"))for(n=Object.keys(e.internalExtensions),o=0;o<n.length;++o)t.uint32(74).fork().uint32(10).string(n[o]).uint32(18).string(e.internalExtensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.chatroomProto.SignalMessage;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.fromUid=e.int64();break;case 4:i.type=e.string();break;case 5:i.content=e.bytes();break;case 6:i.uuid=e.string();break;case 7:i.extension=e.string();break;case 8:i.extensions===l.emptyObject&&(i.extensions={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;)switch((p=e.uint32())>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}i.extensions[n]=o;break;case 9:for(i.internalExtensions===l.emptyObject&&(i.internalExtensions={}),u=e.uint32()+e.pos,n="",o="";e.pos<u;){var p;switch((p=e.uint32())>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.internalExtensions[n]=o;break;default:e.skipType(7&s)}}return i},e}(),i.GroupSignalRequest=function(){function e(e){if(this.extensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.option=null,e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&Object.hasOwnProperty.call(e,"fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(32).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(42).string(e.topic),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(50).string(e.type),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(58).bytes(e.content),null!=e.option&&Object.hasOwnProperty.call(e,"option")&&c.chatroomProto.SignalMessageOption.encode(e.option,t.uint32(66).fork()).ldelim(),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&t.uint32(74).string(e.uuid),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&t.uint32(82).string(e.extension),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(90).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.chatroomProto.GroupSignalRequest;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.fromUid=e.int64();break;case 4:i.groupId=e.int64();break;case 5:i.topic=e.string();break;case 6:i.type=e.string();break;case 7:i.content=e.bytes();break;case 8:i.option=c.chatroomProto.SignalMessageOption.decode(e,e.uint32());break;case 9:i.uuid=e.string();break;case 10:i.extension=e.string();break;case 11:i.extensions===l.emptyObject&&(i.extensions={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.extensions[n]=o;break;default:e.skipType(7&s)}}return i},e}(),i.GroupSignalResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(18).string(e.msg),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.GroupSignalResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.CheckUserIsOnlineRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(32).int64(e.uid),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.CheckUserIsOnlineRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.uid=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.CheckUserIsOnlineResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.isOnline=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(18).string(e.msg),null!=e.isOnline&&Object.hasOwnProperty.call(e,"isOnline")&&t.uint32(24).bool(e.isOnline),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.CheckUserIsOnlineResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.isOnline=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableMsg=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.action=0,e.prototype.content=l.newBuffer([]),e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uri="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.action&&Object.hasOwnProperty.call(e,"action")&&t.uint32(8).int32(e.action),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).bytes(e.content),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),null!=e.uri&&Object.hasOwnProperty.call(e,"uri")&&t.uint32(34).string(e.uri),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.UnreliableMsg;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.action=e.int32();break;case 2:o.content=e.bytes();break;case 3:o.timestamp=e.int64();break;case 4:o.uri=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushMsgRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.msg=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(18).string(e.region),null!=e.envType&&Object.hasOwnProperty.call(e,"envType")&&t.uint32(26).string(e.envType),null!=e.envName&&Object.hasOwnProperty.call(e,"envName")&&t.uint32(34).string(e.envName),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&c.chatroomProto.UnreliableMsg.encode(e.msg,t.uint32(42).fork()).ldelim(),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.UnreliableIMPushMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.region=e.string();break;case 3:o.envType=e.string();break;case 4:o.envName=e.string();break;case 5:o.msg=c.chatroomProto.UnreliableMsg.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.UnreliableIMPushMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushGroupSysMsgRequest=function(){function e(e){if(this.targetUserTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.msg=null,e.prototype.targetUserTags=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(16).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(26).string(e.topic),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(34).string(e.region),null!=e.envType&&Object.hasOwnProperty.call(e,"envType")&&t.uint32(42).string(e.envType),null!=e.envName&&Object.hasOwnProperty.call(e,"envName")&&t.uint32(50).string(e.envName),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&c.chatroomProto.UnreliableMsg.encode(e.msg,t.uint32(58).fork()).ldelim(),null!=e.targetUserTags&&e.targetUserTags.length)for(var n=0;n<e.targetUserTags.length;++n)t.uint32(66).string(e.targetUserTags[n]);return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.UnreliableIMPushGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.groupId=e.int64();break;case 3:o.topic=e.string();break;case 4:o.region=e.string();break;case 5:o.envType=e.string();break;case 6:o.envName=e.string();break;case 7:o.msg=c.chatroomProto.UnreliableMsg.decode(e,e.uint32());break;case 8:o.targetUserTags&&o.targetUserTags.length||(o.targetUserTags=[]),o.targetUserTags.push(e.string());break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushGroupSysMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.UnreliableIMPushGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyUinfoChange=function(){function e(e){if(this.infos={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.opType=0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.infos=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.opType&&Object.hasOwnProperty.call(e,"opType")&&t.uint32(24).int32(e.opType),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(32).int64(e.uid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(42).string(e.groupId),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(48).int64(e.timestamp),null!=e.infos&&Object.hasOwnProperty.call(e,"infos"))for(var n=Object.keys(e.infos),o=0;o<n.length;++o)t.uint32(58).fork().uint32(10).string(n[o]).uint32(18).string(e.infos[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.chatroomProto.NotifyUinfoChange;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.opType=e.int32();break;case 4:i.uid=e.int64();break;case 5:i.groupId=e.string();break;case 6:i.timestamp=e.int64();break;case 7:i.infos===l.emptyObject&&(i.infos={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.infos[n]=o;break;default:e.skipType(7&s)}}return i},e.OpType=function(){var e={},t=Object.create(e);return t[e[0]="kOpUpdate"]=0,t[e[1]="kOpDel"]=1,t[e[2]="kOpSet"]=2,t}(),e}(),i.OsPushMsg=function(){function e(e){if(this.statsTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.title="",e.prototype.content="",e.prototype.payload=l.newBuffer([]),e.prototype.icon="",e.prototype.disableOsPush=!1,e.prototype.pushId=l.Long?l.Long.fromBits(0,0,!0):0,e.prototype.statsTags=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.title&&Object.hasOwnProperty.call(e,"title")&&t.uint32(10).string(e.title),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).string(e.content),null!=e.payload&&Object.hasOwnProperty.call(e,"payload")&&t.uint32(26).bytes(e.payload),null!=e.icon&&Object.hasOwnProperty.call(e,"icon")&&t.uint32(34).string(e.icon),null!=e.disableOsPush&&Object.hasOwnProperty.call(e,"disableOsPush")&&t.uint32(40).bool(e.disableOsPush),null!=e.pushId&&Object.hasOwnProperty.call(e,"pushId")&&t.uint32(48).uint64(e.pushId),null!=e.statsTags&&e.statsTags.length)for(var n=0;n<e.statsTags.length;++n)t.uint32(58).string(e.statsTags[n]);return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.OsPushMsg;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.title=e.string();break;case 2:o.content=e.string();break;case 3:o.payload=e.bytes();break;case 4:o.icon=e.string();break;case 5:o.disableOsPush=e.bool();break;case 6:o.pushId=e.uint64();break;case 7:o.statsTags&&o.statsTags.length||(o.statsTags=[]),o.statsTags.push(e.string());break;default:e.skipType(7&r)}}return o},e}(),i.MqMsgContent=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.action=0,e.prototype.data=l.newBuffer([]),e.prototype.uuid="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uri="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.action&&Object.hasOwnProperty.call(e,"action")&&t.uint32(8).int32(e.action),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&t.uint32(26).string(e.uuid),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(32).int64(e.timestamp),null!=e.uri&&Object.hasOwnProperty.call(e,"uri")&&t.uint32(42).string(e.uri),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.MqMsgContent;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.action=e.int32();break;case 2:o.data=e.bytes();break;case 3:o.uuid=e.string();break;case 4:o.timestamp=e.int64();break;case 5:o.uri=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.MqMsgOptions=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.skipEnqueue=!1,e.prototype.retentionPeriod=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.skipEnqueue&&Object.hasOwnProperty.call(e,"skipEnqueue")&&t.uint32(8).bool(e.skipEnqueue),null!=e.retentionPeriod&&Object.hasOwnProperty.call(e,"retentionPeriod")&&t.uint32(16).int64(e.retentionPeriod),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.MqMsgOptions;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.skipEnqueue=e.bool();break;case 2:o.retentionPeriod=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.OsPushOptions=function(){function e(e){if(this.limitobjs={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.enableOspushLimit=!1,e.prototype.serviceType=0,e.prototype.dayLimitOpt=0,e.prototype.freqLimitOpt=0,e.prototype.limitobjs=l.emptyObject,e.prototype.sendCondition=0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.enableOspushLimit&&Object.hasOwnProperty.call(e,"enableOspushLimit")&&t.uint32(8).bool(e.enableOspushLimit),null!=e.serviceType&&Object.hasOwnProperty.call(e,"serviceType")&&t.uint32(16).uint32(e.serviceType),null!=e.dayLimitOpt&&Object.hasOwnProperty.call(e,"dayLimitOpt")&&t.uint32(24).uint32(e.dayLimitOpt),null!=e.freqLimitOpt&&Object.hasOwnProperty.call(e,"freqLimitOpt")&&t.uint32(32).uint32(e.freqLimitOpt),null!=e.limitobjs&&Object.hasOwnProperty.call(e,"limitobjs"))for(var n=Object.keys(e.limitobjs),o=0;o<n.length;++o)t.uint32(42).fork().uint32(8).int64(n[o]).uint32(18).string(e.limitobjs[n[o]]).ldelim();return null!=e.sendCondition&&Object.hasOwnProperty.call(e,"sendCondition")&&t.uint32(48).int32(e.sendCondition),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.chatroomProto.OsPushOptions;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.enableOspushLimit=e.bool();break;case 2:i.serviceType=e.uint32();break;case 3:i.dayLimitOpt=e.uint32();break;case 4:i.freqLimitOpt=e.uint32();break;case 5:i.limitobjs===l.emptyObject&&(i.limitobjs={});var u=e.uint32()+e.pos;for(n=0,o="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.int64();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.limitobjs["object"==typeof n?l.longToHash(n):n]=o;break;case 6:i.sendCondition=e.int32();break;default:e.skipType(7&s)}}return i},e}(),i.P2PMqMsgRequest=function(){function e(e){if(this.extensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.toUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.content=null,e.prototype.owner="",e.prototype.extensions=l.emptyObject,e.prototype.ospush=null,e.prototype.msgOptions=null,e.prototype.ospushOptions=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.toUid&&Object.hasOwnProperty.call(e,"toUid")&&t.uint32(8).int64(e.toUid),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(18).string(e.topic),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&c.chatroomProto.MqMsgContent.encode(e.content,t.uint32(26).fork()).ldelim(),null!=e.owner&&Object.hasOwnProperty.call(e,"owner")&&t.uint32(34).string(e.owner),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(42).fork().uint32(10).string(n[o]).uint32(18).bytes(e.extensions[n[o]]).ldelim();return null!=e.ospush&&Object.hasOwnProperty.call(e,"ospush")&&c.chatroomProto.OsPushMsg.encode(e.ospush,t.uint32(50).fork()).ldelim(),null!=e.msgOptions&&Object.hasOwnProperty.call(e,"msgOptions")&&c.chatroomProto.MqMsgOptions.encode(e.msgOptions,t.uint32(58).fork()).ldelim(),null!=e.ospushOptions&&Object.hasOwnProperty.call(e,"ospushOptions")&&c.chatroomProto.OsPushOptions.encode(e.ospushOptions,t.uint32(66).fork()).ldelim(),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.chatroomProto.P2PMqMsgRequest;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.toUid=e.int64();break;case 2:i.topic=e.string();break;case 3:i.content=c.chatroomProto.MqMsgContent.decode(e,e.uint32());break;case 4:i.owner=e.string();break;case 5:i.extensions===l.emptyObject&&(i.extensions={});var u=e.uint32()+e.pos;for(n="",o=[];e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.string();break;case 2:o=e.bytes();break;default:e.skipType(7&p)}}i.extensions[n]=o;break;case 6:i.ospush=c.chatroomProto.OsPushMsg.decode(e,e.uint32());break;case 7:i.msgOptions=c.chatroomProto.MqMsgOptions.decode(e,e.uint32());break;case 8:i.ospushOptions=c.chatroomProto.OsPushOptions.decode(e,e.uint32());break;default:e.skipType(7&s)}}return i},e}(),i.GroupMqMsgRequest=function(){function e(e){if(this.ospushUids=[],this.extensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.ospushUids=l.emptyArray,e.prototype.content=null,e.prototype.owner="",e.prototype.extensions=l.emptyObject,e.prototype.ospush=null,e.prototype.msgOptions=null,e.prototype.ospushOptions=null,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(8).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(18).string(e.topic),null!=e.ospushUids&&e.ospushUids.length){t.uint32(26).fork();for(var n=0;n<e.ospushUids.length;++n)t.int64(e.ospushUids[n]);t.ldelim()}if(null!=e.content&&Object.hasOwnProperty.call(e,"content")&&c.chatroomProto.MqMsgContent.encode(e.content,t.uint32(34).fork()).ldelim(),null!=e.owner&&Object.hasOwnProperty.call(e,"owner")&&t.uint32(42).string(e.owner),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions")){var o=Object.keys(e.extensions);for(n=0;n<o.length;++n)t.uint32(50).fork().uint32(10).string(o[n]).uint32(18).bytes(e.extensions[o[n]]).ldelim()}return null!=e.ospush&&Object.hasOwnProperty.call(e,"ospush")&&c.chatroomProto.OsPushMsg.encode(e.ospush,t.uint32(58).fork()).ldelim(),null!=e.msgOptions&&Object.hasOwnProperty.call(e,"msgOptions")&&c.chatroomProto.MqMsgOptions.encode(e.msgOptions,t.uint32(66).fork()).ldelim(),null!=e.ospushOptions&&Object.hasOwnProperty.call(e,"ospushOptions")&&c.chatroomProto.OsPushOptions.encode(e.ospushOptions,t.uint32(74).fork()).ldelim(),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.chatroomProto.GroupMqMsgRequest;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.groupId=e.int64();break;case 2:i.topic=e.string();break;case 3:if(i.ospushUids&&i.ospushUids.length||(i.ospushUids=[]),2==(7&s))for(var u=e.uint32()+e.pos;e.pos<u;)i.ospushUids.push(e.int64());else i.ospushUids.push(e.int64());break;case 4:i.content=c.chatroomProto.MqMsgContent.decode(e,e.uint32());break;case 5:i.owner=e.string();break;case 6:for(i.extensions===l.emptyObject&&(i.extensions={}),u=e.uint32()+e.pos,n="",o=[];e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.string();break;case 2:o=e.bytes();break;default:e.skipType(7&p)}}i.extensions[n]=o;break;case 7:i.ospush=c.chatroomProto.OsPushMsg.decode(e,e.uint32());break;case 8:i.msgOptions=c.chatroomProto.MqMsgOptions.decode(e,e.uint32());break;case 9:i.ospushOptions=c.chatroomProto.OsPushOptions.decode(e,e.uint32());break;default:e.skipType(7&s)}}return i},e}(),i.GetQueueConfigRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(26).string(e.region),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(32).int64(e.selfUid),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.GetQueueConfigRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.region=e.string();break;case 4:o.selfUid=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.GetQueueConfigResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.queueCount=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.queueCount&&Object.hasOwnProperty.call(e,"queueCount")&&t.uint32(32).int32(e.queueCount),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.GetQueueConfigResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.queueCount=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.ChatChangedAggregateNotify=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(8).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(18).string(e.topic),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.ChatChangedAggregateNotify;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.groupId=e.int64();break;case 2:o.topic=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.MultiCastMPChatRequest=function(){function e(e){if(this.ospushUids=[],this.targetUserTags=[],this.extensions={},this.statTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromIdType="",e.prototype.fromId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.toIdType="",e.prototype.toId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.partitionId="",e.prototype.msgType=0,e.prototype.content=l.newBuffer([]),e.prototype.ospushUids=l.emptyArray,e.prototype.osPushMsg=null,e.prototype.uuid="",e.prototype.retentionPeriod=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.storeHistory="",e.prototype.customTimestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.extension="",e.prototype.targetUserTags=l.emptyArray,e.prototype.chatChangedAggregateNotify=null,e.prototype.ospushOptions=null,e.prototype.extensions=l.emptyObject,e.prototype.toIdRegion="",e.prototype.statTags=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.fromIdType&&Object.hasOwnProperty.call(e,"fromIdType")&&t.uint32(26).string(e.fromIdType),null!=e.fromId&&Object.hasOwnProperty.call(e,"fromId")&&t.uint32(32).int64(e.fromId),null!=e.toIdType&&Object.hasOwnProperty.call(e,"toIdType")&&t.uint32(42).string(e.toIdType),null!=e.toId&&Object.hasOwnProperty.call(e,"toId")&&t.uint32(48).int64(e.toId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(56).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(66).string(e.topic),null!=e.partitionId&&Object.hasOwnProperty.call(e,"partitionId")&&t.uint32(74).string(e.partitionId),null!=e.msgType&&Object.hasOwnProperty.call(e,"msgType")&&t.uint32(80).int32(e.msgType),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(90).bytes(e.content),null!=e.ospushUids&&e.ospushUids.length){t.uint32(98).fork();for(var n=0;n<e.ospushUids.length;++n)t.int64(e.ospushUids[n]);t.ldelim()}if(null!=e.osPushMsg&&Object.hasOwnProperty.call(e,"osPushMsg")&&c.chatroomProto.OsPushMsg.encode(e.osPushMsg,t.uint32(106).fork()).ldelim(),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&t.uint32(114).string(e.uuid),null!=e.retentionPeriod&&Object.hasOwnProperty.call(e,"retentionPeriod")&&t.uint32(120).int64(e.retentionPeriod),null!=e.storeHistory&&Object.hasOwnProperty.call(e,"storeHistory")&&t.uint32(130).string(e.storeHistory),null!=e.customTimestamp&&Object.hasOwnProperty.call(e,"customTimestamp")&&t.uint32(136).int64(e.customTimestamp),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&t.uint32(146).string(e.extension),null!=e.targetUserTags&&e.targetUserTags.length)for(n=0;n<e.targetUserTags.length;++n)t.uint32(154).string(e.targetUserTags[n]);if(null!=e.chatChangedAggregateNotify&&Object.hasOwnProperty.call(e,"chatChangedAggregateNotify")&&c.chatroomProto.ChatChangedAggregateNotify.encode(e.chatChangedAggregateNotify,t.uint32(162).fork()).ldelim(),null!=e.ospushOptions&&Object.hasOwnProperty.call(e,"ospushOptions")&&c.chatroomProto.OsPushOptions.encode(e.ospushOptions,t.uint32(170).fork()).ldelim(),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions")){var o=Object.keys(e.extensions);for(n=0;n<o.length;++n)t.uint32(178).fork().uint32(10).string(o[n]).uint32(18).string(e.extensions[o[n]]).ldelim()}if(null!=e.toIdRegion&&Object.hasOwnProperty.call(e,"toIdRegion")&&t.uint32(186).string(e.toIdRegion),null!=e.statTags&&e.statTags.length)for(n=0;n<e.statTags.length;++n)t.uint32(194).string(e.statTags[n]);return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.chatroomProto.MultiCastMPChatRequest;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.fromIdType=e.string();break;case 4:i.fromId=e.int64();break;case 5:i.toIdType=e.string();break;case 6:i.toId=e.int64();break;case 7:i.groupId=e.int64();break;case 8:i.topic=e.string();break;case 9:i.partitionId=e.string();break;case 10:i.msgType=e.int32();break;case 11:i.content=e.bytes();break;case 12:if(i.ospushUids&&i.ospushUids.length||(i.ospushUids=[]),2==(7&s))for(var u=e.uint32()+e.pos;e.pos<u;)i.ospushUids.push(e.int64());else i.ospushUids.push(e.int64());break;case 13:i.osPushMsg=c.chatroomProto.OsPushMsg.decode(e,e.uint32());break;case 14:i.uuid=e.string();break;case 15:i.retentionPeriod=e.int64();break;case 16:i.storeHistory=e.string();break;case 17:i.customTimestamp=e.int64();break;case 18:i.extension=e.string();break;case 19:i.targetUserTags&&i.targetUserTags.length||(i.targetUserTags=[]),i.targetUserTags.push(e.string());break;case 20:i.chatChangedAggregateNotify=c.chatroomProto.ChatChangedAggregateNotify.decode(e,e.uint32());break;case 21:i.ospushOptions=c.chatroomProto.OsPushOptions.decode(e,e.uint32());break;case 22:for(i.extensions===l.emptyObject&&(i.extensions={}),u=e.uint32()+e.pos,n="",o="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.extensions[n]=o;break;case 23:i.toIdRegion=e.string();break;case 24:i.statTags&&i.statTags.length||(i.statTags=[]),i.statTags.push(e.string());break;default:e.skipType(7&s)}}return i},e}(),i.MsgType=function(){var e={},t=Object.create(e);return t[e[0]="kText"]=0,t[e[1]="kImage"]=1,t[e[2]="kUrl"]=2,t[e[3]="kAudio"]=3,t[e[4]="kVideo"]=4,t[e[1e4]="kCustomStart"]=1e4,t}(),i.TextMsg=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.text="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.text&&Object.hasOwnProperty.call(e,"text")&&t.uint32(10).string(e.text),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.chatroomProto.TextMsg;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.text=e.string();break;default:e.skipType(7&r)}}return o},e}(),i),e.exports=c},function(e,t,n){"use strict";e.exports=p;var o,r=n(9),i=r.LongBits,s=r.base64,a=r.utf8;function u(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function l(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new u(l,0,0),this.tail=this.head,this.states=null}var d=function(){return r.Buffer?function(){return(p.create=function(){return new o})()}:function(){return new p}};function h(e,t,n){t[n]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function g(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function m(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}p.create=d(),p.alloc=function(e){return new r.Array(e)},r.Array!==Array&&(p.alloc=r.pool(p.alloc,r.Array.prototype.subarray)),p.prototype._push=function(e,t,n){return this.tail=this.tail.next=new u(e,t,n),this.len+=t,this},f.prototype=Object.create(u.prototype),f.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(g,10,i.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=i.from(e);return this._push(g,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(g,t.length(),t)},p.prototype.bool=function(e){return this._push(h,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=i.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(r.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(r.float.writeDoubleLE,8,e)};var y=r.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var o=0;o<e.length;++o)t[n+o]=e[o]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(r.isString(e)){var n=p.alloc(t=s.length(e));s.decode(e,n,0),e=n}return this.uint32(t)._push(y,t,e)},p.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},p.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new u(l,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(l,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},p._configure=function(e){o=e,p.create=d(),o._configure()}},function(e,t,n){"use strict";e.exports=u;var o,r=n(9),i=r.LongBits,s=r.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var l,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},p=function(){return r.Buffer?function(e){return(u.create=function(e){return r.Buffer.isBuffer(e)?new o(e):c(e)})(e)}:c};function d(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=p(),u.prototype._slice=r.Array.prototype.subarray||r.Array.prototype.slice,u.prototype.uint32=(l=4294967295,function(){if(l=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return l;if(l=(l|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return l;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return l}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},u.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){o=e,u.create=p(),o._configure();var t=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},function(e,t,n){"use strict";e.exports=n(86)},function(e,t,n){"use strict";e.exports=b;var o=n(15);((b.prototype=Object.create(o.prototype)).constructor=b).className="Type";var r=n(8),i=n(19),s=n(10),a=n(30),u=n(31),l=n(33),c=n(27),p=n(26),d=n(4),h=n(48),f=n(49),g=n(50),m=n(51),y=n(52);function b(e,t){o.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function I(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var n=this.fields[e[t]],o=n.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=n}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=d.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=d.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=b.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof l||((e.prototype=new l).constructor=e,d.merge(e.prototype,t)),e.$type=e.prototype.$type=this,d.merge(e,l,!0),this._ctor=e;for(var n=0;n<this.fieldsArray.length;++n)this._fieldsArray[n].resolve();var o={};for(n=0;n<this.oneofsArray.length;++n)o[this._oneofsArray[n].resolve().name]={get:d.oneOfGetter(this._oneofsArray[n].oneof),set:d.oneOfSetter(this._oneofsArray[n].oneof)};n&&Object.defineProperties(e.prototype,o)}}}),b.generateConstructor=function(e){for(var t,n=d.codegen(["p"],e.name),o=0;o<e.fieldsArray.length;++o)(t=e._fieldsArray[o]).map?n("this%s={}",d.safeProp(t.name)):t.repeated&&n("this%s=[]",d.safeProp(t.name));return n("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t){var n=new b(e,t.options);n.extensions=t.extensions,n.reserved=t.reserved;for(var l=Object.keys(t.fields),c=0;c<l.length;++c)n.add((void 0!==t.fields[l[c]].keyType?a.fromJSON:s.fromJSON)(l[c],t.fields[l[c]]));if(t.oneofs)for(l=Object.keys(t.oneofs),c=0;c<l.length;++c)n.add(i.fromJSON(l[c],t.oneofs[l[c]]));if(t.nested)for(l=Object.keys(t.nested),c=0;c<l.length;++c){var p=t.nested[l[c]];n.add((void 0!==p.id?s.fromJSON:void 0!==p.fields?b.fromJSON:void 0!==p.values?r.fromJSON:void 0!==p.methods?u.fromJSON:o.fromJSON)(l[c],p))}return t.extensions&&t.extensions.length&&(n.extensions=t.extensions),t.reserved&&t.reserved.length&&(n.reserved=t.reserved),t.group&&(n.group=!0),t.comment&&(n.comment=t.comment),n},b.prototype.toJSON=function(e){var t=o.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return d.toObject(["options",t&&t.options||void 0,"oneofs",o.arrayToJSON(this.oneofsArray,e),"fields",o.arrayToJSON(this.fieldsArray.filter(function(e){return!e.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},b.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var n=this.oneofsArray;for(t=0;t<n.length;)n[t++].resolve();return o.prototype.resolveAll.call(this)},b.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},b.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),I(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),I(this)):o.prototype.add.call(this,e)},b.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),I(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),I(this)}return o.prototype.remove.call(this,e)},b.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},b.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)},b.prototype.create=function(e){return new this.ctor(e)},b.prototype.setup=function(){for(var e=this.fullName,t=[],n=0;n<this.fieldsArray.length;++n)t.push(this._fieldsArray[n].resolve().resolvedType);this.encode=h(this)({Writer:p,types:t,util:d}),this.decode=f(this)({Reader:c,types:t,util:d}),this.verify=g(this)({types:t,util:d}),this.fromObject=m.fromObject(this)({types:t,util:d}),this.toObject=m.toObject(this)({types:t,util:d});var o=y[e];if(o){var r=Object.create(this);r.fromObject=this.fromObject,this.fromObject=o.fromObject.bind(r),r.toObject=this.toObject,this.toObject=o.toObject.bind(r)}return this},b.prototype.encode=function(e,t){return this.setup().encode(e,t)},b.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},b.prototype.decode=function(e,t){return this.setup().decode(e,t)},b.prototype.decodeDelimited=function(e){return e instanceof c||(e=c.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e){return this.setup().verify(e)},b.prototype.fromObject=function(e){return this.setup().fromObject(e)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){d.decorateType(t,e)}}},function(e,t,n){"use strict";e.exports=s;var o=n(10);((s.prototype=Object.create(o.prototype)).constructor=s).className="MapField";var r=n(12),i=n(4);function s(e,t,n,r,s,a){if(o.call(this,e,t,r,void 0,void 0,s,a),!i.isString(n))throw TypeError("keyType must be a string");this.keyType=n,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===r.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return o.prototype.resolve.call(this)},s.d=function(e,t,n){return"function"==typeof n?n=i.decorateType(n).name:n&&"object"==typeof n&&(n=i.decorateEnum(n).name),function(o,r){i.decorateType(o.constructor).add(new s(r,e,t,n))}}},function(e,t,n){"use strict";e.exports=a;var o=n(15);((a.prototype=Object.create(o.prototype)).constructor=a).className="Service";var r=n(32),i=n(4),s=n(46);function a(e,t){o.call(this,e,t),this.methods={},this._methodsArray=null}function u(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var n=new a(e,t.options);if(t.methods)for(var o=Object.keys(t.methods),i=0;i<o.length;++i)n.add(r.fromJSON(o[i],t.methods[o[i]]));return t.nested&&n.addJSON(t.nested),n.comment=t.comment,n},a.prototype.toJSON=function(e){var t=o.prototype.toJSON.call(this,e),n=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",o.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",n?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||o.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return o.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof r?(this.methods[e.name]=e,e.parent=this,u(this)):o.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof r){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,u(this)}return o.prototype.remove.call(this,e)},a.prototype.create=function(e,t,n){for(var o,r=new s.Service(e,t,n),a=0;a<this.methodsArray.length;++a){var u=i.lcFirst((o=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");r[u]=i.codegen(["r","c"],i.isReserved(u)?u+"_":u)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return r}},function(e,t,n){"use strict";e.exports=i;var o=n(11);((i.prototype=Object.create(o.prototype)).constructor=i).className="Method";var r=n(4);function i(e,t,n,i,s,a,u,l){if(r.isObject(s)?(u=s,s=a=void 0):r.isObject(a)&&(u=a,a=void 0),void 0!==t&&!r.isString(t))throw TypeError("type must be a string");if(!r.isString(n))throw TypeError("requestType must be a string");if(!r.isString(i))throw TypeError("responseType must be a string");o.call(this,e,u),this.type=t||"rpc",this.requestType=n,this.requestStream=!!s||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),o.prototype.resolve.call(this))}},function(e,t,n){"use strict";e.exports=r;var o=n(9);function r(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)this[t[n]]=e[t[n]]}r.create=function(e){return this.$type.create(e)},r.encode=function(e,t){return this.$type.encode(e,t)},r.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},r.decode=function(e){return this.$type.decode(e)},r.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},r.verify=function(e){return this.$type.verify(e)},r.fromObject=function(e){return this.$type.fromObject(e)},r.toObject=function(e,t){return this.$type.toObject(e,t)},r.prototype.toJSON=function(){return this.$type.toObject(this,o.toJSONOptions)}},function(e,t,n){"use strict";e.exports=p;var o=n(15);((p.prototype=Object.create(o.prototype)).constructor=p).className="Root";var r,i,s,a=n(10),u=n(8),l=n(19),c=n(4);function p(e){o.call(this,"",e),this.deferred=[],this.files=[]}function d(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},p.prototype.resolvePath=c.path.resolve,p.prototype.fetch=c.fetch,p.prototype.load=function e(t,n,o){"function"==typeof n&&(o=n,n=void 0);var r=this;if(!o)return c.asPromise(e,r,t,n);var a=o===d;function u(e,t){if(o){var n=o;if(o=null,a)throw e;n(e,t)}}function l(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var n=e.substring(t);if(n in s)return n}return null}function p(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){i.filename=e;var o,s=i(t,r,n),p=0;if(s.imports)for(;p<s.imports.length;++p)(o=l(s.imports[p])||r.resolvePath(e,s.imports[p]))&&h(o);if(s.weakImports)for(p=0;p<s.weakImports.length;++p)(o=l(s.weakImports[p])||r.resolvePath(e,s.weakImports[p]))&&h(o,!0)}else r.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}a||f||u(null,r)}function h(e,t){if(!(r.files.indexOf(e)>-1))if(r.files.push(e),e in s)a?p(e,s[e]):(++f,setTimeout(function(){--f,p(e,s[e])}));else if(a){var n;try{n=c.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}p(e,n)}else++f,r.fetch(e,function(n,i){--f,o&&(n?t?f||u(null,r):u(n):p(e,i))})}var f=0;c.isString(t)&&(t=[t]);for(var g,m=0;m<t.length;++m)(g=r.resolvePath("",t[m]))&&h(g);if(a)return r;f||u(null,r)},p.prototype.loadSync=function(e,t){if(!c.isNode)throw Error("not supported");return this.load(e,t,d)},p.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return o.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var n=t.parent.lookup(t.extend);if(n){var o=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return o.declaringField=t,t.extensionField=o,n.add(o),!0}return!1}p.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof u)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof l)){if(e instanceof r)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);h.test(e.name)&&(e.parent[e.name]=e)}},p.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof u)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof o){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);h.test(e.name)&&delete e.parent[e.name]}},p._configure=function(e,t,n){r=e,i=t,s=n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.lockers=new Map}lock(e){this.lockers.set(e,!0)}unlock(e){this.lockers.set(e,!1)}wait(e){return new Promise((t,n)=>{setTimeout(()=>{this.lockers.get(e)?n({rescode:1008,msg:`${e} has been locked`}):t()})})}islock(e){return this.lockers.get(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let o=0,r={now:function(){0===o&&(o=Date.now()-1);let e=Date.now()-o;return e>4294967295?(o+=4294967295,Date.now()-o):e},utc:function(){return Math.round(Date.now()/1e3)}};t.default=r},function(e,t,n){"use strict";var o,r=n(17),i=r.Reader,s=r.Writer,a=r.util,u=r.roots.default||(r.roots.default={});u.hummerProto=((o={}).SetUserRegionRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=a.Long?a.Long.fromBits(0,0,!1):0,e.prototype.appId=a.Long?a.Long.fromBits(0,0,!1):0,e.prototype.selfUid=a.Long?a.Long.fromBits(0,0,!1):0,e.prototype.region="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=s.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.region&&e.hasOwnProperty("region")&&t.uint32(34).string(e.region),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new u.hummerProto.SetUserRegionRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.region=e.string();break;default:e.skipType(7&r)}}return o},e}(),o.SetUserRegionResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=a.Long?a.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=s.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof i||(e=i.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new u.hummerProto.SetUserRegionResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),o),e.exports=u},function(e,t,n){"use strict";var o,r,i,s=n(17),a=s.Reader,u=s.Writer,l=s.util,c=s.roots.default||(s.roots.default={});c.proto=((i={}).Action=(o={},(r=Object.create(o))[o[0]="kLogin"]=0,r[o[3e3]="kP2PChat"]=3e3,r[o[1e6]="kNotifySignalMessage"]=1e6,r[o[1000001]="kNotifyJoinSignalGroup"]=1000001,r[o[1000002]="kNotifyLeaveSignalGroup"]=1000002,r[o[1000003]="kNotifyUinfoChange"]=1000003,r[o[1000004]="kNotifyUserOnlineStatusChange"]=1000004,r[o[1000005]="kNotifyUserCountChange"]=1000005,r[o[1000006]="kNotifyChannelPropsChange"]=1000006,r[o[15e5]="kP2PMessage"]=15e5,r[o[1500001]="kP2CMessage"]=1500001,r),i.GetMaxSeqIdRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(34).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(40).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetMaxSeqIdRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.topic=e.string();break;case 5:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.GetMaxSeqIdResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.maxSeqId&&Object.hasOwnProperty.call(e,"maxSeqId")&&t.uint32(32).int64(e.maxSeqId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetMaxSeqIdResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.maxSeqId=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.GetGrpSysMaxSeqIdRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.queueId=0,e.prototype.groupRegion="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(32).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(42).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(48).int32(e.queueId),null!=e.groupRegion&&Object.hasOwnProperty.call(e,"groupRegion")&&t.uint32(58).string(e.groupRegion),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetGrpSysMaxSeqIdRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.topic=e.string();break;case 6:o.queueId=e.int32();break;case 7:o.groupRegion=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.GetGrpSysMaxSeqIdResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.maxSeqId&&Object.hasOwnProperty.call(e,"maxSeqId")&&t.uint32(32).int64(e.maxSeqId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetGrpSysMaxSeqIdResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.maxSeqId=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushMsgRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(16).int64(e.uid),null!=e.seqId&&Object.hasOwnProperty.call(e,"seqId")&&t.uint32(24).int64(e.seqId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(32).int64(e.groupId),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(42).string(e.region),null!=e.envType&&Object.hasOwnProperty.call(e,"envType")&&t.uint32(50).string(e.envType),null!=e.envName&&Object.hasOwnProperty.call(e,"envName")&&t.uint32(58).string(e.envName),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(66).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(72).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.IMPushMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.uid=e.int64();break;case 3:o.seqId=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.region=e.string();break;case 6:o.envType=e.string();break;case 7:o.envName=e.string();break;case 8:o.topic=e.string();break;case 9:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.IMPushMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushGroupSysMsgRequest=function(){function e(e){if(this.targetUserTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.topic="",e.prototype.prevSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.msg=null,e.prototype.targetUserTags=l.emptyArray,e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(16).int64(e.groupId),null!=e.seqId&&Object.hasOwnProperty.call(e,"seqId")&&t.uint32(24).int64(e.seqId),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(34).string(e.region),null!=e.envType&&Object.hasOwnProperty.call(e,"envType")&&t.uint32(42).string(e.envType),null!=e.envName&&Object.hasOwnProperty.call(e,"envName")&&t.uint32(50).string(e.envName),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(58).string(e.topic),null!=e.prevSeqId&&Object.hasOwnProperty.call(e,"prevSeqId")&&t.uint32(64).int64(e.prevSeqId),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&c.proto.Msg.encode(e.msg,t.uint32(74).fork()).ldelim(),null!=e.targetUserTags&&e.targetUserTags.length)for(var n=0;n<e.targetUserTags.length;++n)t.uint32(82).string(e.targetUserTags[n]);return null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(88).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.IMPushGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.groupId=e.int64();break;case 3:o.seqId=e.int64();break;case 4:o.region=e.string();break;case 5:o.envType=e.string();break;case 6:o.envName=e.string();break;case 7:o.topic=e.string();break;case 8:o.prevSeqId=e.int64();break;case 9:o.msg=c.proto.Msg.decode(e,e.uint32());break;case 10:o.targetUserTags&&o.targetUserTags.length||(o.targetUserTags=[]),o.targetUserTags.push(e.string());break;case 11:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushGroupSysMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.IMPushGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.PullMsgRequest=function(){function e(e){if(this.userTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.exclusiveStartSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.limit=0,e.prototype.userTags=l.emptyArray,e.prototype.statisDeliveryDelay=!1,e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.exclusiveStartSeqId&&Object.hasOwnProperty.call(e,"exclusiveStartSeqId")&&t.uint32(32).int64(e.exclusiveStartSeqId),null!=e.limit&&Object.hasOwnProperty.call(e,"limit")&&t.uint32(40).int32(e.limit),null!=e.userTags&&e.userTags.length)for(var n=0;n<e.userTags.length;++n)t.uint32(50).string(e.userTags[n]);return null!=e.statisDeliveryDelay&&Object.hasOwnProperty.call(e,"statisDeliveryDelay")&&t.uint32(56).bool(e.statisDeliveryDelay),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(66).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(72).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.PullMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.exclusiveStartSeqId=e.int64();break;case 5:o.limit=e.int32();break;case 6:o.userTags&&o.userTags.length||(o.userTags=[]),o.userTags.push(e.string());break;case 7:o.statisDeliveryDelay=e.bool();break;case 8:o.topic=e.string();break;case 9:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.PullMsgResponse=function(){function e(e){if(this.msgs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.msgs=l.emptyArray,e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.hasMore=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.msgs&&e.msgs.length)for(var n=0;n<e.msgs.length;++n)c.proto.Msg.encode(e.msgs[n],t.uint32(34).fork()).ldelim();return null!=e.maxSeqId&&Object.hasOwnProperty.call(e,"maxSeqId")&&t.uint32(40).int64(e.maxSeqId),null!=e.hasMore&&Object.hasOwnProperty.call(e,"hasMore")&&t.uint32(48).bool(e.hasMore),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.PullMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.msgs&&o.msgs.length||(o.msgs=[]),o.msgs.push(c.proto.Msg.decode(e,e.uint32()));break;case 5:o.maxSeqId=e.int64();break;case 6:o.hasMore=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.PullGroupSysMsgRequest=function(){function e(e){if(this.userTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.exclusiveStartSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.limit=0,e.prototype.userTags=l.emptyArray,e.prototype.statisDeliveryDelay=!1,e.prototype.topic="",e.prototype.queueId=0,e.prototype.groupRegion="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(32).int64(e.groupId),null!=e.exclusiveStartSeqId&&Object.hasOwnProperty.call(e,"exclusiveStartSeqId")&&t.uint32(40).int64(e.exclusiveStartSeqId),null!=e.limit&&Object.hasOwnProperty.call(e,"limit")&&t.uint32(48).int32(e.limit),null!=e.userTags&&e.userTags.length)for(var n=0;n<e.userTags.length;++n)t.uint32(58).string(e.userTags[n]);return null!=e.statisDeliveryDelay&&Object.hasOwnProperty.call(e,"statisDeliveryDelay")&&t.uint32(64).bool(e.statisDeliveryDelay),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(74).string(e.topic),null!=e.queueId&&Object.hasOwnProperty.call(e,"queueId")&&t.uint32(80).int32(e.queueId),null!=e.groupRegion&&Object.hasOwnProperty.call(e,"groupRegion")&&t.uint32(90).string(e.groupRegion),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.PullGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.exclusiveStartSeqId=e.int64();break;case 6:o.limit=e.int32();break;case 7:o.userTags&&o.userTags.length||(o.userTags=[]),o.userTags.push(e.string());break;case 8:o.statisDeliveryDelay=e.bool();break;case 9:o.topic=e.string();break;case 10:o.queueId=e.int32();break;case 11:o.groupRegion=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.PullGroupSysMsgResponse=function(){function e(e){if(this.msgs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.msgs=l.emptyArray,e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.hasMore=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.msgs&&e.msgs.length)for(var n=0;n<e.msgs.length;++n)c.proto.Msg.encode(e.msgs[n],t.uint32(34).fork()).ldelim();return null!=e.maxSeqId&&Object.hasOwnProperty.call(e,"maxSeqId")&&t.uint32(40).int64(e.maxSeqId),null!=e.hasMore&&Object.hasOwnProperty.call(e,"hasMore")&&t.uint32(48).bool(e.hasMore),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.PullGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.msgs&&o.msgs.length||(o.msgs=[]),o.msgs.push(c.proto.Msg.decode(e,e.uint32()));break;case 5:o.maxSeqId=e.int64();break;case 6:o.hasMore=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyUserStatusChange=function(){function e(e){if(this.joinuids=[],this.leaveuids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.joinuids=l.emptyArray,e.prototype.leaveuids=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(26).string(e.groupId),null!=e.joinuids&&e.joinuids.length){t.uint32(34).fork();for(var n=0;n<e.joinuids.length;++n)t.uint64(e.joinuids[n]);t.ldelim()}if(null!=e.leaveuids&&e.leaveuids.length){for(t.uint32(42).fork(),n=0;n<e.leaveuids.length;++n)t.uint64(e.leaveuids[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.NotifyUserStatusChange;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.groupId=e.string();break;case 4:if(o.joinuids&&o.joinuids.length||(o.joinuids=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos<i;)o.joinuids.push(e.uint64());else o.joinuids.push(e.uint64());break;case 5:if(o.leaveuids&&o.leaveuids.length||(o.leaveuids=[]),2==(7&r))for(i=e.uint32()+e.pos;e.pos<i;)o.leaveuids.push(e.uint64());else o.leaveuids.push(e.uint64());break;default:e.skipType(7&r)}}return o},e}(),i.NotifyJoinSignalGroup=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(24).int64(e.uid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(34).string(e.groupId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.NotifyJoinSignalGroup;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.uid=e.int64();break;case 4:o.groupId=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyLeaveSignalGroup=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(24).int64(e.uid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(34).string(e.groupId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.NotifyLeaveSignalGroup;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.uid=e.int64();break;case 4:o.groupId=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.Msg=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.action=0,e.prototype.content=l.newBuffer([]),e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.seqId&&Object.hasOwnProperty.call(e,"seqId")&&t.uint32(8).int64(e.seqId),null!=e.action&&Object.hasOwnProperty.call(e,"action")&&t.uint32(16).int32(e.action),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(26).bytes(e.content),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(32).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.Msg;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.seqId=e.int64();break;case 2:o.action=e.int32();break;case 3:o.content=e.bytes();break;case 4:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.SignalMessageOption=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.reliable="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.reliable&&Object.hasOwnProperty.call(e,"reliable")&&t.uint32(10).string(e.reliable),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.SignalMessageOption;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.reliable=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.P2PSignalRequest=function(){function e(e){if(this.extensions={},this.internalExtensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.toUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.option=null,e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.prototype.internalExtensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&Object.hasOwnProperty.call(e,"fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.toUid&&Object.hasOwnProperty.call(e,"toUid")&&t.uint32(32).int64(e.toUid),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(42).string(e.type),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(50).bytes(e.content),null!=e.option&&Object.hasOwnProperty.call(e,"option")&&c.proto.SignalMessageOption.encode(e.option,t.uint32(58).fork()).ldelim(),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&t.uint32(66).string(e.uuid),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&t.uint32(74).string(e.extension),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(82).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();if(null!=e.internalExtensions&&Object.hasOwnProperty.call(e,"internalExtensions"))for(n=Object.keys(e.internalExtensions),o=0;o<n.length;++o)t.uint32(90).fork().uint32(10).string(n[o]).uint32(18).string(e.internalExtensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.proto.P2PSignalRequest;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.fromUid=e.int64();break;case 4:i.toUid=e.int64();break;case 5:i.type=e.string();break;case 6:i.content=e.bytes();break;case 7:i.option=c.proto.SignalMessageOption.decode(e,e.uint32());break;case 8:i.uuid=e.string();break;case 9:i.extension=e.string();break;case 10:i.extensions===l.emptyObject&&(i.extensions={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;)switch((p=e.uint32())>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}i.extensions[n]=o;break;case 11:for(i.internalExtensions===l.emptyObject&&(i.internalExtensions={}),u=e.uint32()+e.pos,n="",o="";e.pos<u;){var p;switch((p=e.uint32())>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.internalExtensions[n]=o;break;default:e.skipType(7&s)}}return i},e}(),i.P2PSignalResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(18).string(e.msg),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.P2PSignalResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.SignalMessage=function(){function e(e){if(this.extensions={},this.internalExtensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.prototype.internalExtensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&Object.hasOwnProperty.call(e,"fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(34).string(e.type),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(42).bytes(e.content),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&t.uint32(50).string(e.uuid),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&t.uint32(58).string(e.extension),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(66).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();if(null!=e.internalExtensions&&Object.hasOwnProperty.call(e,"internalExtensions"))for(n=Object.keys(e.internalExtensions),o=0;o<n.length;++o)t.uint32(74).fork().uint32(10).string(n[o]).uint32(18).string(e.internalExtensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.proto.SignalMessage;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.fromUid=e.int64();break;case 4:i.type=e.string();break;case 5:i.content=e.bytes();break;case 6:i.uuid=e.string();break;case 7:i.extension=e.string();break;case 8:i.extensions===l.emptyObject&&(i.extensions={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;)switch((p=e.uint32())>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}i.extensions[n]=o;break;case 9:for(i.internalExtensions===l.emptyObject&&(i.internalExtensions={}),u=e.uint32()+e.pos,n="",o="";e.pos<u;){var p;switch((p=e.uint32())>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.internalExtensions[n]=o;break;default:e.skipType(7&s)}}return i},e}(),i.GroupSignalRequest=function(){function e(e){if(this.extensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.option=null,e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&Object.hasOwnProperty.call(e,"fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(32).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(42).string(e.topic),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(50).string(e.type),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(58).bytes(e.content),null!=e.option&&Object.hasOwnProperty.call(e,"option")&&c.proto.SignalMessageOption.encode(e.option,t.uint32(66).fork()).ldelim(),null!=e.uuid&&Object.hasOwnProperty.call(e,"uuid")&&t.uint32(74).string(e.uuid),null!=e.extension&&Object.hasOwnProperty.call(e,"extension")&&t.uint32(82).string(e.extension),null!=e.extensions&&Object.hasOwnProperty.call(e,"extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(90).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.proto.GroupSignalRequest;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.fromUid=e.int64();break;case 4:i.groupId=e.int64();break;case 5:i.topic=e.string();break;case 6:i.type=e.string();break;case 7:i.content=e.bytes();break;case 8:i.option=c.proto.SignalMessageOption.decode(e,e.uint32());break;case 9:i.uuid=e.string();break;case 10:i.extension=e.string();break;case 11:i.extensions===l.emptyObject&&(i.extensions={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.extensions[n]=o;break;default:e.skipType(7&s)}}return i},e}(),i.GroupSignalResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(18).string(e.msg),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GroupSignalResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.CheckUserIsOnlineRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(32).int64(e.uid),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.CheckUserIsOnlineRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.uid=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.CheckUserIsOnlineResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.isOnline=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(18).string(e.msg),null!=e.isOnline&&Object.hasOwnProperty.call(e,"isOnline")&&t.uint32(24).bool(e.isOnline),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.CheckUserIsOnlineResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.isOnline=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.BatchCheckUserIsOnlineRequest=function(){function e(e){if(this.uids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uids=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.uids&&e.uids.length){t.uint32(34).fork();for(var n=0;n<e.uids.length;++n)t.int64(e.uids[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.BatchCheckUserIsOnlineRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:if(o.uids&&o.uids.length||(o.uids=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos<i;)o.uids.push(e.int64());else o.uids.push(e.int64());break;default:e.skipType(7&r)}}return o},e}(),i.BatchCheckUserIsOnlineResponse=function(){function e(e){if(this.onlineUids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.onlineUids=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(18).string(e.msg),null!=e.onlineUids&&e.onlineUids.length){t.uint32(26).fork();for(var n=0;n<e.onlineUids.length;++n)t.int64(e.onlineUids[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.BatchCheckUserIsOnlineResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:if(o.onlineUids&&o.onlineUids.length||(o.onlineUids=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos<i;)o.onlineUids.push(e.int64());else o.onlineUids.push(e.int64());break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableMsg=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.action=0,e.prototype.content=l.newBuffer([]),e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uri="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.action&&Object.hasOwnProperty.call(e,"action")&&t.uint32(8).int32(e.action),null!=e.content&&Object.hasOwnProperty.call(e,"content")&&t.uint32(18).bytes(e.content),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(24).int64(e.timestamp),null!=e.uri&&Object.hasOwnProperty.call(e,"uri")&&t.uint32(34).string(e.uri),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableMsg;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.action=e.int32();break;case 2:o.content=e.bytes();break;case 3:o.timestamp=e.int64();break;case 4:o.uri=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushMsgRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.msg=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(18).string(e.region),null!=e.envType&&Object.hasOwnProperty.call(e,"envType")&&t.uint32(26).string(e.envType),null!=e.envName&&Object.hasOwnProperty.call(e,"envName")&&t.uint32(34).string(e.envName),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&c.proto.UnreliableMsg.encode(e.msg,t.uint32(42).fork()).ldelim(),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableIMPushMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.region=e.string();break;case 3:o.envType=e.string();break;case 4:o.envName=e.string();break;case 5:o.msg=c.proto.UnreliableMsg.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableIMPushMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushGroupSysMsgRequest=function(){function e(e){if(this.targetUserTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.msg=null,e.prototype.targetUserTags=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(16).int64(e.groupId),null!=e.topic&&Object.hasOwnProperty.call(e,"topic")&&t.uint32(26).string(e.topic),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(34).string(e.region),null!=e.envType&&Object.hasOwnProperty.call(e,"envType")&&t.uint32(42).string(e.envType),null!=e.envName&&Object.hasOwnProperty.call(e,"envName")&&t.uint32(50).string(e.envName),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&c.proto.UnreliableMsg.encode(e.msg,t.uint32(58).fork()).ldelim(),null!=e.targetUserTags&&e.targetUserTags.length)for(var n=0;n<e.targetUserTags.length;++n)t.uint32(66).string(e.targetUserTags[n]);return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableIMPushGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.groupId=e.int64();break;case 3:o.topic=e.string();break;case 4:o.region=e.string();break;case 5:o.envType=e.string();break;case 6:o.envName=e.string();break;case 7:o.msg=c.proto.UnreliableMsg.decode(e,e.uint32());break;case 8:o.targetUserTags&&o.targetUserTags.length||(o.targetUserTags=[]),o.targetUserTags.push(e.string());break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushGroupSysMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableIMPushGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyUinfoChange=function(){function e(e){if(this.infos={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.opType=0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.infos=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.opType&&Object.hasOwnProperty.call(e,"opType")&&t.uint32(24).int32(e.opType),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(32).int64(e.uid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(42).string(e.groupId),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(48).int64(e.timestamp),null!=e.infos&&Object.hasOwnProperty.call(e,"infos"))for(var n=Object.keys(e.infos),o=0;o<n.length;++o)t.uint32(58).fork().uint32(10).string(n[o]).uint32(18).string(e.infos[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.proto.NotifyUinfoChange;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.opType=e.int32();break;case 4:i.uid=e.int64();break;case 5:i.groupId=e.string();break;case 6:i.timestamp=e.int64();break;case 7:i.infos===l.emptyObject&&(i.infos={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.infos[n]=o;break;default:e.skipType(7&s)}}return i},e.OpType=function(){var e={},t=Object.create(e);return t[e[0]="kOpUpdate"]=0,t[e[1]="kOpDel"]=1,t[e[2]="kOpSet"]=2,t[e[3]="kOpClear"]=3,t}(),e}(),i.NotifyChannelPropsChange=function(){function e(e){if(this.props={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.opType=0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.props=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.opType&&Object.hasOwnProperty.call(e,"opType")&&t.uint32(24).int32(e.opType),null!=e.uid&&Object.hasOwnProperty.call(e,"uid")&&t.uint32(32).int64(e.uid),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(42).string(e.groupId),null!=e.timestamp&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(48).int64(e.timestamp),null!=e.props&&Object.hasOwnProperty.call(e,"props"))for(var n=Object.keys(e.props),o=0;o<n.length;++o)t.uint32(58).fork().uint32(10).string(n[o]).uint32(18).string(e.props[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o,r=void 0===t?e.len:e.pos+t,i=new c.proto.NotifyChannelPropsChange;e.pos<r;){var s=e.uint32();switch(s>>>3){case 1:i.logId=e.int64();break;case 2:i.appId=e.int64();break;case 3:i.opType=e.int32();break;case 4:i.uid=e.int64();break;case 5:i.groupId=e.string();break;case 6:i.timestamp=e.int64();break;case 7:i.props===l.emptyObject&&(i.props={});var u=e.uint32()+e.pos;for(n="",o="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:n=e.string();break;case 2:o=e.string();break;default:e.skipType(7&p)}}i.props[n]=o;break;default:e.skipType(7&s)}}return i},e.OpType=function(){var e={},t=Object.create(e);return t[e[0]="kOpUpdate"]=0,t[e[1]="kOpDel"]=1,t[e[2]="kOpSet"]=2,t[e[3]="kOpClear"]=3,t}(),e}(),i.NotifyChannelUserCountChange=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.count=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.groupId&&Object.hasOwnProperty.call(e,"groupId")&&t.uint32(26).string(e.groupId),null!=e.count&&Object.hasOwnProperty.call(e,"count")&&t.uint32(32).uint32(e.count),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.NotifyChannelUserCountChange;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.groupId=e.string();break;case 4:o.count=e.uint32();break;default:e.skipType(7&r)}}return o},e}(),i.SetUserRegionRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(34).string(e.region),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.SetUserRegionRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.region=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.SetUserRegionResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.SetUserRegionResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.GetQueueConfigRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(16).int64(e.appId),null!=e.region&&Object.hasOwnProperty.call(e,"region")&&t.uint32(26).string(e.region),null!=e.selfUid&&Object.hasOwnProperty.call(e,"selfUid")&&t.uint32(32).int64(e.selfUid),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetQueueConfigRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.region=e.string();break;case 4:o.selfUid=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.GetQueueConfigResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.queueCount=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&Object.hasOwnProperty.call(e,"logId")&&t.uint32(8).int64(e.logId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).int32(e.code),null!=e.msg&&Object.hasOwnProperty.call(e,"msg")&&t.uint32(26).string(e.msg),null!=e.queueCount&&Object.hasOwnProperty.call(e,"queueCount")&&t.uint32(32).int32(e.queueCount),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetQueueConfigResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.queueCount=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i),e.exports=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(5);t.default=class{constructor(e=0,t=0){this.high=e,this.low=t}destroy(){}equal(e){return null!==e&&this.low===e.low&&this.high===e.high}toString(){return new o(this.low,this.high,!0).toString(10)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(1),r=n(7);t.default=class{static encodeUCS2(e){let t=[],n=e.length;for(let o=0;o<n;o++)t.push(e.charCodeAt(o));let o=Uint16Array.from(t);return new Uint8Array(o.buffer)}static decodeUCS2(e){let t=o.default.payload2DataView(e);e=null;let n=0,r=[];for(;n+2<=t.byteLength;)r.push(t.getUint16(n,!0)),n+=2;let i=r.length,s="";for(let e=0;e<i;e++)s+=String.fromCharCode(r[e]);return s}static encodeUtf8(e){return r.Utify.encodeStringToUtf8Bytes(e)}static decodeUtf8(e){let t="",n=e.byteLength;for(let o=0;o<n;o++){let n=e[o].toString(2),r=n.match(/^1+?(?=0)/);if(r&&8==n.length){let n=r[0].length,i=e[o].toString(2).slice(n+1);for(let t=1;t<n;t++)i+=e[t+o].toString(2).slice(2);t+=String.fromCodePoint(parseInt(i,2)),o+=n-1}else t+=String.fromCharCode(e[o])}return t}static sizeof(e){for(var t=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);if(o>=55296&&o<=56319&&n+1<e.length){var r=e.charCodeAt(n+1);if(r>=56320&&r<=57343){++n,t+=4;continue}}t+=o<=127?1:o<=2047?2:3}return t}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(42);t.encodeStringToUtf8Bytes=function(e){let t=o.length(e),n=new Uint8Array(t);return o.write(e,n,0),n},t.decodeUtf8BytesToString=function(e){return o.read(e,0,e.length)}},function(e,t,n){"use strict";var o=t;o.length=function(e){for(var t=0,n=0,o=0;o<e.length;++o)(n=e.charCodeAt(o))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(o+1))?(++o,t+=4):t+=3;return t},o.read=function(e,t,n){if(n-t<1)return"";for(var o,r=null,i=[],s=0;t<n;)(o=e[t++])<128?i[s++]=o:o>191&&o<224?i[s++]=(31&o)<<6|63&e[t++]:o>239&&o<365?(o=((7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(o>>10),i[s++]=56320+(1023&o)):i[s++]=(15&o)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,i)),s=0);return r?(s&&r.push(String.fromCharCode.apply(String,i.slice(0,s))),r.join("")):String.fromCharCode.apply(String,i.slice(0,s))},o.write=function(e,t,n){for(var o,r,i=n,s=0;s<e.length;++s)(o=e.charCodeAt(s))<128?t[n++]=o:o<2048?(t[n++]=o>>6|192,t[n++]=63&o|128):55296==(64512&o)&&56320==(64512&(r=e.charCodeAt(s+1)))?(o=65536+((1023&o)<<10)+(1023&r),++s,t[n++]=o>>18|240,t[n++]=o>>12&63|128,t[n++]=o>>6&63|128,t[n++]=63&o|128):(t[n++]=o>>12|224,t[n++]=o>>6&63|128,t[n++]=63&o|128);return n-i}},function(e,t,n){"use strict";var o=t;function r(){o.util._configure(),o.Writer._configure(o.BufferWriter),o.Reader._configure(o.BufferReader)}o.build="minimal",o.Writer=n(26),o.BufferWriter=n(83),o.Reader=n(27),o.BufferReader=n(84),o.util=n(9),o.rpc=n(46),o.roots=n(47),o.configure=r,r()},function(e,t,n){"use strict";e.exports=function(e,t){var n=new Array(arguments.length-1),o=0,r=2,i=!0;for(;r<arguments.length;)n[o++]=arguments[r++];return new Promise(function(r,s){n[o]=function(e){if(i)if(i=!1,e)s(e);else{for(var t=new Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];r.apply(null,t)}};try{e.apply(t||null,n)}catch(e){i&&(i=!1,s(e))}})}},function(module,exports,__webpack_require__){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},function(e,t,n){"use strict";t.Service=n(85)},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";e.exports=function(e){for(var t,n=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(i.compareFieldsById),u=0;u<a.length;++u){var l=a[u].resolve(),c=e._fieldsArray.indexOf(l),p=l.resolvedType instanceof o?"int32":l.type,d=r.basic[p];t="m"+i.safeProp(l.name),l.map?(n("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,l.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(l.id<<3|2)>>>0,8|r.mapKey[l.keyType],l.keyType),void 0===d?n("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,t):n(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|d,p,t),n("}")("}")):l.repeated?(n("if(%s!=null&&%s.length){",t,t),l.packed&&void 0!==r.packed[p]?n("w.uint32(%i).fork()",(l.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(n("for(var i=0;i<%s.length;++i)",t),void 0===d?s(n,l,c,t+"[i]"):n("w.uint32(%i).%s(%s[i])",(l.id<<3|d)>>>0,p,t)),n("}")):(l.optional&&n("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,l.name),void 0===d?s(n,l,c,t):n("w.uint32(%i).%s(%s)",(l.id<<3|d)>>>0,p,t))}return n("return w")};var o=n(8),r=n(12),i=n(4);function s(e,t,n,o){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",n,o,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",n,o,(t.id<<3|2)>>>0)}},function(e,t,n){"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter(function(e){return e.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break");t("switch(t>>>3){");for(var n=0;n<e.fieldsArray.length;++n){var a=e._fieldsArray[n].resolve(),u=a.resolvedType instanceof o?"int32":a.type,l="m"+i.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",l)("%s={}",l)("var c2 = r.uint32()+r.pos"),void 0!==r.defaults[a.keyType]?t("k=%j",r.defaults[a.keyType]):t("k=null"),void 0!==r.defaults[u]?t("value=%j",r.defaults[u]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===r.basic[u]?t("value=types[%i].decode(r,r.uint32())",n):t("value=r.%s()",u),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==r.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',l):t("%s[k]=value",l)):a.repeated?(t("if(!(%s&&%s.length))",l,l)("%s=[]",l),void 0!==r.packed[u]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",l,u)("}else"),void 0===r.basic[u]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",l,n):t("%s.push(r.%s())",l,u)):void 0===r.basic[u]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",l,n):t("%s=r.%s()",l,u),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),n=0;n<e._fieldsArray.length;++n){var c=e._fieldsArray[n];c.required&&t("if(!m.hasOwnProperty(%j))",c.name)("throw util.ProtocolError(%j,{instance:m})",s(c))}return t("return m")};var o=n(8),r=n(12),i=n(4);function s(e){return"missing required '"+e.name+"'"}},function(e,t,n){"use strict";e.exports=function(e){var t=r.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),n=e.oneofsArray,o={};n.length&&t("var p={}");for(var u=0;u<e.fieldsArray.length;++u){var l=e._fieldsArray[u].resolve(),c="m"+r.safeProp(l.name);if(l.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",c,l.name),l.map)t("if(!util.isObject(%s))",c)("return%j",i(l,"object"))("var k=Object.keys(%s)",c)("for(var i=0;i<k.length;++i){"),a(t,l,"k[i]"),s(t,l,u,c+"[k[i]]")("}");else if(l.repeated)t("if(!Array.isArray(%s))",c)("return%j",i(l,"array"))("for(var i=0;i<%s.length;++i){",c),s(t,l,u,c+"[i]")("}");else{if(l.partOf){var p=r.safeProp(l.partOf.name);1===o[l.partOf.name]&&t("if(p%s===1)",p)("return%j",l.partOf.name+": multiple values"),o[l.partOf.name]=1,t("p%s=1",p)}s(t,l,u,c)}l.optional&&t("}")}return t("return null")};var o=n(8),r=n(4);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,n,r){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(%s){",r)("default:")("return%j",i(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",n,r)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",r)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",r,r,r,r)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',r)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',r)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",r)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',r,r,r)("return%j",i(t,"buffer"))}return e}function a(e,t,n){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",n)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",n)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",n)("return%j",i(t,"boolean key"))}return e}},function(e,t,n){"use strict";var o=t,r=n(8),i=n(4);function s(e,t,n,o){if(t.resolvedType)if(t.resolvedType instanceof r){e("switch(d%s){",o);for(var i=t.resolvedType.values,s=Object.keys(i),a=0;a<s.length;++a)t.repeated&&i[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",i[s[a]])("m%s=%j",o,i[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,n,o);else{var u=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,u)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,u?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function a(e,t,n,o){if(t.resolvedType)t.resolvedType instanceof r?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",o,n,o,o):e("d%s=types[%i].toObject(m%s,o)",o,n,o);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,i?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}o.fromObject=function(e){var t=e.fieldsArray,n=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return n("return new this.ctor");n("var m=new this.ctor");for(var o=0;o<t.length;++o){var a=t[o].resolve(),u=i.safeProp(a.name);a.map?(n("if(d%s){",u)('if(typeof d%s!=="object")',u)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",u),s(n,a,o,u+"[ks[i]]")("}")("}")):a.repeated?(n("if(d%s){",u)("if(!Array.isArray(d%s))",u)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",u)("for(var i=0;i<d%s.length;++i){",u),s(n,a,o,u+"[i]")("}")("}")):(a.resolvedType instanceof r||n("if(d%s!=null){",u),s(n,a,o,u),a.resolvedType instanceof r||n("}"))}return n("return m")},o.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var n=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),o=[],s=[],u=[],l=0;l<t.length;++l)t[l].partOf||(t[l].resolve().repeated?o:t[l].map?s:u).push(t[l]);if(o.length){for(n("if(o.arrays||o.defaults){"),l=0;l<o.length;++l)n("d%s=[]",i.safeProp(o[l].name));n("}")}if(s.length){for(n("if(o.objects||o.defaults){"),l=0;l<s.length;++l)n("d%s={}",i.safeProp(s[l].name));n("}")}if(u.length){for(n("if(o.defaults){"),l=0;l<u.length;++l){var c=u[l],p=i.safeProp(c.name);if(c.resolvedType instanceof r)n("d%s=o.enums===String?%j:%j",p,c.resolvedType.valuesById[c.typeDefault],c.typeDefault);else if(c.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,c.typeDefault.toString(),c.typeDefault.toNumber());else if(c.bytes){var d="["+Array.prototype.slice.call(c.typeDefault).join(",")+"]";n("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,c.typeDefault))("else{")("d%s=%s",p,d)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else n("d%s=%j",p,c.typeDefault)}n("}")}var h=!1;for(l=0;l<t.length;++l){c=t[l];var f=e._fieldsArray.indexOf(c);p=i.safeProp(c.name);c.map?(h||(h=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),a(n,c,f,p+"[ks2[j]]")("}")):c.repeated?(n("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),a(n,c,f,p+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",p,c.name),a(n,c,f,p),c.partOf&&n("if(o.oneofs)")("d%s=%j",i.safeProp(c.partOf.name),c.name)),n("}")}return n("return d")}},function(e,t,n){"use strict";var o=t,r=n(33);o[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),n=this.lookup(t);if(n){var o="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===o.indexOf("/")&&(o="/"+o),this.create({type_url:o,value:n.encode(n.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var n="",o="";if(t&&t.json&&e.type_url&&e.value){o=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(o);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof r){var s=e.$type.toObject(e,t);return""===n&&(n="type.googleapis.com/"),o=n+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),s["@type"]=o,s}return this.toObject(e,t)}}},function(e,t,n){"use strict";e.exports=h;var o=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,i=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,s=/^ *[*\/]+ */,a=/^\s*\*?\/*/,u=/\n/g,l=/\s/,c=/\\(.?)/g,p={0:"\0",r:"\r",n:"\n",t:"\t"};function d(e){return e.replace(c,function(e,t){switch(t){case"\\":case"":return t;default:return p[t]||""}})}function h(e,t){e=e.toString();var n=0,c=e.length,p=1,h=null,f=null,g=0,m=!1,y=!1,b=[],I=null;function v(e){return Error("illegal "+e+" (line "+p+")")}function O(t){return e.charAt(t)}function w(n,o,r){h=e.charAt(n++),g=p,m=!1,y=r;var i,l=n-(t?2:3);do{if(--l<0||"\n"===(i=e.charAt(l))){m=!0;break}}while(" "===i||"\t"===i);for(var c=e.substring(n,o).split(u),d=0;d<c.length;++d)c[d]=c[d].replace(t?a:s,"").trim();f=c.join("\n").trim()}function S(t){var n=k(t),o=e.substring(t,n);return/^\s*\/{1,2}/.test(o)}function k(e){for(var t=e;t<c&&"\n"!==O(t);)t++;return t}function _(){if(b.length>0)return b.shift();if(I)return function(){var t="'"===I?i:r;t.lastIndex=n-1;var o=t.exec(e);if(!o)throw v("string");return n=t.lastIndex,P(I),I=null,d(o[1])}();var s,a,u,h,f,g=0===n;do{if(n===c)return null;for(s=!1;l.test(u=O(n));)if("\n"===u&&(g=!0,++p),++n===c)return null;if("/"===O(n)){if(++n===c)throw v("comment");if("/"===O(n))if(t){if(h=n,f=!1,S(n)){f=!0;do{if((n=k(n))===c)break;n++}while(S(n))}else n=Math.min(c,k(n)+1);f&&w(h,n,g),p++,s=!0}else{for(f="/"===O(h=n+1);"\n"!==O(++n);)if(n===c)return null;++n,f&&w(h,n-1,g),++p,s=!0}else{if("*"!==(u=O(n)))return"/";h=n+1,f=t||"*"===O(h);do{if("\n"===u&&++p,++n===c)throw v("comment");a=u,u=O(n)}while("*"!==a||"/"!==u);++n,f&&w(h,n-2,g),s=!0}}}while(s);var m=n;if(o.lastIndex=0,!o.test(O(m++)))for(;m<c&&!o.test(O(m));)++m;var y=e.substring(n,n=m);return'"'!==y&&"'"!==y||(I=y),y}function P(e){b.push(e)}function T(){if(!b.length){var e=_();if(null===e)return null;P(e)}return b[0]}return Object.defineProperty({next:_,peek:T,push:P,skip:function(e,t){var n=T();if(n===e)return _(),!0;if(!t)throw v("token '"+n+"', '"+e+"' expected");return!1},cmnt:function(e){var n=null;return void 0===e?g===p-1&&(t||"*"===h||m)&&(n=y?f:null):(g<e&&T(),g!==e||m||!t&&"/"!==h||(n=y?null:f)),n}},"line",{get:function(){return p}})}h.unescape=d},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var o=new Uint8Array(16);e.exports=function(){return n(o),o}}else{var r=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}},function(e,t){for(var n=[],o=0;o<256;++o)n[o]=(o+256).toString(16).substr(1);e.exports=function(e,t){var o=t||0,r=n;return[r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]]].join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(t.WebSocketState||(t.WebSocketState={}))},function(e,t,n){"use strict";function o(e){return null!==e&&"object"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t.looseEqual=function e(t,n){if(t===n)return!0;var r=o(t),i=o(n);if(!r||!i)return!r&&!i&&String(t)===String(n);try{var s=Array.isArray(t),a=Array.isArray(n);if(s&&a)return t.length===n.length&&t.every(function(t,o){return e(t,n[o])});if(t instanceof Date&&n instanceof Date)return t.getTime()===n.getTime();if(s||a)return!1;var u=Object.keys(t),l=Object.keys(n);return u.length===l.length&&u.every(function(o){return e(t[o],n[o])})}catch(e){return!1}}},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(38),s=n(59),a=n(5),u=n(3),l=n(7),c=n(35),p=n(13),d=n(20),h=n(16),f=n(14),g=n(170),m=n(22),y=n(21),b=new u.Logger("Channel"),I=["Online/RTChannel/","RTChannel/"],v=9e5,O=20;class w{constructor(e,t,n){this.channelInfos=[],this.queueEnable=!1,this.pollChannelTimer=[],this.region=null,this.channelId=null,this.handlers={},this.mutex=new c.default,this.hummer=e,r.default.isEmpty(n)&&b.warn("constructor: channelId invalid!"),this.channelId=n,this.region=t,this.env=l.parseEnvParams(t),null!=this.env?(this.initChannelPollTimer(),this.addEventListener(),this.start()):b.error("constructor: region error")}get queueCount(){return l.QUEUE_COUNT}get h5_g_globals(){return this.hummer.h5_g_globals}get appid(){return this.h5_g_globals.appid}get ap(){return this.hummer.ap}get uid(){return this.h5_g_globals.uid}set uid(e){this.h5_g_globals.uid=e}get joinedChannels(){return this.h5_g_globals.joinedChannels}get connectState(){return this.ap.connectState}set connectState(e){this.ap.connectState=e}get connected(){return this.ap.connectState.state==l.ConnectionState.CONNECTED}get regionChannelId(){return`${this.region}:${this.channelId}`}isValidQueueId(e){return!!(e<this.queueCount&&this.channelInfos[e])}addEventListener(){this.ap.on(f.AP_EVENTS.CONNECTION_STATE_CHANGED,e=>{this.onConnectionStateChange(e)}),this.ap.on(f.AP_EVENTS.BROADCAST_V2,e=>{this.onBroadcast(e)}),this.ap.on(f.AP_EVENTS.TRY_LOGOUT,()=>{this.queueEnable&&this.leaveChannel().catch(e=>{b.log("leaveChannel: e=",e),this.queueEnable=!1})})}get cimService(){return`svc_${this.env.area}_cim_${this.env.type}_${this.env.name}_proxy`}get regionCode(){return"china"===this.env.area||"shenzhen"===this.env.area?"chn":this.env.area}get autherService(){return`svc_${this.regionCode}_chatroom_auther`}start(){this.onConnectionStateChange(this.connectState)}stop(){this.clearChannelTimer(),this.queueEnable=!1}getFirstGrpSysMaxSeqId(e){return o(this,void 0,void 0,function*(){if(!e)return;const t=l.getMutexKey(l.MutexKey.getChannelMaxSeqId,`${e.state}:${e.queueId}`);try{yield this.mutex.wait(t),this.mutex.lock(t);const n=yield this.getGrpSysMaxSeqId(e.state,e.queueId);b.log(`getFirstGrpSysMaxSeqId[${e.state}:${e.queueId}]: res=`,n,typeof n.maxSeqId),n&&0===n.code&&(e.receivedBcMaxSeqId=n.maxSeqId,e.hasBcFirstGetMaxSeqSuccess=!0,b.log(`getFirstGrpSysMaxSeqId[${e.state}:${e.queueId}]: receivedBcMaxSeqId=`,e.receivedBcMaxSeqId.toString()),this.pullGroupSysMsgIfAny(e.state,e.queueId),this.pollChannelTimer[e.state][e.queueId]||(this.pollChannelTimer[e.state][e.queueId]=setInterval(this.pullGroupMsgPeriod.bind(this),v,e.state,e.queueId)))}catch(t){b.warn(`getFirstGrpSysMaxSeqId[${e.state}:${e.queueId}] failed`,t)}finally{this.mutex.unlock(t)}})}onConnectionStateChange(e){switch(e.state){case l.ConnectionState.RECONNECTING:break;case l.ConnectionState.CONNECTED:this.pullGroupMsgPeriodForQueue(),this.queueEnable&&this.joinChannelBc();break;case l.ConnectionState.DISCONNECTED:e.reason===l.ConnectionChangeReason.LOGOUT&&this.stop()}}onBroadcast(e){const t=this.decodeBroadcastRes(e);t instanceof i.proto.IMPushGroupSysMsgRequest?this.onReceivePushGroupMsgRequest(t):b.debug("ignore onBroadcast")}decodeBroadcastRes(e){return s.default.decodeBroadcastRes(e)}decodeRouteRes(e){return s.default.decodeRouteRes(e)}onReceivePushGroupMsgRequest(e){if(e.region!==this.env.region||e.envType!==this.env.type||e.envName!==this.env.name)return void b.debug("ignore IMPushGroupSysMsgRequest as it not match env:",this.env);const{state:t,channelId:n}=this.getChannelIdFromTopic(e.topic);if(t===l.LineState.UNKOWN||n!==this.channelId)return void b.debug("IMPushGroupSysMsgRequest: not found group_id="+e.groupId.toString()+" regionChannelId="+this.regionChannelId+" queueId="+e.queueId);const o=e.queueId||0;if(!this.isValidQueueId(o))return void b.warn(`onReceivePushGroupMsgRequest: queue[${o}] not exists`);b.log(`onReceivePushGroupMsgRequest[${t}:${o}]:`,e);const r=this.channelInfos[t][o];if(r.isPulling)b.debug(`onReceivePushGroupMsgRequest[${o}]: pulling is going...`);else if(e.prevSeqId&&e.prevSeqId.equals(r.receivedBcMaxSeqId))r.receivedBcMaxSeqId=e.seqId,b.log(`onReceivePushGroupMsgRequest receivedBcMaxSeqId[${r.state}:${r.queueId}] is updated to`,r.receivedBcMaxSeqId.toString()),this.processReliableChannelMsg(e.msg);else{if(r.receivedBcMaxSeqId.greaterThanOrEqual(e.seqId))return;if(!r.hasBcFirstGetMaxSeqSuccess)return void b.log("receive channel push msg. but wait for first get max seq success");this.pullGroupSysMsgIfAny(r.state,r.queueId).catch(e=>{b.warn("pullGroupsysMsgIfAny: e=",e)})}}pullGroupSysMsgIfAny(e,t){return o(this,void 0,void 0,function*(){let n=this.channelInfos[e][t];if(n&&!n.isPulling)try{n.isPulling=!0;const e=yield this.pullGroupSysMsgOnce(n);e&&e.hasMore&&(b.log("has more. schedule a new pull"),setTimeout(this.pullGroupSysMsgIfAny.bind(this),100,n.queueId))}catch(e){b.warn("pull channel msgs: ",e),n.isPulling=!1}finally{n.isPulling=!1}})}notifyChannelMessageListener(e){for(const t of e.msgs)this.processReliableChannelMsg(t)}processReliableChannelMsg(e){let t=new Uint8Array(e.content.byteLength);switch(t.set(e.content,0),e.content=null,e.action){case i.proto.Action.kP2CMessage:{let e=new g.default;e.unmarshall(t);let n=e.toMessage();this.emit(f.CHANNEL_EVENTS.CHANNEL_MESSAGE,n);break}default:b.debug("unexpected channel action:",e.action)}}pullGroupMsgPeriodForQueue(){if(this.queueEnable){b.log(`pullGroupMsgPeriodForQueue[${this.regionChannelId}]`);for(let e=0;e<l.LineState.TOTAL_SIZE;e++)for(let t of this.channelInfos[e])setTimeout(this.pullGroupMsgPeriod.bind(this),200,t.state,t.queueId)}}pullGroupMsgPeriod(e,t){return o(this,void 0,void 0,function*(){if(!this.queueEnable)return;const n=this.channelInfos[e][t];if(this.connected&&n&&!n.isPulling){b.debug(`pullGroupMsgPeriod[${this.regionChannelId}][${t}]`);try{n.isPulling=!0;const e=yield this.pullGroupSysMsgOnce(n);e&&e.hasMore&&setTimeout(this.pullGroupMsgPeriod.bind(this),100,n.state,n.queueId)}catch(e){b.warn("pullGroupMsgPeriod:",e),n.isPulling=!1}finally{n.isPulling=!1}}})}pullGroupSysMsgOnce(e){return o(this,void 0,void 0,function*(){if(!e)return null;const t={startSeqId:e.receivedBcMaxSeqId,limit:l.SIZE_LIMIT,channelId:this.channelId,queueId:e.queueId,state:e.state};b.debug(`pullGroupSysMsg[${this.regionChannelId}][${e.queueId}]: req=`,t);const n=yield this.pullGroupSysMsg(t);return b.debug(`pullGroupSysMsg[${this.regionChannelId}][${e.queueId}]: res=`,n),n.maxSeqId instanceof a&&n.maxSeqId.greaterThan(0)?(e.receivedBcMaxSeqId=n.maxSeqId,b.log(`pullGroupSysMsgOnce receivedBcMaxSeqId[${e.queueId}] is updated to`,e.receivedBcMaxSeqId.toString())):b.log(`pullGroupSysMsgOnce[${e.queueId}]: has_more=`,n.hasMore),n instanceof i.proto.PullGroupSysMsgResponse?(this.notifyChannelMessageListener(n),n):(b.debug(`pullGroupSysMsgOnce[${e.queueId}]: unkown group msg`),null)})}initChannelStatus(){for(let e=0;e<l.LineState.TOTAL_SIZE;e++){this.channelInfos.push([]);for(let t=0;t<this.queueCount;t++)this.channelInfos[e][t]={state:e,queueId:t,hasBcFirstGetMaxSeqSuccess:!1,receivedBcMaxSeqId:a.UZERO,maxBcPushSeqId:a.UZERO,isPulling:!1}}b.debug("channelInfos=",this.channelInfos)}initQueue(){return o(this,void 0,void 0,function*(){if(!this.queueEnable)try{this.queueEnable=!0,this.initChannelStatus();for(let e=0;e<l.LineState.TOTAL_SIZE;e++)for(let t=0;t<this.queueCount;t++){let n=this.channelInfos[e][t];n.hasBcFirstGetMaxSeqSuccess?this.pullGroupMsgPeriod(e,t).catch(e=>{}):this.getFirstGrpSysMaxSeqId(n).catch(n=>{b.warn(`getFirstGrpSysMaxSeqId[${this.regionChannelId}][${e}:${t}]: e=`,n)})}}catch(e){b.warn("initQueue: e=",e)}})}getGrpSysMaxSeqId(e,t=0){return o(this,void 0,void 0,function*(){const n=I[e]+this.channelId;let o=this.calcDJBHash(n);const r=i.proto.GetGrpSysMaxSeqIdRequest;let s=r.create({logId:this.generateLogId(),appId:a.fromNumber(this.appid),selfUid:a.fromString(this.uid),groupId:o,topic:n,queueId:t});b.log(`getGrpSysMaxSeqId[${e}:${t}]: req=`,s,"logId=",s.logId.toString());let u=r.encode(s).finish();const c=yield this.send(this.cimService,"cim.proto.ProxyService.GetGrpSysMaxSeqId",u);return c instanceof i.proto.GetGrpSysMaxSeqIdResponse?0===c.code?(b.log(`getGrpSysMaxSeqId[${e}:${t}] res= `,c,", type=",typeof c.maxSeqId),"number"==typeof c.maxSeqId?{code:c.code,maxSeqId:a.fromNumber(c.maxSeqId)}:{code:c.code,maxSeqId:c.maxSeqId}):(b.warn("getGrpSysMaxSeqId failed",c),{code:c.code,msg:c.msg}):(b.warn(`getGrpSysMaxSeqId[${e}:${t}]: unexpected res=`,c),{code:l.UNKOWN,msg:"unexpected response: "+c})})}joinChannel(){return this.h5_g_globals.isAnonymous?Promise.resolve({rescode:l.kAnonymousOperation,msg:l.kAnonymousTips}):this.connected?l.checkChannelId(this.channelId)?-1!==this.joinedChannels.indexOf(this.regionChannelId)?Promise.resolve({rescode:5110,msg:"Already joined"}):this.joinedChannels.length>=O?Promise.resolve({rescode:5109,msg:"Channel count Limit"}):new Promise((e,t)=>o(this,void 0,void 0,function*(){try{yield this.mutex.wait(l.MutexKey.joinChannel),this.mutex.lock(l.MutexKey.joinChannel);const n=yield this.joinChannelBcV2(this.channelId);n&&0===n.rescode&&(this.queueEnable||this.initQueue(),this.addChannelId(this.regionChannelId)),e(n)}catch(e){this.queueEnable=!1,t(e)}finally{this.mutex.unlock(l.MutexKey.joinChannel)}})):Promise.resolve({rescode:l.kInvalid_Parameters,msg:l.INVALID_PARAMETERS}):Promise.resolve({rescode:l.kOperationTimeout,msg:l.OPERATION_TIMEOUT})}leaveChannel(){return this.h5_g_globals.isAnonymous?Promise.resolve({rescode:l.kAnonymousOperation,msg:l.kAnonymousTips}):l.checkChannelId(this.channelId)?-1===this.joinedChannels.indexOf(this.regionChannelId)?Promise.resolve({rescode:5101,msg:"User Not In Channel"}):this.connected?new Promise((e,t)=>o(this,void 0,void 0,function*(){try{yield this.mutex.wait(l.MutexKey.leaveChannel),this.mutex.lock(l.MutexKey.leaveChannel);const n=yield this.leaveChannelBcV2(this.channelId);n&&0===n.rescode&&(this.clearChannelInfo(),this.deleteChannelId(this.regionChannelId)),e(n)}catch(e){t(e)}finally{this.mutex.unlock(l.MutexKey.leaveChannel)}})):Promise.resolve({rescode:l.kOperationTimeout,msg:l.OPERATION_TIMEOUT}):Promise.resolve({rescode:l.kInvalid_Parameters,msg:l.INVALID_PARAMETERS})}sendP2CMessage(e){return this.h5_g_globals.isAnonymous?Promise.resolve({rescode:l.kAnonymousOperation,msg:l.kAnonymousTips}):this.connected?l.checkChannelId(this.channelId)?-1===this.joinedChannels.indexOf(this.regionChannelId)?Promise.resolve({rescode:5101,msg:"User Not In Channel"}):new Promise((t,n)=>o(this,void 0,void 0,function*(){try{let o=new g.default;o.appid=this.appid,o.opUid=this.uid,o.channelId=this.channelId,o.region=this.region;const i=e.message;switch(i.msgType){case h.MsgType.TEXT:o.type=h.MsgType.TEXT;let e=new m.default;e.text=i.content,o.content=e.marshall()}if(0===i.content.length&&0===Object.keys(e.appExtras).length)return t({rescode:l.kInvalid_Parameters,msg:l.INVALID_PARAMETERS});e.options&&(o.isOffline=e.options.isOffline||!1),o.uuid=y(),o.timestamp=(new Date).getTime(),e.appExtras&&(o.extensions=r.default.toMap(e.appExtras));let s=o.marshall();b.debug("sendP2CMessage: pkg=",o);const a=yield this.send(this.autherService,"SendP2CMessage",s);t(a)}catch(e){n(e)}})):Promise.resolve({rescode:l.kInvalid_Parameters,msg:l.INVALID_PARAMETERS}):Promise.resolve({rescode:l.kOperationTimeout,msg:l.OPERATION_TIMEOUT})}pullGroupSysMsg(e){return o(this,void 0,void 0,function*(){if(r.default.isEmpty(e.startSeqId))return Promise.reject({code:l.UNKOWN,msg:"startSeqId is empty!"});if(0===e.limit)return Promise.reject({code:l.UNKOWN,msg:"limit is zero!"});let t;t="string"==typeof e.startSeqId?a.fromString(e.startSeqId):e.startSeqId,b.debug(`pullGroupSysMsg[${e.queueId}]: startSeqId=`,t,"req=",e);let n=I[e.state]+e.channelId,o=this.calcDJBHash(n);const s=i.proto.PullGroupSysMsgRequest;let u=s.create({logId:this.generateLogId(),appId:a.fromNumber(this.appid),selfUid:a.fromString(this.uid),groupId:o,exclusiveStartSeqId:t,limit:e.limit,statisDeliveryDelay:!0,topic:n,queueId:e.queueId});b.log(`pullGroupSysMsg[${e.queueId}]: req=`,u);let c=s.encode(u).finish();const p=yield this.send(this.cimService,"cim.proto.ProxyService.PullGroupSysMsg",c);return p instanceof i.proto.PullGroupSysMsgResponse?(b.log(`pullGroupSysMsg[${e.queueId}]: res=`,p),0===p.code?p:{code:p.code,msg:p.msg}):(b.warn(`pullGroupSysMsg[${e.queueId}]: unexpected res=`,p),{code:l.UNKOWN,msg:"unexpected response: "+p})})}joinChannelBcV2(e){return new Promise((t,n)=>o(this,void 0,void 0,function*(){try{let o={subs:this.genUserGroupId(e)};const r=yield this.subscribeBcV2(o);t({rescode:r.rescode,msg:r.msg})}catch(e){n(e)}}))}joinChannelBc(){this.queueEnable&&this.joinChannelBcV2(this.channelId).catch(e=>{b.warn(e)})}leaveChannelBcV2(e){return o(this,void 0,void 0,function*(){return new Promise((t,n)=>o(this,void 0,void 0,function*(){try{let o={unsubs:this.genUserGroupId(e)};const r=yield this.subscribeBcV2(o);t({rescode:r.rescode,msg:r.msg})}catch(e){n(e)}}))})}genUserGroupId(e){let t=[];for(let n=0;n<l.LineState.TOTAL_SIZE;n++){let o=I[n]+e,r=this.calcDJBHash(o),i=`hydra:${this.region}:${o}:${r}`;t.push(i)}return t}subscribeBcV2(e){return o(this,void 0,void 0,function*(){return this.ap.subscribeBcV2(e)})}clearChannelInfo(){this.channelInfos=[],this.queueEnable=!1}deleteChannelId(e){let t=this.joinedChannels.indexOf(e);-1!==t&&this.joinedChannels.splice(t,1)}addChannelId(e){-1===this.joinedChannels.indexOf(e)&&this.joinedChannels.push(e)}clearChannelTimer(){for(let e=l.LineState.ONLINE;e<l.LineState.TOTAL_SIZE;e++)for(const t of this.pollChannelTimer[e])clearInterval(t);this.initChannelPollTimer()}initChannelPollTimer(){this.pollChannelTimer=new Array([],[])}send(e,t,n){return this.h5_g_globals.bLostConnection?Promise.reject({rescode:l.kOperationTimeout,msg:l.OPERATION_TIMEOUT}):new Promise((r,i)=>o(this,void 0,void 0,function*(){try{const o=yield this.ap.sendData(this.appid,e,t,n),s=this.decodeRouteRes(o);r(s)}catch(e){i(e)}}))}}t.default=w,l.applyMixins(w,[p.Emitter,d.Base])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(28),r=n(3),i=n(5),s=n(38),a=n(167),u=n(168),l=n(169),c=n(37),p=n(23),d=n(24);o.util.Long=i,o.configure();const h=new r.Logger("ChannelProtocol");t.default=class{static decodeRouteRes(e){h.debug("decodeRouteRes:",e);try{if("cim.proto.ProxyService.SetUserRegion"==e.fnName)return c.hummerProto.SetUserRegionResponse.decode(new Uint8Array(e.data));if("CreateChatRoom"==e.fnName){let t=new p.default;return t.unmarshall(e.data),t}if("GetUserCount"==e.fnName){let t=new d.default;return t.unmarshall(e.data),t}if("BatchCheckUserStatus"==e.fnName){let t=new a.default;return t.unmarshall(e.data),t}if("SendP2PMessage"==e.fnName){let t=new u.default;return t.unmarshall(e.data),t}if("SendP2CMessage"==e.fnName){let t=new l.default;return t.unmarshall(e.data),t}if("cim.proto.ProxyService.GetQueueConfig"==e.fnName)return s.proto.GetQueueConfigResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.GetMaxSeqId"==e.fnName)return s.proto.GetMaxSeqIdResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.PullMsg"==e.fnName)return s.proto.PullMsgResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.GroupSignal"==e.fnName)return s.proto.GroupSignalResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.GetGrpSysMaxSeqId"==e.fnName)return s.proto.GetGrpSysMaxSeqIdResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.PullGroupSysMsg"==e.fnName)return s.proto.PullGroupSysMsgResponse.decode(new Uint8Array(e.data));h.info("decodeRouteRes: unexpected msg: "+e)}catch(e){h.warn("decodeRouteRes: failed to decode msg:"+e)}return null}static decodeUnicastRes(e){h.debug("decodeUnicastRes:",e);try{if("cim.proto.PushService.IMPushMsg"==e.fnName)return s.proto.IMPushMsgRequest.decode(new Uint8Array(e.data));h.info("decodeUnicastRes: unexpected msg: "+e)}catch(e){h.warn("decodeUnicastRes: failed to decode msg:"+e)}return null}static decodeBroadcastRes(e){h.debug("decodeBroadcastRes:",e);try{if("cim.proto.PushService.IMPushGroupSysMsg"==e.fnName)return s.proto.IMPushGroupSysMsgRequest.decode(new Uint8Array(e.data));h.log("decodeBroadcastRes: unexpected msg: "+e)}catch(e){h.warn("decodeBroadcastRes: failed to decode msg:"+e)}return null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(61),r=n(129),i=n(7),s=n(3),a=n(131),u=n(58),l=n(16),c=new s.Logger("ChatroomAndSvc");class p extends a.default{constructor({appid:e}){super({appid:e})}createChatRoomInstance(e){let t=`${e.region}:${e.roomid}`;if(this.chatrooms[t])return c.info(`createChatRoomInstance: [${t}] exists!`),this.chatrooms[t].chatroom;let n=new o.default(this,e.roomid,e.region);return this.chatrooms[t]={chatroom:n,region:e.region,roomid:e.roomid},c.info(`createChatRoomInstance: [${t}]`),n}createChannel(e){let t=`${e.region}:${e.channelId}`,n=this.channels.get(t);if(void 0!==n)return c.info(`createChannel: [${t}] exists!`),n.channel;let o=new u.default(this,e.region,e.channelId);return this.channels.set(t,{channel:o,region:e.region,channelId:e.channelId}),c.info(`createChannel: [${t}]`),o}createSvcInstance(){return this.svc?(c.info("svc instance exists!"),this.svc):(this.svc=new r.default(this),c.info("createSvcInstance"),this.svc)}}const d=function(){let e;return function(t){return e||(e=new p(t)),e}}();t.default={VERSION:"2.2.1",createHummer:d,ConnectionChangeReason:i.ConnectionChangeReason,ConnectionState:i.ConnectionState,createMessage:l.createMessage}},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(6),s=n(5),a=n(3),u=n(2),l=n(64),c=n(65),p=n(66),d=n(67),h=n(68),f=n(69),g=n(70),m=n(71),y=n(72),b=n(99),I=n(100),v=n(101),O=n(102),w=n(103),S=n(104),k=n(105),_=n(106),P=n(107),T=n(108),U=n(109),x=n(110),E=n(111),M=n(112),R=n(113),C=n(114),A=n(35),j=n(7),N=n(25),q=n(115),L=n(13),B=n(20),D=n(14),G=n(117),V=n(118),H=n(119),F=n(120),$=n(121),K=n(122),J=n(123),z=n(124),W=n(125),X=n(126),Z=n(21),Q=new a.Logger("ChatRoom"),Y="ChatRoom/",ee=["ChatRoom/","ChatRoom/Chat/"],te=100,ne=3e5,oe=9e5;var re,ie;!function(e){e[e.UNKOWN=-1]="UNKOWN",e[e.BC=0]="BC",e[e.TEXT=1]="TEXT",e[e.TOTAL_SIZE=2]="TOTAL_SIZE"}(re=t.MsgType||(t.MsgType={})),function(e){e[e.PEER=1]="PEER",e[e.GROUP=2]="GROUP"}(ie||(ie={}));class se{constructor(e,t,n){this.roomid=0,this.region="cn",this.queueEnable=!1,this.chatroomInfos=[],this.heartbeat={need_ping:0,heartbeat_duration:20,pollHeartbeatTimer:null},this.emitOffline=!1,this.offlineTimer=null,this.pollChannelTimer=[],this.offline_check_duration=75,this.peerInfos=[],this.pollTimer=[],this.handlers={},this.mutex=new A.default,this.hummer=e,r.default.isNumber(t)||Q.warn("constructor: roomid must be number"),this.region=n,this.roomid=t,this.env=j.parseEnvParams(n),this.env?(this.userEnv=j.parseEnvParams(this.userRegion),this.userEnv||Q.warn("constructor: userRegion error"),this.initChannelPollTimer(),this.addEventListener()):Q.error("constructor: region error")}get queueCount(){return j.QUEUE_COUNT}get ap(){return this.hummer.ap}get appid(){return this.h5_g_globals.appid}get uid(){return this.h5_g_globals.uid}get h5_g_globals(){return this.hummer.h5_g_globals}get userRegion(){return this.h5_g_globals.userRegion}isValidQueueId(e,t){switch(e){case ie.PEER:return!!(t<this.queueCount&&this.peerInfos[t]);case ie.GROUP:return!!(t<this.queueCount&&this.chatroomInfos[t]);default:return!1}}addEventListener(){Q.debug("addEventListener"),this.ap.on(D.AP_EVENTS.CONNECTION_STATE_CHANGED,e=>{this.onConnectStateChange(e)}),this.ap.on(D.AP_EVENTS.BROADCAST_V2,e=>{this.onBroadcast(e)}),this.ap.on(D.AP_EVENTS.UNICAST,e=>{this.onUnicast(e)}),this.ap.on(D.AP_EVENTS.TRY_LOGOUT,()=>{this.queueEnable&&this.leaveChatRoom().catch(e=>{Q.log("leaveChatRoom: e=",e),this.leaveOp()})})}initPeerStatus(){for(let e=0;e<this.queueCount;e++)this.peerInfos[e]={queueId:e,hasFirstGetMaxSeqSuccess:!1,receivedMaxSeqId:s.UZERO,maxPushSeqId:s.UZERO}}initChatRoomStatus(){for(let e=0;e<re.TOTAL_SIZE;e++){this.chatroomInfos.push([]);for(let t=0;t<this.queueCount;t++)this.chatroomInfos[e][t]={type:e,queueId:t,groupId:s.fromNumber(this.roomid),hasBcFirstGetMaxSeqSuccess:!1,receivedBcMaxSeqId:s.UZERO,maxBcPushSeqId:s.UZERO,isPulling:!1}}Q.debug("channelInfos=",this.chatroomInfos)}get regionCode(){return"china"===this.env.area||"shenzhen"===this.env.area?"chn":this.env.area}get cimUserService(){return`svc_${this.userEnv.area}_cim_${this.userEnv.type}_${this.userEnv.name}_proxy`}get cimService(){return`svc_${this.env.area}_cim_${this.env.type}_${this.env.name}_proxy`}get autherService(){return`svc_${this.regionCode}_chatroom_auther`}get tempService(){return`svc_${this.regionCode}_chatroom_tempservice`}get onlineQueryService(){return`svc_${this.regionCode}_chatroom_online_query_d`}onUnicast(e){const t=y.default.decodeUnicastRes(e,this.regionCode);if(t)if(t instanceof N.chatroomProto.IMPushMsgRequest){Q.debug("onUnicast: res=",t);const e=t.queueId||0;if(!this.isValidQueueId(ie.PEER,e))return;this.onReceivePushMsgRequest(t,this.peerInfos[e])}else{let e=new Uint8Array(t.data.byteLength);e.set(t.data,0);let n=new DataView(e.buffer),o=new u.default(n);o.uri===i.default.PCS_KickOffUserBcURI?this.onPCS_KickOffUserBc(o):Q.debug("onUnicast: unhandle data")}}onReceivePushMsgRequest(e,t){const n=this.getSingleTopic();e.topic===n&&e.region===this.userEnv.region&&e.envType===this.userEnv.type&&e.envName===this.userEnv.name?(Q.debug(`ChatRoom[${this.roomid}]: receive IMPushMsgRequest:`,e),this.queueEnable?(t.maxPushSeqId=e.seqId,t.hasFirstGetMaxSeqSuccess?this.pullMsgIfAny(t.queueId).catch(e=>{Q.warn("pullMsgIfAny failed",e)}):Q.log("receive push msg. but wait for first get max seq success")):Q.debug("onReceivePushMsgRequest: already leave")):Q.debug("ignore IMPushMsgRequest as it not match userEnv=",this.userEnv)}pullMsgIfAny(e){return o(this,void 0,void 0,function*(){const t=j.getMutexKey(j.MutexKey.chatPullMsg,e);try{yield this.mutex.wait(t),this.mutex.lock(t);const n=yield this.pullMsgOnce(e);n&&n.hasMore&&(Q.log("has more. schedule a new pull"),setTimeout(this.pullMsgIfAny.bind(this),100,e))}catch(t){Q.warn(`pull msgs[${e}]: `,t)}finally{this.mutex.unlock(t)}})}pullMsgOnce(e){return o(this,void 0,void 0,function*(){let t=this.peerInfos[e];if(!t)return;if(!t.hasFirstGetMaxSeqSuccess)return Q.log("first GetMaxSeqId request it not finished yet. wait"),null;const n=yield this.pullMsg({startSeqId:t.receivedMaxSeqId,queueId:e,limit:te});return n.maxSeqId instanceof s&&n.maxSeqId.greaterThan(0)?(t.receivedMaxSeqId=n.maxSeqId,Q.log(`receivedMaxSeqId[${e}] is updated to `+t.receivedMaxSeqId.toString())):Q.log(`pullMsgOnce[${e}]: has_more=`+n.hasMore),n instanceof N.chatroomProto.PullMsgResponse?(this.notifyMessageListener(n),n):(Q.log(`pullMsgOnce[${e}]: unkown sys msg`),null)})}notifyMessageListener(e){for(const t of e.msgs)switch(t.action){case N.chatroomProto.Action.kSendUnicastUc:{let e=new Uint8Array(t.content.byteLength);e.set(t.content,0),t.content=null,this.recvUnicastBc(e);break}default:Q.warn("unexpected action:"+t.action)}}onBroadcast(e){const t=y.default.decodeBroadcastRes(e);t&&(t instanceof N.chatroomProto.IMPushGroupSysMsgRequest?this.onReceivePushGroupMsgRequest(t):Q.debug("ignore onBroadcast"))}onReceivePushGroupMsgRequest(e){if(!this.queueEnable)return;if(e.region!==this.env.region||e.envType!==this.env.type||e.envName!==this.env.name)return void Q.debug(`ChatRoom[${this.roomid}]: ignore IMPushGroupSysMsgRequest as it not match env=`,this.env);const t=this.checkChatRoomInfoFromTopic(e.topic);if(t===re.UNKOWN)return void Q.debug(`ChatRoom[${this.roomid}]: IMPushGroupSysMsgRequest not found group_id=`+e.groupId);const n=e.queueId||0;if(!this.isValidQueueId(ie.GROUP,n))return void Q.warn(`onReceivePushGroupMsgRequest: queue[${n}] not exists`);Q.log(`onReceivePushGroupMsgRequest[${n}]:`,e);const o=this.chatroomInfos[t][n];if(o.isPulling)Q.debug(`onReceivePushGroupMsgRequest[${this.roomid}:${n}]: pulling is going...`);else if(e.prevSeqId&&e.prevSeqId.equals(o.receivedBcMaxSeqId))this.processReliableChannelMsg(e.msg),o.receivedBcMaxSeqId=e.seqId;else{if(o.receivedBcMaxSeqId.greaterThanOrEqual(e.seqId))return;if(!o.hasBcFirstGetMaxSeqSuccess)return void Q.log("receive group push msg. but wait for get first max seq");this.pullGroupSysMsgIfAny(o.type,o.queueId).catch(e=>{Q.warn("pullGroupsysMsgIfAny failed:",e)})}}onPCS_DismissChatRoomBc(e){let t=new u.default(e.view),n=new l.default;if(n.unmarshall(t),n.roomid!==this.roomid)return;const o={uid:n.uid,roomid:n.roomid};this.emit(D.CHATROOM_EVENTS.CHATROOM_DISMISSED,o)}onPCS_UpdateChatRoomInfoBc(e){let t=new u.default(e.view),n=new c.default;if(n.unmarshall(t),n.roomid!==this.roomid)return;const o={uid:n.uid,attributes:n.attributes};this.emit(D.CHATROOM_EVENTS.ROOM_ATTRIBUTES_UPDATED,o)}onPCS_UpdateChatRoomRolerBc(e){let t=new u.default(e.view),n=new p.default;if(n.unmarshall(t),n.roomid!==this.roomid)return;const o={admin:n.admin,uid:n.uid,op:n.op,roler:n.roler};Q.log("UpdateRolerBc:",o),this.emit(D.CHATROOM_EVENTS.ROLER_UPDATED,o)}onPCS_KickOffUserBc(e){let t=new u.default(e.view),n=new d.default;if(n.unmarshall(t),n.roomid!==this.roomid)return;n.uid2instanceids[this.uid]!==this.h5_g_globals.instId.toString()?Q.debug("onPCS_KickOffUserBc: not kick: uid2instanceids=",n.uid2instanceids):this.leaveOp();const o={admin:n.admin,tuids:n.tuids,secs:n.secs,reason:n.reason,kicktype:n.type};Q.info(`[${this.region}:${this.roomid}]:${D.CHATROOM_EVENTS.USER_KICKED_OFF}: `+JSON.stringify(o)),this.emit(D.CHATROOM_EVENTS.USER_KICKED_OFF,o)}onPCS_SendBroadcastBc(e){this.h5_g_globals.isAnonymous||this.recvBroadcastBc(e)}recvBroadcastBc(e){let t=new u.default(e.view),n=new h.default;if(n.unmarshall(t),n.roomid!==this.roomid||n.uid===this.uid)return;const o={uid:n.uid,content:n.content,kvExtra:n.extProps};this.emit(D.CHATROOM_EVENTS.GROUP_MESSAGE,o)}recvUnicastBc(e){let t=new C.default;if(t.unmarshall(e),t.roomid!==this.roomid)return;const n={uid:t.uid,content:t.content,receiver:t.receiver,kvExtra:t.extProps};this.emit(D.CHATROOM_EVENTS.SINGLE_USER_MESSAGE,n)}onPCS_TextChatBc(e){let t=new u.default(e.view),n=new f.default;if(n.unmarshall(t),Q.log("onPCS_TextChatBc: local roomid="+this.roomid+", pkg="+JSON.stringify(n)),n.roomid!==this.roomid)return;const o={uid:n.uid,chat:n.chat,extra:n.chatProps,kvExtra:n.extProps};this.emit(D.CHATROOM_EVENTS.TEXTCHAT,o)}decodeTextChat(e){let t=N.chatroomProto.MultiCastMPChatRequest.decode(e.content);if(t.msgType==N.chatroomProto.MsgType.kText){let e=N.chatroomProto.TextMsg.decode(t.content);const n={uid:t.fromId.toString(),chat:e.text,extra:{extra:t.extension},kvExtra:t.extensions};Q.debug("TextChat=",t),this.emit(D.CHATROOM_EVENTS.TEXTCHAT,n)}}onPCS_DisableUserTextBc(e){let t=new u.default(e.view),n=new V.default;if(n.unmarshall(t),n.roomid!==this.roomid)return;const o={opUid:n.opUid,tuids:n.tuids,secs:n.secs,reason:n.reason};n.disable?this.emit(D.CHATROOM_EVENTS.USERS_MUTED,o):this.emit(D.CHATROOM_EVENTS.USERS_UNMUTED,o)}onPCS_ChatRoomUserCountBc(e){let t=new u.default(e.view),n=new g.default;if(n.unmarshall(t),Q.log("onPCS_ChatRoomUserCountBc: local roomid="+this.roomid+", pkg="+JSON.stringify(n)),n.roomid!==this.roomid)return;const o={totalCount:n.totalCount};this.emit(D.CHATROOM_EVENTS.USER_COUNT_UPDATED,o)}onPCS_ChatRoomUserBc(e){let t=new u.default(e.view),n=new m.default;if(n.unmarshall(t),n.roomid!==this.roomid)return;const o={joinUsers:n.joinUsers,leaveUsers:n.leaveUsers};this.emit(D.CHATROOM_EVENTS.USER_ONLINE_UPDATED,o)}onUserAttributesChangeBc(e){let t=new u.default(e.view),n=new R.default;if(n.unmarshall(t),n.roomid!==this.roomid)return;const o={uid:n.uid,attributes:n.infos};switch(n.op){case R.OpType.kOpUpdate:break;case R.OpType.kOpSet:this.emit(D.CHATROOM_EVENTS.USER_ATTRIBUTES_SET,o);break;case R.OpType.kOpDel:}}onPCS_OnRoomExtraAttributesBc(e,t){let n=new u.default(e.view),o=new W.default;if(o.unmarshall(n),o.roomid!==this.roomid)return;const r={uid:o.uid,lasttimeTs:o.lasttimeTs,extraAttributes:o.extraAttributes};switch(t){case N.chatroomProto.Action.kSetRoomExtraAttributesBc:this.emit(D.CHATROOM_EVENTS.ROOM_EXTRA_ATTRIBUTES_SET,r);break;case N.chatroomProto.Action.kUpdateRoomExtraAttributesBc:this.emit(D.CHATROOM_EVENTS.ROOM_EXTRA_ATTRIBUTES_UPDATED,r);break;case N.chatroomProto.Action.kDeleteRoomExtraAttributesBc:this.emit(D.CHATROOM_EVENTS.ROOM_EXTRA_ATTRIBUTES_DELETED,r);break;case N.chatroomProto.Action.kClearRoomExtraAttributesBc:this.emit(D.CHATROOM_EVENTS.ROOM_EXTRA_ATTRIBUTES_CLEARED,r)}}joinChannelBcV2(){return new Promise((e,t)=>o(this,void 0,void 0,function*(){try{let n={subs:this.genUserGroupId()};const o=yield this.subscribeBcV2(n);e({rescode:o.rescode,msg:o.msg})}catch(e){t(e)}}))}leaveChannelBcV2(){return o(this,void 0,void 0,function*(){return new Promise((e,t)=>o(this,void 0,void 0,function*(){try{let n={unsubs:this.genUserGroupId()};const o=yield this.subscribeBcV2(n);e({rescode:o.rescode,msg:o.msg})}catch(e){t(e)}}))})}joinRoom(e=null){return o(this,void 0,void 0,function*(){return new Promise((t,n)=>o(this,void 0,void 0,function*(){try{let o=new b.default;o.appid=this.appid,o.uid=this.uid,o.roomid=this.roomid,e&&(o.joinProps=r.default.toMap(e));let i=o.marshall();const s=yield this.send(this.autherService,"JoinChatRoom",i);if(Q.log("joinRoom: res="+JSON.stringify(s)),s&&0===s.rescode){this.setCheckOfflineTime(s.props),this.setCrossRegionHeartbeatParams(s.props),this.heartbeatOnlineProc();const e=yield this.joinChannelBcV2();e&&0===e.rescode&&(this.queueEnable||this.initMaxSeqId().then(e=>{console.debug("initMaxSeqId: res="+JSON.stringify(e)),this.queueEnable=e.every(e=>0===e.code)}).catch(e=>{this.queueEnable=!1,n(e)})),t(e)}else t(s)}catch(e){n(e)}}))})}initMaxSeqId(){let e=[];for(let t=0;t<re.TOTAL_SIZE;t++)for(let n=0;n<this.queueCount;n++)e.push(this.getFirstGrpSysMaxSeqId(this.chatroomInfos[t][n]));for(let t=0;t<this.queueCount;t++)e.push(this.getFirstMaxSeqId(t));return Promise.all(e)}setCheckOfflineTime(e){r.default.hasOwn(e,"props_offline_check_duration")&&(this.offline_check_duration=Number(e.props_offline_check_duration)),Q.debug("offline_check_duration="+this.offline_check_duration)}setCrossRegionHeartbeatParams(e){r.default.hasOwn(e,"props_need_ping")&&r.default.hasOwn(e,"props_cross_region_heartbeat_duration")?(this.heartbeat.need_ping=Number(e.props_need_ping),this.heartbeat.heartbeat_duration=Number(e.props_cross_region_heartbeat_duration)):(this.heartbeat.need_ping=0,this.heartbeat.heartbeat_duration=20),Q.info("heartbeat=",this.heartbeat),this.modifyOfflineCheckDuration()}modifyOfflineCheckDuration(){this.heartbeat.need_ping&&(this.offline_check_duration=this.heartbeat.heartbeat_duration,Q.log("modify offline_check_duration="+this.offline_check_duration))}heartbeatOnlineProc(){if(this.heartbeat.need_ping){if(Q.log("heartbeatOnlineProc start"),this.pingOnlineUserHeartBeat().catch(e=>{Q.warn("heartbeatOnlineProc",e)}),!this.heartbeat.pollHeartbeatTimer){const e=r.default.MAX(5,this.heartbeat.heartbeat_duration/3);this.heartbeat.pollHeartbeatTimer=setInterval(this.pingOnlineUserHeartBeatPeriod.bind(this),1e3*e)}}else this.resetHeartbeatTimer()}leaveRoom(){return this.roomid?new Promise((e,t)=>o(this,void 0,void 0,function*(){try{let n=new I.default;n.appid=this.appid,n.uid=this.uid,n.roomid=this.roomid;let o=n.marshall();const r=yield this.send(this.autherService,"LeaveChatRoom",o);if(Q.info("LeaveChatRoom: "+JSON.stringify(r)),r&&0===r.rescode){const t=yield this.leaveChannelBcV2();e(t)}else e(r)}catch(e){t(e)}})):Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID})}subscribeBcV2(e){return o(this,void 0,void 0,function*(){return this.ap.subscribeBcV2(e)})}onConnectStateChange(e){switch(e.state){case j.ConnectionState.RECONNECTING:if(this.queueEnable&&!this.offlineTimer){const e=1e3*r.default.MAX(this.offline_check_duration-11,5);Q.debug("start offlineTimer: delta="+e),this.offlineTimer=setTimeout(this.onChatRoomUserOffline.bind(this),e)}break;case j.ConnectionState.CONNECTED:if(this.clearOfflineTimer(),this.heartbeatOnlineProc(),this.subscribeUserGroup(),this.queueEnable){for(let e=0;e<this.queueCount;e++)this.pullMsgPeriod(e).catch(e=>{Q.warn("failed to pull msg:",e)});this.joinChannelBcV2().catch(e=>{Q.warn(e)});for(let e=0;e<re.TOTAL_SIZE;e++)for(let t=0;t<this.queueCount;t++)this.pullGroupSysMsgOnce(this.chatroomInfos[e][t]).catch(e=>{Q.warn("failed to pull group msg:",e)})}else this.emitOffline&&(this.emitOffline=!1,this.leaveRoom().catch(e=>{Q.warn(`leaveRoom[${this.roomid}]: e=`,e)}));break;case j.ConnectionState.DISCONNECTED:e.reason===j.ConnectionChangeReason.LOGOUT&&this.stop()}}clearOfflineTimer(){this.offlineTimer&&(clearTimeout(this.offlineTimer),delete this.offlineTimer,this.offlineTimer=null)}onChatRoomUserOffline(){if(this.connected)return;const e=this.genUserGroupId();for(let t of e){Q.debug("sub",t,"userGroupsV2.subs",this.h5_g_globals.userGroupsV2.subs);const e=this.h5_g_globals.userGroupsV2.subs.indexOf(t);-1!==e&&this.h5_g_globals.userGroupsV2.subs.splice(e,1)}this.queueEnable=!1,this.emitOffline=!0,this.emit(D.CHATROOM_EVENTS.CHATROOM_USER_OFFLINE)}subscribeUserGroup(){this.ap.subscribeUserGroup(),this.ap.subscribeUserGroupV2()}get connected(){return this.ap.connectState.state==j.ConnectionState.CONNECTED}stop(){this.clearPollTimer(),this.clearPollChannelTimer(),this.resetHeartbeatTimer(),this.queueEnable=!1}initQueue(){return o(this,void 0,void 0,function*(){this.queueEnable||(this.initPeerStatus(),this.initChatRoomStatus())})}getFirstMaxSeqId(e){return o(this,void 0,void 0,function*(){let t=this.peerInfos[e];if(!t)return;const n=j.getMutexKey(j.MutexKey.chatGetMaxSeqId,t.queueId);try{yield this.mutex.wait(n),this.mutex.lock(n);const o=yield this.getMaxSeqId(t.queueId);return Q.log(`getMaxSeqId[${e}]: res=`,o,typeof o.maxSeqId),t.receivedMaxSeqId=o.maxSeqId,t.hasFirstGetMaxSeqSuccess=!0,this.pullMsgIfAny(t.queueId),this.pollTimer[t.queueId]||(this.pollTimer[t.queueId]=setInterval(this.pullMsgPeriod.bind(this),ne,t.queueId)),o}catch(t){Q.warn(`getMaxSeqId[${e}]: e=`,t)}finally{this.mutex.unlock(n)}})}getMaxSeqId(e){return o(this,void 0,void 0,function*(){const t=this.getSingleTopic(),n=N.chatroomProto.GetMaxSeqIdRequest;let o=n.create({logId:this.generateLogId(),appId:s.fromNumber(this.appid),selfUid:s.fromString(this.uid),topic:t,queueId:e});Q.log("GetMaxSeqId[$queueId] req=",o,"logId=",o.logId.toString());let r=n.encode(o).finish();const i=yield this.send(this.cimUserService,"cim.proto.ProxyService.GetMaxSeqId",r);return i instanceof N.chatroomProto.GetMaxSeqIdResponse?0===i.code?(Q.log("getMaxSeqId res=",i,", type=",typeof i.maxSeqId),"number"==typeof i.maxSeqId?{code:i.code,maxSeqId:s.fromNumber(i.maxSeqId)}:{code:i.code,maxSeqId:i.maxSeqId}):(Q.warn("getMaxSeqId failed",i),{code:i.code,msg:i.msg}):(Q.warn("getMaxSeqId: unexpected res=",i),{code:j.UNKOWN,msg:"unexpected response: "+i})})}pullMsgPeriod(e){return o(this,void 0,void 0,function*(){if(!this.connected)return;const t=j.getMutexKey(j.MutexKey.chatPullMsg,e);try{yield this.mutex.wait(t),this.mutex.lock(t);const n=yield this.pullMsgOnce(e);n&&n.hasMore&&setTimeout(this.pullMsgPeriod.bind(this),100,e)}catch(e){Q.warn("pullMsgPeriod: ",e)}finally{this.mutex.unlock(t)}})}getFirstGrpSysMaxSeqId(e){return o(this,void 0,void 0,function*(){if(!e)return Promise.reject({code:j.UNKOWN,msg:"ChatroomInfo is null"});const t=j.getMutexKey(j.MutexKey.chatGetGroupMaxSeqId,`${e.type}:${e.queueId}`);try{yield this.mutex.wait(t),this.mutex.lock(t);const n=yield this.getGrpSysMaxSeqId(e.type,e.queueId);return Q.log(`getGrpSysMaxSeqId[${e.queueId}]: res=`,n),e.receivedBcMaxSeqId=n.maxSeqId,e.hasBcFirstGetMaxSeqSuccess=!0,Q.log(`getBcFirstMaxSeqId[${e.queueId}]: receivedBcMaxSeqId=`+n.maxSeqId),this.pullGroupSysMsgIfAny(e.type,e.queueId),this.pollChannelTimer[e.type][e.queueId]||(this.pollChannelTimer[e.type][e.queueId]=setInterval(this.pullGroupSysMsgIfAny.bind(this),oe,e.type,e.queueId)),n}catch(e){Q.warn("getFirstGrpSysMaxSeqId: e=",e)}finally{this.mutex.unlock(t)}})}pullGroupSysMsgIfAny(e,t){return o(this,void 0,void 0,function*(){if(!this.queueEnable)return;let n=this.chatroomInfos[e][t];if(n&&this.connected&&!n.isPulling)try{n.isPulling=!0;const t=yield this.pullGroupSysMsgOnce(n);t&&t.hasMore&&(Q.log("has more. schedule a new pull"),setTimeout(this.pullGroupSysMsgIfAny.bind(this),100,e,n.queueId))}catch(e){Q.warn("pull channel msgs:",e),n.isPulling=!1}finally{n.isPulling=!1}})}pullGroupSysMsgOnce(e){return o(this,void 0,void 0,function*(){if(!this.queueEnable)return;if(!e||!this.connected)return;let t={startSeqId:e.receivedBcMaxSeqId,queueId:e.queueId,limit:te,type:e.type};const n=yield this.pullGroupSysMsg(t);return n.maxSeqId instanceof s&&n.maxSeqId.greaterThan(0)?(e.receivedBcMaxSeqId=n.maxSeqId,Q.log("receivedBcMaxSeqId is updated to "+e.receivedBcMaxSeqId.toString())):Q.log("pullGroupSysMsgOnce: has_more="+n.hasMore),n instanceof N.chatroomProto.PullGroupSysMsgResponse?(this.notifyGroupMessageListener(n),n):(Q.log("pullGroupSysMsgOnce: unkown group msg"),null)})}notifyGroupMessageListener(e){for(const t of e.msgs)this.processReliableChannelMsg(t)}processReliableChannelMsg(e){Q.log("processReliableChannelMsg: ",e);let t=new Uint8Array(e.content.byteLength);t.set(e.content,0);let n=new DataView(t.buffer),o=new u.default(n);switch(e.action){case N.chatroomProto.Action.kDismissChatRoomBc:this.onPCS_DismissChatRoomBc(o);break;case N.chatroomProto.Action.kUpdateChatRoomInfoBc:this.onPCS_UpdateChatRoomInfoBc(o);break;case N.chatroomProto.Action.kUpdateRolerBc:this.onPCS_UpdateChatRoomRolerBc(o);break;case N.chatroomProto.Action.kKickOffUserBc:this.onPCS_KickOffUserBc(o);break;case N.chatroomProto.Action.kSendBroadcastBc:this.recvBroadcastBc(o);break;case N.chatroomProto.Action.kUserInfoChangeBc:this.onUserAttributesChangeBc(o);break;case N.chatroomProto.Action.kUserCountBc:this.onPCS_ChatRoomUserCountBc(o);break;case N.chatroomProto.Action.kUserOnlineChangeBc:this.onPCS_ChatRoomUserBc(o);break;case N.chatroomProto.Action.kSetRoomExtraAttributesBc:case N.chatroomProto.Action.kUpdateRoomExtraAttributesBc:case N.chatroomProto.Action.kDeleteRoomExtraAttributesBc:case N.chatroomProto.Action.kClearRoomExtraAttributesBc:this.onPCS_OnRoomExtraAttributesBc(o,e.action);break;case N.chatroomProto.Action.kMultiCastAppSessionChat:this.decodeTextChat(e);break;case N.chatroomProto.Action.kDisableUserTextBc:this.onPCS_DisableUserTextBc(o);break;default:Q.info("unexpected group action:"+e.action)}}getGrpSysMaxSeqId(e,t){return o(this,void 0,void 0,function*(){const n=this.getGroupTopic(e),o=N.chatroomProto.GetGrpSysMaxSeqIdRequest;let r=o.create({logId:this.generateLogId(),appId:s.fromNumber(this.appid),selfUid:s.fromString(this.uid),groupId:s.fromNumber(this.roomid),topic:n,queueId:t});Q.log(`getGrpSysMaxSeqId[${e}:${t}]: req=`,r,"logId=",r.logId.toString());let i=o.encode(r).finish();const a=yield this.send(this.cimService,"cim.proto.ProxyService.GetGrpSysMaxSeqId",i);return a instanceof N.chatroomProto.GetGrpSysMaxSeqIdResponse?0===a.code?(Q.log(`getGrpSysMaxSeqId[${e}:${t}]: res=`,a),"number"==typeof a.maxSeqId?{code:a.code,maxSeqId:s.fromNumber(a.maxSeqId)}:{code:a.code,maxSeqId:a.maxSeqId}):(Q.warn(`getGrpSysMaxSeqId[${e}:${t}] failed`,a),{code:a.code,msg:a.msg}):(Q.warn(`getGrpSysMaxSeqId[[${e}:${t}]]: unexpected response:`,a),{code:j.UNKOWN,msg:"unexpected response: "+a})})}pullMsg(e){return o(this,void 0,void 0,function*(){if(r.default.isEmpty(e.startSeqId))return{code:j.UNKOWN,msg:"startSeqId is empty!"};if(0==e.limit)return{code:j.UNKOWN,msg:"limit is zero!"};let t;t="string"==typeof e.startSeqId?s.fromString(e.startSeqId):e.startSeqId;const n=this.getSingleTopic(),o=N.chatroomProto.PullMsgRequest;let i=o.create({logId:this.generateLogId(),appId:s.fromNumber(this.appid),selfUid:s.fromString(this.uid),exclusiveStartSeqId:t,limit:e.limit,statisDeliveryDelay:!0,topic:n,queueId:e.queueId});Q.log(`pullMsg[${e.queueId}]: req=`,i,"logid=",i.logId.toString());let a=o.encode(i).finish();const u=yield this.send(this.cimUserService,"cim.proto.ProxyService.PullMsg",a);return u instanceof N.chatroomProto.PullMsgResponse?(Q.log(`pullMsg[${e.queueId}]: res=`,u),u):(Q.warn(`pullMsg[${e.queueId}]: unexpected res=`,u),{code:j.UNKOWN,msg:"unexpected response: "+u})})}pullGroupSysMsg(e){return o(this,void 0,void 0,function*(){if(r.default.isEmpty(e.startSeqId))return{code:j.UNKOWN,msg:"startSeqId is empty!"};if(0===e.limit)return{code:j.UNKOWN,msg:"limit is zero!"};let t;t="string"==typeof e.startSeqId?s.fromString(e.startSeqId):e.startSeqId,Q.debug(`pullGroupSysMsg[${e.type}:${e.queueId}]: startSeqId=`,t,"req=",e);const n=this.getGroupTopic(e.type),o=N.chatroomProto.PullGroupSysMsgRequest;let i=o.create({logId:this.generateLogId(),appId:s.fromNumber(this.appid),selfUid:s.fromString(this.uid),groupId:s.fromNumber(this.roomid),exclusiveStartSeqId:t,limit:e.limit,statisDeliveryDelay:!0,topic:n,queueId:e.queueId});Q.log(`pullGroupSysMsg[${e.type}:${e.queueId}]: req=`,i,"logid=",i.logId.toString());let a=o.encode(i).finish();const u=yield this.send(this.cimService,"cim.proto.ProxyService.PullGroupSysMsg",a);return u instanceof N.chatroomProto.PullGroupSysMsgResponse?(Q.log(`pullGroupSysMsg[${e.type}:${e.queueId}]: res=`,u),u):(Q.warn(`pullGroupSysMsg[${e.type}:${e.queueId}]: unexpected res=`,u),{code:j.UNKOWN,msg:"unexpected response: "+u})})}joinChatRoom(e=null){return this.h5_g_globals.isAnonymous?Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips}):j.checkRoomid(this.roomid)?this.h5_g_globals.isAnonymous||this.connected?new Promise((t,n)=>o(this,void 0,void 0,function*(){try{yield this.mutex.wait(j.MutexKey.joinChatRoom),this.mutex.lock(j.MutexKey.joinChatRoom),Q.log("joinChatRoom: uid="+this.uid+", isAnonymous="+this.h5_g_globals.isAnonymous),this.queueEnable?Q.info("already in chatroom"):yield this.initQueue();const o=yield this.joinRoom(e.joinProps);t(o)}catch(e){n(e)}finally{this.mutex.unlock(j.MutexKey.joinChatRoom)}})):Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT}):Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID})}leaveChatRoom(){return this.h5_g_globals.isAnonymous?Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips}):this.connected?j.checkRoomid(this.roomid)?new Promise((e,t)=>o(this,void 0,void 0,function*(){try{yield this.mutex.wait(j.MutexKey.leaveChatRoom),this.mutex.lock(j.MutexKey.leaveChatRoom);const n=yield this.leaveRoom();n&&0===n.rescode&&(this.clearChatRoomInfo(),this.clearPollTimer(),this.clearPollChannelTimer()),e(n)}catch(e){t(e)}finally{this.mutex.unlock(j.MutexKey.leaveChatRoom)}})):Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID}):Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT})}updateChatRoomAttributes(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new v.default;t.appid=this.appid,t.uid=this.uid,t.roomid=this.roomid,t.attributes=r.default.toMap(e.attributes);let n=t.marshall();return this.send(this.autherService,"UpdateChatRoomInfo",n)}dismissChatRoom(){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let e=new O.default;e.appid=this.appid,e.uid=this.uid,e.roomid=this.roomid;let t=e.marshall();return this.send(this.autherService,"DismissChatRoom",t)}kickOffUser(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkUid(e.uid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_OPERATED_UID});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new w.default;t.appid=this.appid,t.admin=this.uid,t.uid=e.uid,t.roomid=this.roomid,t.secs=e.secs,t.reason=e.reason;let n=t.marshall();return this.send(this.autherService,"KickOffUser",n)}muteUser(e){const t={uid:e.uid,secs:e.secs,disable:!0,reason:e.reason};return this.mute(t)}unMuteUser(e){const t={uid:e.uid,secs:e.secs,disable:!1,reason:e.reason};return this.mute(t)}mute(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkUid(e.uid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_OPERATED_UID});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new G.default;t.appid=this.appid,t.opUid=this.uid,t.uid=e.uid,t.roomid=this.roomid,t.secs=e.secs&&0!==e.secs.length?e.secs:"0",t.disable=e.disable,t.reason=e.reason||"",Q.debug("mute",t);let n=t.marshall();return this.send(this.autherService,"DisableUserText",n)}getMutedUserList(){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let e=new H.default;e.appid=this.appid,e.roomid=this.roomid;let t=e.marshall();return this.send(this.tempService,"GetChatRoomDisableTextUser",t)}updateRoler(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new S.default;t.appid=this.appid,t.admin=this.uid,t.uid=e.uid,t.roomid=this.roomid,t.op=e.op,t.roler=e.roler;let n=t.marshall();return this.send(this.autherService,"UpdateRoler",n)}sendGroupMessage(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new k.default;t.appid=this.appid,t.uid=this.uid,t.roomid=this.roomid,t.content=e.content,t.requestId=this.generateLogId().toString(),e.kvExtra&&(t.extProps=r.default.toMap(e.kvExtra));let n=t.marshall();return this.send(this.autherService,"SendBroadcast",n)}sendSingleUserMessage(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkUid(e.receiver))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_UID});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new _.default;t.appid=this.appid,t.uid=this.uid,t.roomid=this.roomid,t.content=e.content,t.receiver=e.receiver,t.requestId=this.generateLogId().toString(),e.kvExtra&&(t.extProps=r.default.toMap(e.kvExtra));let n=t.marshall();return this.send(this.autherService,"SendUnicast",n)}sendTextChat(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new P.default;if(t.appid=this.appid,t.uid=this.uid,t.roomid=this.roomid,t.chat=e.chat,e.extra){const n={extra:e.extra};t.chatProps=r.default.toMap(n)}t.chatProps.set("uuid",Z()),e.kvExtra&&(t.extProps=r.default.toMap(e.kvExtra)),t.requestId=this.generateLogId().toString();let n=t.marshall();return this.send(`svc_${this.regionCode}_chatroom_textchat`,"SendTextChat",n)}getChatRoomAttributes(){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let e=new T.default;e.appid=this.appid,e.roomid=this.roomid;let t=e.marshall();return this.send(`svc_${this.regionCode}_chatroom_sinfo`,"GetChatRoomInfo",t)}getChatRoomManager(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new U.default;t.appid=this.appid,t.roomid=this.roomid,t.roler=e.roler;let n=t.marshall();return this.send(`svc_${this.regionCode}_chatroom_smember`,"GetChatRoomManager",n)}getUserList(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new x.default;t.appid=this.appid,t.roomid=this.roomid,t.num=e.num,t.pos=e.pos;let n=t.marshall();return this.send(this.onlineQueryService,"GetUserList",n)}setUserAttributes(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new E.default;t.appid=this.appid,t.uid=this.uid,t.roomid=this.roomid,t.infos=r.default.toMap(e.attributes);let n=t.marshall();return this.send(this.autherService,"SetUserInfo",n)}getUserAttributesList(){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let e=new M.default;e.appid=this.appid,e.roomid=this.roomid;let t=e.marshall();return this.send(this.onlineQueryService,"GetUserInfoList",t)}setRoomExtraAttributes(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new z.default;t.appid=this.appid,t.roomid=this.roomid,t.opuid=this.uid,e.extraAttributes&&(t.props=r.default.toMap(e.extraAttributes));let n=t.marshall();return this.send(this.autherService,"SetRoomExtraAttributes",n)}updateRoomExtraAttributes(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new J.default;t.appid=this.appid,t.roomid=this.roomid,t.opuid=this.uid,e.extraAttributes&&(t.props=r.default.toMap(e.extraAttributes));let n=t.marshall();return this.send(this.autherService,"UpdateRoomExtraAttributes",n)}deleteRoomExtraAttributes(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new K.default;t.appid=this.appid,t.roomid=this.roomid,t.opuid=this.uid,t.extrakeys=e.extraKeys;let n=t.marshall();return this.send(this.autherService,"DeleteRoomExtraAttributes",n)}clearRoomExtraAttributes(){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let e=new $.default;e.appid=this.appid,e.roomid=this.roomid,e.opuid=this.uid;let t=e.marshall();return this.send(this.autherService,"ClearRoomExtraAttributes",t)}fetchRoomExtraAttributes(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new F.default;t.appid=this.appid,t.roomid=this.roomid,t.opuid=this.uid,t.extrakeys=e.extraKeys;let n=t.marshall();return this.send(`svc_${this.regionCode}_chatroom_sinfo`,"FetchRoomExtraAttributes",n)}fetchHistoryMessages(e){return o(this,void 0,void 0,function*(){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:j.kAnonymousOperation,msg:j.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT});if(!j.checkRoomid(this.roomid))return Promise.resolve({rescode:j.kInvalid_Parameters,msg:j.INVALID_ROOMID});let t=new X.default;t.appid=this.appid,t.roomid=this.roomid,t.uid=this.uid,t.roomIdType="chatroom",t.msgTypes=e.msgTypes,e.anchor&&(t.anchorUuid=e.anchor.uuid||"",t.anchorTimestamp=e.anchor.timestamp||0),t.direction=e.direction,e.limit>=1&&(t.limit=e.limit),t.region=this.region;let n=t.marshall();return Q.debug("fetchHistoryMessages: pkg=",t),this.send(this.autherService,"QueryHistoryMsg",n)})}pingOnlineUserHeartBeatPeriod(e=null){return o(this,void 0,void 0,function*(){if(this.connected)try{const t=yield this.pingOnlineUserHeartBeat(e);Q.info("pingOnlineUserHeartBeat: res=",t)}catch(e){Q.warn("pingOnlineUserHeartBeat: e=",e)}})}pingOnlineUserHeartBeat(e=null){let t=new q.default;t.appid=this.appid,t.uid=this.uid,t.roomid=this.roomid,e&&(t.ext=r.default.toMap(e.ext));let n=t.marshall();return this.send(`svc_${this.regionCode}_chatroom_heartbeat`,"OnlineUserHeartBeat",n)}clearChatRoomInfo(){this.resetHeartbeatTimer(),this.chatroomInfos=[],this.queueEnable=!1}resetHeartbeatTimer(){this.heartbeat.pollHeartbeatTimer&&(clearInterval(this.heartbeat.pollHeartbeatTimer),delete this.heartbeat.pollHeartbeatTimer,this.heartbeat.pollHeartbeatTimer=null,Q.log("resetHeartbeatTimer"))}checkChatRoomInfoFromTopic(e){Q.debug("topic="+e);let t=e.split("/");if(3===t.length){if("ChatRoom"===t[0]&&Number(t[1])===this.appid&&Number(t[2])===this.roomid)return re.BC}else if(4===t.length&&"ChatRoom"===t[0]&&"Chat"===t[1]&&Number(t[2])===this.appid&&Number(t[3])===this.roomid)return re.TEXT;return re.UNKOWN}genUserGroupId(){let e=[];for(let t=0;t<re.TOTAL_SIZE;t++){const n=this.getGroupTopic(t),o=s.fromNumber(this.roomid),r="hummer:"+this.appid.toString()+":"+n+":"+o.toString();e.push(r)}return e}getGroupTopic(e){return ee[e]+this.appid+"/"+this.roomid}getSingleTopic(){return Y+this.appid}send(e,t,n){return this.h5_g_globals.bLostConnection?Promise.reject({rescode:j.kOperationTimeout,msg:j.OPERATION_TIMEOUT}):new Promise((r,i)=>o(this,void 0,void 0,function*(){try{const o=yield this.ap.sendData(this.appid,e,t,n),s=y.default.decodeRouteRes(o,this.regionCode);r(s)}catch(e){i(e)}}))}leaveOp(){this.queueEnable=!1,this.leaveChannelBcV2().catch(e=>{})}clearPollTimer(){for(let e of this.pollTimer)e&&clearInterval(e);this.pollTimer=[]}clearPollChannelTimer(){for(let e=0;e<re.TOTAL_SIZE;e++)for(const t of this.pollChannelTimer[e])clearInterval(t);this.initChannelPollTimer()}initChannelPollTimer(){this.pollChannelTimer=new Array([],[])}}t.default=se,j.applyMixins(se,[L.Emitter,B.Base])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let o=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},s=function(e){if(!e||"[object Object]"!==r.call(e))return!1;let t,n=o.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&o.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||o.call(e,t)},a=function(...e){let t,n,o,r,u,l,c=arguments[0],p=1,d=arguments.length,h=!1;for("boolean"==typeof c&&(h=c,c=arguments[1]||{},p=2),(null==c||"object"!=typeof c&&"function"!=typeof c)&&(c={});p<d;++p)if(null!=(t=arguments[p]))for(n in t)o=c[n],c!==(r=t[n])&&(h&&r&&(s(r)||(u=i(r)))?(u?(u=!1,l=o&&i(o)?o:[]):l=o&&s(o)?o:{},c[n]=a(h,l,r)):void 0!==r&&(c[n]=r));return c};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e=0,t=0,n=0){this.sid=e,this.appId=t,this.channelId=n}fromString(e){if(this.sid=0,this.appId=0,this.channelId=0,-1!==e.toString().indexOf("-")){let t=e.split("-");return this.sid=parseInt(t[0])||0,this.appId=parseInt(t[1])||0,this.channelId=parseInt(t[2])||0,!0}return!1}toString(){return this.sid+"-"+this.appId+"-"+this.channelId}equal(e){return this.toString()===e.toString()}toBigint(){return 4294967296*this.sid+this.appId}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0}unmarshall(e){this.appid=e.popUInt32(),this.uid=e.popUInt64String(),this.roomid=e.popUInt32()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.attributes={}}unmarshall(e){this.appid=e.popUInt32(),this.uid=e.popUInt64String(),this.roomid=e.popUInt32();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popString(),n=e.popUtf8String();this.attributes[t]=n}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.admin="0",this.uid="0",this.roomid=0,this.op=0,this.roler=""}unmarshall(e){this.appid=e.popUInt32(),this.admin=e.popUInt64String(),this.uid=e.popUInt64String(),this.roomid=e.popUInt32(),this.op=e.popUInt32(),this.roler=e.popString()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.roomid=0,this.admin="0",this.tuids=[],this.secs=0,this.reason="",this.type=0,this.uid2instanceids={}}unmarshall(e){this.appid=e.popUInt32(),this.roomid=e.popUInt32(),this.admin=e.popUInt64String();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popUInt64String();this.tuids.push(t)}this.secs=e.popUInt32(),this.reason=e.popUtf8String(),this.type=e.popUInt32();let n=e.popUInt32();for(let t=0;t<n;t++){let t=e.popUInt64String(),n=e.popUInt64String();this.uid2instanceids[t]=n}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.content="",this.requestId="",this.timestamp="0",this.extProps={}}unmarshall(e){this.appid=e.popUInt32(),this.uid=e.popUInt64String(),this.roomid=e.popUInt32(),this.content=e.popUtf8String(),this.requestId=e.popString(),this.timestamp=e.popUInt64String();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popUtf8String(),n=e.popUtf8String();this.extProps[t]=n}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.chat="",this.chatProps={},this.extProps={},this.requestId="",this.timestamp="0"}unmarshall(e){this.appid=e.popUInt32(),this.uid=e.popUInt64String(),this.roomid=e.popUInt32(),this.chat=e.popUtf8String();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popUtf8String(),n=e.popUtf8String();this.chatProps[t]=n}t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popUtf8String(),n=e.popUtf8String();this.extProps[t]=n}this.requestId=e.popUtf8String(),this.timestamp=e.popUInt64String()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.roomid=0,this.totalCount=0}unmarshall(e){this.appid=e.popUInt32(),this.roomid=e.popUInt32(),this.totalCount=e.popUInt32()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.roomid=0,this.joinUsers=[],this.leaveUsers=[]}unmarshall(e){this.appid=e.popUInt32(),this.roomid=e.popUInt32();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popUInt64String();this.joinUsers.push(t)}t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popUInt64String();this.leaveUsers.push(t)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(23),r=n(73),i=n(74),s=n(24),a=n(75),u=n(76),l=n(77),c=n(25),p=n(3),d=n(28),h=n(5),f=n(93),g=n(94),m=n(95),y=n(96),b=n(97);d.util.Long=h,d.configure();const I=new p.Logger("ChatRoomProto");t.default=class{static decodeRouteRes(e,t){let n=null;try{if("QueryHistoryMsg"==e.fnName)(n=new b.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_auther`||e.svcName==`svc_${t}_chatroom_textchat`)(n=new o.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_sinfo`&&"GetChatRoomInfo"==e.fnName)(n=new r.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_sinfo`&&"FetchRoomExtraAttributes"==e.fnName)(n=new y.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_smember`&&"GetChatRoomManager"==e.fnName)(n=new i.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_online_query_d`&&"GetUserCount"==e.fnName)(n=new s.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_online_query_d`&&"GetUserList"==e.fnName)(n=new a.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_online_query_d`&&"GetUserInfoList"==e.fnName)(n=new u.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_tempservice`&&"GetChatRoomDisableTextUser"==e.fnName)(n=new g.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_online_query_d`&&"GetSpecificUserList"==e.fnName)(n=new l.default).unmarshall(e.data);else if(e.svcName==`svc_${t}_chatroom_heartbeat`&&"OnlineUserHeartBeat"==e.fnName)(n=new f.default).unmarshall(e.data);else{if("cim.proto.ProxyService.GetQueueConfig"==e.fnName)return m.proto.GetQueueConfigResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.GetMaxSeqId"==e.fnName)return c.chatroomProto.GetMaxSeqIdResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.PullMsg"==e.fnName)return c.chatroomProto.PullMsgResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.GetGrpSysMaxSeqId"==e.fnName)return c.chatroomProto.GetGrpSysMaxSeqIdResponse.decode(new Uint8Array(e.data));if("cim.proto.ProxyService.PullGroupSysMsg"==e.fnName)return c.chatroomProto.PullGroupSysMsgResponse.decode(new Uint8Array(e.data))}}catch(e){I.warn("decodeRouteRes: failed to decode msg:",e)}return n}static decodeUnicastRes(e,t){I.debug("decodeUnicastRes:",e);try{return"service_api_gateway"===e.svcName&&"cim.proto.PushService.IMPushMsg"===e.fnName?c.chatroomProto.IMPushMsgRequest.decode(new Uint8Array(e.data)):e.svcName!=`svc_${t}_chatroom_auther`&&"chatroom_auther"!=e.svcName||"SendUnicastUc"!=e.fnName?(I.debug("decodeUnicastRes: unhandle msg: ",e),e):null}catch(e){I.warn("decodeUnicastRes: failed to decode msg:",e)}return null}static decodeBroadcastRes(e){I.debug("decodeBroadcastRes: ",e);try{if("service_api_gateway"===e.svcName&&"cim.proto.PushService.IMPushGroupSysMsg"==e.fnName)return c.chatroomProto.IMPushGroupSysMsgRequest.decode(new Uint8Array(e.data));I.debug("decodeBroadcastRes: unhandle msg: ",e)}catch(e){I.warn("decodeBroadcastRes: failed to decode msg:",e)}return null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.roomid=0,this.rescode=0,this.attributes={}}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.roomid=n.popUInt32(),this.rescode=n.popUInt32();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popString(),t=n.popUtf8String();this.attributes[e]=t}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.roomid=0,this.admins={},this.rescode=0}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.roomid=n.popUInt32();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popString(),t=n.popUInt32(),o=[];for(let e=0;e<t;e++){let e=n.popUInt64String();o.push(e)}this.admins[e]=o}this.rescode=n.popUInt32()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.roomid=0,this.pos=0,this.uids=[],this.rescode=0}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.roomid=n.popUInt32(),this.pos=n.popUInt32();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popUInt64String();this.uids.push(e)}this.rescode=n.popUInt32()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.roomid=0,this.users={},this.rescode=0}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.roomid=n.popUInt32();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popUInt64String(),t={},o=n.popUInt32();for(let e=0;e<o;e++){let e=n.popString(),o=n.popUtf8String();t[e]=o}this.users[e]=t}this.rescode=n.popUInt32()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.roomid=0,this.uids=[],this.rescode=0,this.msg=""}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.roomid=n.popUInt32();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popUInt64String();this.uids.push(e)}this.rescode=n.popUInt32(),this.msg=n.popString()}}},function(e,t,n){"use strict";var o=t;o.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),i=new Array(123),s=0;s<64;)i[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;o.encode=function(e,t,n){for(var o,i=null,s=[],a=0,u=0;t<n;){var l=e[t++];switch(u){case 0:s[a++]=r[l>>2],o=(3&l)<<4,u=1;break;case 1:s[a++]=r[o|l>>4],o=(15&l)<<2,u=2;break;case 2:s[a++]=r[o|l>>6],s[a++]=r[63&l],u=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=r[o],s[a++]=61,1===u&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};o.decode=function(e,t,n){for(var o,r=n,s=0,a=0;a<e.length;){var u=e.charCodeAt(a++);if(61===u&&s>1)break;if(void 0===(u=i[u]))throw Error("invalid encoding");switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(48&u)>>4,o=u,s=2;break;case 2:t[n++]=(15&o)<<4|(60&u)>>2,o=u,s=3;break;case 3:t[n++]=(3&o)<<6|u,s=0}}if(1===s)throw Error("invalid encoding");return n-r},o.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)}},function(e,t,n){"use strict";function o(){this._listeners={}}e.exports=o,o.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},o.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],o=0;o<n.length;)n[o].fn===t?n.splice(o,1):++o;return this},o.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],o=1;o<arguments.length;)n.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,n)}return this}},function(e,t,n){"use strict";function o(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),n=new Uint8Array(t.buffer),o=128===n[3];function r(e,o,r){t[0]=e,o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2],o[r+3]=n[3]}function i(e,o,r){t[0]=e,o[r]=n[3],o[r+1]=n[2],o[r+2]=n[1],o[r+3]=n[0]}function s(e,o){return n[0]=e[o],n[1]=e[o+1],n[2]=e[o+2],n[3]=e[o+3],t[0]}function a(e,o){return n[3]=e[o],n[2]=e[o+1],n[1]=e[o+2],n[0]=e[o+3],t[0]}e.writeFloatLE=o?r:i,e.writeFloatBE=o?i:r,e.readFloatLE=o?s:a,e.readFloatBE=o?a:s}():function(){function t(e,t,n,o){var r=t<0?1:0;if(r&&(t=-t),0===t)e(1/t>0?0:2147483648,n,o);else if(isNaN(t))e(2143289344,n,o);else if(t>3.4028234663852886e38)e((r<<31|2139095040)>>>0,n,o);else if(t<1.1754943508222875e-38)e((r<<31|Math.round(t/1.401298464324817e-45))>>>0,n,o);else{var i=Math.floor(Math.log(t)/Math.LN2);e((r<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,n,o)}}function n(e,t,n){var o=e(t,n),r=2*(o>>31)+1,i=o>>>23&255,s=8388607&o;return 255===i?s?NaN:r*(1/0):0===i?1.401298464324817e-45*r*s:r*Math.pow(2,i-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i),e.readFloatLE=n.bind(null,s),e.readFloatBE=n.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),n=new Uint8Array(t.buffer),o=128===n[7];function r(e,o,r){t[0]=e,o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2],o[r+3]=n[3],o[r+4]=n[4],o[r+5]=n[5],o[r+6]=n[6],o[r+7]=n[7]}function i(e,o,r){t[0]=e,o[r]=n[7],o[r+1]=n[6],o[r+2]=n[5],o[r+3]=n[4],o[r+4]=n[3],o[r+5]=n[2],o[r+6]=n[1],o[r+7]=n[0]}function s(e,o){return n[0]=e[o],n[1]=e[o+1],n[2]=e[o+2],n[3]=e[o+3],n[4]=e[o+4],n[5]=e[o+5],n[6]=e[o+6],n[7]=e[o+7],t[0]}function a(e,o){return n[7]=e[o],n[6]=e[o+1],n[5]=e[o+2],n[4]=e[o+3],n[3]=e[o+4],n[2]=e[o+5],n[1]=e[o+6],n[0]=e[o+7],t[0]}e.writeDoubleLE=o?r:i,e.writeDoubleBE=o?i:r,e.readDoubleLE=o?s:a,e.readDoubleBE=o?a:s}():function(){function t(e,t,n,o,r,i){var s=o<0?1:0;if(s&&(o=-o),0===o)e(0,r,i+t),e(1/o>0?0:2147483648,r,i+n);else if(isNaN(o))e(0,r,i+t),e(2146959360,r,i+n);else if(o>1.7976931348623157e308)e(0,r,i+t),e((s<<31|2146435072)>>>0,r,i+n);else{var a;if(o<2.2250738585072014e-308)e((a=o/5e-324)>>>0,r,i+t),e((s<<31|a/4294967296)>>>0,r,i+n);else{var u=Math.floor(Math.log(o)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=o*Math.pow(2,-u))>>>0,r,i+t),e((s<<31|u+1023<<20|1048576*a&1048575)>>>0,r,i+n)}}}function n(e,t,n,o,r){var i=e(o,r+t),s=e(o,r+n),a=2*(s>>31)+1,u=s>>>20&2047,l=4294967296*(1048575&s)+i;return 2047===u?l?NaN:a*(1/0):0===u?5e-324*a*l:a*Math.pow(2,u-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0),e.readDoubleLE=n.bind(null,s,0,4),e.readDoubleBE=n.bind(null,a,4,0)}(),e}function r(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function i(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=o(o)},function(e,t,n){"use strict";e.exports=function(e,t,n){var o=n||8192,r=o>>>1,i=null,s=o;return function(n){if(n<1||n>r)return e(n);s+n>o&&(i=e(o),s=0);var a=t.call(i,s,s+=n);return 7&s&&(s=1+(7|s)),a}}},function(e,t,n){"use strict";e.exports=r;var o=n(9);function r(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=r.zero=new r(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var s=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var n=e>>>0,o=(e-n)/4294967296>>>0;return t&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new r(n,o)},r.from=function(e){if("number"==typeof e)return r.fromNumber(e);if(o.isString(e)){if(!o.Long)return r.fromNumber(parseInt(e,10));e=o.Long.fromString(e)}return e.low||e.high?new r(e.low>>>0,e.high>>>0):i},r.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+4294967296*n)}return this.lo+4294967296*this.hi},r.prototype.toLong=function(e){return o.Long?new o.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;r.fromHash=function(e){return e===s?i:new r((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},r.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},r.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}},function(e,t,n){"use strict";e.exports=i;var o=n(26);(i.prototype=Object.create(o.prototype)).constructor=i;var r=n(9);function i(){o.call(this)}function s(e,t,n){e.length<40?r.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}i._configure=function(){i.alloc=r._Buffer_allocUnsafe,i.writeBytesBuffer=r.Buffer&&r.Buffer.prototype instanceof Uint8Array&&"set"===r.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var o=0;o<e.length;)t[n++]=e[o++]}},i.prototype.bytes=function(e){r.isString(e)&&(e=r._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=r.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},i._configure()},function(e,t,n){"use strict";e.exports=i;var o=n(27);(i.prototype=Object.create(o.prototype)).constructor=i;var r=n(9);function i(e){o.call(this,e)}i._configure=function(){r.Buffer&&(i.prototype._slice=r.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},function(e,t,n){"use strict";e.exports=r;var o=n(9);function r(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(r.prototype=Object.create(o.EventEmitter.prototype)).constructor=r,r.prototype.rpcCall=function e(t,n,r,i,s){if(!i)throw TypeError("request must be specified");var a=this;if(!s)return o.asPromise(e,a,t,n,r,i);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(e,n){if(e)return a.emit("error",e,t),s(e);if(null!==n){if(!(n instanceof r))try{n=r[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",n,t),s(null,n)}a.end(!0)})}catch(e){return a.emit("error",e,t),void setTimeout(function(){s(e)},0)}else setTimeout(function(){s(Error("already ended"))},0)},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,n){"use strict";var o=e.exports=n(87);o.build="full",o.tokenize=n(53),o.parse=n(91),o.common=n(92),o.Root._configure(o.Type,o.parse,o.common)},function(e,t,n){"use strict";var o=e.exports=n(43);o.build="light",o.load=function(e,t,n){return"function"==typeof t?(n=t,t=new o.Root):t||(t=new o.Root),t.load(e,n)},o.loadSync=function(e,t){return t||(t=new o.Root),t.loadSync(e)},o.encoder=n(48),o.decoder=n(49),o.verifier=n(50),o.converter=n(51),o.ReflectionObject=n(11),o.Namespace=n(15),o.Root=n(34),o.Enum=n(8),o.Type=n(29),o.Field=n(10),o.OneOf=n(19),o.MapField=n(30),o.Service=n(31),o.Method=n(32),o.Message=n(33),o.wrappers=n(52),o.types=n(12),o.util=n(4),o.ReflectionObject._configure(o.Root),o.Namespace._configure(o.Type,o.Service,o.Enum),o.Root._configure(o.Type),o.Field._configure(o.Type)},function(e,t,n){"use strict";function o(e,t){"string"==typeof e&&(t=e,e=void 0);var n=[];function r(e){if("string"!=typeof e){var t=i();if(o.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var s=Object.keys(e),a=new Array(s.length+1),u=new Array(s.length),l=0;l<s.length;)a[l]=s[l],u[l]=e[s[l++]];return a[l]=t,Function.apply(null,a).apply(null,u)}return Function(t)()}for(var c=new Array(arguments.length-1),p=0;p<c.length;)c[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,function(e,t){var n=c[p++];switch(t){case"d":case"f":return String(Number(n));case"i":return String(Math.floor(n));case"j":return JSON.stringify(n);case"s":return String(n)}return"%"}),p!==c.length)throw Error("parameter count mismatch");return n.push(e),r}function i(o){return"function "+(o||t||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return r.toString=i,r}e.exports=o,o.verbose=!1},function(e,t,n){"use strict";e.exports=i;var o=n(44),r=n(45)("fs");function i(e,t,n){return"function"==typeof t?(n=t,t={}):t||(t={}),n?!t.xhr&&r&&r.readFile?r.readFile(e,function(o,r){return o&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,n):o?n(o):n(null,t.binary?r:r.toString("utf8"))}):i.xhr(e,t,n):o(i,this,e,t)}i.xhr=function(e,t,n){var o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===o.readyState){if(0!==o.status&&200!==o.status)return n(Error("status "+o.status));if(t.binary){var e=o.response;if(!e){e=[];for(var r=0;r<o.responseText.length;++r)e.push(255&o.responseText.charCodeAt(r))}return n(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return n(null,o.responseText)}},t.binary&&("overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.responseType="arraybuffer"),o.open("GET",e),o.send()}},function(e,t,n){"use strict";var o=t,r=o.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=o.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),n=r(e),o="";n&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):n?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};o.resolve=function(e,t,n){return n||(t=i(t)),r(t)?t:(n||(e=i(e)),(e=e.replace(/(?:\/|^)[^\/]+$/,"")).length?i(e+"/"+t):t)}},function(e,t,n){"use strict";e.exports=k,k.filename=null,k.defaults={keepCase:!1};var o=n(53),r=n(34),i=n(29),s=n(10),a=n(30),u=n(19),l=n(8),c=n(31),p=n(32),d=n(12),h=n(4),f=/^[1-9][0-9]*$/,g=/^-?[1-9][0-9]*$/,m=/^0[x][0-9a-fA-F]+$/,y=/^-?0[x][0-9a-fA-F]+$/,b=/^0[0-7]+$/,I=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,O=/^[a-zA-Z_][a-zA-Z_0-9]*$/,w=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,S=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function k(e,t,n){t instanceof r||(n=t,t=new r),n||(n=k.defaults);var _,P,T,U,x,E=n.preferTrailingComment||!1,M=o(e,n.alternateCommentMode||!1),R=M.next,C=M.push,A=M.peek,j=M.skip,N=M.cmnt,q=!0,L=!1,B=t,D=n.keepCase?function(e){return e}:h.camelCase;function G(e,t,n){var o=k.filename;return n||(k.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(o?o+", ":"")+"line "+M.line+")")}function V(){var e,t=[];do{if('"'!==(e=R())&&"'"!==e)throw G(e);t.push(R()),j(e),e=A()}while('"'===e||"'"===e);return t.join("")}function H(e){var t=R();switch(t){case"'":case'"':return C(t),V();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var n=1;"-"===e.charAt(0)&&(n=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return n*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return n*parseInt(e,10);if(m.test(e))return n*parseInt(e,16);if(b.test(e))return n*parseInt(e,8);if(v.test(e))return n*parseFloat(e);throw G(e,"number",t)}(t,!0)}catch(n){if(e&&w.test(t))return t;throw G(t,"value")}}function F(e,t){var n,o;do{!t||'"'!==(n=A())&&"'"!==n?e.push([o=$(R()),j("to",!0)?$(R()):o]):e.push(V())}while(j(",",!0));j(";")}function $(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw G(e,"id");if(g.test(e))return parseInt(e,10);if(y.test(e))return parseInt(e,16);if(I.test(e))return parseInt(e,8);throw G(e,"id")}function K(){if(void 0!==_)throw G("package");if(_=R(),!w.test(_))throw G(_,"name");B=B.define(_),j(";")}function J(){var e,t=A();switch(t){case"weak":e=T||(T=[]),R();break;case"public":R();default:e=P||(P=[])}t=V(),j(";"),e.push(t)}function z(){if(j("="),U=V(),!(L="proto3"===U)&&"proto2"!==U)throw G(U,"syntax");j(";")}function W(e,t){switch(t){case"option":return Q(e,t),j(";"),!0;case"message":return function(e,t){if(!O.test(t=R()))throw G(t,"type name");var n=new i(t);X(n,function(e){if(!W(n,e))switch(e){case"map":!function(e){j("<");var t=R();if(void 0===d.mapKey[t])throw G(t,"type");j(",");var n=R();if(!w.test(n))throw G(n,"type");j(">");var o=R();if(!O.test(o))throw G(o,"name");j("=");var r=new a(D(o),$(R()),t,n);X(r,function(e){if("option"!==e)throw G(e);Q(r,e),j(";")},function(){te(r)}),e.add(r)}(n);break;case"required":case"optional":case"repeated":Z(n,e);break;case"oneof":!function(e,t){if(!O.test(t=R()))throw G(t,"name");var n=new u(D(t));X(n,function(e){"option"===e?(Q(n,e),j(";")):(C(e),Z(n,"optional"))}),e.add(n)}(n,e);break;case"extensions":F(n.extensions||(n.extensions=[]));break;case"reserved":F(n.reserved||(n.reserved=[]),!0);break;default:if(!L||!w.test(e))throw G(e);C(e),Z(n,"optional")}}),e.add(n)}(e,t),!0;case"enum":return function(e,t){if(!O.test(t=R()))throw G(t,"name");var n=new l(t);X(n,function(e){switch(e){case"option":Q(n,e),j(";");break;case"reserved":F(n.reserved||(n.reserved=[]),!0);break;default:!function(e,t){if(!O.test(t))throw G(t,"name");j("=");var n=$(R(),!0),o={};X(o,function(e){if("option"!==e)throw G(e);Q(o,e),j(";")},function(){te(o)}),e.add(t,n,o.comment)}(n,e)}}),e.add(n)}(e,t),!0;case"service":return function(e,t){if(!O.test(t=R()))throw G(t,"service name");var n=new c(t);X(n,function(e){if(!W(n,e)){if("rpc"!==e)throw G(e);!function(e,t){var n=N(),o=t;if(!O.test(t=R()))throw G(t,"name");var r,i,s,a,u=t;j("("),j("stream",!0)&&(i=!0);if(!w.test(t=R()))throw G(t);r=t,j(")"),j("returns"),j("("),j("stream",!0)&&(a=!0);if(!w.test(t=R()))throw G(t);s=t,j(")");var l=new p(u,o,r,s,i,a);l.comment=n,X(l,function(e){if("option"!==e)throw G(e);Q(l,e),j(";")}),e.add(l)}(n,e)}}),e.add(n)}(e,t),!0;case"extend":return function(e,t){if(!w.test(t=R()))throw G(t,"reference");var n=t;X(null,function(t){switch(t){case"required":case"repeated":case"optional":Z(e,t,n);break;default:if(!L||!w.test(t))throw G(t);C(t),Z(e,"optional",n)}})}(e,t),!0}return!1}function X(e,t,n){var o=M.line;if(e&&("string"!=typeof e.comment&&(e.comment=N()),e.filename=k.filename),j("{",!0)){for(var r;"}"!==(r=R());)t(r);j(";",!0)}else n&&n(),j(";"),e&&("string"!=typeof e.comment||E)&&(e.comment=N(o)||e.comment)}function Z(e,t,n){var o=R();if("group"!==o){if(!w.test(o))throw G(o,"type");var r=R();if(!O.test(r))throw G(r,"name");r=D(r),j("=");var a=new s(r,$(R()),o,t,n);X(a,function(e){if("option"!==e)throw G(e);Q(a,e),j(";")},function(){te(a)}),e.add(a),L||!a.repeated||void 0===d.packed[o]&&void 0!==d.basic[o]||a.setOption("packed",!1,!0)}else!function(e,t){var n=R();if(!O.test(n))throw G(n,"name");var o=h.lcFirst(n);n===o&&(n=h.ucFirst(n));j("=");var r=$(R()),a=new i(n);a.group=!0;var u=new s(o,r,n,t);u.filename=k.filename,X(a,function(e){switch(e){case"option":Q(a,e),j(";");break;case"required":case"optional":case"repeated":Z(a,e);break;default:throw G(e)}}),e.add(a).add(u)}(e,t)}function Q(e,t){var n=j("(",!0);if(!w.test(t=R()))throw G(t,"name");var o,r=t,i=r;n&&(j(")"),i=r="("+r+")",t=A(),S.test(t)&&(o=t.substr(1),r+=t,R())),j("="),function(e,t,n,o){e.setParsedOption&&e.setParsedOption(t,n,o)}(e,i,Y(e,r),o)}function Y(e,t){if(j("{",!0)){for(var n={};!j("}",!0);){if(!O.test(x=R()))throw G(x,"name");var o,r=x;"{"===A()?o=Y(e,t+"."+x):(j(":"),"{"===A()?o=Y(e,t+"."+x):(o=H(!0),ee(e,t+"."+x,o)));var i=n[r];i&&(o=[].concat(i).concat(o)),n[r]=o,j(",",!0)}return n}var s=H(!0);return ee(e,t,s),s}function ee(e,t,n){e.setOption&&e.setOption(t,n)}function te(e){if(j("[",!0)){do{Q(e,"option")}while(j(",",!0));j("]")}return e}for(;null!==(x=R());)switch(x){case"package":if(!q)throw G(x);K();break;case"import":if(!q)throw G(x);J();break;case"syntax":if(!q)throw G(x);z();break;case"option":Q(B,x),j(";");break;default:if(W(B,x)){q=!1;continue}throw G(x)}return k.filename=null,{package:_,imports:P,weakImports:T,syntax:U,root:t}}},function(e,t,n){"use strict";e.exports=i;var o,r=/\/|\./;function i(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),i[e]=t}i("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),i("duration",{Duration:o={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),i("timestamp",{Timestamp:o}),i("empty",{Empty:{fields:{}}}),i("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),i("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),i("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),i.get=function(e){return i[e]||null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.rescode=0,this.ext={},this.msg=""}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.uid=n.popUInt64String(),this.roomid=n.popUInt32(),this.rescode=n.popUInt32();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popString(),t=n.popUtf8String();this.ext[e]=t}this.msg=n.popUtf8String()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.roomid=0,this.rescode=0,this.uids=[]}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.roomid=n.popUInt32(),this.rescode=n.popUInt32();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popUInt64String();this.uids.push(e)}}}},function(e,t,n){"use strict";var o,r,i,s=n(17),a=s.Reader,u=s.Writer,l=s.util,c=s.roots.default||(s.roots.default={});c.proto=((i={}).Action=(o={},(r=Object.create(o))[o[0]="kLogin"]=0,r[o[3e3]="kP2PChat"]=3e3,r[o[1e6]="kNotifySignalMessage"]=1e6,r[o[1000001]="kNotifyJoinSignalGroup"]=1000001,r[o[1000002]="kNotifyLeaveSignalGroup"]=1000002,r[o[1000003]="kNotifyUinfoChange"]=1000003,r[o[1000004]="kNotifyUserOnlineStatusChange"]=1000004,r[o[1000005]="kNotifyUserCountChange"]=1000005,r[o[1000006]="kNotifyChannelPropsChange"]=1000006,r),i.GetMaxSeqIdRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.topic&&e.hasOwnProperty("topic")&&t.uint32(34).string(e.topic),null!=e.queueId&&e.hasOwnProperty("queueId")&&t.uint32(40).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetMaxSeqIdRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.topic=e.string();break;case 5:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.GetMaxSeqIdResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),null!=e.maxSeqId&&e.hasOwnProperty("maxSeqId")&&t.uint32(32).int64(e.maxSeqId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetMaxSeqIdResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.maxSeqId=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.GetGrpSysMaxSeqIdRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.queueId=0,e.prototype.groupRegion="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(32).int64(e.groupId),null!=e.topic&&e.hasOwnProperty("topic")&&t.uint32(42).string(e.topic),null!=e.queueId&&e.hasOwnProperty("queueId")&&t.uint32(48).int32(e.queueId),null!=e.groupRegion&&e.hasOwnProperty("groupRegion")&&t.uint32(58).string(e.groupRegion),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetGrpSysMaxSeqIdRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.topic=e.string();break;case 6:o.queueId=e.int32();break;case 7:o.groupRegion=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.GetGrpSysMaxSeqIdResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),null!=e.maxSeqId&&e.hasOwnProperty("maxSeqId")&&t.uint32(32).int64(e.maxSeqId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetGrpSysMaxSeqIdResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.maxSeqId=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushMsgRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.uid&&e.hasOwnProperty("uid")&&t.uint32(16).int64(e.uid),null!=e.seqId&&e.hasOwnProperty("seqId")&&t.uint32(24).int64(e.seqId),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(32).int64(e.groupId),null!=e.region&&e.hasOwnProperty("region")&&t.uint32(42).string(e.region),null!=e.envType&&e.hasOwnProperty("envType")&&t.uint32(50).string(e.envType),null!=e.envName&&e.hasOwnProperty("envName")&&t.uint32(58).string(e.envName),null!=e.topic&&e.hasOwnProperty("topic")&&t.uint32(66).string(e.topic),null!=e.queueId&&e.hasOwnProperty("queueId")&&t.uint32(72).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.IMPushMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.uid=e.int64();break;case 3:o.seqId=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.region=e.string();break;case 6:o.envType=e.string();break;case 7:o.envName=e.string();break;case 8:o.topic=e.string();break;case 9:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.IMPushMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushGroupSysMsgRequest=function(){function e(e){if(this.targetUserTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.topic="",e.prototype.prevSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.msg=null,e.prototype.targetUserTags=l.emptyArray,e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(16).int64(e.groupId),null!=e.seqId&&e.hasOwnProperty("seqId")&&t.uint32(24).int64(e.seqId),null!=e.region&&e.hasOwnProperty("region")&&t.uint32(34).string(e.region),null!=e.envType&&e.hasOwnProperty("envType")&&t.uint32(42).string(e.envType),null!=e.envName&&e.hasOwnProperty("envName")&&t.uint32(50).string(e.envName),null!=e.topic&&e.hasOwnProperty("topic")&&t.uint32(58).string(e.topic),null!=e.prevSeqId&&e.hasOwnProperty("prevSeqId")&&t.uint32(64).int64(e.prevSeqId),null!=e.msg&&e.hasOwnProperty("msg")&&c.proto.Msg.encode(e.msg,t.uint32(74).fork()).ldelim(),null!=e.targetUserTags&&e.targetUserTags.length)for(var n=0;n<e.targetUserTags.length;++n)t.uint32(82).string(e.targetUserTags[n]);return null!=e.queueId&&e.hasOwnProperty("queueId")&&t.uint32(88).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.IMPushGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.groupId=e.int64();break;case 3:o.seqId=e.int64();break;case 4:o.region=e.string();break;case 5:o.envType=e.string();break;case 6:o.envName=e.string();break;case 7:o.topic=e.string();break;case 8:o.prevSeqId=e.int64();break;case 9:o.msg=c.proto.Msg.decode(e,e.uint32());break;case 10:o.targetUserTags&&o.targetUserTags.length||(o.targetUserTags=[]),o.targetUserTags.push(e.string());break;case 11:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.IMPushGroupSysMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.IMPushGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.PullMsgRequest=function(){function e(e){if(this.userTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.exclusiveStartSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.limit=0,e.prototype.userTags=l.emptyArray,e.prototype.statisDeliveryDelay=!1,e.prototype.topic="",e.prototype.queueId=0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.exclusiveStartSeqId&&e.hasOwnProperty("exclusiveStartSeqId")&&t.uint32(32).int64(e.exclusiveStartSeqId),null!=e.limit&&e.hasOwnProperty("limit")&&t.uint32(40).int32(e.limit),null!=e.userTags&&e.userTags.length)for(var n=0;n<e.userTags.length;++n)t.uint32(50).string(e.userTags[n]);return null!=e.statisDeliveryDelay&&e.hasOwnProperty("statisDeliveryDelay")&&t.uint32(56).bool(e.statisDeliveryDelay),null!=e.topic&&e.hasOwnProperty("topic")&&t.uint32(66).string(e.topic),null!=e.queueId&&e.hasOwnProperty("queueId")&&t.uint32(72).int32(e.queueId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.PullMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.exclusiveStartSeqId=e.int64();break;case 5:o.limit=e.int32();break;case 6:o.userTags&&o.userTags.length||(o.userTags=[]),o.userTags.push(e.string());break;case 7:o.statisDeliveryDelay=e.bool();break;case 8:o.topic=e.string();break;case 9:o.queueId=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i.PullMsgResponse=function(){function e(e){if(this.msgs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.msgs=l.emptyArray,e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.hasMore=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),null!=e.msgs&&e.msgs.length)for(var n=0;n<e.msgs.length;++n)c.proto.Msg.encode(e.msgs[n],t.uint32(34).fork()).ldelim();return null!=e.maxSeqId&&e.hasOwnProperty("maxSeqId")&&t.uint32(40).int64(e.maxSeqId),null!=e.hasMore&&e.hasOwnProperty("hasMore")&&t.uint32(48).bool(e.hasMore),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.PullMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.msgs&&o.msgs.length||(o.msgs=[]),o.msgs.push(c.proto.Msg.decode(e,e.uint32()));break;case 5:o.maxSeqId=e.int64();break;case 6:o.hasMore=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.PullGroupSysMsgRequest=function(){function e(e){if(this.userTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.exclusiveStartSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.limit=0,e.prototype.userTags=l.emptyArray,e.prototype.statisDeliveryDelay=!1,e.prototype.topic="",e.prototype.queueId=0,e.prototype.groupRegion="",e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(32).int64(e.groupId),null!=e.exclusiveStartSeqId&&e.hasOwnProperty("exclusiveStartSeqId")&&t.uint32(40).int64(e.exclusiveStartSeqId),null!=e.limit&&e.hasOwnProperty("limit")&&t.uint32(48).int32(e.limit),null!=e.userTags&&e.userTags.length)for(var n=0;n<e.userTags.length;++n)t.uint32(58).string(e.userTags[n]);return null!=e.statisDeliveryDelay&&e.hasOwnProperty("statisDeliveryDelay")&&t.uint32(64).bool(e.statisDeliveryDelay),null!=e.topic&&e.hasOwnProperty("topic")&&t.uint32(74).string(e.topic),null!=e.queueId&&e.hasOwnProperty("queueId")&&t.uint32(80).int32(e.queueId),null!=e.groupRegion&&e.hasOwnProperty("groupRegion")&&t.uint32(90).string(e.groupRegion),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.PullGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.groupId=e.int64();break;case 5:o.exclusiveStartSeqId=e.int64();break;case 6:o.limit=e.int32();break;case 7:o.userTags&&o.userTags.length||(o.userTags=[]),o.userTags.push(e.string());break;case 8:o.statisDeliveryDelay=e.bool();break;case 9:o.topic=e.string();break;case 10:o.queueId=e.int32();break;case 11:o.groupRegion=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.PullGroupSysMsgResponse=function(){function e(e){if(this.msgs=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.msgs=l.emptyArray,e.prototype.maxSeqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.hasMore=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),null!=e.msgs&&e.msgs.length)for(var n=0;n<e.msgs.length;++n)c.proto.Msg.encode(e.msgs[n],t.uint32(34).fork()).ldelim();return null!=e.maxSeqId&&e.hasOwnProperty("maxSeqId")&&t.uint32(40).int64(e.maxSeqId),null!=e.hasMore&&e.hasOwnProperty("hasMore")&&t.uint32(48).bool(e.hasMore),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.PullGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.msgs&&o.msgs.length||(o.msgs=[]),o.msgs.push(c.proto.Msg.decode(e,e.uint32()));break;case 5:o.maxSeqId=e.int64();break;case 6:o.hasMore=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyUserStatusChange=function(){function e(e){if(this.joinuids=[],this.leaveuids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.joinuids=l.emptyArray,e.prototype.leaveuids=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(26).string(e.groupId),null!=e.joinuids&&e.joinuids.length){t.uint32(34).fork();for(var n=0;n<e.joinuids.length;++n)t.uint64(e.joinuids[n]);t.ldelim()}if(null!=e.leaveuids&&e.leaveuids.length){for(t.uint32(42).fork(),n=0;n<e.leaveuids.length;++n)t.uint64(e.leaveuids[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.NotifyUserStatusChange;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.groupId=e.string();break;case 4:if(o.joinuids&&o.joinuids.length||(o.joinuids=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos<i;)o.joinuids.push(e.uint64());else o.joinuids.push(e.uint64());break;case 5:if(o.leaveuids&&o.leaveuids.length||(o.leaveuids=[]),2==(7&r))for(i=e.uint32()+e.pos;e.pos<i;)o.leaveuids.push(e.uint64());else o.leaveuids.push(e.uint64());break;default:e.skipType(7&r)}}return o},e}(),i.NotifyJoinSignalGroup=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.uid&&e.hasOwnProperty("uid")&&t.uint32(24).int64(e.uid),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(34).string(e.groupId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.NotifyJoinSignalGroup;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.uid=e.int64();break;case 4:o.groupId=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyLeaveSignalGroup=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.uid&&e.hasOwnProperty("uid")&&t.uint32(24).int64(e.uid),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(34).string(e.groupId),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.NotifyLeaveSignalGroup;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.uid=e.int64();break;case 4:o.groupId=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.Msg=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seqId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.action=0,e.prototype.content=l.newBuffer([]),e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.seqId&&e.hasOwnProperty("seqId")&&t.uint32(8).int64(e.seqId),null!=e.action&&e.hasOwnProperty("action")&&t.uint32(16).int32(e.action),null!=e.content&&e.hasOwnProperty("content")&&t.uint32(26).bytes(e.content),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&t.uint32(32).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.Msg;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.seqId=e.int64();break;case 2:o.action=e.int32();break;case 3:o.content=e.bytes();break;case 4:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.SignalMessageOption=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.reliable="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.reliable&&e.hasOwnProperty("reliable")&&t.uint32(10).string(e.reliable),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.SignalMessageOption;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.reliable=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.P2PSignalRequest=function(){function e(e){if(this.extensions={},this.internalExtensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.toUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.option=null,e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.prototype.internalExtensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&e.hasOwnProperty("fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.toUid&&e.hasOwnProperty("toUid")&&t.uint32(32).int64(e.toUid),null!=e.type&&e.hasOwnProperty("type")&&t.uint32(42).string(e.type),null!=e.content&&e.hasOwnProperty("content")&&t.uint32(50).bytes(e.content),null!=e.option&&e.hasOwnProperty("option")&&c.proto.SignalMessageOption.encode(e.option,t.uint32(58).fork()).ldelim(),null!=e.uuid&&e.hasOwnProperty("uuid")&&t.uint32(66).string(e.uuid),null!=e.extension&&e.hasOwnProperty("extension")&&t.uint32(74).string(e.extension),null!=e.extensions&&e.hasOwnProperty("extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(82).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();if(null!=e.internalExtensions&&e.hasOwnProperty("internalExtensions"))for(n=Object.keys(e.internalExtensions),o=0;o<n.length;++o)t.uint32(90).fork().uint32(10).string(n[o]).uint32(18).string(e.internalExtensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o=void 0===t?e.len:e.pos+t,r=new c.proto.P2PSignalRequest;e.pos<o;){var i=e.uint32();switch(i>>>3){case 1:r.logId=e.int64();break;case 2:r.appId=e.int64();break;case 3:r.fromUid=e.int64();break;case 4:r.toUid=e.int64();break;case 5:r.type=e.string();break;case 6:r.content=e.bytes();break;case 7:r.option=c.proto.SignalMessageOption.decode(e,e.uint32());break;case 8:r.uuid=e.string();break;case 9:r.extension=e.string();break;case 10:e.skip().pos++,r.extensions===l.emptyObject&&(r.extensions={}),n=e.string(),e.pos++,r.extensions[n]=e.string();break;case 11:e.skip().pos++,r.internalExtensions===l.emptyObject&&(r.internalExtensions={}),n=e.string(),e.pos++,r.internalExtensions[n]=e.string();break;default:e.skipType(7&i)}}return r},e}(),i.P2PSignalResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(8).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(18).string(e.msg),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&t.uint32(24).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.P2PSignalResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.SignalMessage=function(){function e(e){if(this.extensions={},this.internalExtensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.prototype.internalExtensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&e.hasOwnProperty("fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.type&&e.hasOwnProperty("type")&&t.uint32(34).string(e.type),null!=e.content&&e.hasOwnProperty("content")&&t.uint32(42).bytes(e.content),null!=e.uuid&&e.hasOwnProperty("uuid")&&t.uint32(50).string(e.uuid),null!=e.extension&&e.hasOwnProperty("extension")&&t.uint32(58).string(e.extension),null!=e.extensions&&e.hasOwnProperty("extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(66).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();if(null!=e.internalExtensions&&e.hasOwnProperty("internalExtensions"))for(n=Object.keys(e.internalExtensions),o=0;o<n.length;++o)t.uint32(74).fork().uint32(10).string(n[o]).uint32(18).string(e.internalExtensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o=void 0===t?e.len:e.pos+t,r=new c.proto.SignalMessage;e.pos<o;){var i=e.uint32();switch(i>>>3){case 1:r.logId=e.int64();break;case 2:r.appId=e.int64();break;case 3:r.fromUid=e.int64();break;case 4:r.type=e.string();break;case 5:r.content=e.bytes();break;case 6:r.uuid=e.string();break;case 7:r.extension=e.string();break;case 8:e.skip().pos++,r.extensions===l.emptyObject&&(r.extensions={}),n=e.string(),e.pos++,r.extensions[n]=e.string();break;case 9:e.skip().pos++,r.internalExtensions===l.emptyObject&&(r.internalExtensions={}),n=e.string(),e.pos++,r.internalExtensions[n]=e.string();break;default:e.skipType(7&i)}}return r},e}(),i.GroupSignalRequest=function(){function e(e){if(this.extensions={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.fromUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.type="",e.prototype.content=l.newBuffer([]),e.prototype.option=null,e.prototype.uuid="",e.prototype.extension="",e.prototype.extensions=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.fromUid&&e.hasOwnProperty("fromUid")&&t.uint32(24).int64(e.fromUid),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(32).int64(e.groupId),null!=e.topic&&e.hasOwnProperty("topic")&&t.uint32(42).string(e.topic),null!=e.type&&e.hasOwnProperty("type")&&t.uint32(50).string(e.type),null!=e.content&&e.hasOwnProperty("content")&&t.uint32(58).bytes(e.content),null!=e.option&&e.hasOwnProperty("option")&&c.proto.SignalMessageOption.encode(e.option,t.uint32(66).fork()).ldelim(),null!=e.uuid&&e.hasOwnProperty("uuid")&&t.uint32(74).string(e.uuid),null!=e.extension&&e.hasOwnProperty("extension")&&t.uint32(82).string(e.extension),null!=e.extensions&&e.hasOwnProperty("extensions"))for(var n=Object.keys(e.extensions),o=0;o<n.length;++o)t.uint32(90).fork().uint32(10).string(n[o]).uint32(18).string(e.extensions[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o=void 0===t?e.len:e.pos+t,r=new c.proto.GroupSignalRequest;e.pos<o;){var i=e.uint32();switch(i>>>3){case 1:r.logId=e.int64();break;case 2:r.appId=e.int64();break;case 3:r.fromUid=e.int64();break;case 4:r.groupId=e.int64();break;case 5:r.topic=e.string();break;case 6:r.type=e.string();break;case 7:r.content=e.bytes();break;case 8:r.option=c.proto.SignalMessageOption.decode(e,e.uint32());break;case 9:r.uuid=e.string();break;case 10:r.extension=e.string();break;case 11:e.skip().pos++,r.extensions===l.emptyObject&&(r.extensions={}),n=e.string(),e.pos++,r.extensions[n]=e.string();break;default:e.skipType(7&i)}}return r},e}(),i.GroupSignalResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(8).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(18).string(e.msg),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&t.uint32(24).int64(e.timestamp),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GroupSignalResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.timestamp=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.CheckUserIsOnlineRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.uid&&e.hasOwnProperty("uid")&&t.uint32(32).int64(e.uid),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.CheckUserIsOnlineRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.uid=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.CheckUserIsOnlineResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.isOnline=!1,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(8).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(18).string(e.msg),null!=e.isOnline&&e.hasOwnProperty("isOnline")&&t.uint32(24).bool(e.isOnline),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.CheckUserIsOnlineResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:o.isOnline=e.bool();break;default:e.skipType(7&r)}}return o},e}(),i.BatchCheckUserIsOnlineRequest=function(){function e(e){if(this.uids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uids=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.uids&&e.uids.length){t.uint32(34).fork();for(var n=0;n<e.uids.length;++n)t.int64(e.uids[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.BatchCheckUserIsOnlineRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:if(o.uids&&o.uids.length||(o.uids=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos<i;)o.uids.push(e.int64());else o.uids.push(e.int64());break;default:e.skipType(7&r)}}return o},e}(),i.BatchCheckUserIsOnlineResponse=function(){function e(e){if(this.onlineUids=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.prototype.msg="",e.prototype.onlineUids=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(8).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(18).string(e.msg),null!=e.onlineUids&&e.onlineUids.length){t.uint32(26).fork();for(var n=0;n<e.onlineUids.length;++n)t.int64(e.onlineUids[n]);t.ldelim()}return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.BatchCheckUserIsOnlineResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.code=e.int32();break;case 2:o.msg=e.string();break;case 3:if(o.onlineUids&&o.onlineUids.length||(o.onlineUids=[]),2==(7&r))for(var i=e.uint32()+e.pos;e.pos<i;)o.onlineUids.push(e.int64());else o.onlineUids.push(e.int64());break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableMsg=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.action=0,e.prototype.content=l.newBuffer([]),e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.uri="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.action&&e.hasOwnProperty("action")&&t.uint32(8).int32(e.action),null!=e.content&&e.hasOwnProperty("content")&&t.uint32(18).bytes(e.content),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&t.uint32(24).int64(e.timestamp),null!=e.uri&&e.hasOwnProperty("uri")&&t.uint32(34).string(e.uri),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableMsg;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.action=e.int32();break;case 2:o.content=e.bytes();break;case 3:o.timestamp=e.int64();break;case 4:o.uri=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushMsgRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.msg=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.region&&e.hasOwnProperty("region")&&t.uint32(18).string(e.region),null!=e.envType&&e.hasOwnProperty("envType")&&t.uint32(26).string(e.envType),null!=e.envName&&e.hasOwnProperty("envName")&&t.uint32(34).string(e.envName),null!=e.msg&&e.hasOwnProperty("msg")&&c.proto.UnreliableMsg.encode(e.msg,t.uint32(42).fork()).ldelim(),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableIMPushMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.region=e.string();break;case 3:o.envType=e.string();break;case 4:o.envName=e.string();break;case 5:o.msg=c.proto.UnreliableMsg.decode(e,e.uint32());break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableIMPushMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushGroupSysMsgRequest=function(){function e(e){if(this.targetUserTags=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.topic="",e.prototype.region="",e.prototype.envType="",e.prototype.envName="",e.prototype.msg=null,e.prototype.targetUserTags=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(16).int64(e.groupId),null!=e.topic&&e.hasOwnProperty("topic")&&t.uint32(26).string(e.topic),null!=e.region&&e.hasOwnProperty("region")&&t.uint32(34).string(e.region),null!=e.envType&&e.hasOwnProperty("envType")&&t.uint32(42).string(e.envType),null!=e.envName&&e.hasOwnProperty("envName")&&t.uint32(50).string(e.envName),null!=e.msg&&e.hasOwnProperty("msg")&&c.proto.UnreliableMsg.encode(e.msg,t.uint32(58).fork()).ldelim(),null!=e.targetUserTags&&e.targetUserTags.length)for(var n=0;n<e.targetUserTags.length;++n)t.uint32(66).string(e.targetUserTags[n]);return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableIMPushGroupSysMsgRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.groupId=e.int64();break;case 3:o.topic=e.string();break;case 4:o.region=e.string();break;case 5:o.envType=e.string();break;case 6:o.envName=e.string();break;case 7:o.msg=c.proto.UnreliableMsg.decode(e,e.uint32());break;case 8:o.targetUserTags&&o.targetUserTags.length||(o.targetUserTags=[]),o.targetUserTags.push(e.string());break;default:e.skipType(7&r)}}return o},e}(),i.UnreliableIMPushGroupSysMsgResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.UnreliableIMPushGroupSysMsgResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.NotifyUinfoChange=function(){function e(e){if(this.infos={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.opType=0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.infos=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.opType&&e.hasOwnProperty("opType")&&t.uint32(24).int32(e.opType),null!=e.uid&&e.hasOwnProperty("uid")&&t.uint32(32).int64(e.uid),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(42).string(e.groupId),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&t.uint32(48).int64(e.timestamp),null!=e.infos&&e.hasOwnProperty("infos"))for(var n=Object.keys(e.infos),o=0;o<n.length;++o)t.uint32(58).fork().uint32(10).string(n[o]).uint32(18).string(e.infos[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o=void 0===t?e.len:e.pos+t,r=new c.proto.NotifyUinfoChange;e.pos<o;){var i=e.uint32();switch(i>>>3){case 1:r.logId=e.int64();break;case 2:r.appId=e.int64();break;case 3:r.opType=e.int32();break;case 4:r.uid=e.int64();break;case 5:r.groupId=e.string();break;case 6:r.timestamp=e.int64();break;case 7:e.skip().pos++,r.infos===l.emptyObject&&(r.infos={}),n=e.string(),e.pos++,r.infos[n]=e.string();break;default:e.skipType(7&i)}}return r},e.OpType=function(){var e={},t=Object.create(e);return t[e[0]="kOpUpdate"]=0,t[e[1]="kOpDel"]=1,t[e[2]="kOpSet"]=2,t[e[3]="kOpClear"]=3,t}(),e}(),i.NotifyChannelPropsChange=function(){function e(e){if(this.props={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.opType=0,e.prototype.uid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.timestamp=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.props=l.emptyObject,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.opType&&e.hasOwnProperty("opType")&&t.uint32(24).int32(e.opType),null!=e.uid&&e.hasOwnProperty("uid")&&t.uint32(32).int64(e.uid),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(42).string(e.groupId),null!=e.timestamp&&e.hasOwnProperty("timestamp")&&t.uint32(48).int64(e.timestamp),null!=e.props&&e.hasOwnProperty("props"))for(var n=Object.keys(e.props),o=0;o<n.length;++o)t.uint32(58).fork().uint32(10).string(n[o]).uint32(18).string(e.props[n[o]]).ldelim();return t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n,o=void 0===t?e.len:e.pos+t,r=new c.proto.NotifyChannelPropsChange;e.pos<o;){var i=e.uint32();switch(i>>>3){case 1:r.logId=e.int64();break;case 2:r.appId=e.int64();break;case 3:r.opType=e.int32();break;case 4:r.uid=e.int64();break;case 5:r.groupId=e.string();break;case 6:r.timestamp=e.int64();break;case 7:e.skip().pos++,r.props===l.emptyObject&&(r.props={}),n=e.string(),e.pos++,r.props[n]=e.string();break;default:e.skipType(7&i)}}return r},e.OpType=function(){var e={},t=Object.create(e);return t[e[0]="kOpUpdate"]=0,t[e[1]="kOpDel"]=1,t[e[2]="kOpSet"]=2,t[e[3]="kOpClear"]=3,t}(),e}(),i.NotifyChannelUserCountChange=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.groupId="",e.prototype.count=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.groupId&&e.hasOwnProperty("groupId")&&t.uint32(26).string(e.groupId),null!=e.count&&e.hasOwnProperty("count")&&t.uint32(32).uint32(e.count),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.NotifyChannelUserCountChange;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.groupId=e.string();break;case 4:o.count=e.uint32();break;default:e.skipType(7&r)}}return o},e}(),i.SetUserRegionRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(24).int64(e.selfUid),null!=e.region&&e.hasOwnProperty("region")&&t.uint32(34).string(e.region),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.SetUserRegionRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.selfUid=e.int64();break;case 4:o.region=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.SetUserRegionResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.SetUserRegionResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;default:e.skipType(7&r)}}return o},e}(),i.GetQueueConfigRequest=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.appId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.region="",e.prototype.selfUid=l.Long?l.Long.fromBits(0,0,!1):0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.appId&&e.hasOwnProperty("appId")&&t.uint32(16).int64(e.appId),null!=e.region&&e.hasOwnProperty("region")&&t.uint32(26).string(e.region),null!=e.selfUid&&e.hasOwnProperty("selfUid")&&t.uint32(32).int64(e.selfUid),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetQueueConfigRequest;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.appId=e.int64();break;case 3:o.region=e.string();break;case 4:o.selfUid=e.int64();break;default:e.skipType(7&r)}}return o},e}(),i.GetQueueConfigResponse=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.logId=l.Long?l.Long.fromBits(0,0,!1):0,e.prototype.code=0,e.prototype.msg="",e.prototype.queueCount=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=u.create()),null!=e.logId&&e.hasOwnProperty("logId")&&t.uint32(8).int64(e.logId),null!=e.code&&e.hasOwnProperty("code")&&t.uint32(16).int32(e.code),null!=e.msg&&e.hasOwnProperty("msg")&&t.uint32(26).string(e.msg),null!=e.queueCount&&e.hasOwnProperty("queueCount")&&t.uint32(32).int32(e.queueCount),t},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var n=void 0===t?e.len:e.pos+t,o=new c.proto.GetQueueConfigResponse;e.pos<n;){var r=e.uint32();switch(r>>>3){case 1:o.logId=e.int64();break;case 2:o.code=e.int32();break;case 3:o.msg=e.string();break;case 4:o.queueCount=e.int32();break;default:e.skipType(7&r)}}return o},e}(),i),e.exports=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.context="",this.appid=0,this.roomid=0,this.opuid="0",this.lasttimeUid="0",this.lasttimeTs=0,this.rescode=0,this.msg="",this.extraAttributes={}}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.context=n.popString(),this.appid=n.popUInt32(),this.roomid=n.popUInt32(),this.opuid=n.popUInt64String(),this.lasttimeUid=n.popUInt64String(),this.lasttimeTs=n.popNumber(),this.rescode=n.popUInt32(),this.msg=n.popString();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popString(),t=n.popUtf8String();this.extraAttributes[e]=t}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1),i=n(98);t.default=class{constructor(){this.context="",this.appid=0,this.roomid=0,this.uid="0",this.roomIdType="",this.rescode=0,this.msg="",this.hasMore=!1,this.msgs=[]}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.context=n.popString(),this.appid=n.popUInt32(),this.roomid=n.popUInt32(),this.uid=n.popUInt64String(),this.roomIdType=n.popString(),this.rescode=n.popUInt32(),this.msg=n.popString(),this.hasMore=n.popBool();let s=n.popUInt32();for(let e=0;e<s;e++){let e=new i.default;e.unmarshall(n);let t={msgType:e.msgType,content:e.content,uuid:e.uuid,timestamp:e.timestamp,uid:e.uid,extra:e.extra,kvExtra:e.kvExtra};this.msgs.push(t)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(25),r=new(n(3).Logger)("HistoryMsg");t.default=class{constructor(){this.action="0",this.content="",this.timestamp=0,this.uuid="",this.owner="",this.mark_revoked=!1,this.uid="",this.extra="",this.kvExtra={}}unmarshall(e){this.action=e.popUInt64String();let t=e.popUint8Array();if(Number(this.action)==o.chatroomProto.Action.kMultiCastAppSessionChat){let e=o.chatroomProto.MultiCastMPChatRequest.decode(t);if(r.debug("MultiCastMPChatRequest: ",e),e.msgType==o.chatroomProto.MsgType.kText){let t=o.chatroomProto.TextMsg.decode(e.content);this.uid=e.fromId.toString(),this.msgType=e.msgType,this.content=t.text,this.extra=e.extension,this.kvExtra=e.extensions}}else r.warn("unexpected action:",this.action);this.timestamp=e.popNumber(),this.uuid=e.popString(),this.owner=e.popString(),this.mark_revoked=e.popBool()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.joinProps=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUInt32(this.joinProps.size);for(let[t,n]of this.joinProps)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.attributes=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUInt32(this.attributes.size);for(let[t,n]of this.attributes)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.admin="0",this.uid="0",this.roomid=0,this.secs="0",this.reason=""}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt64String(this.admin),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUInt64String(this.secs),e.pushUtf8String(this.reason),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.admin="0",this.uid="0",this.roomid=0,this.op=0,this.roler=""}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt64String(this.admin),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUInt32(this.op),e.pushUtf8String(this.roler),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.content="",this.requestId="",this.timestamp="0",this.extProps=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUtf8String(this.content),e.pushString(this.requestId),e.pushUInt64String(this.timestamp),e.pushUInt32(this.extProps.size);for(let[t,n]of this.extProps)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.content="",this.receiver="0",this.requestId="",this.timestamp="0",this.extProps=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUtf8String(this.content),e.pushUInt64String(this.receiver),e.pushString(this.requestId),e.pushUInt64String(this.timestamp),e.pushUInt32(this.extProps.size);for(let[t,n]of this.extProps)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.chat="",this.chatProps=new Map,this.extProps=new Map,this.requestId="",this.timestamp="0"}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUtf8String(this.chat),e.pushUInt32(this.chatProps.size);for(let[t,n]of this.chatProps)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());e.pushUInt32(this.extProps.size);for(let[t,n]of this.extProps)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.pushString(this.requestId),e.pushUInt64String(this.timestamp),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.roomid=0}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.roomid=0,this.roler=""}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.pushUtf8String(this.roler),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.roomid=0,this.num=0,this.pos=0}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.pushUInt32(this.num),e.pushUInt32(this.pos),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.infos=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid);let t=this.infos.size;e.pushUInt32(t);for(let[t,n]of this.infos)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.roomid=0}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.kOpUpdate=0]="kOpUpdate",e[e.kOpDel=1]="kOpDel",e[e.kOpSet=2]="kOpSet"}(t.OpType||(t.OpType={}));t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.op=0,this.infos={}}unmarshall(e){this.appid=e.popUInt32(),this.uid=e.popUInt64String(),this.roomid=e.popUInt32(),this.op=e.popUInt32();const t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popString(),n=e.popUtf8String();this.infos[t]=n}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.content="",this.receiver="0",this.requestId="",this.timestamp="0",this.extProps={}}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t);this.appid=n.popUInt32(),this.uid=n.popUInt64String(),this.roomid=n.popUInt32(),this.content=n.popUtf8String(),this.receiver=n.popUInt64String(),this.requestId=n.popString(),this.timestamp=n.popUInt64String();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popUtf8String(),t=n.popUtf8String();this.extProps[e]=t}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.ext=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUInt32(this.ext.size);for(let[t,n]of this.ext)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(module,exports,__webpack_require__){(function(global){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;!function(e,t){module.exports=t(e)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==global?global:this,function(global){"use strict";global=global||{};var _Base64=global.Base64,version="2.5.1",buffer;if(module.exports)try{buffer=eval("require('buffer').Buffer")}catch(e){buffer=void 0}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b64tab=function(e){for(var t={},n=0,o=e.length;n<o;n++)t[e.charAt(n)]=n;return t}(b64chars),fromCharCode=String.fromCharCode,cb_utob=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?fromCharCode(192|t>>>6)+fromCharCode(128|63&t):fromCharCode(224|t>>>12&15)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return fromCharCode(240|t>>>18&7)+fromCharCode(128|t>>>12&63)+fromCharCode(128|t>>>6&63)+fromCharCode(128|63&t)},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(e){return e.replace(re_utob,cb_utob)},cb_encode=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[b64chars.charAt(n>>>18),b64chars.charAt(n>>>12&63),t>=2?"=":b64chars.charAt(n>>>6&63),t>=1?"=":b64chars.charAt(63&n)].join("")},btoa=global.btoa?function(e){return global.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e)).toString("base64")}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e)).toString("base64")}:function(e){return btoa(utob(e))},encode=function(e,t){return t?_encode(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):_encode(String(e))},encodeURI=function(e){return encode(e,!0)},re_btou=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),cb_btou=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return fromCharCode(55296+(t>>>10))+fromCharCode(56320+(1023&t));case 3:return fromCharCode((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return fromCharCode((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=function(e){return e.replace(re_btou,cb_btou)},cb_decode=function(e){var t=e.length,n=t%4,o=(t>0?b64tab[e.charAt(0)]<<18:0)|(t>1?b64tab[e.charAt(1)]<<12:0)|(t>2?b64tab[e.charAt(2)]<<6:0)|(t>3?b64tab[e.charAt(3)]:0),r=[fromCharCode(o>>>16),fromCharCode(o>>>8&255),fromCharCode(255&o)];return r.length-=[0,0,2,1][n],r.join("")},_atob=global.atob?function(e){return global.atob(e)}:function(e){return e.replace(/\S{1,4}/g,cb_decode)},atob=function(e){return _atob(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=buffer?buffer.from&&Uint8Array&&buffer.from!==Uint8Array.from?function(e){return(e.constructor===buffer.constructor?e:buffer.from(e,"base64")).toString()}:function(e){return(e.constructor===buffer.constructor?e:new buffer(e,"base64")).toString()}:function(e){return btou(_atob(e))},decode=function(e){return _decode(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},noConflict=function(){var e=global.Base64;return global.Base64=_Base64,e};if(global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict,__buffer__:buffer},"function"==typeof Object.defineProperty){var noEnum=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)})),Object.defineProperty(String.prototype,"toBase64",noEnum(function(e){return encode(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,!0)}))}}return global.Meteor&&(Base64=global.Base64),module.exports?module.exports.Base64=global.Base64:(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return global.Base64}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)),{Base64:global.Base64}})}).call(this,__webpack_require__(18))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.opUid="0",this.uid="0",this.roomid=0,this.secs="0",this.disable=!1,this.reason=""}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt64String(this.opUid),e.pushUInt64String(this.uid),e.pushUInt32(this.roomid),e.pushUInt64String(this.secs),e.pushBool(this.disable),e.pushUtf8String(this.reason),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.opUid="0",this.tuids=[],this.roomid=0,this.secs="0",this.disable=!1,this.reason=""}unmarshall(e){this.appid=e.popUInt32(),this.opUid=e.popUInt64String();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popUInt64String();this.tuids.push(t)}this.roomid=e.popUInt32(),this.secs=e.popUInt64String(),this.disable=e.popBool(),this.reason=e.popUtf8String()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.roomid=0}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.context="",this.appid=0,this.roomid=0,this.opuid="0",this.extrakeys=[]}marshall(){let e=new o.default(!1);e.pushString(this.context),e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.pushUInt64String(this.opuid);let t=this.extrakeys.length;e.pushUInt32(t);for(let t of this.extrakeys)e.pushUtf8String(t.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.context="",this.appid=0,this.roomid=0,this.opuid="0"}marshall(){let e=new o.default(!1);return e.pushString(this.context),e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.pushUInt64String(this.opuid),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.context="",this.appid=0,this.roomid=0,this.opuid="0",this.extrakeys=[]}marshall(){let e=new o.default(!1);e.pushString(this.context),e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.pushUInt64String(this.opuid);let t=this.extrakeys.length;e.pushUInt32(t);for(let t of this.extrakeys)e.pushUtf8String(t.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.context="",this.appid=0,this.roomid=0,this.opuid="0",this.props=new Map}marshall(){let e=new o.default(!1);e.pushString(this.context),e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.pushUInt64String(this.opuid);let t=this.props.size;e.pushUInt32(t);for(let[t,n]of this.props)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.context="",this.appid=0,this.roomid=0,this.opuid="0",this.props=new Map}marshall(){let e=new o.default(!1);e.pushString(this.context),e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.pushUInt64String(this.opuid);let t=this.props.size;e.pushUInt32(t);for(let[t,n]of this.props)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.uid="0",this.roomid=0,this.lasttimeTs=0,this.extraAttributes={}}unmarshall(e){this.appid=e.popUInt32(),this.uid=e.popUInt64String(),this.roomid=e.popUInt32(),this.lasttimeTs=e.popNumber();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popUtf8String(),n=e.popUtf8String();this.extraAttributes[t]=n}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.context="",this.appid=0,this.roomid=0,this.uid="0",this.roomIdType="",this.anchorUuid="",this.anchorTimestamp=0,this.direction=0,this.limit=1,this.region="cn",this.msgTypes=[]}marshall(){let e=new o.default(!1);e.pushString(this.context),e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.pushUInt64String(this.uid),e.pushString(this.roomIdType),e.pushString(this.anchorUuid),e.pushUInt64String(this.anchorTimestamp.toString()),e.pushUInt32(this.direction),e.pushUInt32(this.limit),e.pushString(this.region);let t=this.msgTypes.length;e.pushUInt32(t);for(let t of this.msgTypes)e.pushUInt32(Number(t));return e.marshall()}}},function(e,t,n){var o,r,i=n(54),s=n(55),a=0,u=0;e.exports=function(e,t,n){var l=t&&n||0,c=t||[],p=(e=e||{}).node||o,d=void 0!==e.clockseq?e.clockseq:r;if(null==p||null==d){var h=i();null==p&&(p=o=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==d&&(d=r=16383&(h[6]<<8|h[7]))}var f=void 0!==e.msecs?e.msecs:(new Date).getTime(),g=void 0!==e.nsecs?e.nsecs:u+1,m=f-a+(g-u)/1e4;if(m<0&&void 0===e.clockseq&&(d=d+1&16383),(m<0||f>a)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=f,u=g,r=d;var y=(1e4*(268435455&(f+=122192928e5))+g)%4294967296;c[l++]=y>>>24&255,c[l++]=y>>>16&255,c[l++]=y>>>8&255,c[l++]=255&y;var b=f/4294967296*1e4&268435455;c[l++]=b>>>8&255,c[l++]=255&b,c[l++]=b>>>24&15|16,c[l++]=b>>>16&255,c[l++]=d>>>8|128,c[l++]=255&d;for(var I=0;I<6;++I)c[l+I]=p[I];return t||s(c)}},function(e,t,n){var o=n(54),r=n(55);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||o)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[i+a]=s[a];return t||r(s)}},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(130),i=n(3),s=n(7),a=n(13),u=n(14),l=new i.Logger("Svc");class c{constructor(e){this.handlers={},this.hummer=e,this.addEventListener(),this.start()}get h5_g_globals(){return this.hummer.h5_g_globals}get appid(){return this.h5_g_globals.appid}get ap(){return this.hummer.ap}get uid(){return this.h5_g_globals.uid}set uid(e){this.h5_g_globals.uid=e}addEventListener(){l.debug("addEventListener"),this.ap.on(u.AP_EVENTS.CONNECTION_STATE_CHANGED,e=>{this.onConnectionStateChange(e)}),this.ap.on(u.AP_EVENTS.BROADCAST,e=>{this.emit(u.SVC_EVENTS.BROADCAST_MESSAGE,e)}),this.ap.on(u.AP_EVENTS.BROADCAST_V2,e=>{this.emit(u.SVC_EVENTS.BROADCAST_MESSAGE_V2,e)}),this.ap.on(u.AP_EVENTS.UNICAST,e=>{this.onUnicast(e)})}get connectState(){return this.ap.connectState}start(){this.onConnectionStateChange(this.connectState)}stop(){}onConnectionStateChange(e){switch(e.state){case s.ConnectionState.CONNECTED:break;case s.ConnectionState.DISCONNECTED:e.reason===s.ConnectionChangeReason.LOGOUT&&this.stop()}}onUnicast(e){const t=this.decodeUnicastRes(e);t&&this.emit(u.SVC_EVENTS.UNICAST_MESSAGE,t)}decodeUnicastRes(e){return r.default.decodeUnicastRes(e)}decodeRouteRes(e){return r.default.decodeRouteRes(e)}sendData(e){return this.sendSvc(e.svcName,e.fnName,e.data,e.routeArgs,e.clientHeaders,e.protoType)}subscribeBcGroup(e){let t=[];for(let n of e)t.push({grpType:n.groupType,grpId:n.groupId});const n={subs:t};return this.ap.subscribeBc(n)}unSubscribeBcGroup(e){let t=[];for(let n of e)t.push({grpType:n.groupType,grpId:n.groupId});const n={unsubs:t};return this.ap.subscribeBc(n)}subscribeBcGroupV2(e){return new Promise((t,n)=>o(this,void 0,void 0,function*(){try{let o={subs:Array.isArray(e)?e:[e]};const r=yield this.ap.subscribeBcV2(o);t({rescode:r.rescode,msg:r.msg})}catch(e){n(e)}}))}unSubscribeBcGroupV2(e){return new Promise((t,n)=>o(this,void 0,void 0,function*(){try{let o={unsubs:Array.isArray(e)?e:[e]};const r=yield this.ap.subscribeBcV2(o);t({rescode:r.rescode,msg:r.msg})}catch(e){n(e)}}))}sendSvc(e,t,n,r,i,a){return this.h5_g_globals.bLostConnection?Promise.reject({rescode:s.kOperationTimeout,msg:"disconnect"}):new Promise((s,u)=>o(this,void 0,void 0,function*(){try{const o=yield this.ap.sendSvcData(this.appid,e,t,n,r,i,a),l=this.decodeRouteRes(o);s(l)}catch(e){u(e)}}))}}t.default=c,s.applyMixins(c,[a.Emitter])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=new(n(3).Logger)("SvcProtocol");t.default=class{static decodeRouteRes(e){o.debug("decodeRouteRes:",e);try{return e}catch(e){o.warn("decodeRouteRes: decode failed:",e)}return null}static decodeUnicastRes(e){o.debug("decodeUnicastRes:",e);try{return e}catch(e){o.warn("decodeUnicastRes: decode failed:",e)}return null}static decodeBroadcastRes(e){o.debug("decodeBroadcastRes:",e);try{return e}catch(e){o.warn("decodeBroadcastRes: decode failed:",e)}return null}}},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(132),s=n(38),a=n(59),u=n(5),l=n(3),c=n(7),p=n(13),d=n(20),h=n(14),f=n(171),g=n(172),m=n(16),y=n(22),b=n(21),I=new l.Logger("Peer"),v=["Online",""],O=3e5;class w extends i.default{constructor({appid:e}){super({appid:e}),this.queueEnable=!1,this.peerInfos=[],this.pollTimer=[],this.env=c.parseEnvParams(this.userRegion),null!=this.env?(I.debug("constructor"),this.initPollTimer(),this.addPeerEventListener(),this.start()):I.error("constructor: userRegion error")}get queueCount(){return c.QUEUE_COUNT}get userRegion(){return this.h5_g_globals.userRegion}get connected(){return this.ap.connectState.state==c.ConnectionState.CONNECTED}addPeerEventListener(){this.ap.on(h.AP_EVENTS.CONNECTION_STATE_CHANGED,e=>{this.onPeerConnectionStateChange(e)}),this.ap.on(h.AP_EVENTS.UNICAST,e=>{this.onUnicast(e)})}get cimService(){return`svc_${this.env.area}_cim_${this.env.type}_${this.env.name}_proxy`}initPeerStatus(){for(let e=0;e<c.LineState.TOTAL_SIZE;e++){this.peerInfos.push([]);for(let t=0;t<this.queueCount;t++){let n=!1,o=u.UZERO;e==c.LineState.OFFLINE&&(o=this.getOfflineSeqId(this.appid,this.uid,t)).greaterThan(0)&&(n=!0),this.peerInfos[e][t]={state:e,queueId:t,hasFirstGetMaxSeqSuccess:n,receivedMaxSeqId:o,maxPushSeqId:u.UZERO}}}I.debug("peerInfos=",this.peerInfos)}start(){this.onPeerConnectionStateChange(this.connectState)}stop(){this.resetTimer(),this.queueEnable=!1}getFirstMaxSeqId(e){return o(this,void 0,void 0,function*(){if(!e)return;const t=c.getMutexKey(c.MutexKey.getMaxSeqId,`${e.state}:${e.queueId}`);try{yield this.mutex.wait(t),this.mutex.lock(t);const n=yield this.getMaxSeqId(e.state,e.queueId);I.log(`getMaxSeqId[${e.state}:${e.queueId}]: res=`,n,typeof n.maxSeqId),n&&0===n.code&&(e.receivedMaxSeqId=n.maxSeqId,e.hasFirstGetMaxSeqSuccess=!0,e.state==c.LineState.OFFLINE&&this.setOfflineSeqId(this.appid,this.uid,e.queueId,n.maxSeqId),I.debug(`getMaxSeqId[${e.state}:${e.queueId}]: receivedMaxSeqId=`,e.receivedMaxSeqId),this.pullMsgIfAny(e.state,e.queueId),this.pollTimer[e.state][e.queueId]||(this.pollTimer[e.state][e.queueId]=setInterval(this.pullMsgPeriod.bind(this),O,e.state,e.queueId)))}catch(t){I.warn(`getFirstMaxSeqId[${e.state}:${e.queueId}]: e=`,t)}finally{this.mutex.unlock(t)}})}onPeerConnectionStateChange(e){switch(e.state){case c.ConnectionState.CONNECTED:this.initQueue().catch(e=>{I.warn("onConnectionStateChange:",e)}),this.pullMsgForQueue();break;case c.ConnectionState.DISCONNECTED:e.reason===c.ConnectionChangeReason.LOGOUT&&this.stop()}}pullMsgForQueue(){if(this.queueEnable){I.debug("pullMsgForQueue");for(let e=c.LineState.ONLINE;e<c.LineState.TOTAL_SIZE;e++)for(let t=0;t<this.queueCount;t++)setTimeout(this.pullMsgPeriod.bind(this),1e3,e,t)}}onUnicast(e){const t=this.decodeUnicastRes(e);if(t instanceof s.proto.IMPushMsgRequest){I.debug("onUnicast: res=",t);const e=t.queueId||0;if(!this.isValidQueueId(e))return void I.warn(`onUnicast: queue[${e}] not exists`);let n=this.getLineStateFromTopic(t.topic);if(n===c.LineState.UNKOWN)return void I.log("ignore IMPushMsgRequest as it not match topic=",t.topic);this.onReceivePushMsgRequest(t,this.peerInfos[n][e])}else I.log("ignore this unicast msg")}getLineStateFromTopic(e){let t=v.indexOf(e);return-1!==t&&t<c.LineState.TOTAL_SIZE?t:c.LineState.UNKOWN}onReceivePushMsgRequest(e,t){I.debug(`PeerService[${t.state}:${t.queueId}]: receive IMPushMsgRequest:`,e),e.region===this.env.region&&e.envType===this.env.type&&e.envName===this.env.name?(t.maxPushSeqId=e.seqId,t.hasFirstGetMaxSeqSuccess?this.pullMsgIfAny(t.state,t.queueId).catch(e=>{I.warn("pullMsgIfAny failed:",e)}):I.log("receive push msg. but wait for first get max seq success")):I.debug("ignore IMPushMsgRequest as it not match env:",this.env)}pullMsgIfAny(e,t){return o(this,void 0,void 0,function*(){let n=this.peerInfos[e][t];if(!n)return;const o=c.getMutexKey(c.MutexKey.pullPeerMsg,`${e}:${t}`);try{yield this.mutex.wait(o),this.mutex.lock(o);const e=yield this.pullMsgOnce(n);e&&e.hasMore&&(I.info("has more. schedule a new pull"),setTimeout(this.pullMsgIfAny.bind(this),100,n.state,n.queueId))}catch(e){I.warn("pull msgs: ",e)}finally{this.mutex.unlock(o)}})}notifyMessageListener(e){for(const t of e.msgs){let e=new Uint8Array(t.content.byteLength);switch(e.set(t.content,0),t.content=null,t.action){case s.proto.Action.kP2PMessage:{let t=new g.default;t.unmarshall(e);let n=t.toMessage();this.emit(h.HUMMER_EVENTS.P2P_MESSAGE,n);break}default:I.warn("unexpected action:",t.action)}}}pullMsgOnce(e){return o(this,void 0,void 0,function*(){if(!e.hasFirstGetMaxSeqSuccess)return I.log("the first GetMaxSeq request it not finished yet. wait"),null;const t=yield this.pullMsg({startSeqId:e.receivedMaxSeqId,queueId:e.queueId,limit:c.SIZE_LIMIT,state:e.state});return t.maxSeqId instanceof u&&t.maxSeqId.greaterThan(0)?(e.receivedMaxSeqId=t.maxSeqId,I.log(`pullMsgOnce receivedMaxSeqId[${e.state}:${e.queueId}] is updated to`,e.receivedMaxSeqId.toString()),e.state==c.LineState.OFFLINE&&this.setOfflineSeqId(this.appid,this.uid,e.queueId,t.maxSeqId)):I.log(`pullMsgOnce[${e.state}:${e.queueId}]: has_more=`,t.hasMore),t instanceof s.proto.PullMsgResponse?(this.notifyMessageListener(t),t):(I.log("pullMsgOnce: unkown sys msg"),null)})}pullMsgPeriod(e,t){return o(this,void 0,void 0,function*(){const n=this.peerInfos[e][t];if(!this.connected||!n)return;const o=c.getMutexKey(c.MutexKey.pullPeerMsg,`${e}:${t}`);try{yield this.mutex.wait(o),this.mutex.lock(o);const e=yield this.pullMsgOnce(n);e&&e.hasMore&&setTimeout(this.pullMsgPeriod.bind(this),100,n.state,n.queueId)}catch(e){I.warn("pullMsgPeriod: ",e)}finally{this.mutex.unlock(o)}})}decodeUnicastRes(e){return a.default.decodeUnicastRes(e)}decodeRouteRes(e){return a.default.decodeRouteRes(e)}getMaxSeqId(e,t=0){return o(this,void 0,void 0,function*(){const n=s.proto.GetMaxSeqIdRequest,o=n.create({logId:this.generateLogId(),appId:u.fromNumber(this.appid),selfUid:u.fromString(this.uid),topic:v[e],queueId:t});I.log(`getMaxSeqId[${e}:${t}]: req=`,o,"logId=",o.logId);let r=n.encode(o).finish();const i=yield this.send(this.cimService,"cim.proto.ProxyService.GetMaxSeqId",r);return i instanceof s.proto.GetMaxSeqIdResponse?0===i.code?(I.debug(`getMaxSeqId[${e}:${t}] res=`,i,", maxSeqId type=",typeof i.maxSeqId),"number"==typeof i.maxSeqId?{code:i.code,maxSeqId:u.fromNumber(i.maxSeqId)}:{code:i.code,maxSeqId:i.maxSeqId}):(I.warn("getMaxSeqId failed",i),{code:i.code,msg:i.msg}):(I.warn("getMaxSeqId: unexpected response:",i),{code:c.UNKOWN,msg:"unexpected response: "+i})})}initQueue(){return o(this,void 0,void 0,function*(){if(!this.queueEnable)try{this.queueEnable=!0,this.initPeerStatus();for(let e=c.LineState.ONLINE;e<c.LineState.TOTAL_SIZE;e++)for(let t=0;t<this.queueCount;t++){let n=this.peerInfos[e][t];n.hasFirstGetMaxSeqSuccess||this.getFirstMaxSeqId(n).catch(e=>{I.warn(`getFirstMaxSeqId[${t}]: e=`,e)})}}catch(e){I.warn("initQueue: e=",e)}})}pullMsg(e){return o(this,void 0,void 0,function*(){if(r.default.isEmpty(e.startSeqId))return{code:c.UNKOWN,msg:"start_seq_id is empty!"};if(0===e.limit)return{code:c.UNKOWN,msg:"limit is zero!"};let t;t="string"==typeof e.startSeqId?u.fromString(e.startSeqId):e.startSeqId;const n=s.proto.PullMsgRequest;let o=n.create({logId:this.generateLogId(),appId:u.fromNumber(this.appid),selfUid:u.fromString(this.uid),exclusiveStartSeqId:t,limit:e.limit,statisDeliveryDelay:!0,topic:v[e.state],queueId:e.queueId});I.log(`pullMsg[${e.state}:${e.queueId}]: req=`,o);let i=n.encode(o).finish();const a=yield this.send(this.cimService,"cim.proto.ProxyService.PullMsg",i);return a instanceof s.proto.PullMsgResponse?0===a.code?(I.log(`pullMsg[${e.state}:${e.queueId}]: res=`,a),a):(I.warn("pullMsg failed",a),{code:a.code,msg:a.msg}):(I.warn("pullMsg: unexpected res=",a),{code:c.UNKOWN,msg:"unexpected response: "+a})})}isValidQueueId(e){return!!(e<this.queueCount&&this.peerInfos[e])}resetTimer(){for(let e=c.LineState.ONLINE;e<c.LineState.TOTAL_SIZE;e++)for(let t of this.pollTimer[e])t&&clearInterval(t);this.initPollTimer()}initPollTimer(){this.pollTimer=[];for(let e=c.LineState.ONLINE;e<c.LineState.TOTAL_SIZE;e++)this.pollTimer.push([])}filterInnerKeys(e){const t={},n=["hmr_offline","hmr_timestamp"];for(let o of Object.keys(e))-1===n.indexOf(o)&&(t[o]=e[o]);return t}fetchUserOnlineStatus(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:c.kAnonymousOperation,msg:c.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:c.kOperationTimeout,msg:c.OPERATION_TIMEOUT});if(!e.uids||0===e.uids.length)return Promise.reject({rescode:c.kInvalid_Parameters,msg:c.INVALID_PARAMETERS});if(!c.isUint64StringArray(e.uids))return Promise.reject({rescode:c.kInvalid_Parameters,msg:c.INVALID_UID});let t=new f.default;t.appid=this.appid,t.opUid=this.h5_g_globals.uid,t.uids=e.uids;let n=t.marshall();const o=`svc_${c.parseEnvParams(this.h5_g_globals.userRegion).area}_chatroom_auther`;return this.send(o,"BatchCheckUserStatus",n)}sendP2PMessage(e){return this.h5_g_globals.isAnonymous?Promise.resolve({rescode:c.kAnonymousOperation,msg:c.kAnonymousTips}):this.connected?c.checkUid(e.receiver)?new Promise((t,n)=>o(this,void 0,void 0,function*(){try{let o=new g.default;o.appid=this.appid,o.opUid=this.uid,o.toUid=e.receiver;const i=e.message;switch(i.msgType){case m.MsgType.TEXT:o.type=m.MsgType.TEXT;let e=new y.default;e.text=i.content,o.content=e.marshall()}if(0===i.content.length&&0===Object.keys(e.appExtras).length)return t({rescode:c.kInvalid_Parameters,msg:c.INVALID_PARAMETERS});e.options&&(o.isOffline=e.options.isOffline||!1),o.uuid=b(),o.timestamp=(new Date).getTime(),e.appExtras&&(o.extensions=r.default.toMap(e.appExtras));let s=o.marshall();const a=`svc_${c.parseEnvParams(this.userRegion).area}_chatroom_auther`,u=this.send(a,"SendP2PMessage",s);t(u)}catch(e){n(e)}})):Promise.resolve({rescode:c.kInvalid_Parameters,msg:c.INVALID_UID}):Promise.resolve({rescode:c.kOperationTimeout,msg:c.OPERATION_TIMEOUT})}send(e,t,n){return this.h5_g_globals.bLostConnection?Promise.reject({rescode:c.kOperationTimeout,msg:c.OPERATION_TIMEOUT}):new Promise((r,i)=>o(this,void 0,void 0,function*(){try{const o=yield this.ap.sendData(this.appid,e,t,n),s=this.decodeRouteRes(o);r(s)}catch(e){i(e)}}))}setOfflineSeqId(e,t,n,o){let i=this.getOfflineSeqIds(e,t);if(i.length!==c.QUEUE_COUNT&&(i=[u.UZERO,u.UZERO]),i[n].greaterThan(o))return;i[n]=o;let s=`${i[0].toString()},${i[1].toString()}`;const a=`hummer_offline_seqid_${e}_${t}`;if(I.debug("setOfflineSeqId: key="+a+", value="+s),this.h5_g_globals.isMiniProgram)r.default.setWxCookie(a,s);else{let e="https:"==document.location.protocol;r.default.setCookie(a,s,168,"/",this.h5_g_globals.domain,e)}}getOfflineSeqIds(e,t){const n=`hummer_offline_seqid_${e}_${t}`;let o=(r.default.getCookie(n,this.h5_g_globals.isMiniProgram)||"0,0").split(","),i=[];for(let e=0;e<c.QUEUE_COUNT&&e<o.length;e++)i.push(u.fromString(o[e],!0));return i}getOfflineSeqId(e,t,n){if(n>=c.QUEUE_COUNT)return u.UZERO;return this.getOfflineSeqIds(e,t)[n]}}t.default=w,c.applyMixins(w,[p.Emitter,d.Base])},function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,a)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const r=n(3),i=n(1),s=n(133),a=n(163),u=n(7),l=n(37),c=n(164),p=n(36),d=n(35),h=n(13),f=n(165),g=n(5),m=n(20),y=n(14),b=n(57),I=n(166),v=n(58),O=new r.Logger("Hummer");class w{constructor({appid:e}){this.checkTimer=null,this.chatrooms=[],this.channels=new Map,this.rtsService=null,this.svc=null,this.handlers={},this.mutex=new d.default,i.default.isNumber(e)||O.warn("constructor: appid must be number"),this.appid=e,this.h5_g_globals=new a.default(e),this.h5_g_globals.appid=e,this.h5_g_globals.hiidoHost=u.getHiidoHost(!0),this.setScode(50275),this.ap=new s.default(this.h5_g_globals),this.addEventListener(),this.checkTimes=0,this.checkTimer=setInterval(this.onCheckTimer.bind(this),1e3),this.start()}get uid(){return this.h5_g_globals.uid}set uid(e){this.h5_g_globals.uid=e}get token(){return this.h5_g_globals.token}set token(e){this.h5_g_globals.token=e}get connectState(){return this.ap.connectState}get connected(){return this.ap.connectState.state==u.ConnectionState.CONNECTED}set connectState(e){this.ap.connectState=e}addEventListener(){this.addConnectionStateListener(),this.ap.on(y.AP_EVENTS.TOKEN_EXPIRED,()=>{this.emit(y.HUMMER_EVENTS.TOKEN_EXPIRED)}),this.ap.on(y.AP_EVENTS.TOKEN_WILL_EXPIRE,()=>{this.emit(y.HUMMER_EVENTS.TOKEN_WILL_EXPIRE)}),this.ap.on(y.AP_EVENTS.FORCEOUT_OFFLINE,e=>{O.debug("ForceOut: data=",e),this.emit(y.HUMMER_EVENTS.FORCEOUT_OFFLINE,{code:e.code,reason:e.reason}),this.onConnectionStateChange({state:u.ConnectionState.DISCONNECTED,reason:u.ConnectionChangeReason.REMOTE_LOGIN}),this.logout().catch(e=>{O.info("addEventListener: e=",e)})})}addConnectionStateListener(){this.ap.on(y.AP_EVENTS.CONNECTION_STATE_CHANGED,e=>{this.emit(y.HUMMER_EVENTS.CONNECTION_STATE_CHANGED,e),e.reason===u.ConnectionChangeReason.LOGOUT&&this.stop()})}onConnectionStateChange(e){b.looseEqual(e,this.connectState)||(this.connectState=e,this.emit(y.HUMMER_EVENTS.CONNECTION_STATE_CHANGED,e))}start(){O.log("start"),this.ap&&this.ap.start()}onCheckTimer(){let e=p.default.now();this.checkTimes++,this.ap&&this.ap.onCheckTimer(e,this.checkTimes)}setScode(e){i.default.isNumber(e)?(e<=0&&(e=0),O.debug("setScode: scode="+e),this.h5_g_globals.scode=e):O.error("setScode: scode must be a number")}setLogLevel(e=r.LOGLEVEL.LOG){r.Logger.setLevel(e)}getLog(){return r.Logger.getLog()}login(e){return"0"===e.uid?Promise.resolve({rescode:1011,msg:"UID should not be Anonymous"}):u.checkUid(e.uid)?new Promise((t,n)=>o(this,void 0,void 0,function*(){try{yield this.mutex.wait(u.MutexKey.login),this.mutex.lock(u.MutexKey.login);const o=this.getTokenType(e.tokenType);if(o===u.TokenType.UNKOWN)return n({rescode:u.UNKOWN,msg:"tokenType invalid"});this.h5_g_globals.tokenType=o,this.onConnectionStateChange({state:u.ConnectionState.CONNECTING,reason:u.ConnectionChangeReason.LOGIN});let r="0",s="";if(e?(r=e.uid,s=e.token):(r=i.default.getCookie("hummer_uid",this.h5_g_globals.isMiniProgram),s=i.default.getCookie("hummer_token",this.h5_g_globals.isMiniProgram)),"0"===r)return t({rescode:u.kAnonymousOperation,msg:u.kAnonymousTips});this.h5_g_globals.uid=r,this.h5_g_globals.token=s,O.log("login: appid="+this.appid+" uid="+this.h5_g_globals.uid+" tokenType="+this.h5_g_globals.tokenType+" token="+this.h5_g_globals.token);const a=yield this.ap.loginAp();if(a&&0===a.rescode){if(this.setCookie(r,s),e.region){let t=e.region;yield this.setUserRegion({region:t})}}else this.onConnectionStateChange({state:u.ConnectionState.DISCONNECTED,reason:u.ConnectionChangeReason.LOGIN_FAILURE});t(a)}catch(e){n(e)}finally{this.mutex.unlock(u.MutexKey.login)}})):Promise.resolve({rescode:u.kInvalid_Parameters,msg:u.INVALID_UID})}logout(e=!0){const t=this.h5_g_globals;return t.isAnonymous?Promise.resolve({rescode:u.kAnonymousOperation,msg:u.kAnonymousTips}):(O.debug("logout uid="+t.uid+" isAnonymous="+t.isAnonymous),this.h5_g_globals.bLostConnection?Promise.reject({rescode:u.kOperationTimeout,msg:u.OPERATION_TIMEOUT}):new Promise((n,r)=>o(this,void 0,void 0,function*(){try{yield this.mutex.wait(u.MutexKey.logout),this.mutex.lock(u.MutexKey.logout);const o=yield this.ap.logoutAp();o&&0===o.rescode&&(this.uid="0",t.logout(),e||t.isMiniProgram||(O.warn("Hummer.logout clear token"),this.clearCookie())),n(o)}catch(e){r(e)}finally{this.mutex.unlock(u.MutexKey.logout)}})))}refreshToken(e){return this.h5_g_globals.isAnonymous||"0"===this.uid?Promise.resolve({rescode:u.kAnonymousOperation,msg:u.kAnonymousTips}):new Promise((t,n)=>o(this,void 0,void 0,function*(){try{yield this.mutex.wait(u.MutexKey.login),this.mutex.lock(u.MutexKey.login),this.token=e.token;const o=yield this.ap.loginAp(u.TokenOpType.REFRESH);o&&0===o.rescode?(this.setCookie(this.uid,e.token),this.subscribeUserGroup()):this.onConnectionStateChange({state:u.ConnectionState.RECONNECTING,reason:u.ConnectionChangeReason.INTERRUPTED}),t(o)}catch(e){n(e)}finally{this.mutex.unlock(u.MutexKey.login)}}))}refreshToken1(e){return this.h5_g_globals.isAnonymous||"0"===this.uid?Promise.resolve({rescode:u.kAnonymousOperation,msg:u.kAnonymousTips}):this.connected?new Promise((t,n)=>o(this,void 0,void 0,function*(){try{yield this.mutex.wait(u.MutexKey.login),this.mutex.lock(u.MutexKey.login),this.token=e.token;const o=yield this.ap.refreshTokenAp();o&&0===o.rescode?(this.setCookie(this.uid,e.token),this.subscribeUserGroup()):this.onConnectionStateChange({state:u.ConnectionState.RECONNECTING,reason:u.ConnectionChangeReason.INTERRUPTED}),t(o)}catch(e){n(e)}finally{this.mutex.unlock(u.MutexKey.login)}})):this.refreshToken(e)}creatChannelInstance(e){const t=e.region?e.region:this.h5_g_globals.userRegion;let n=`${t}:${e.channelId}`;if(this.channels[n])return O.info(`creatChannelInstance: [${n}] exists!`),this.channels[n].room;let o=new v.default(this,t,e.channelId);return this.channels[n]={channel:v.default,region:t,channelId:e.channelId},O.info(`creatChannelInstance: [${n}]`),o}createChatRoom(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:u.kAnonymousOperation,msg:u.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:u.kOperationTimeout,msg:u.OPERATION_TIMEOUT});let t=new f.default;t.appid=this.appid,t.uid=this.h5_g_globals.uid,e.attributes&&(t.props=i.default.toMap(e.attributes));let n=t.marshall();const o=`svc_${u.parseEnvParams(e.region).area}_chatroom_auther`;return this.send(o,"CreateChatRoom",n)}getChatRoomUserCount(e){if(this.h5_g_globals.isAnonymous)return Promise.resolve({rescode:u.kAnonymousOperation,msg:u.kAnonymousTips});if(!this.connected)return Promise.resolve({rescode:u.kOperationTimeout,msg:u.OPERATION_TIMEOUT});if(!u.checkRoomid(e.roomid))return Promise.resolve({rescode:u.kInvalid_Parameters,msg:u.INVALID_ROOMID});let t=new I.default;t.appid=this.appid,t.roomid=e.roomid;const n=`svc_${u.parseEnvParams(e.region).area}_chatroom_online_query_d`;let o=t.marshall();return this.send(n,"GetUserCount",o)}getState(){return this.connectState.state}getConnectionState(){return this.connectState.state}getInstanceInfo(){return this.h5_g_globals.bLostConnection?Promise.resolve({rescode:u.kOperationTimeout,msg:u.OPERATION_TIMEOUT}):Promise.resolve({rescode:0,uid:this.uid,instanceId:this.h5_g_globals.instId,isAnonymous:this.h5_g_globals.isAnonymous,appid:this.h5_g_globals.appid})}setUserRegion(e){return new Promise((t,n)=>o(this,void 0,void 0,function*(){try{const o=l.hummerProto.SetUserRegionRequest;let r=o.create({logId:this.generateLogId(),appId:g.fromNumber(this.appid),selfUid:g.fromString(this.uid),region:e.region});O.debug("setUserRegion:",r,"logId=",r.logId.toString());let i=o.encode(r).finish();const s=u.parseEnvParams(e.region),a=`svc_${s.area}_cim_${s.type}_${s.name}_proxy`,c=yield this.send(a,"cim.proto.ProxyService.SetUserRegion",i);c instanceof l.hummerProto.SetUserRegionResponse?(O.log("setUserRegion res:",c),0===c.code&&(this.h5_g_globals.hiidoHost=u.getHiidoHost(s.innerFlag),this.h5_g_globals.userRegion=e.region),t({rescode:c.code,msg:c.msg})):(O.warn("setUserRegion: unexpected response:",c),t({rescode:u.UNKOWN,msg:"unexpected response: "+c}))}catch(e){n(e)}}))}decodeRouteRes(e){return c.default.decodeRouteRes(e)}send(e,t,n){return this.h5_g_globals.bLostConnection?Promise.reject({rescode:u.kOperationTimeout,msg:u.OPERATION_TIMEOUT}):new Promise((r,i)=>o(this,void 0,void 0,function*(){try{const o=yield this.ap.sendData(this.appid,e,t,n),s=this.decodeRouteRes(o);r(s)}catch(e){i(e)}}))}subscribeUserGroup(){this.ap.subscribeUserGroup(),this.ap.subscribeUserGroupV2()}setCookie(e,t){if(this.h5_g_globals.isMiniProgram)i.default.setWxCookie("hummer_uid",e),i.default.setWxCookie("hummer_token",t);else{let n="https:"==document.location.protocol;i.default.setCookie("hummer_uid",e,168,"/",this.h5_g_globals.domain,n),i.default.setCookie("hummer_token",t,168,"/",this.h5_g_globals.domain,n)}}clearCookie(){let e=document.cookie.split(";");for(let t=0;t<e.length;t++)/^hummer_/.test(e[t].split("=")[0].replace(/\s/,""))&&(document.cookie=e[t].split("=")[0].replace(/\s/,"")+"="+e[t].split("=")[1]+";expires="+new Date(1)+";domain="+this.h5_g_globals.domain+";path=/")}stop(){O.log("stop"),this.chatrooms=[],this.rtsService=null}}t.default=w,u.applyMixins(w,[h.Emitter,m.Base])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(134),r=n(7),i=n(135),s=n(3),a=n(137),u=n(138),l=n(6),c=n(2),p=n(1),d=n(139),h=n(140),f=n(141),g=n(142),m=n(36),y=n(143),b=n(147),I=n(149),v=n(150),O=n(151),w=n(152),S=n(153),k=n(154),_=n(155),P=n(156),T=n(157),U=n(158),x=n(159),E=n(160),M=n(13),R=n(14),C=n(57),A=n(161),j=n(162),N=new s.Logger("Ap");class q{constructor(e){this.wsAddr=r.WSHOST,this.connectState={state:r.ConnectionState.DISCONNECTED,reason:r.ConnectionChangeReason.INIT},this.logined=!1,this.loginState=r.LoginState.UNKOWN,this.link=null,this.latenceStat={min:0,max:0,avg:0,count:0,sum:0,timeout:0},this.handleDic=new Map,this.isTokenOk=!0,this.tokenState=r.TokenState.TOKEN_VALID,this.isPostLogin=!1,this.loginBuf=[],this.expireTimer=null,this.handlers={},this.h5_g_globals=e,this.wsState=g.default.INIT,this.lastTimerCheck=m.default.now(),this.lastRecvPong=m.default.now(),this.sendBuf=[],this.registerHandle()}get uid(){return this.h5_g_globals.uid}get token(){return this.h5_g_globals.token||""}get connected(){return this.connectState.state==r.ConnectionState.CONNECTED}registerHandle(){this.addHandle(l.default.PSvcLoginResURI,this.onPSvcLoginRes.bind(this)),this.addHandle(l.default.PSvcLogoutResURI,this.onPSvcLogoutRes.bind(this)),this.addHandle(l.default.PSvcTokenResURI,this.onPSvcTokenRes.bind(this)),this.addHandle(l.default.PSvcRouteResURI,this.onPSvcRouteRes.bind(this)),this.addHandle(l.default.PSvcSubsGroupResURI,this.onPSvcSubsGroupRes.bind(this)),this.addHandle(l.default.PCS_ServiceSubcribeUserGroupResV2URI,this.onPSvcSubsGroupResV2.bind(this)),this.addHandle(l.default.PSvcUnicastURI,this.onPSvcUnicast.bind(this)),this.addHandle(l.default.PSvcBroadcastURI,this.onPSvcBroadcast.bind(this)),this.addHandle(l.default.PCS_ServiceBroadCastV2URI,this.onPSvcBroadcastV2.bind(this)),this.addHandle(l.default.PAPForceOutURI,this.onAPForceOut.bind(this))}addHandle(e,t){this.handleDic.set(e,t)}onCheckTimer(e,t){if(this.wsState!=g.default.CLOSED&&this.link){if(this.wsState==g.default.CONNECTED&&e-this.lastTimerCheck>=5e3)if(this.lastTimerCheck=e,this.logined)this.pingAp().catch(e=>{N.warn(e)});else if(this.loginBuf.length>0)for(let e=0;e<this.loginBuf.length;e++)this.send(this.loginBuf[e].arraybuffer),this.loginBuf.splice(e,1);else this.isTokenOk&&this.tokenState!==r.TokenState.TOKEN_EXPIRED&&this.loginAp().then(e=>{this.onTokenExpired(e.rescode)}).catch(e=>{N.warn(e)})}else this.logined=!1,N.log("onCheckTimer check ap not ready. re-connect. wsState="+this.wsState+", isPostLogin="+this.isPostLogin),this.connect(),this.isPostLogin&&this.loginState!==r.LoginState.LOGOUT&&this.onConnectionStateChange({state:r.ConnectionState.RECONNECTING,reason:r.ConnectionChangeReason.INTERRUPTED});t%60==0&&this.reportRtt()}stop(){N.log("stop"),this.clearLoginBuf(),setTimeout(()=>{this.h5_g_globals.logout()},100),this.close()}clearSendBuf(){this.sendBuf.length>500&&(this.sendBuf=[])}deleteLoginBufBySeqId(e){for(let t=0;t<this.loginBuf.length;t++)this.loginBuf[t].seqId===e&&this.loginBuf.splice(t,1)}clearLoginBuf(){this.loginBuf=[]}pushLoginBuf(e){let t=this.loginBuf.length;t>20&&this.loginBuf.splice(0,t-20),this.loginBuf.push(e)}flushBuf(){const e=this.sendBuf.length;if(0!==e){N.log("flushBuf len="+e);for(let t=0;t<e;++t){let e=this.sendBuf[t];if(e.origin)this.send(e.data);else{let t=this.wrapApRouter(e);this.send(t.buf)}}}this.sendBuf=[]}onLoginAp(e){if(!C.looseEqual(e,this.connectState))switch(e.state==r.ConnectionState.CONNECTED&&(this.isPostLogin=!0,N.debug("onLoginAp: isPostLogin="+this.isPostLogin)),N.debug("onLoginAp: state="+JSON.stringify(e)),this.connectState=e,this.emit(R.AP_EVENTS.CONNECTION_STATE_CHANGED,e),this.logined=e.state===r.ConnectionState.CONNECTED,e.state){case r.ConnectionState.CONNECTED:this.flushBuf();break;case r.ConnectionState.DISCONNECTED:e.reason===r.ConnectionChangeReason.LOGOUT&&this.stop()}}onConnectionStateChange(e){C.looseEqual(e,this.connectState)||this.connectState.reason==r.ConnectionChangeReason.REMOTE_LOGIN&&e.reason===r.ConnectionChangeReason.LOGOUT||(this.connectState=e,this.emit(R.AP_EVENTS.CONNECTION_STATE_CHANGED,e))}appidReady(){return this.link&&this.wsState===g.default.CONNECTED&&this.logined}resetWsState(){N.log("resetWsState"),this.wsState=g.default.CLOSED,this.link&&this.link.reset(),this.clearSendBuf()}onopen(){if(N.log("onopen"),this.h5_g_globals.bLostConnection&&(this.h5_g_globals.bLostConnection=!1),this.wsState=g.default.CONNECTED,"0"!==this.uid&&this.isTokenOk&&0===this.loginBuf.length){const e={state:r.ConnectionState.RECONNECTING,reason:r.ConnectionChangeReason.INTERRUPTED};this.onConnectionStateChange(e)}if(this.loginBuf.length>0)for(let e=0;e<this.loginBuf.length;e++)this.send(this.loginBuf[e].arraybuffer),this.loginBuf.splice(e,1);else this.isTokenOk&&this.loginAp().then(e=>{this.onTokenExpired(e.code)}).catch(e=>{N.warn("onopen: loginAp err=",e)})}onclose(){N.log("onclose"),this.wsState!=g.default.CONNECTED||this.h5_g_globals.bLostConnection||(this.h5_g_globals.bLostConnection=!0),this.resetWsState()}onerror(e){N.debug("onerror err="+JSON.stringify(e)),this.resetWsState()}onData(e,t){let n=new c.default(t);if(e===l.default.PSvcPongURI){let e=new d.default;e.unmarshall(n),this.setHeartBeatTimeoutSecs(e);const t=this.h5_g_globals.seqContext[e.context];t&&(delete this.h5_g_globals.seqContext[e.context],t.resolve(e)),this.lastRecvPong=m.default.now()}else this.onProto(e,n)}setHeartBeatTimeoutSecs(e){e&&e.heartBeatTimeoutSecs&&(this.h5_g_globals.heartBeatTimeoutSecs=e.heartBeatTimeoutSecs)}onProto(e,t){const n=this.handleDic.get(e);void 0!==n?n(t):N.log("onProto UNKNOWN uri="+(e>>8&p.default.getUintMax())+"/"+(255&e))}send(e){this.link&&this.wsState==g.default.CONNECTED?this.link.send(e):N.warn("send failed")}sendLoginRequest(e,t){this.link&&this.wsState==g.default.CONNECTED?this.link.send(e):(N.log("sendLoginRequest socket is not ready, and try to cache"),this.pushLoginBuf({arraybuffer:e,seqId:t}))}wrapApRouter(e){let t=e.appid,n=e.svcName,o=e.fnName,r=e.routeArgs,i=e.clientHeaders,s=e.protoType,u=new a.default;if(e.preAllocSeq?u.context=e.preAllocSeq:u.context=this.h5_g_globals.getSeqId().toString(),u.uid=this.logined?this.h5_g_globals.uid:"0",u.appid=t,u.instId=this.h5_g_globals.instId,u.svcName=n,u.traceId="web_"+u.instId.toString()+"_"+u.context,o&&(u.fnName=o),s&&(u.protoType=s),u.data=e.data,u.dataCRC=0,r&&(u.routeArgs=r),i){if(!p.default.isMap(i))return void N.error("wrapApRouter clientHeaders should be a map!");for(let[e,t]of i)e!==a.APIVersion&&u.clientHeaders.set(e,t)}let l=u.marshall();return N.debug("wrapApRouter send service route request: "+u.toString()),{buf:l,seqId:u.context}}sendData(e,t,n,o){return new Promise((r,i)=>{N.debug("====== send ======",t,n);const s=Date.now();console.time(`sendData_${s}`);const a={appid:e,svcName:t,fnName:n,data:o,routeArgs:new Map,clientHeaders:new Map,protoType:"yyp"};this.sendAppData(a).then(e=>{if(N.debug("sendAppData cb",t,n),console.timeEnd(`sendData_${s}`),!e)return i(e);r(e)}).catch(e=>{i(e)})})}sendSvcData(e,t,n,o,r,i,s){return new Promise((a,u)=>{N.debug("====== send ======",t,n);const l=Date.now();if(console.time(`sendData_${l}`),r||(r=new Map),i||(i=new Map),!p.default.isMap(r)||!p.default.isMap(i))return void N.error("wrapApRouter routeArgs/clientHeaders should be a map!");const c={appid:e,svcName:t,fnName:n,data:o,routeArgs:r,clientHeaders:i,protoType:s||"yyp"};this.sendAppData(c).then(e=>{if(N.debug("sendAppData cb",t,n),console.timeEnd(`sendData_${l}`),!e)return u(e);a(e)}).catch(e=>{u(e)})})}sendAppData(e){return this.sendApRouter(e)}sendApRouter(e){let t="",n=new Promise((n,o)=>{if(this.appidReady()){let n=this.wrapApRouter(e);t=n.seqId,this.send(n.buf)}else{let r=Object.assign({},e);r.resolve=n,r.reject=o,r.preAllocSeq=this.h5_g_globals.getSeqId().toString(),r.fnName=e.fnName,r.uri=e.uri,t=r.preAllocSeq,this.sendBuf.push(r)}this.h5_g_globals.seqContext[t]={resolve:n,reject:o,appid:e.appid,svcName:e.svcName,fnName:e.fnName,protoType:e.protoType,uri:e.uri?e.uri:0,routeReqStartTs:m.default.now(),traceId:"web_"+this.h5_g_globals.instId.toString()+"_"+t}}),o=p.default.DelayPromise(r.TIME_OUT).then(()=>{let e=this.h5_g_globals;const n=e.seqContext[t];if(n){let o="appid:"+n.appid+" svcName:"+n.svcName+" fnName:"+n.fnName+" traceId:"+n.traceId;N.log("sendApRouter seqId:"+t+" time out. "+o);let i=new Map;i.set("appid",e.appid),i.set("uid",e.uid),i.set("serviceName",n.svcName),i.set("functionName",n.fnName),i.set("traceId",n.traceId),i.set("cost",r.TIME_OUT),i.set("uri",n.uri),i.set("sdkResCode",-3);let s=y.default.genUrl(i);if(y.default.sendUrl(s,e.isMiniProgram),b.default.report(e.scode,n.svcName,n.fnName,n.protoType,r.TIME_OUT,408),this.sendBuf){for(let e=this.sendBuf.length-1;e>=0;e--){let t=this.sendBuf[e].uri;t===l.default.PTextChatReqURI&&(N.warn("sendApRouter remove cached data, preAllocSeq="+this.sendBuf[e].preAllocSeq+" uri="+t),this.sendBuf.splice(e,1))}}throw delete e.seqContext[t],{rescode:r.kOperationTimeout,msg:r.OPERATION_TIMEOUT}}});return Promise.race([n,o])}onPSvcRouteRes(e){let t=new k.default;t.unmarshall(e);const n=this.h5_g_globals;let o=n.seqContext[t.context];if(o){let r=o.resolve,i=o.reject;N.log("onPSvcRouteRes:"+t.toString());let s=m.default.now()-o.routeReqStartTs,a=new Map;this.fillStatMap(a,e.uri,t),a.set("rtt",s),this.checkAndSendStatMap(a),b.default.report(n.scode,o.svcName,o.fnName,o.protoType,s,t.rescode),200===t.rescode?r&&r(t):i&&i({rescode:t.rescode,msg:t.msg,appid:o.appid,svcName:o.svcName,fnName:o.fnName,traceId:t.traceId}),delete n.seqContext[t.context]}}onPSvcSubsGroupRes(e){let t=new _.default;t.unmarshall(e);const n=this.h5_g_globals;let o=n.seqContext[t.context];if(o){let i=o.resolve,s=o.reject;N.log("onPSvcSubsGroupRes: "+JSON.stringify(t));let a=m.default.now()-o.subReqStartTs,u=new Map;this.fillStatMap(u,e.uri,t),u.set("rtt",a),u.set("tid",o.traceId),this.checkAndSendStatMap(u),b.default.report(n.scode,"svc_sub_v2","","",a,t.rescode),200===t.rescode?i&&i({context:t.context,rescode:r.SUCCESS,msg:r.OK,traceId:o.traceId}):s&&s({rescode:t.rescode,msg:"subs bc groups error",traceId:o.traceId}),delete n.seqContext[t.context]}else N.debug("onPSvcSubsGroupRes maybe timeout: context="+t.context+" rescode="+t.rescode)}onPSvcSubsGroupResV2(e){let t=new U.default;t.unmarshall(e);const n=this.h5_g_globals;let o=n.seqContext[t.context];if(o){let i=o.resolve,s=o.reject;N.log("onPSvcSubsGroupResV2: "+JSON.stringify(t));let a=m.default.now()-o.subReqStartTs,u=new Map;this.fillStatMap(u,e.uri,t),u.set("rtt",a),u.set("tid",o.traceId),this.checkAndSendStatMap(u),b.default.report(n.scode,"svc_sub","","",a,t.rescode),200===t.rescode?i&&i({context:t.context,rescode:r.SUCCESS,msg:t.msg,traceId:t.traceId}):s&&s({rescode:t.rescode,msg:t.msg,traceId:t.traceId}),delete n.seqContext[t.context]}else N.debug("onPSvcSubsGroupResV2 maybe timeout: context="+t.context+" rescode="+t.rescode)}fillStatMap(e,t,n){const r=this.h5_g_globals;e.set("said",r.appid),e.set("uid",r.uid),e.set("uri",t),e.set("sdkv","web_"+o.sdkVersion),n.svcName&&e.set("sn",n.svcName),n.fnName&&e.set("fn",n.fnName),n.traceId&&e.set("tid",r.uid+"_"+n.traceId),n.rescode?e.set("sc",n.rescode):e.set("sc",200),e.set("cc",1),e.set("no",0)}checkAndSendStatMap(e,t="ystrpc"){e.get("rtt")<0&&(e.set("rtt",p.default.getUintMax),N.warn("checkAndSendStatMap invalid cost value, set it to uint.max, map:"+JSON.stringify(e)));let n=y.default.genUrl(e,t,this.h5_g_globals.hiidoHost);y.default.sendUrl(n,this.h5_g_globals.isMiniProgram)}connect(){if(this.wsState!=g.default.CONNECTING&&this.wsState!=g.default.CONNECTED){const e=this.h5_g_globals,t=this.wsAddr+"/websocket?appid="+e.appid+"&version="+encodeURIComponent(o.sdkVersion.toString())+"&uuid="+encodeURIComponent(e.uuid);N.log("connect start to connect ws server. url="+t),this.link=new i.default(this,e.isMiniProgram),this.wsState=g.default.CONNECTING,this.link.connect(t)}else N.log("connect websocket is connecting/connected...")}close(){this.wsState!=g.default.CLOSING?(this.wsState=g.default.CLOSING,this.link&&this.link.reset()):N.log("connect websocket is closing...")}reportRtt(){this.latenceStat={min:0,max:0,avg:0,count:0,sum:0,timeout:0}}pingAp(){let e="",t=m.default.now(),n=new Promise((n,o)=>{let r=new h.default;r.appid=this.h5_g_globals.appid,r.context=this.h5_g_globals.getSeqId().toString(),e=r.context,this.send(r.marshall()),this.h5_g_globals.seqContext[e]={resolve:()=>{let e=m.default.now()-t;e<this.latenceStat.min?this.latenceStat.min=e:0==this.latenceStat.min&&(this.latenceStat.min=e),e>this.latenceStat.max?this.latenceStat.max=e:0==this.latenceStat.max&&(this.latenceStat.max=e),this.latenceStat.sum+=e,this.latenceStat.count+=1,this.latenceStat.avg=Math.round(this.latenceStat.sum/this.latenceStat.count)},reject:()=>{this.latenceStat.timeout+=1}}}),o=p.default.DelayPromise(r.TIME_OUT).then(()=>{if(this.h5_g_globals.seqContext[e])throw N.debug("pingAp ping seqId:"+e+" time out."),delete this.h5_g_globals.seqContext[e],this.latenceStat.timeout+=1,this.connected||this.resetWsState(),{rescode:r.kOperationTimeout,msg:r.OPERATION_TIMEOUT}});return Promise.race([n,o])}loginAp(e=r.TokenOpType.LOGIN){if("0"===this.uid)return N.debug("loginAp: waiting"),this.logined=!0,Promise.resolve({rescode:r.kAnonymousOperation,msg:r.kAnonymousTips});let t=m.default.now(),n="",i=new Promise((r,i)=>{this.h5_g_globals.loginApStartTs=t;let s=new u.default;s.context=this.h5_g_globals.getSeqId().toString(),s.uid=this.uid,s.appid=this.h5_g_globals.appid,s.instId=this.h5_g_globals.instId,s.seqId=parseInt(s.context),s.tokenType=this.h5_g_globals.tokenType,s.otp=this.token,s.traceId="web_"+s.instId+"_"+s.context,N.debug("loginAp: otp len="+s.otp.length),s.clientHeaders.set("SCKTerminal","web"),s.clientHeaders.set("SCKDeviceId","web_"+this.uid),s.clientHeaders.set("SCKSvcSdkVer",o.sdkVersion.toString()),s.context=s.context+":"+e,N.debug("loginAp: req="+JSON.stringify(s)),n=s.context,this.sendLoginRequest(s.marshall(),n),this.h5_g_globals.seqContext[n]={resolve:r,reject:i}}),s=p.default.DelayPromise(r.TIME_OUT).then(()=>{if(this.h5_g_globals.seqContext[n])throw N.debug("loginAp seqId:"+n+" time out."),delete this.h5_g_globals.seqContext[n],this.latenceStat.timeout+=1,this.deleteLoginBufBySeqId(n),this.isTokenOk=!1,this.parseLoginContext(n)===r.TokenOpType.LOGIN&&this.onLoginAp({state:r.ConnectionState.DISCONNECTED,reason:r.ConnectionChangeReason.LOGIN_TIMEOUT}),{rescode:r.kOperationTimeout,msg:r.OPERATION_TIMEOUT}});return Promise.race([i,s])}refreshTokenAp(){if("0"===this.uid)return N.debug("refreshToken: waiting"),this.logined=!0,Promise.resolve({rescode:r.UNKOWN,msg:"uid=0 no need to login"});let e=m.default.now(),t="",n=new Promise((n,r)=>{this.h5_g_globals.loginApStartTs=e;let i=new A.default;i.context=this.h5_g_globals.getSeqId().toString(),i.uid=this.uid,i.appid=this.h5_g_globals.appid,i.instId=this.h5_g_globals.instId,i.seqId=parseInt(i.context),i.tokenType=this.h5_g_globals.tokenType,i.otp=this.token,i.traceId="web_"+i.instId+"_"+i.context,N.debug("refreshTokenAp: otp len="+i.otp.length),i.clientHeaders.set("SCKTerminal","web"),i.clientHeaders.set("SCKDeviceId","web_"+this.uid),i.clientHeaders.set("SCKSvcSdkVer",o.sdkVersion.toString()),N.debug("refreshTokenAp: req="+JSON.stringify(i)),t=i.context,this.sendLoginRequest(i.marshall(),t),this.h5_g_globals.seqContext[t]={resolve:n,reject:r}}),i=p.default.DelayPromise(r.TIME_OUT).then(()=>{if(this.h5_g_globals.seqContext[t])throw N.debug("refreshTokenAp seqId:"+t+" time out."),delete this.h5_g_globals.seqContext[t],this.latenceStat.timeout+=1,this.deleteLoginBufBySeqId(t),this.isTokenOk=!1,{rescode:r.kOperationTimeout,msg:r.OPERATION_TIMEOUT}});return Promise.race([n,i])}logoutAp(){const e=this.h5_g_globals;if(e.isAnonymous)return N.debug("logout anonymous user not need to logout."),Promise.resolve({rescode:r.UNKOWN,msg:"anonymous uid="+e.uid+" not need to logout"});let t="",n=new Promise((n,o)=>{this.emit(R.AP_EVENTS.TRY_LOGOUT),e.logoutApStartTs=m.default.now();let r=new f.default;r.context=e.getSeqId().toString(),r.uid=e.uid,r.appid=e.appid,r.instId=e.instId,N.debug("logoutAp: req="+JSON.stringify(r)),setTimeout(()=>{this.send(r.marshall())},500),t=r.context,this.h5_g_globals.seqContext[t]={resolve:n,reject:o}}),o=p.default.DelayPromise(r.TIME_OUT).then(()=>{if(e.seqContext[t])throw N.log("logoutAp seqId:"+t+" time out."),delete e.seqContext[t],this.latenceStat.timeout+=1,{rescode:r.kOperationTimeout,msg:r.OPERATION_TIMEOUT}});return Promise.race([n,o])}onPSvcLoginRes(e){let t=new x.default;t.unmarshall(e);const n=this.h5_g_globals;let o=n.seqContext[t.context];if(o){let i=o.resolve;o.reject;delete n.seqContext[t.context],N.debug("onPSvcLoginRes: "+JSON.stringify(t));let s=m.default.now()-this.h5_g_globals.loginApStartTs,a=new Map;if(this.fillStatMap(a,e.uri,t),a.set("rtt",s),this.checkAndSendStatMap(a,"ystsvclogin"),b.default.report(this.h5_g_globals.scode,"svc_login","","",s,t.rescode),200===t.rescode){N.debug("onPSvcLoginRes success: "+JSON.stringify(t)),this.h5_g_globals.userType=r.UserType.NON_ANONYMOUS,this.loginState=r.LoginState.LOGIN,this.isTokenOk=!0,this.tokenState=r.TokenState.TOKEN_VALID,this.onLoginAp({state:r.ConnectionState.CONNECTED,reason:r.ConnectionChangeReason.LOGIN_SUCCESS}),i&&i({rescode:r.SUCCESS,msg:r.OK});const e=this.parseTokenExpireTiming(t.serverHeaders);this.handleTokenExpireTimer(e)}else{this.clearExpireTimer(),N.warn("onPSvcLoginRes:",t);const e=this.parseTokenStatus(t.serverHeaders)||{code:t.rescode,msg:t.msg};this.start(),i&&i({rescode:e.code,msg:e.msg})}}else N.log("onPSvcLoginRes: "+JSON.stringify(t))}onPSvcTokenRes(e){let t=new j.default;t.unmarshall(e);const n=this.h5_g_globals;let o=n.seqContext[t.context];if(o){let i=o.resolve;o.reject;delete n.seqContext[t.context],N.debug("onPSvcTokenRes: "+JSON.stringify(t));let s=m.default.now()-this.h5_g_globals.loginApStartTs,a=new Map;if(this.fillStatMap(a,e.uri,t),a.set("rtt",s),this.checkAndSendStatMap(a,"ystsvclogin"),b.default.report(this.h5_g_globals.scode,"svc_login","","",s,t.rescode),200===t.rescode){N.debug("onPSvcTokenRes success: "+JSON.stringify(t)),this.h5_g_globals.userType=r.UserType.NON_ANONYMOUS,this.loginState=r.LoginState.LOGIN,this.isTokenOk=!0,this.tokenState=r.TokenState.TOKEN_VALID,this.onLoginAp({state:r.ConnectionState.CONNECTED,reason:r.ConnectionChangeReason.LOGIN_SUCCESS}),i&&i({rescode:r.SUCCESS,msg:r.OK});const e=this.parseTokenExpireTiming(t.serverHeaders);this.handleTokenExpireTimer(e)}else{this.clearExpireTimer(),N.warn("onPSvcTokenRes:",t);const e=this.parseTokenStatus(t.serverHeaders)||{code:t.rescode,msg:t.msg};this.tokenState=e.code==r.ExpiredTokenException?r.TokenState.TOKEN_EXPIRED:r.TokenState.TOKEN_INVALID,this.start(),i&&i({rescode:e.code,msg:e.msg})}}else N.log("onPSvcTokenRes: "+JSON.stringify(t))}onPSvcLogoutRes(e){let t=new E.default;t.unmarshall(e);const n=this.h5_g_globals,o=n.seqContext[t.context];if(o){let i=o.resolve;o.reject;delete n.seqContext[t.context],N.log("onPSvcLogoutRes: "+JSON.stringify(t));let s=m.default.now()-this.h5_g_globals.logoutApStartTs,a=new Map;if(this.fillStatMap(a,e.uri,t),a.set("cost",s),this.checkAndSendStatMap(a),b.default.report(this.h5_g_globals.scode,"svc_logout","","",s,t.rescode),200===t.rescode){i&&i({rescode:r.SUCCESS,msg:r.OK});const e={state:r.ConnectionState.DISCONNECTED,reason:r.ConnectionChangeReason.LOGOUT};this.loginState=r.LoginState.LOGOUT,this.onConnectionStateChange(e)}else i&&i({rescode:t.rescode,msg:t.msg})}else N.log("onPSvcLogoutRes: "+JSON.stringify(t))}subscribeBc(e){const t=this.h5_g_globals,n=t.getSeqId().toString();let o=new Promise((o,r)=>{let i=new P.default;if(i.context=n,i.appid=t.appid,e.subs){i.joinGroups=e.subs;let n=e.subs.length;for(let o=0;o<n;++o){let n=e.subs[o].grpType+"_"+e.subs[o].grpId;t.userGroups.subs[n]=1}}if(e.unsubs){i.leaveGroups=e.unsubs;let n=e.unsubs.length;for(let o=0;o<n;++o){let n=e.unsubs[o].grpType+"_"+e.unsubs[o].grpId;t.userGroups.unsubs[n]=1}}N.log("subscribeBc "+JSON.stringify(i));let s=i.marshall();if(this.appidReady())this.send(s);else{let e={data:s,resolve:o,reject:r,origin:!0};this.sendBuf.push(e)}t.seqContext[n]={resolve:o,reject:r,subReqStartTs:m.default.now(),traceId:"web_"+t.instId+"_"+i.context}}),i=p.default.DelayPromise(r.TIME_OUT).then(()=>{const e=t.seqContext[n];if(e){N.warn("subscribeBc seqId:"+n+" timeout.");let o=new Map;throw this.fillStatMap(o,l.default.PSvcSubsGroupReqURI,e),o.set("rrt",r.TIME_OUT),o.set("cc",-3),this.checkAndSendStatMap(o),b.default.report(t.scode,"svc_sub","","",r.TIME_OUT,408),delete t.seqContext[n],{rescode:r.kOperationTimeout,msg:r.OPERATION_TIMEOUT}}});return Promise.race([o,i])}subscribeBcV2(e){const t=this.h5_g_globals;let n=t.getSeqId().toString(),o=new Promise((o,r)=>{let i=new T.default;if(i.context=n,i.appid=t.appid,i.traceId="web_"+t.instId+"_"+i.context,e.subs){i.join=e.subs;for(const n of e.subs)-1===t.userGroupsV2.subs.indexOf(n)&&t.userGroupsV2.subs.push(n)}if(e.unsubs){i.leave=e.unsubs;for(const n of e.unsubs)-1===t.userGroupsV2.unsubs.indexOf(n)&&t.userGroupsV2.unsubs.push(n)}N.log("subscribeBcV2: "+JSON.stringify(i));let s=i.marshall();if(this.appidReady())this.send(s);else{let e={data:s,resolve:o,reject:r,origin:!0};this.sendBuf.push(e)}t.seqContext[n]={resolve:o,reject:r,subReqStartTs:m.default.now(),traceId:i.traceId}}),i=p.default.DelayPromise(r.TIME_OUT).then(()=>{const e=t.seqContext[n];if(e){N.warn("subscribeBcV2 seqId:"+n+" timeout.");let o=new Map;throw this.fillStatMap(o,l.default.PSvcSubsGroupReqURI,e),o.set("rrt",r.TIME_OUT),o.set("cc",-3),this.checkAndSendStatMap(o),b.default.report(t.scode,"svc_sub","","",r.TIME_OUT,408),delete t.seqContext[n],{rescode:r.kOperationTimeout,msg:r.OPERATION_TIMEOUT}}});return Promise.race([o,i])}subscribeUserGroup(){this.filterUnsubs();const e=this.h5_g_globals;let t=e.userGroups.subs,n=[],o=Object.keys(t);for(let e=0;e<o.length;++e){let t=o[e].split("_");n.push({grpType:t[0],grpId:t[1]})}t=e.userGroups.unsubs;let r=[],i=Object.keys(t);for(let e=0;e<i.length;++e){let t=i[e].split("_");r.push({grpType:t[0],grpId:t[1]})}(n&&n.length||r&&r.length)&&(N.log("subscribeUserGroup re-subs groups. subs:"+JSON.stringify(n)+" unsubs:"+JSON.stringify(r)),this.subscribeBc({subs:n,unsubs:r}).catch(e=>{N.warn(e)}))}subscribeUserGroupV2(){this.filterUnsubsV2();const e=this.h5_g_globals.userGroupsV2.subs,t=this.h5_g_globals.userGroupsV2.unsubs;(e&&e.length||t&&t.length)&&(N.log("subscribeUserGroupV2 re-subs groups. subs="+JSON.stringify(e)+" unsubs="+JSON.stringify(t)),this.subscribeBcV2({subs:e,unsubs:t}).catch(e=>{N.warn(e)}))}filterUnsubs(){for(let e in this.h5_g_globals.userGroups.unsubs)for(let t in this.h5_g_globals.userGroups.subs)JSON.stringify(this.h5_g_globals.userGroups.unsubs[e])===JSON.stringify(this.h5_g_globals.userGroups.subs[t])&&delete this.h5_g_globals.userGroups.unsubs[e]}filterUnsubsV2(){this.h5_g_globals.userGroupsV2.subs.forEach(e=>{const t=this.h5_g_globals.userGroupsV2.unsubs.indexOf(e);-1!==t&&this.h5_g_globals.userGroupsV2.unsubs.splice(t,1)})}start(){N.log("start"),this.connect()}onPSvcUnicast(e){let t=new I.default;t.unmarshall(e);let n=new Map;this.fillStatMap(n,e.uri,t),n.set("length",t.data.byteLength),this.checkAndSendStatMap(n),N.log("onPSvcUnicast:"+t.toString());const o={appid:t.appid,svcName:t.svcName,fnName:t.fnName,protoType:t.protoType,traceId:t.traceId,data:t.data};this.emit(R.AP_EVENTS.UNICAST,o);let r=new v.default;r.context=t.context;let i=r.marshall();this.send(i)}onPSvcBroadcast(e){let t=new O.default;t.unmarshall(e);let n=t.groupType.toString()+"_"+t.groupId.toString();if(N.log("onPSvcBroadcast:"+t.toString()+" bcKey="+n+" isInnerBcGroup="+this.h5_g_globals.innerBcGroups[n]),this.h5_g_globals.innerBcGroups[n]){let e=new Uint8Array(t.data.byteLength);e.set(t.data,0),t.data=null;let n=new DataView(e.buffer),o=new c.default(n);this.emit(R.AP_EVENTS.INNER_BROADCAST,o)}else this.invokeBroadCastCallback(t)}invokeBroadCastCallback(e){const t={appid:e.appid,bcGroup:{groupType:e.groupType.toString(),groupId:e.groupId.toString()},svcName:e.svcName,fnName:e.fnName,protoType:e.protoType,traceId:e.traceId,data:e.data};this.emit(R.AP_EVENTS.BROADCAST,t)}onPSvcBroadcastV2(e){let t=new S.default;t.unmarshall(e);let n=t.ugid;N.log("onPSvcBroadcastV2: "+t.toString()+" bcKey="+n),this.invokeBroadCastV2Callback(t)}invokeBroadCastV2Callback(e){const t={appid:e.appid,bc_group:e.ugid,svcName:e.svcName,fnName:e.fnName,protoType:e.protoType,traceId:e.traceId,data:e.data};this.emit(R.AP_EVENTS.BROADCAST_V2,t)}onAPForceOut(e){let t=new w.default;t.unmarshall(e),N.log("onAPForceOut pkg="+JSON.stringify(t));const n={code:t.code,reason:t.desc};this.h5_g_globals.instId===t.instId&&this.emit(R.AP_EVENTS.FORCEOUT_OFFLINE,n)}parseLoginContext(e){let t=e.split(":");return 2===t.length?Number(t[1]):r.TokenOpType.LOGIN}onTokenExpired(e){e===r.ExpiredTokenException&&(this.emit(R.AP_EVENTS.TOKEN_EXPIRED),this.isTokenOk=!1,this.tokenState=r.TokenState.TOKEN_EXPIRED)}onTokenWillExpire(){this.emit(R.AP_EVENTS.TOKEN_WILL_EXPIRE)}handleTokenExpireTimer(e){if(this.clearExpireTimer(),!e||e<r.EXPIRED_DELTA||e>r.UPPER_LIMIT)return void console.log("expireTiming is invalid");N.log("tokenWillExpire timer start: expireTiming="+e);const t=e-r.EXPIRED_DELTA;this.expireTimer=setTimeout(this.onTokenWillExpire.bind(this),t)}clearExpireTimer(){this.expireTimer&&(clearTimeout(this.expireTimer),delete this.expireTimer,this.expireTimer=null)}parseTokenStatus(e){if(p.default.hasOwn(e,"tokenservice-errorCode")&&p.default.hasOwn(e,"tokenservice-errorMsg")){return{code:Number(e["tokenservice-errorCode"]),msg:e["tokenservice-errorMsg"]}}return null}parseTokenExpireTiming(e){return p.default.hasOwn(e,"tokenservice-expireTiming")?Number(e["tokenservice-expireTiming"]):null}}r.applyMixins(q,[M.Emitter]),t.default=q},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION="3.2.2",t.sdkVersion=1608105575},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(3),r=n(136),i=n(56),s=new o.Logger("ProtoLink");t.default=class{constructor(e,t=!1){this.linkHandler=null,this.ws=null,this.connected=!1,this.linkHandler=e,this.bMiniProgram=t}destroy(){this.linkHandler=null,this.reset()}connect(e){this.reset(),this.bMiniProgram?(this.ws=new r.default(e),this.ws.onopen(()=>this.onopen()),this.ws.onerror(e=>this.onerror(e)),this.ws.onclose(()=>this.onclose()),this.ws.onmessage(e=>this.onmessage(e))):(this.ws=new WebSocket(e),this.ws.binaryType="arraybuffer",this.ws.onopen=this.onopen.bind(this),this.ws.onerror=this.onerror.bind(this),this.ws.onclose=this.onclose.bind(this),this.ws.onmessage=this.onmessage.bind(this))}reset(){this.ws&&(this.connected=!1,this.bMiniProgram?this.ws.close():(this.ws.onopen=null,this.ws.onerror=null,this.ws.onclose=null,this.ws.onmessage=null,this.ws.close()),this.ws=null)}send(e){this.ws&&this.connected&&(this.ws.readyState===i.WebSocketState.OPEN?this.ws.send(e):s.warn("send fail: readyState="+this.ws.readyState))}onopen(){this.connected=!0,this.linkHandler&&this.linkHandler.onopen()}onerror(e){this.connected=!1,this.ws=null,this.linkHandler&&(this.linkHandler.onerror(e),this.linkHandler=null)}onclose(){this.connected=!1,this.ws=null,this.linkHandler&&(this.linkHandler.onclose(),this.linkHandler=null)}onmessage(e){e.data instanceof ArrayBuffer?this.processArrayBuffer(e.data):this.processText(e.data)}processText(e){s.debug("processText data=",e)}processArrayBuffer(e){let t=new DataView(e),n=0,o=0,r=0;for(;n+10<e.byteLength;){if(n+(o=t.getUint32(n,!0))>e.byteLength||o<10)return void s.error("processArrayBuffer length error pktLen="+o+" bufferLen="+e.byteLength);r=t.getUint32(n+4,!0);let i=new DataView(e,n,o);this.linkHandler&&this.linkHandler.onData(r,i),n+=o}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(3),r=n(56),i=new o.Logger("WxWebsocket");t.default=class{constructor(e){this.ws=null,this.ws=wx.connectSocket({url:e}),i.log("constructor: url="+e)}get readyState(){return this.ws?this.ws.readyState:r.WebSocketState.OPEN}close(){this.ws?this.ws.close():wx.closeSocket()}send(e){this.ws?this.ws.send({data:e.buffer}):wx.sendSocketMessage({data:e.buffer,fail:function(e){i.error("send wx sendSocketMessage failed err="+JSON.stringify(e))}})}onopen(e){this.ws?this.ws.onOpen(e):wx.onSocketOpen(e)}onerror(e){this.ws?this.ws.onError(e):wx.onSocketError(e)}onclose(e){this.ws?this.ws.onClose(e):wx.onSocketClose(e)}onmessage(e){this.ws?this.ws.onMessage(e):wx.onSocketMessage(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(6),i=n(1);t.APIVersion="APIVersion";t.default=class{constructor(){this.context="",this.uid="0",this.appid=0,this.instId=0,this.svcName="",this.fnName="",this.protoType="",this.data=null,this.dataCRC=0,this.routeArgs=new Map,this.clientHeaders=new Map,this.clientHeaders.set(t.APIVersion,"v2"),this.traceId=""}marshall(){let e=new o.default;e.setUri(r.default.PSvcRouteReqURI),e.pushString(this.context),e.pushUInt64String(this.uid),e.pushUInt32(this.appid),e.pushUInt32(this.instId),e.pushString(this.svcName),e.pushString(this.fnName),e.pushString(this.protoType),"string"==typeof this.data?e.pushString32(this.data):e.pushUint8Array32(this.data),e.pushUInt32(this.dataCRC),e.pushUInt32(this.routeArgs.size);for(let[t,n]of this.routeArgs)e.pushString(t),e.pushUtf8String(n);e.pushUInt32(this.clientHeaders.size);for(let[t,n]of this.clientHeaders)e.pushString(t),e.pushUtf8String(n);return e.pushString(this.traceId),e.marshall()}toString(){return"context="+this.context+" uid="+this.uid+" appid="+this.appid+" instId="+this.instId+" svcName="+this.svcName+" fnName="+this.fnName+" traceId="+this.traceId+" routeArgs="+i.default.stringfyMap(this.routeArgs)+" clientHeaders="+i.default.stringfyMap(this.clientHeaders)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(6);t.default=class{constructor(){this.context="",this.uid="0",this.appid=0,this.instId=0,this.seqId=0,this.user="",this.password="",this.otp="",this.clientHeaders=new Map,this.tokenType=0,this.traceId=""}marshall(){let e=new o.default;e.setUri(r.default.PSvcLoginReqURI),e.pushString(this.context),e.pushUInt64String(this.uid),e.pushUInt32(this.appid),e.pushUInt32(this.instId),e.pushUInt64String(this.seqId.toString()),e.pushString(this.user),e.pushString(this.password),e.pushString(this.otp),e.pushUInt32(this.clientHeaders.size);for(let[t,n]of this.clientHeaders)e.pushString(t),e.pushString(n);return e.pushUInt32(this.tokenType),e.pushString(this.traceId),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.context="",this.timestamp=null,this.heartBeatTimeoutSecs=60,this.extension={}}unmarshall(e){this.context=e.popString(),this.timestamp=e.popUInt64(),this.heartBeatTimeoutSecs=e.popUInt32()||60;const t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popString(),n=e.popString();this.extension[t]=n}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(6);t.default=class{constructor(){this.context="",this.appid=0,this.extension=new Map}marshall(){let e=new o.default;e.setUri(r.default.PSvcPingURI),e.pushString(this.context),e.pushUInt32(this.appid);let t=this.extension.size;e.pushUInt32(t);for(let[t,n]of this.extension)e.pushString(t.toString()),e.pushString(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(6);t.default=class{constructor(){this.context="",this.uid="0",this.appid=0,this.instId=0}marshall(){let e=new o.default;return e.setUri(r.default.PSvcLogoutReqURI),e.pushString(this.context),e.pushUInt64String(this.uid),e.pushUInt32(this.appid),e.pushUInt32(this.instId),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={INIT:"init",CONNECTING:"connecting",CONNECTED:"connected",CLOSING:"closing",CLOSED:"closed"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(3),r=n(36),i=n(1),s=n(144),a=new o.Logger("HiidoUtil");t.default=class{static genUrl(e,t="ystrpc",n="mlog.hiido.com"){let o="https://"+n+"/c.gif?",i=r.default.utc(),a=t+i+"HiidoYYSystem",u=o+"act="+t+"&time="+i+"&key="+(a=s(a));for(let[t,n]of e)u+="&"+t+"="+n;return u}static sendUrl(e,t){if(a.debug("sendUrl url:"+e),t){let t=e.indexOf("?"),n=e.slice(0,t),o=e.slice(t+1).split("&"),r=o.length,s={};for(let e=0;e<r;e++)t=o[e].indexOf("="),s[o[e].slice(0,t)]=o[e].slice(t+1);i.default.yFetch({url:n,data:s})}else(new Image).src=e}}},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;
/**
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.7.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/
/**
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.7.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
*/
!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(146),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createOutputMethod(n)}return e},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(e){if("string"==typeof e)return crypto.createHash("md5").update(e,"utf8").digest("hex");if(null==e)throw ERROR;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash("md5").update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod};function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if("string"!==n){if("object"!==n)throw ERROR;if(null===e)throw ERROR;if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw ERROR;t=!0}for(var o,r,i=0,s=e.length,a=this.blocks,u=this.buffer8;i<s;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)if(ARRAY_BUFFER)for(r=this.start;i<s&&r<64;++i)u[r++]=e[i];else for(r=this.start;i<s&&r<64;++i)a[r>>2]|=e[i]<<SHIFT[3&r++];else if(ARRAY_BUFFER)for(r=this.start;i<s&&r<64;++i)(o=e.charCodeAt(i))<128?u[r++]=o:o<2048?(u[r++]=192|o>>6,u[r++]=128|63&o):o<55296||o>=57344?(u[r++]=224|o>>12,u[r++]=128|o>>6&63,u[r++]=128|63&o):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),u[r++]=240|o>>18,u[r++]=128|o>>12&63,u[r++]=128|o>>6&63,u[r++]=128|63&o);else for(r=this.start;i<s&&r<64;++i)(o=e.charCodeAt(i))<128?a[r>>2]|=o<<SHIFT[3&r++]:o<2048?(a[r>>2]|=(192|o>>6)<<SHIFT[3&r++],a[r>>2]|=(128|63&o)<<SHIFT[3&r++]):o<55296||o>=57344?(a[r>>2]|=(224|o>>12)<<SHIFT[3&r++],a[r>>2]|=(128|o>>6&63)<<SHIFT[3&r++],a[r>>2]|=(128|63&o)<<SHIFT[3&r++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),a[r>>2]|=(240|o>>18)<<SHIFT[3&r++],a[r>>2]|=(128|o>>12&63)<<SHIFT[3&r++],a[r>>2]|=(128|o>>6&63)<<SHIFT[3&r++],a[r>>2]|=(128|63&o)<<SHIFT[3&r++]);this.lastByteIndex=r,this.bytes+=r-this.start,r>=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,o,r,i,s=this.blocks;this.first?t=((t=((e=((e=s[0]-680876937)<<7|e>>>25)-271733879<<0)^(n=((n=(-271733879^(o=((o=(-1732584194^2004318071&e)+s[1]-117830708)<<12|o>>>20)+e<<0)&(-271733879^e))+s[2]-1126478375)<<17|n>>>15)+o<<0)&(o^e))+s[3]-1316259209)<<22|t>>>10)+n<<0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((o=this.h3)^t&(n^o))+s[0]-680876936)<<7|e>>>25)+t<<0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+s[1]-389564586)<<12|o>>>20)+e<<0)&(e^t))+s[2]+606105819)<<17|n>>>15)+o<<0)&(o^e))+s[3]-1044525330)<<22|t>>>10)+n<<0),t=((t+=((e=((e+=(o^t&(n^o))+s[4]-176418897)<<7|e>>>25)+t<<0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+s[5]+1200080426)<<12|o>>>20)+e<<0)&(e^t))+s[6]-1473231341)<<17|n>>>15)+o<<0)&(o^e))+s[7]-45705983)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(o^t&(n^o))+s[8]+1770035416)<<7|e>>>25)+t<<0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+s[9]-1958414417)<<12|o>>>20)+e<<0)&(e^t))+s[10]-42063)<<17|n>>>15)+o<<0)&(o^e))+s[11]-1990404162)<<22|t>>>10)+n<<0,t=((t+=((e=((e+=(o^t&(n^o))+s[12]+1804603682)<<7|e>>>25)+t<<0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+s[13]-40341101)<<12|o>>>20)+e<<0)&(e^t))+s[14]-1502002290)<<17|n>>>15)+o<<0)&(o^e))+s[15]+1236535329)<<22|t>>>10)+n<<0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+s[1]-165796510)<<5|e>>>27)+t<<0)^t))+s[6]-1069501632)<<9|o>>>23)+e<<0)^e&((n=((n+=(e^t&(o^e))+s[11]+643717713)<<14|n>>>18)+o<<0)^o))+s[0]-373897302)<<20|t>>>12)+n<<0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+s[5]-701558691)<<5|e>>>27)+t<<0)^t))+s[10]+38016083)<<9|o>>>23)+e<<0)^e&((n=((n+=(e^t&(o^e))+s[15]-660478335)<<14|n>>>18)+o<<0)^o))+s[4]-405537848)<<20|t>>>12)+n<<0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+s[9]+568446438)<<5|e>>>27)+t<<0)^t))+s[14]-1019803690)<<9|o>>>23)+e<<0)^e&((n=((n+=(e^t&(o^e))+s[3]-187363961)<<14|n>>>18)+o<<0)^o))+s[8]+1163531501)<<20|t>>>12)+n<<0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+s[13]-1444681467)<<5|e>>>27)+t<<0)^t))+s[2]-51403784)<<9|o>>>23)+e<<0)^e&((n=((n+=(e^t&(o^e))+s[7]+1735328473)<<14|n>>>18)+o<<0)^o))+s[12]-1926607734)<<20|t>>>12)+n<<0,t=((t+=((i=(o=((o+=((r=t^n)^(e=((e+=(r^o)+s[5]-378558)<<4|e>>>28)+t<<0))+s[8]-2022574463)<<11|o>>>21)+e<<0)^e)^(n=((n+=(i^t)+s[11]+1839030562)<<16|n>>>16)+o<<0))+s[14]-35309556)<<23|t>>>9)+n<<0,t=((t+=((i=(o=((o+=((r=t^n)^(e=((e+=(r^o)+s[1]-1530992060)<<4|e>>>28)+t<<0))+s[4]+1272893353)<<11|o>>>21)+e<<0)^e)^(n=((n+=(i^t)+s[7]-155497632)<<16|n>>>16)+o<<0))+s[10]-1094730640)<<23|t>>>9)+n<<0,t=((t+=((i=(o=((o+=((r=t^n)^(e=((e+=(r^o)+s[13]+681279174)<<4|e>>>28)+t<<0))+s[0]-358537222)<<11|o>>>21)+e<<0)^e)^(n=((n+=(i^t)+s[3]-722521979)<<16|n>>>16)+o<<0))+s[6]+76029189)<<23|t>>>9)+n<<0,t=((t+=((i=(o=((o+=((r=t^n)^(e=((e+=(r^o)+s[9]-640364487)<<4|e>>>28)+t<<0))+s[12]-421815835)<<11|o>>>21)+e<<0)^e)^(n=((n+=(i^t)+s[15]+530742520)<<16|n>>>16)+o<<0))+s[2]-995338651)<<23|t>>>9)+n<<0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+s[0]-198630844)<<6|e>>>26)+t<<0)|~n))+s[7]+1126891415)<<10|o>>>22)+e<<0)^((n=((n+=(e^(o|~t))+s[14]-1416354905)<<15|n>>>17)+o<<0)|~e))+s[5]-57434055)<<21|t>>>11)+n<<0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+s[12]+1700485571)<<6|e>>>26)+t<<0)|~n))+s[3]-1894986606)<<10|o>>>22)+e<<0)^((n=((n+=(e^(o|~t))+s[10]-1051523)<<15|n>>>17)+o<<0)|~e))+s[1]-2054922799)<<21|t>>>11)+n<<0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+s[8]+1873313359)<<6|e>>>26)+t<<0)|~n))+s[15]-30611744)<<10|o>>>22)+e<<0)^((n=((n+=(e^(o|~t))+s[6]-1560198380)<<15|n>>>17)+o<<0)|~e))+s[13]+1309151649)<<21|t>>>11)+n<<0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+s[4]-145523070)<<6|e>>>26)+t<<0)|~n))+s[11]-1120210379)<<10|o>>>22)+e<<0)^((n=((n+=(e^(o|~t))+s[2]+718787259)<<15|n>>>17)+o<<0)|~e))+s[9]-343485551)<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=o+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+o<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,o="",r=this.array(),i=0;i<15;)e=r[i++],t=r[i++],n=r[i++],o+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=r[i],o+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}()}).call(this,__webpack_require__(145),__webpack_require__(18))},function(e,t){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(e){o=s}}();var u,l=[],c=!1,p=-1;function d(){c&&u&&(c=!1,u.length?l=u.concat(l):p=-1,l.length&&h())}function h(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(u=l,l=[];++p<t;)u&&u[p].run();p=-1,t=l.length}u=null,c=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function g(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||c||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{static report(e,t,o,r,i,s){if(0===e)return;if("undefined"==typeof window)return;if(-1!==navigator.userAgent.indexOf("Electron"))return;let a=n(148);a.Metrics&&(a.Metrics.setOptions({isOversea:!0}),a.Metrics.serviceReport({scode:e,ver:"1.0.0",uri:t+"|"+o+"|"+r,timeSpent:i,code:s}))}}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"report",function(){return fe}),n.d(t,"Metrics",function(){return ge}),n.d(t,"oldMetrics",function(){return me}),n.d(t,"setSiteId",function(){return ye}),n.d(t,"setSpeId",function(){return be});var o="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{};function r(e,t){return e(t={exports:{}},t.exports),t.exports}var i=r(function(e){!function(t){function n(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,t,o,r,i,s){return n((a=n(n(t,e),n(r,s)))<<(u=i)|a>>>32-u,o);var a,u}function r(e,t,n,r,i,s,a){return o(t&n|~t&r,e,t,i,s,a)}function i(e,t,n,r,i,s,a){return o(t&r|n&~r,e,t,i,s,a)}function s(e,t,n,r,i,s,a){return o(t^n^r,e,t,i,s,a)}function a(e,t,n,r,i,s,a){return o(n^(t|~r),e,t,i,s,a)}function u(e,t){var o,u,l,c,p;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var d=1732584193,h=-271733879,f=-1732584194,g=271733878;for(o=0;o<e.length;o+=16)u=d,l=h,c=f,p=g,h=a(h=a(h=a(h=a(h=s(h=s(h=s(h=s(h=i(h=i(h=i(h=i(h=r(h=r(h=r(h=r(h,f=r(f,g=r(g,d=r(d,h,f,g,e[o],7,-680876936),h,f,e[o+1],12,-389564586),d,h,e[o+2],17,606105819),g,d,e[o+3],22,-1044525330),f=r(f,g=r(g,d=r(d,h,f,g,e[o+4],7,-176418897),h,f,e[o+5],12,1200080426),d,h,e[o+6],17,-1473231341),g,d,e[o+7],22,-45705983),f=r(f,g=r(g,d=r(d,h,f,g,e[o+8],7,1770035416),h,f,e[o+9],12,-1958414417),d,h,e[o+10],17,-42063),g,d,e[o+11],22,-1990404162),f=r(f,g=r(g,d=r(d,h,f,g,e[o+12],7,1804603682),h,f,e[o+13],12,-40341101),d,h,e[o+14],17,-1502002290),g,d,e[o+15],22,1236535329),f=i(f,g=i(g,d=i(d,h,f,g,e[o+1],5,-165796510),h,f,e[o+6],9,-1069501632),d,h,e[o+11],14,643717713),g,d,e[o],20,-373897302),f=i(f,g=i(g,d=i(d,h,f,g,e[o+5],5,-701558691),h,f,e[o+10],9,38016083),d,h,e[o+15],14,-660478335),g,d,e[o+4],20,-405537848),f=i(f,g=i(g,d=i(d,h,f,g,e[o+9],5,568446438),h,f,e[o+14],9,-1019803690),d,h,e[o+3],14,-187363961),g,d,e[o+8],20,1163531501),f=i(f,g=i(g,d=i(d,h,f,g,e[o+13],5,-1444681467),h,f,e[o+2],9,-51403784),d,h,e[o+7],14,1735328473),g,d,e[o+12],20,-1926607734),f=s(f,g=s(g,d=s(d,h,f,g,e[o+5],4,-378558),h,f,e[o+8],11,-2022574463),d,h,e[o+11],16,1839030562),g,d,e[o+14],23,-35309556),f=s(f,g=s(g,d=s(d,h,f,g,e[o+1],4,-1530992060),h,f,e[o+4],11,1272893353),d,h,e[o+7],16,-155497632),g,d,e[o+10],23,-1094730640),f=s(f,g=s(g,d=s(d,h,f,g,e[o+13],4,681279174),h,f,e[o],11,-358537222),d,h,e[o+3],16,-722521979),g,d,e[o+6],23,76029189),f=s(f,g=s(g,d=s(d,h,f,g,e[o+9],4,-640364487),h,f,e[o+12],11,-421815835),d,h,e[o+15],16,530742520),g,d,e[o+2],23,-995338651),f=a(f,g=a(g,d=a(d,h,f,g,e[o],6,-198630844),h,f,e[o+7],10,1126891415),d,h,e[o+14],15,-1416354905),g,d,e[o+5],21,-57434055),f=a(f,g=a(g,d=a(d,h,f,g,e[o+12],6,1700485571),h,f,e[o+3],10,-1894986606),d,h,e[o+10],15,-1051523),g,d,e[o+1],21,-2054922799),f=a(f,g=a(g,d=a(d,h,f,g,e[o+8],6,1873313359),h,f,e[o+15],10,-30611744),d,h,e[o+6],15,-1560198380),g,d,e[o+13],21,1309151649),f=a(f,g=a(g,d=a(d,h,f,g,e[o+4],6,-145523070),h,f,e[o+11],10,-1120210379),d,h,e[o+2],15,718787259),g,d,e[o+9],21,-343485551),d=n(d,u),h=n(h,l),f=n(f,c),g=n(g,p);return[d,h,f,g]}function l(e){var t,n="",o=32*e.length;for(t=0;t<o;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function c(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var o=8*e.length;for(t=0;t<o;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function p(e){var t,n,o="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),o+="0123456789abcdef".charAt(t>>>4&15)+"0123456789abcdef".charAt(15&t);return o}function d(e){return unescape(encodeURIComponent(e))}function h(e){return function(e){return l(u(c(e),8*e.length))}(d(e))}function f(e,t){return function(e,t){var n,o,r=c(e),i=[],s=[];for(i[15]=s[15]=void 0,r.length>16&&(r=u(r,8*e.length)),n=0;n<16;n+=1)i[n]=909522486^r[n],s[n]=1549556828^r[n];return o=u(i.concat(c(t)),512+8*t.length),l(u(s.concat(o),640))}(d(e),d(t))}function g(e,t,n){return t?n?f(t,e):p(f(t,e)):n?h(e):p(h(e))}e.exports?e.exports=g:t.md5=g}(o)}),s="hdjs_session_id",a="hdjs_session_time",u="_HIIDO_DEFER_",l={PC:1,MOBILE:2},c=["ubuntu","centos","fedora","debian","gentoo","suse","mandriva","slackware","freebsd","archlinux"],p={android:/android (\d+\.\d+)/i,ios:/cpu (?:iphone )os (\d+_\d+)/i,wp:[/windows phone(?:[ os]{3})? (\d+\.\d+)/i,/windows nt (\d\.\d)/i],blackberry:/(?:Version|Blackberry[\w]+)\/(\d\.\d)/i,symbian:/symbian(?:os)?\/(\d+[.\d]{0,2})/i,tizen:/tizen (\d+\.\d+)/i},d=-1,h=[{engine:"baidu.com",rule:"wd|word|w|kw|key",value:1},{engine:"haosou.com",rule:"q",value:2},{engine:"sogou.com",rule:"query",value:3},{engine:"google.",rule:"q",value:4},{engine:"bing.com",rule:"q",value:5},{engine:"yahoo.com",rule:"p|q",value:6},{engine:"youdao.com",rule:"q",value:7},{engine:"yodao.com",rule:"q",value:8},{engine:"iask.sina.com.cn",rule:"searchWord|k",value:9},{engine:"zhongsou.com",rule:"w|word",value:10},{engine:"search.com",rule:"q",value:11},{engine:"sm.cn",rule:"q",value:12},{engine:"chinaso.com",rule:"q",value:13},{engine:"soku.com",rule:"keyword",value:14},{engine:"alexa.com",rule:"q",value:15},{engine:"s.weibo.com",rule:function(e){return e.split("&")[0].split("/").pop()},value:16},{engine:"qq.com",rule:"k",value:17},{engine:"lofter.com",rule:function(e){var t;return e.indexOf("queryString")>-1&&null!==(t=new RegExp("(^|)queryString=([^&]*)(&|$)","gi").exec(e))?t[2]:e.split("?")[0].split("/").pop()},value:18}],f="hd_newui",g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},y="-1",b={name:"na",version:y};function I(e){return function(t){return Object.prototype.toString.call(t)==="[object "+e+"]"}}var v=I("String"),O=I("RegExp"),w=I("Object"),S=I("Function");function k(e,t,n,o){var r=b;(function(e,t){for(var n=0,o=e.length;n<o&&!1!==t.call(e,e[n],n);n++);})(t,function(t){var n=function(e,t,n){var o=S(t)?t.call(null,n):t;if(!o)return null;var r={name:e,version:y,codename:""};if(!0===o)return r;if(v(o)){if(-1!==n.indexOf(o))return r}else{if(w(o))return o.hasOwnProperty("version")&&(r.version=o.version),r;if(O(o)){var i=o.exec(n);if(i)return i.length>=2&&i[1]?r.version=i[1].replace(/_/g,"."):r.version=y,r}}}(t[0],t[1],e);if(n)return r=n,!1}),n.call(o,r.name,r.version)}var _=function(){function e(t){m(this,e),this._rules=t}return e.prototype.parse=function(e){var t={};k(e=(e||"").toLowerCase(),this._rules.device,function(e,n){var o=parseFloat(n);t.device={name:e,version:o,fullVersion:n},t.device[e]=o},t),k(e,this._rules.os,function(e,n){var o=parseFloat(n);t.os={name:e,version:o,fullVersion:n},t.os[e]=o},t);var n=this.IEMode(e);return k(e,this._rules.engine,function(e,o){var r=o;n&&(o=n.engineVersion||n.engineMode,r=n.engineMode);var i=parseFloat(o);t.engine={name:e,version:i,fullVersion:o,mode:parseFloat(r),fullMode:r,compatible:!!n&&n.compatible},t.engine[e]=i},t),k(e,this._rules.browser,function(e,o){var r=o;n&&("ie"===e&&(o=n.browserVersion),r=n.browserMode);var i=parseFloat(o);t.browser={name:e,version:i,fullVersion:o,mode:parseFloat(r),fullMode:r,compatible:!!n&&n.compatible},t.browser[e]=i},t),t},e.prototype.IEMode=function(e){if(!this._rules.re_msie.test(e))return null;var t,n,o=void 0,r=void 0,i=void 0;if(-1!==e.indexOf("trident/")&&(o=/\btrident\/([0-9.]+)/.exec(e))&&o.length>=2){r=o[1];var s=o[1].split(".");s[0]=parseInt(s[0],10)+4,i=s.join(".")}n=(o=this._rules.re_msie.exec(e))[1];var a=o[1].split(".");return void 0===i&&(i=n),a[0]=parseInt(a[0],10)-4,t=a.join("."),void 0===r&&(r=t),{browserVersion:i,browserMode:n,engineVersion:r,engineMode:t,compatible:r!==t}},e}(),P="undefined"==typeof window?o:window,T=P.external,U=/\b(?:msie |ie |trident\/[0-9].*rv[ :])([0-9.]+)/,x=/\bbb10\b.+?\bversion\/([\d.]+)/,E=/\bblackberry\b.+\bversion\/([\d.]+)/,M=/\bblackberry\d+\/([\d.]+)/;function R(e){if(T)try{var t=T.twGetRunPath.toLowerCase(),n=T.twGetSecurityID(P),o=T.twGetVersion(n);if(t&&-1===t.indexOf(e))return!1;if(o)return{version:o}}catch(e){}}var C={device:[["nokia",function(e){return-1!==e.indexOf("nokia ")?/\bnokia ([0-9]+)?/:/\bnokia([a-z0-9]+)?/}],["samsung",function(e){return-1!==e.indexOf("samsung")?/\bsamsung(?:[ \-](?:sgh|gt|sm))?-([a-z0-9]+)/:/\b(?:sgh|sch|gt|sm)-([a-z0-9]+)/}],["wp",function(e){return-1!==e.indexOf("windows phone ")||-1!==e.indexOf("xblwp")||-1!==e.indexOf("zunewp")||-1!==e.indexOf("windows ce")}],["pc","windows"],["ipad","ipad"],["ipod","ipod"],["iphone",/\biphone\b|\biph(\d)/],["mac","macintosh"],["mi",/\bmi[ \-]?([a-z0-9 ]+(?= build|\)))/],["hongmi",/\bhm[ \-]?([a-z0-9]+)/],["aliyun",/\baliyunos\b(?:[\-](\d+))?/],["meizu",function(e){return e.indexOf("meizu")>=0?/\bmeizu[\/ ]([a-z0-9]+)\b/:/\bm([0-9cx]{1,4})\b/}],["nexus",/\bnexus ([0-9s.]+)/],["huawei",function(e){var t=/\bmediapad (.+?)(?= build\/huaweimediapad\b)/;return-1!==e.indexOf("huawei-huawei")?/\bhuawei\-huawei\-([a-z0-9\-]+)/:t.test(e)?t:/\bhuawei[ _\-]?([a-z0-9]+)/}],["lenovo",function(e){return-1!==e.indexOf("lenovo-lenovo")?/\blenovo\-lenovo[ \-]([a-z0-9]+)/:/\blenovo[ \-]?([a-z0-9]+)/}],["zte",function(e){return/\bzte\-[tu]/.test(e)?/\bzte-[tu][ _\-]?([a-su-z0-9\+]+)/:/\bzte[ _\-]?([a-su-z0-9\+]+)/}],["vivo",/\bvivo(?: ([a-z0-9]+))?/],["htc",function(e){return/\bhtc[a-z0-9 _\-]+(?= build\b)/.test(e)?/\bhtc[ _\-]?([a-z0-9 ]+(?= build))/:/\bhtc[ _\-]?([a-z0-9 ]+)/}],["oppo",/\boppo[_]([a-z0-9]+)/],["konka",/\bkonka[_\-]([a-z0-9]+)/],["sonyericsson",/\bmt([a-z0-9]+)/],["coolpad",/\bcoolpad[_ ]?([a-z0-9]+)/],["lg",/\blg[\-]([a-z0-9]+)/],["android",/\bandroid\b|\badr\b/],["blackberry",function(e){return e.indexOf("blackberry")>=0?/\bblackberry\s?(\d+)/:"bb10"}]],os:[["wp",function(e){return-1!==e.indexOf("windows phone ")?/\bwindows phone (?:os )?([0-9.]+)/:-1!==e.indexOf("xblwp")?/\bxblwp([0-9.]+)/:-1!==e.indexOf("zunewp")?/\bzunewp([0-9.]+)/:"windows phone"}],["windows",/\bwindows nt ([0-9.]+)/],["macosx",/\bmac os x ([0-9._]+)/],["ios",function(e){return/\bcpu(?: iphone)? os /.test(e)?/\bcpu(?: iphone)? os ([0-9._]+)/:-1!==e.indexOf("iph os ")?/\biph os ([0-9_]+)/:/\bios\b/}],["yunos",/\baliyunos ([0-9.]+)/],["android",function(e){return e.indexOf("android")>=0?/\bandroid[ \/-]?([0-9.x]+)?/:e.indexOf("adr")>=0?e.indexOf("mqqbrowser")>=0?/\badr[ ]\(linux; u; ([0-9.]+)?/:/\badr(?:[ ]([0-9.]+))?/:"android"}],["chromeos",/\bcros i686 ([0-9.]+)/],["linux","linux"],["windowsce",/\bwindows ce(?: ([0-9.]+))?/],["symbian",/\bsymbian(?:os)?\/([0-9.]+)/],["blackberry",function(e){var t=e.match(x)||e.match(E)||e.match(M);return t?{version:t[1]}:"blackberry"}]],browser:[["edge",/edge\/([0-9.]+)/],["sogou",function(e){return e.indexOf("sogoumobilebrowser")>=0?/sogoumobilebrowser\/([0-9.]+)/:e.indexOf("sogoumse")>=0||/ se ([0-9.x]+)/}],["theworld",function(){var e=R("theworld");return void 0!==e?e:/theworld(?: ([\d.])+)?/}],["360",function(e){var t=R("360se");return void 0!==t?t:-1!==e.indexOf("360 aphone browser")?/\b360 aphone browser \(([^\)]+)\)/:/\b360(?:se|ee|chrome|browser)\b/}],["maxthon",function(){try{if(T&&(T.mxVersion||T.max_version))return{version:T.mxVersion||T.max_version}}catch(e){}return/\b(?:maxthon|mxbrowser)(?:[ \/]([0-9.]+))?/}],["micromessenger",/\bmicromessenger\/([\d.]+)/],["qq",/\bm?qqbrowser\/([0-9.]+)/],["green","greenbrowser"],["tt",/\btencenttraveler ([0-9.]+)/],["liebao",function(e){if(e.indexOf("liebaofast")>=0)return/\bliebaofast\/([0-9.]+)/;if(-1===e.indexOf("lbbrowser"))return!1;var t=void 0;try{T&&T.LiebaoGetVersion&&(t=T.LiebaoGetVersion())}catch(e){}return{version:t||"-1"}}],["tao",/\btaobrowser\/([0-9.]+)/],["coolnovo",/\bcoolnovo\/([0-9.]+)/],["saayaa","saayaa"],["baidu",/\b(?:ba?idubrowser|baiduhd)[ \/]([0-9.x]+)/],["ie",U],["mi",/\bmiuibrowser\/([0-9.]+)/],["opera",function(e){var t=/\bopera.+version\/([0-9.ab]+)/;return t.test(e)?t:/\bopr\/([0-9.]+)/}],["oupeng",/\boupeng\/([0-9.]+)/],["yandex",/yabrowser\/([0-9.]+)/],["ali-ap",function(e){return e.indexOf("aliapp")>0?/\baliapp\(ap\/([0-9.]+)\)/:/\balipayclient\/([0-9.]+)\b/}],["ali-ap-pd",/\baliapp\(ap-pd\/([0-9.]+)\)/],["ali-am",/\baliapp\(am\/([0-9.]+)\)/],["ali-tb",/\baliapp\(tb\/([0-9.]+)\)/],["ali-tb-pd",/\baliapp\(tb-pd\/([0-9.]+)\)/],["ali-tm",/\baliapp\(tm\/([0-9.]+)\)/],["ali-tm-pd",/\baliapp\(tm-pd\/([0-9.]+)\)/],["uc",function(e){return e.indexOf("ucbrowser/")>=0?/\bucbrowser\/([0-9.]+)/:e.indexOf("ubrowser/")>=0?/\bubrowser\/([0-9.]+)/:/\buc\/[0-9]/.test(e)?/\buc\/([0-9.]+)/:e.indexOf("ucweb")>=0?/\bucweb([0-9.]+)?/:/\b(?:ucbrowser|uc)\b/}],["chrome",/ (?:chrome|crios|crmo)\/([0-9.]+)/],["android",function(e){if(-1!==e.indexOf("android"))return/\bversion\/([0-9.]+(?: beta)?)/}],["blackberry",function(e){var t=e.match(x)||e.match(E)||e.match(M);return t?{version:t[1]}:"blackberry"}],["safari",/\bversion\/([0-9.]+(?: beta)?)(?: mobile(?:\/[a-z0-9]+)?)? safari\//],["webview",/\bcpu(?: iphone)? os (?:[0-9._]+).+\bapplewebkit\b/],["firefox",/\bfirefox\/([0-9.ab]+)/],["nokia",/\bnokiabrowser\/([0-9.]+)/]],engine:[["edgehtml",/edge\/([0-9.]+)/],["trident",U],["blink",function(){return"chrome"in P&&"CSS"in P&&/\bapplewebkit[\/]?([0-9.+]+)/}],["webkit",/\bapplewebkit[\/]?([0-9.+]+)/],["gecko",function(e){var t=e.match(/\brv:([\d\w.]+).*\bgecko\/(\d+)/);if(t)return{version:t[1]+"."+t[2]}}],["presto",/\bpresto\/([0-9.]+)/],["androidwebkit",/\bandroidwebkit\/([0-9.]+)/],["coolpadwebkit",/\bcoolpadwebkit\/([0-9.]+)/],["u2",/\bu2\/([0-9.]+)/],["u3",/\bu3\/([0-9.]+)/]],re_msie:U},A=(navigator.userAgent||"")+" "+(navigator.appVersion||"")+" "+(navigator.vendor||""),j=new _(C);function N(e){var t=j.parse(e),n=function(e){if(!C.re_msie.test(e))return null;var t,n,o=void 0,r=void 0,i=void 0;if(-1!==e.indexOf("trident/")&&(o=/\btrident\/([0-9.]+)/.exec(e))&&o.length>=2){r=o[1];var s=o[1].split(".");s[0]=parseInt(s[0],10)+4,i=s.join(".")}n=(o=C.re_msie.exec(e))[1];var a=o[1].split(".");return void 0===i&&(i=n),a[0]=parseInt(a[0],10)-4,t=a.join("."),void 0===r&&(r=t),{browserVersion:i,browserMode:n,engineVersion:r,engineMode:t,compatible:r!==t}}(e);if(n){var o=t.engine.name,r=n.engineVersion||n.engineMode,i=parseFloat(r),s=n.engineMode;t.engine={name:o,version:i,fullVersion:r,mode:parseFloat(s),fullMode:s,compatible:!!n&&n.compatible},t.engine[t.engine.name]=i;var a=t.browser.name,u=t.browser.fullVersion;"ie"===a&&(u=n.browserVersion);var l=n.browserMode,c=parseFloat(u);t.browser={name:a,version:c,fullVersion:u,mode:parseFloat(l),fullMode:l,compatible:!!n&&n.compatible},t.browser[a]=c}return t}var q=N(A);q.parse=N;var L=q,B={"金立":"gionee","大显":"daxian","天语":"tianyu"},D=[{name:"blackberry",regex:/playbook/},{name:"philips",regex:/philips/},{name:"nec",regex:/nec/},{name:"palm",regex:/palm/},{name:"benq",regex:/benq/},{name:"taixin",regex:/telson/},{name:"cect",regex:/cect/},{name:"dbtel",regex:/dbtel/},{name:"konka",regex:/konka/},{name:"changhong",regex:/changhong/},{name:"wanlida",regex:/malata/},{name:"pantech",regex:/pantech/},{name:"dongxin",regex:/eastcom/},{name:"duowei",regex:/doov/},{name:"koobee",regex:/koobee/},{name:"alcatel",regex:/alcatel/},{name:"bird",regex:/bird/}];function G(e){var t,n=L.parse(e).os,o=n.name,r=n.fullVersion;if("windows"===o){if(e.indexOf("wpdesktop")>-1)return"wp|";o="win",e.indexOf("windows nt 5.0")>-1||e.indexOf("windows nt 5.01")>-1||e.indexOf("windows 2000")>-1?r="2000":e.indexOf("windows nt 5.1")>-1||e.indexOf("windows xp")>-1?r="xp":e.indexOf("windows nt 5.2")>-1||e.indexOf("windows 2003")>-1?r="2003":e.indexOf("windows nt 6.0")>-1||e.indexOf("windows vista")>-1?r="vista":e.indexOf("windows nt 6.1")>-1||e.indexOf("windows 2008")>-1||e.indexOf("windows 7")>-1?r="7":e.indexOf("windows nt 6.2")>-1||e.indexOf("windows 8")>-1?r="8.0":e.indexOf("windows nt 6.3")>-1?r="8.1":e.indexOf("windows nt 10.0")>-1&&(r="10.0")}else if("linux"===o){for(var i=c,s=i.length,a=0;a<s;a++)if(e.indexOf(i[a])>-1){r=i[a];break}}else"blackberry"===o&&"-1"===r?(t=e.match(p.blackberry))&&(r=t[1]):"symbian"===o&&"3"===r&&(r="^3");return/tizen/.test(e)&&(o="tizen",(t=e.match(p.tizen))&&(r=t[1])),"chromeos"===o&&(o="cros"),"na"===o&&(/symbian|symbos|series\s?60|series40|syb-[0-9]+|s60/.test(e)&&(o="symbian",(t=e.match(p.symbian))&&(r="3"===t[1]?"^3":t[1])),/blackberry|bb10|rim tablet os/.test(e)&&(o="blackberry",(t=e.match(p.blackberry))&&(r=t[1])),/hisense/.test(e)&&(o="android")),r&&(r="-1"===r?"":(r=r.split(".")).length>1?r[0]+"."+r[1]:r[0]),o+"|"+r}function V(e){if(/baiduboxapp/.test(e))return"baidubox";if(/spark/.test(e))return"baiduspark";if(/qiyu/.test(e))return"qiyu";if(/yunhai/.test(e))return"yunhai";if(/yy/.test(e))return"yy";if(/myie/.test(e))return"mayi";if(/11[45]{1}browser/.test(e))return"115";if(/2345/.test(e))return"2345";var t=L.parse(e).browser,n=t.name,o=t.fullVersion;if("ie"===n)switch(o){case"6.0":n="ie6";break;case"7.0":n="ie7";break;case"8.0":n="ie8";break;case"9.0":n="ie9";break;case"10.0":n="ie10";break;case"11.0":n="ie11";break;case"12.0":n="ie12"}return"micromessenger"===n&&(n="wechat"),"tao"===n&&(n="taobao"),"oupeng"===n&&(n="opera"),n.indexOf("dolfin")>-1&&(n="dolphin"),(n.indexOf("ie")>-1||"android"===n)&&/2345/.test(e)&&(n="2345"),"na"===n&&(/android/.test(e)?n="android":/yandex/.test(e)&&(n="yandex")),n}function H(e){var t,n,o=L.parse(e).device,r=D.length;if("pc"===o.name||"mac"===o.name)return"";if("hongmi"===o.name)return"mi";if(/\bhonor/.test(e)||/\b(h\d+-l\d+)/.test(e))return"huawei";if(/\bsmartisan\b/.test(e)||/sm-?(\d{3,})/.test(e))return"smartisan";if(/\ba0001 build/.test(e))return"oneplus";if(/hisense/.test(e))return"hisense";if(/\bmot[-]([a-z0-9]+)/.test(e)||/ (xt\d+) build/.test(e))return"moto";if(B[o.name])return B[o.name];if("na"===o.name){for(t=0;t<r;t++)if((n=D[t]).regex.test(e))return n.name;return""}return o.name}function F(e){var t=function(e){return/mobile|phone|wpdesktop|windows ce|android|iphone|ipad|ipod|blackberry|bb10|rim tablet os|webos|opera|symbian|symbos|series60|series40|syb-[0-9]+|s60|palm|tizen|xblwp7|zunewp7|yunos|ucweb|midp|mqq|htc|nokia|samsung/i.test(e)?l.MOBILE:l.PC}(e=e.toLowerCase());return{pcmb:t,os:G(e),bs:V(e),mb:H(e)}}function $(e){var t=("; "+document.cookie).split("; "+e+"=");return 1===t.length?"":decodeURIComponent(t[1].split(";")[0])}function K(e,t,n){n=n||{};var o=e+"="+encodeURIComponent(t);if(n.expires&&"number"==typeof n.expires){var r=new Date;n.expires=1e3*n.expires*60*60*24,o=o+"; expires="+(r=new Date(r.getTime()+n.expires)).toUTCString()}o=o+"; path="+(n.path?n.path:"/"),o+=n.domain?"; domain="+n.domain:"",document.cookie=o}function J(e){var t,n=e||window._hiido_wid,o=Object.prototype.toString;if(n)if("[object Array]"===o.call(n))t=n.join("|");else if("function"==typeof n)try{t=n.call(window),"[object Array]"===o.call(t)&&(t=t.join("|"))}catch(e){window.console.log("[HiidoJS]: _hiido_wid 函数实现错误!"),window.console.dir(e),t=""}return t||""}function z(){try{return navigator.javaEnabled()?1:0}catch(e){return 0}}function W(e){var t=d;try{t=e.GetVariable("$version")}catch(e){}return t}function X(e){var t=d;try{t=new ActiveXObject(e)}catch(e){t={activeXError:!0}}return t}function Z(){var e=[{name:"ShockwaveFlash.ShockwaveFlash.7",version:function(e){return W(e)}},{name:"ShockwaveFlash.ShockwaveFlash.6",version:function(e){var t="6,0,21";try{e.AllowScriptAccess="always",t=W(e)}catch(e){}return t}},{name:"ShockwaveFlash.ShockwaveFlash",version:function(e){return W(e)}}],t=d,n=navigator;try{if(n.plugins){for(var o=0;o<n.plugins.length;o++)if(n.plugins[o].name.indexOf("Shockwave Flash")>-1){(t=n.plugins[o].description.split("Shockwave Flash ")).length>1?(t=t[1])&&(t=t.split(".")[0]):t=t[0];break}}else if(window.ActiveXObject)for(var r=0;r<e.length&&t===d;r++){var i=X(e[r].name);i.activeXError||(t=e[r].version(i))!==d&&(t=t.split(",")[0].split(" ")[1])}}catch(e){}return t}var Q="2.2.0",Y="2.2.0";function ee(e){return"v"+(e?Y:Q)}var te=[{domain:"duowan.com",key:"duowan"},{domain:"yy.com",key:"yy"},{domain:"yy.tv",key:"yytv"},{domain:"kuaikuai.cn",key:"kuaikuai"},{domain:"hiido.com",key:"hiido"},{domain:"hiido.cn",key:"hiidocn"},{domain:"hiido.net",key:"hiidonet"},{domain:"bengou.com",key:"bengou"},{domain:"5253.com",key:"5253"},{domain:"duowan.cn",key:"duowancn"},{domain:"zzvv.com",key:"zzvv"},{domain:"99d.com",key:"99d"},{domain:"sc2.com.cn",key:"sc2"},{domain:"100.com",key:"100"},{domain:"5153.com",key:"5153"},{domain:"huya.com",key:"huya"},{domain:"1931.com",key:"1931"},{domain:"fengkaobiguo.com",key:"fengkaobiguo"},{domain:"up24.com",key:"up24"},{domain:"edu24ol.com",key:"edu24ol"},{domain:"ruixueys.com",key:"ruixueys"},{domain:"hqgwy.cn",key:"hqgwy"},{domain:"erdmusic.com",key:"erdmusic"},{domain:"zhiniu8.com",key:"zhiniu8"},{domain:"100yy.com",key:"100yy"},{domain:"dwmoniqi.com",key:"dwmoniqi"},{domain:"bigo.tv",key:"bigotv"},{domain:"bigo.sg",key:"bigosg"},{domain:"like.video",key:"bigolike"},{domain:"mcpemaster.com",key:"mcpemaster"},{domain:"cubetv.sg",key:"cubetvsg"}];function ne(e){this.name="HiidoJSError",this.message="[HiidoJS]: "+e||!1}function oe(){var e=function(){var e,t,n=document.getElementById("_hiido_script_id_")||document.currentScript||(t=document.getElementsByTagName("script"))[t.length-1];if(!n||!n.src)throw new ne("Cannot find Script!");if((e=n.src.split("?")).length>1){for(var o=e[1].split("&"),r={},i=0;i<o.length;i++){var s=o[i].split("=");r[s[0]]=s[1]}return r}return{}}();return e.siteid?e.siteid:""}function re(e,t){if("wechat"===e)return"wechat";for(var n=null,o=h,r=o.length,i=0;i<r&&null===n;i++)t.engine===o[i].value&&(n=o[i].engine);return"s.weibo.com"===n?"weibo":""}function ie(e){var t=$(f),n=window.location.hostname;return n=n.split("."),t||(t=Math.random(),e&&n.length>1?K(f,t,{expires:36500,domain:"."+n[n.length-2]+"."+n[n.length-1]}):K(f,t,{expires:36500})),t}function se(){var e=Math.random()+"";return K(s,e),e}function ae(){var e=new Date;return e=e.getTime(),K(a,e),e}ne.prototype=new Error,ne.prototype.constructor=ne;var ue=l.MOBILE,le=Object.prototype.hasOwnProperty,ce=window.location.protocol+"//ylog.hiido.com/j.gif";function pe(e){var t=pe.isInternal;e=e.toLowerCase();var n=function(e){return e?{host:e.split("/")[2],origin:e}:{host:"",origin:""}}(document.referrer),o=function(e){var t=e.host,n=e.origin;if(!t)return{engine:"",key:""};for(var o=h.length,r=!1,i={engine:"",key:""},s=0;s<o&&!r;s++){var a=h[s],u=a.engine;if(t.indexOf(u)>-1){r=!0,i.engine=a.value;var l,c=a.rule;if("function"==typeof c)i.key=c(n);else{l=c.split("|");for(var p=0;p<l.length;p++){var d=l[p],f=new RegExp("(^|)"+d+"=([^&]*)(&|$)","gi").exec(n);if(null!==f){i.key=f[2];break}}}}}return i}(n),r=t?function(e){for(var t,n,o,r,i="",s=e.split("."),a="",u=0;u<te.length;u++)if(n=(t=te[u]).domain,e.indexOf(n)>-1){if(o=n.split("."),s[r=s.length-o.length]!==o[0]||e.substr(e.length-n.length)!==n)continue;var l=window._hiido_no;i=void 0!==l&&0===l?t.key:(0===r?"www":s[r-1])+"@"+t.key,a=t.domain;break}var c=$("hiido_ui");return c||K("hiido_ui",c=Math.random(),{expires:700,domain:"."+a}),i}(window.location.hostname):oe(),i=F(e),a=!$(f);if(void 0===window["_hdjs_loaded_"+r]){window["_hdjs_loaded_"+r]=!0,this.isInternal=t,this.detect=i,this.data={ht:window.location.hostname,siteid:r,speid:J(),ui:ie(t),sc:window.screen.width+"."+window.screen.height,cl:(window.screen.colorDepth||0)+"-bit",pcmb:i.pcmb,os:i.os,bs:i.bs,mb:i.mb,se:o.engine,wd:o.key,rfh:n.host,rf:n.origin,sns:re(i.bs,o),fl:Z(),ln:navigator.language||"",ja:z(),ck:navigator.cookieEnabled?1:0,ot:"",lt:"",xy:"",ext:"",v:ee(t),pl:window.location.href},this.options={isOversea:!1},a&&(this.data.isnew=1),this._hasBootstrapReport=!1,this._inactiveThreshold=2e4,this.data.hsid=this.getSessionId(),pe.module||window[u]||this._bootstrapReport();var l=this;this.report=window.hd=function(e,t,n){n=n||{},l.options.isOversea=!!n.isOversea,t=t||{};var o=new Date-0+"",r={hsid:$(s),ht:l.data.ht,ui:l.data.ui,siteid:l.data.siteid,pl:l.data.pl,v:l.data.v,rf:l.data.rf,rfh:l.data.rfh,pcmb:l.data.pcmb,rnd:l.data.ui+o,ut:o};if("event"===e){if(!t.eventAction)return void window.console.warn("[HiidoJS] 请使用正确的字段进行事件上报; 详情请查询 https://hdjs.hiido.com/docs/#/events");r.ea=t.eventAction,r.ec=t.eventCategory||"",r.el=t.eventLabel||"",r.ev=t.eventValue||"",l.log("webaction",r)}else"view"===e&&(pe.module||window[u]?(t.uid&&(l.data.uid=t.uid),t.reserve&&(l.data.reserve=pe.JSON.stringify(t.reserve)),l._bootstrapReport()):window.console.warn("[HiidoJS] 请在hiido.js加载前设置defer模式,详见:","http://hdjs.hiido.com/docs/#/usage?id=手动触发上报"))},this.attachMetricMethods()}}pe.prototype={constructor:pe,_bootstrapReport:function(){this._hasBootstrapReport?window.console.warn("[HiidoJS] 请不要重复调用手动上报方法!"):(this._hasBootstrapReport=!0,this.reportEnter(),this.recordLifetime(),this.attachEvents())},attachMetricMethods:function(){var e=this;this.oldMetrics=null,window.Metrics&&(window.__oldMetrics__=window.Metrics,this.oldMetrics=window.__oldMetrics__),window.__Metrics__=window.Metrics=this.Metrics={setOptions:function(t){e.setOptions(t)},serviceReport:function(t){if(e.validateMetricsReportData(t)){var n=(new Date).getTime(),o=e.generateMetricBasicData(n,t);o.reqdata=JSON.stringify([{scode:t.scode,uri:t.uri,reqtime:t.timeSpent,ret:t.code,rtime:n}]),e.log("mmetric",o)}},countReport:function(t){if(e.validateMetricsReportData(t)){var n=(new Date).getTime(),o=e.generateMetricBasicData(n,t);o.counterdata=JSON.stringify([{scode:t.scode,uri:t.uri,counterName:t.countName,value:t.count,invokecount:1}]),e.log("mmetric",o)}},customReport:function(t){if(e.validateMetricsReportData(t)){var n=(new Date).getTime(),o=e.generateMetricBasicData(n,t);o.flatdata=JSON.stringify([{scode:t.scode,uri:t.uri,topic:t.topic,val:t.val,extra:t.extra}]),e.log("mmetric",o)}},noConflict:function(){window.__oldMetrics__&&(window.Metrics=window.__oldMetrics__)}}},generateActKey:function(e,t){return i(e+t+"HiidoYYSystem").toLowerCase()},generateMetricBasicData:function(e,t){var n=e;e=Math.round(e/1e3);var o=this.generateActKey("mmetric",e),r=this.detect,i=r.os.split("|"),s=r.bs,a=i[0],u={ios:0,wp:1,android:2,macosx:3,win:4},l=pe.JSON.stringify([]);return{time:e,key:o,appkey:"",ver:t.ver,sdkver:ee(this.isInternal),sys:le.call(u,a)?u[a]:a,osver:s,model:r.mb,sjp:r.mb,net:"",clienttime:n,reqdata:l,counterdata:l,flatdata:l}},reportEnter:function(){if(!this._enterReportSent){var e=new Date-0+"",t=pe.assign(this.data,{io:1,ut:e,rnd:this.data.ui+e});this.log("webstat",t),this._enterReportSent=!0}},recordLifetime:function(){var e,t=this,n=window.requestAnimationFrame,o=window.cancelAnimationFrame;function r(){e.start()}function i(){e.stop()}this.data.lt=0,e=this._heartbeat=function(){var e;function r(){var o=new Date,i=o-t._ltStart;t.data.lt=t.data.lt+i,t._inactiveTime=t._inactiveTime+i,t._ltStart=o,e=t._inactiveTime<=t._inactiveThreshold?n(r):null}return{start:function(){e||(t._ltStart=new Date,e=n(r))},stop:function(){e&&(o(e),e=null)}}}(),"onfocusin"in document?(document.onfocusin=r,document.onfocusout=i):(window.onfocus=r,window.onblur=i);var s,a,u,l=["","webkit","moz","ms","o"];if(this.data.pcmb===ue){for(var c=0;c<l.length;c++)if((a=(s=l[c])?s+"Hidden":"hidden")in document){u=s+"visibilitychange";break}u&&pe.addEvent(document,u,function(){document[a]?i():r()})}this._inactiveTime=0,e.start()},reportLeave:function(){if(!this._leaveReportSent){var e=new Date-0+"",t=pe.assign(this.data,{io:0,ut:e,rnd:this.data.ui+e,hsid:$(s)});this.log("webstat",t),this._leaveReportSent=!0}},log:function(e,t){var n=this,o=[];for(var r in t)o.push(encodeURIComponent(r)+"="+encodeURIComponent(t[r]));var i,s=o.join("&"),a="log_"+(new Date).getTime(),u=new Image(1,1);if(window[a]=u,u.onerror=function(){(!0===window._HIIDO_OVERSEA_||n.options.isOversea)&&(u.src=ce+"?act="+e+"&"+s,u.onerror=function(){window[a]=null}),window[a]=null},u.onload=function(){window[a]=null},!function(e){return"string"==typeof e&&e.length<=2e3}(i=!0===window._HIIDO_OVERSEA_||n.options.isOversea?"//hlog.hiido.com/j.gif?act="+e+"&"+s:ce+"?act="+e+"&"+s))throw new ne("Exceeding Maximum URL length - 2000 Characters");u.src=i},attachEvents:function(){var e=this;pe.addEvent(document,"click",function(t){var n=t.target||t.srcElement;(function(e){for(var t;e&&"a"!==(t=e.tagName.toLowerCase())&&"html"!==t;)e=e.parentNode;return"a"===t})(n)&&(e.data.ot=n.href),e.data.xy=t.clientX+","+t.clientY},!0),window.onbeforeunload=function(){e.reportLeave()},window.onunload=function(){e.reportLeave()},this.data.pcmb===ue&&(pe.addEvent(window,"pageshow",function(t){t.persisted&&(e._leaveReportSent=!1,e._enterReportSent=!1,e.data.lt=0,e.reportEnter())}),pe.addEvent(window,"pagehide",function(t){t.persisted&&e.reportLeave()}),pe.addEvent(window,"touchstart",function(){e._inactiveTime=0,e._heartbeat.start()}))},getSessionId:function(){var e,t=$(a);return""===t?(e=se(),ae()):""!==this.data.rfh&&-1===this.data.rfh.indexOf(this.data.ht)?e=se():(t=$(a),e=(new Date).getTime()-t>18e5?se():$(s)),ae(),e},validateMetricsReportData:function(e){for(var t,n=["scode","ver","uri"],o=0;o<n.length;o++)if(!e[t=n[o]])return window.console.warn("HiidoJS: Metrics 上报必须上报"+t+". 详情请查询 https://hdjs.hiido.com/docs/#/metrics"),!1;return!0},setOptions:function(e){this.options=pe.assign({},this.options,e)}};var de,he=r(function(e,t){(function(){var n={function:!0,object:!0},r=t&&!t.nodeType&&t,i=n["undefined"==typeof window?"undefined":g(window)]&&window||this,s=r&&n.object&&e&&!e.nodeType&&"object"==g(o)&&o;function a(e,t){e||(e=i.Object()),t||(t=i.Object());var o=e.Number||i.Number,r=e.String||i.String,s=e.Object||i.Object,u=e.Date||i.Date,l=e.SyntaxError||i.SyntaxError,c=e.TypeError||i.TypeError,p=e.Math||i.Math,d=e.JSON||i.JSON;"object"==(void 0===d?"undefined":g(d))&&d&&(t.stringify=d.stringify,t.parse=d.parse);var h,f,m,y=s.prototype,b=y.toString,I=new u(-0xc782b5b800cec);try{I=-109252==I.getUTCFullYear()&&0===I.getUTCMonth()&&1===I.getUTCDate()&&10==I.getUTCHours()&&37==I.getUTCMinutes()&&6==I.getUTCSeconds()&&708==I.getUTCMilliseconds()}catch(e){}function v(e){if(v[e]!==m)return v[e];var n;if("bug-string-char-index"==e)n="a"!="a"[0];else if("json"==e)n=v("json-stringify")&&v("json-parse");else{var i,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var a=t.stringify,l="function"==typeof a&&I;if(l){(i=function(){return 1}).toJSON=i;try{l="0"===a(0)&&"0"===a(new o)&&'""'==a(new r)&&a(b)===m&&a(m)===m&&a()===m&&"1"===a(i)&&"[1]"==a([i])&&"[null]"==a([m])&&"null"==a(null)&&"[null,null,null]"==a([m,b,null])&&a({a:[i,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===a(null,i)&&"[\n 1,\n 2\n]"==a([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==a(new u(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==a(new u(864e13))&&'"-000001-01-01T00:00:00.000Z"'==a(new u(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==a(new u(-1))}catch(e){l=!1}}n=l}if("json-parse"==e){var c=t.parse;if("function"==typeof c)try{if(0===c("0")&&!c(!1)){var p=5==(i=c(s)).a.length&&1===i.a[0];if(p){try{p=!c('"\t"')}catch(e){}if(p)try{p=1!==c("01")}catch(e){}if(p)try{p=1!==c("1.")}catch(e){}}}}catch(e){p=!1}n=p}}return v[e]=!!n}if(!v("json")){var O=v("bug-string-char-index");if(!I)var w=p.floor,S=[0,31,59,90,120,151,181,212,243,273,304,334],k=function(e,t){return S[t]+365*(e-1970)+w((e-1969+(t=+(t>1)))/4)-w((e-1901+t)/100)+w((e-1601+t)/400)};if((h=y.hasOwnProperty)||(h=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=b?h=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,h=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,h.call(this,e)}),f=function(e,t){var o,r,i,s=0;for(i in(o=function(){this.valueOf=0}).prototype.valueOf=0,r=new o)h.call(r,i)&&s++;return o=r=null,s?f=2==s?function(e,t){var n,o={},r="[object Function]"==b.call(e);for(n in e)r&&"prototype"==n||h.call(o,n)||!(o[n]=1)||!h.call(e,n)||t(n)}:function(e,t){var n,o,r="[object Function]"==b.call(e);for(n in e)r&&"prototype"==n||!h.call(e,n)||(o="constructor"===n)||t(n);(o||h.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],f=function(e,t){var o,i,s="[object Function]"==b.call(e),a=!s&&"function"!=typeof e.constructor&&n[g(e.hasOwnProperty)]&&e.hasOwnProperty||h;for(o in e)s&&"prototype"==o||!a.call(e,o)||t(o);for(i=r.length;o=r[--i];a.call(e,o)&&t(o));}),f(e,t)},!v("json-stringify")){var _={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},P=function(e,t){return("000000"+(t||0)).slice(-e)},T=function(e){for(var t='"',n=0,o=e.length,r=!O||o>10,i=r&&(O?e.split(""):e);n<o;n++){var s=e.charCodeAt(n);switch(s){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=_[s];break;default:if(s<32){t+="\\u00"+P(2,s.toString(16));break}t+=r?i[n]:e.charAt(n)}}return t+'"'};t.stringify=function(e,t,o){var r,i,s,a;if(n[void 0===t?"undefined":g(t)]&&t)if("[object Function]"==(a=b.call(t)))i=t;else if("[object Array]"==a){s={};for(var u,l=0,p=t.length;l<p;u=t[l++],("[object String]"==(a=b.call(u))||"[object Number]"==a)&&(s[u]=1));}if(o)if("[object Number]"==(a=b.call(o))){if((o-=o%1)>0)for(r="",o>10&&(o=10);r.length<o;r+=" ");}else"[object String]"==a&&(r=o.length<=10?o:o.slice(0,10));return function e(t,n,o,r,i,s,a){var u,l,p,d,y,I,v,O,S,_,U,x,E,M,R,C;try{u=n[t]}catch(e){}if("object"==(void 0===u?"undefined":g(u))&&u)if("[object Date]"!=(l=b.call(u))||h.call(u,"toJSON"))"function"==typeof u.toJSON&&("[object Number]"!=l&&"[object String]"!=l&&"[object Array]"!=l||h.call(u,"toJSON"))&&(u=u.toJSON(t));else if(u>-1/0&&u<1/0){if(k){for(y=w(u/864e5),p=w(y/365.2425)+1970-1;k(p+1,0)<=y;p++);for(d=w((y-k(p,0))/30.42);k(p,d+1)<=y;d++);y=1+y-k(p,d),v=w((I=(u%864e5+864e5)%864e5)/36e5)%24,O=w(I/6e4)%60,S=w(I/1e3)%60,_=I%1e3}else p=u.getUTCFullYear(),d=u.getUTCMonth(),y=u.getUTCDate(),v=u.getUTCHours(),O=u.getUTCMinutes(),S=u.getUTCSeconds(),_=u.getUTCMilliseconds();u=(p<=0||p>=1e4?(p<0?"-":"+")+P(6,p<0?-p:p):P(4,p))+"-"+P(2,d+1)+"-"+P(2,y)+"T"+P(2,v)+":"+P(2,O)+":"+P(2,S)+"."+P(3,_)+"Z"}else u=null;if(o&&(u=o.call(n,t,u)),null===u)return"null";if("[object Boolean]"==(l=b.call(u)))return""+u;if("[object Number]"==l)return u>-1/0&&u<1/0?""+u:"null";if("[object String]"==l)return T(""+u);if("object"==(void 0===u?"undefined":g(u))){for(M=a.length;M--;)if(a[M]===u)throw c();if(a.push(u),U=[],R=s,s+=i,"[object Array]"==l){for(E=0,M=u.length;E<M;E++)x=e(E,u,o,r,i,s,a),U.push(x===m?"null":x);C=U.length?i?"[\n"+s+U.join(",\n"+s)+"\n"+R+"]":"["+U.join(",")+"]":"[]"}else f(r||u,function(t){var n=e(t,u,o,r,i,s,a);n!==m&&U.push(T(t)+":"+(i?" ":"")+n)}),C=U.length?i?"{\n"+s+U.join(",\n"+s)+"\n"+R+"}":"{"+U.join(",")+"}":"{}";return a.pop(),C}}("",((u={})[""]=e,u),i,s,r,"",[])}}if(!v("json-parse")){var U,x,E=r.fromCharCode,M={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},R=function(){throw U=x=null,l()},C=function(){for(var e,t,n,o,r,i=x,s=i.length;U<s;)switch(r=i.charCodeAt(U)){case 9:case 10:case 13:case 32:U++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=O?i.charAt(U):i[U],U++,e;case 34:for(e="@",U++;U<s;)if((r=i.charCodeAt(U))<32)R();else if(92==r)switch(r=i.charCodeAt(++U)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=M[r],U++;break;case 117:for(t=++U,n=U+4;U<n;U++)(r=i.charCodeAt(U))>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70||R();e+=E("0x"+i.slice(t,U));break;default:R()}else{if(34==r)break;for(r=i.charCodeAt(U),t=U;r>=32&&92!=r&&34!=r;)r=i.charCodeAt(++U);e+=i.slice(t,U)}if(34==i.charCodeAt(U))return U++,e;R();default:if(t=U,45==r&&(o=!0,r=i.charCodeAt(++U)),r>=48&&r<=57){for(48==r&&(r=i.charCodeAt(U+1))>=48&&r<=57&&R(),o=!1;U<s&&(r=i.charCodeAt(U))>=48&&r<=57;U++);if(46==i.charCodeAt(U)){for(n=++U;n<s&&(r=i.charCodeAt(n))>=48&&r<=57;n++);n==U&&R(),U=n}if(101==(r=i.charCodeAt(U))||69==r){for(43!=(r=i.charCodeAt(++U))&&45!=r||U++,n=U;n<s&&(r=i.charCodeAt(n))>=48&&r<=57;n++);n==U&&R(),U=n}return+i.slice(t,U)}if(o&&R(),"true"==i.slice(U,U+4))return U+=4,!0;if("false"==i.slice(U,U+5))return U+=5,!1;if("null"==i.slice(U,U+4))return U+=4,null;R()}return"$"},A=function(e,t,n){var o=j(e,t,n);o===m?delete e[t]:e[t]=o},j=function(e,t,n){var o,r=e[t];if("object"==(void 0===r?"undefined":g(r))&&r)if("[object Array]"==b.call(r))for(o=r.length;o--;)A(r,o,n);else f(r,function(e){A(r,e,n)});return n.call(e,t,r)};t.parse=function(e,t){var n,o;return U=0,x=""+e,n=function e(t){var n,o;if("$"==t&&R(),"string"==typeof t){if("@"==(O?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(n=[];"]"!=(t=C());o||(o=!0))o&&(","==t?"]"==(t=C())&&R():R()),","==t&&R(),n.push(e(t));return n}if("{"==t){for(n={};"}"!=(t=C());o||(o=!0))o&&(","==t?"}"==(t=C())&&R():R()),","!=t&&"string"==typeof t&&"@"==(O?t.charAt(0):t[0])&&":"==C()||R(),n[t.slice(1)]=e(C());return n}R()}return t}(C()),"$"!=C()&&R(),U=x=null,t&&"[object Function]"==b.call(t)?j(((o={})[""]=n,o),"",t):n}}}return t.runInContext=a,t}if(!s||s.global!==s&&s.window!==s&&s.self!==s||(i=s),r)a(i,r);else{var u=i.JSON,l=i.JSON3,c=!1,p=a(i,i.JSON3={noConflict:function(){return c||(c=!0,i.JSON=u,i.JSON3=l,u=l=null),p}});i.JSON={parse:p.parse,stringify:p.stringify}}}).call(o)});(function(e){for(var t=0,n=["ms","moz","webkit","o"],o=0;o<n.length&&!e.requestAnimationFrame;++o)e.requestAnimationFrame=e[n[o]+"RequestAnimationFrame"],e.cancelAnimationFrame=e[n[o]+"CancelAnimationFrame"]||e[n[o]+"CancelRequestAnimationFrame"];if(e.requestAnimationFrame||(e.requestAnimationFrame=function(n){var o=(new Date).getTime(),r=Math.max(0,16-(o-t)),i=e.setTimeout(function(){n(o+r)},r);return t=o+r,i}),e.cancelAnimationFrame||(e.cancelAnimationFrame=function(t){e.clearTimeout(t)}),!window.console){var r={log:function(){},dir:function(e){for(var t in e)r.log(t+" ",e[t])}};r.warn=r.log,window.console=r}window.console.dir||(window.console.dir=function(e){for(var t in e)window.console.log(t+" ",e[t])}),window.console.warn||(window.console.warn=window.console.log)})(window),pe.addEvent=function(e,t,n,o){e.addEventListener?e.addEventListener(t,n,!!o):e.attachEvent&&(e["e"+t+n]=n,e[t+n]=function(){e["e"+t+n](window.event)},e.attachEvent("on"+t,e[t+n]))},pe.assign=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},pe.isInternal=!0,pe.module=!0,pe.JSON=he,pe.prototype.setSiteId=function(e){pe.isInternal||(this.data.siteid=e)},pe.prototype.setSpeId=function(e){this.data&&(this.data.speid=J(e))},function(){try{var e=navigator.userAgent;de=new pe(e)}catch(s){if(s instanceof ne)throw s;window.console.dir(s);var t=new Image(1,1),n="";for(var o in s)n+=o+":"+s[o]+";";var r=encodeURIComponent,i=s.stack?r(s.stack):"";t.src=window.location.protocol+"//wbugs.hiido.com/c.gif?e="+r(n)+"|"+i+"|"+r(window.location.href)+"|"+r(e),t.onload=function(){}}}();var fe=de.report,ge=de.Metrics,me=de.oldMetrics,ye=de.setSiteId.bind(de),be=de.setSpeId.bind(de)}.call(this,n(18))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.context="",this.uid="0",this.appid=0,this.instId=0,this.svcName="",this.fnName="",this.protoType="",this.data=null,this.dataCRC=0,this.serverId="",this.seqId="",this.traceId=""}unmarshall(e){this.context=e.popString(),this.uid=e.popUInt64String(),this.appid=e.popUInt32(),this.instId=e.popUInt32(),this.svcName=e.popString(),this.fnName=e.popString(),this.protoType=e.popString(),this.data=e.popUint8Array32(),this.dataCRC=e.popUInt32(),this.serverId=e.popUInt64String(),this.seqId=e.popUInt64String(),this.traceId=e.popString()}toString(){return"context="+this.context+" uid="+this.uid+" appid="+this.appid+" instId="+this.instId+" svcName="+this.svcName+" fnName="+this.fnName+" protoType="+this.protoType+" dataCRC="+this.dataCRC+" serverId="+this.serverId+" seqId="+this.seqId+" traceId="+this.traceId}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(6);t.default=class{constructor(){this.context=""}marshall(){let e=new o.default;return e.setUri(r.default.PSvcUnicastResURI),e.pushString(this.context),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.groupType="0",this.groupId="0",this.svcName="",this.fnName="",this.protoType="",this.data=null,this.dataCRC=0,this.serverId="0",this.seqId="0",this.traceId=""}unmarshall(e){this.appid=e.popUInt32(),this.groupType=e.popUInt64String(),this.groupId=e.popUInt64String(),this.svcName=e.popString(),this.fnName=e.popString(),this.protoType=e.popString(),this.data=e.popUint8Array32(),this.dataCRC=e.popUInt32(),this.serverId=e.popUInt64String(),this.seqId=e.popUInt64String(),this.traceId=e.popString()}toString(){return"appid="+this.appid+" groupType="+this.groupType+" groupId="+this.groupId+" svcName="+this.svcName+" fnName="+this.fnName+" protoType="+this.protoType+" dataCRC="+this.dataCRC+" serverId="+this.serverId+" seqId="+this.seqId+" traceId="+this.traceId}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.uid="0",this.appid=0,this.instId=0,this.code=0,this.desc=""}unmarshall(e){this.uid=e.popUInt64String(),this.appid=e.popUInt32(),this.instId=e.popUInt32(),this.code=e.popUInt32(),this.desc=e.popUtf8String()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.appid=0,this.ugid="",this.svcName="",this.fnName="",this.protoType="",this.data=null,this.dataCRC=0,this.serverId=null,this.seqId=null,this.traceId=""}unmarshall(e){this.appid=e.popUInt32(),this.ugid=e.popString(),this.svcName=e.popString(),this.fnName=e.popString(),this.protoType=e.popString(),this.data=e.popUint8Array32(),this.dataCRC=e.popUInt32(),this.serverId=e.popUInt64(),this.seqId=e.popUInt64(),this.traceId=e.popString()}toString(){return"appid="+this.appid+" ugid="+this.ugid+" svcName="+this.svcName+" fnName="+this.fnName+" protoType="+this.protoType+" dataCRC="+this.dataCRC+" serverId="+JSON.stringify(this.serverId)+" seqId="+JSON.stringify(this.seqId)+" traceId="+this.traceId}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(1);t.default=class{constructor(){this.context="",this.rescode=0,this.msg="",this.svcName="",this.fnName="",this.protoType="",this.data=null,this.dataCRC=0,this.serverHeaders=new Map,this.traceId=""}unmarshall(e){this.context=e.popString(),this.rescode=e.popUInt32(),this.msg=e.popString(),this.svcName=e.popString(),this.fnName=e.popString(),this.protoType=e.popString(),this.data=e.popUint8Array32(),this.dataCRC=e.popUInt32();let t=e.popUInt32();for(let n=0;n<t;n++)this.serverHeaders.set(e.popString(),e.popString());this.traceId=e.popString()}toString(){return"context="+this.context+" rescode="+this.rescode+" msg="+this.msg+" svcName="+this.svcName+" fnName="+this.fnName+" traceId="+this.traceId+" serverHeaders="+o.default.stringfyMap(this.serverHeaders)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.context="",this.rescode=0}unmarshall(e){this.context=e.popString(),this.rescode=e.popUInt32()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(6),i=n(5);t.default=class{constructor(){this.context="",this.appid=0,this.joinGroups=new Array,this.leaveGroups=new Array}marshall(){let e=new o.default;e.setUri(r.default.PSvcSubsGroupReqURI),e.pushString(this.context),e.pushUInt32(this.appid);let t=this.joinGroups.length;if(0==t)e.pushUInt32(0);else{e.pushUInt32(t);for(let n=0;n<t;n++){let t=i.fromString(this.joinGroups[n].grpType.toString());e.pushUInt32(t.low),e.pushUInt32(t.high);let o=i.fromString(this.joinGroups[n].grpId.toString());e.pushUInt32(o.low),e.pushUInt32(o.high)}}if(0==(t=this.leaveGroups.length))e.pushUInt32(0);else{e.pushUInt32(t);for(let n=0;n<t;n++){let t=i.fromString(this.leaveGroups[n].grpType.toString());e.pushUInt32(t.low),e.pushUInt32(t.high);let o=i.fromString(this.leaveGroups[n].grpId.toString());e.pushUInt32(o.low),e.pushUInt32(o.high)}}return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(6);t.default=class{constructor(){this.context="",this.appid=0,this.join=[],this.leave=[],this.traceId=""}marshall(){let e=new o.default;e.setUri(r.default.PCS_ServiceSubcribeUserGroupV2URI),e.pushString(this.context),e.pushUInt32(this.appid);let t=this.join.length;e.pushUInt32(t);for(let n=0;n<t;n++)e.pushString(this.join[n]);t=this.leave.length,e.pushUInt32(t);for(let n=0;n<t;n++)e.pushString(this.leave[n]);return e.pushString(this.traceId),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.context="",this.rescode=0,this.traceId="",this.msg=""}unmarshall(e){this.context=e.popString(),this.rescode=e.popUInt32(),this.traceId=e.popString(),this.msg=e.popString()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.context="",this.rescode=0,this.msg="",this.serverHeaders={}}unmarshall(e){this.context=e.popString(),this.rescode=e.popUInt32(),this.msg=e.popString();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popString(),n=e.popString();this.serverHeaders[t]=n}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.context="",this.rescode=0,this.msg=""}unmarshall(e){this.context=e.popString(),this.rescode=e.popUInt32(),this.msg=e.popString()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(6);t.default=class{constructor(){this.context="",this.uid="0",this.appid=0,this.instId=0,this.seqId=0,this.otp="",this.clientHeaders=new Map,this.tokenType=0,this.traceId=""}marshall(){let e=new o.default;e.setUri(r.default.PSvcTokenReqURI),e.pushString(this.context),e.pushUInt64String(this.uid),e.pushUInt32(this.appid),e.pushUInt32(this.instId),e.pushUInt64String(this.seqId.toString()),e.pushString(this.otp),e.pushUInt32(this.clientHeaders.size);for(let[t,n]of this.clientHeaders)e.pushString(t),e.pushString(n);return e.pushUInt32(this.tokenType),e.pushString(this.traceId),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.context="",this.rescode=0,this.msg="",this.serverHeaders={},this.traceId="",this.iskickOut=!1}unmarshall(e){this.context=e.popString(),this.rescode=e.popUInt32(),this.msg=e.popString();let t=e.popUInt32();for(let n=0;n<t;n++){let t=e.popString(),n=e.popString();this.serverHeaders[t]=n}this.traceId=e.popString(),this.iskickOut=e.popBool()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(21),r=n(7);t.default=class{constructor(e){this.appid=0,this.userRegion="cn",this.heartBeatTimeoutSecs=60,this.joinedChannels=[],this.appid=e,this.bShareAnonymousUid=!0,this.wxAppid="",this.hiidoHost="",this.scode=0,this.bRetry=!1,this.seqId=0,this.seqContext={},this.domain="",this.chlAppkey=0,this.chlPassword="",this.uid="0",this.anonymousUid=0,this.instId=Math.round(4294967295*Math.random()),this.tokenType=r.TokenType.TOKEN_3RD,this.token="",this.topSid=0,this.subSid=0,this.asid=0,this.channelJoined=!1,this.exclusiveJoin=!1,this.lastSentJoinChl=-2e3,this.lastSendLeaveChl=0,this.userType=r.UserType.ANONYMOUS,this.userGroups={subs:{},unsubs:{}},this.innerBcGroups={},this.userGroupsV2={subs:[],unsubs:[]},this.uuid=o.v4(),this.bLostConnection=!1,this.everJoinChannel=!1,this.loginUdbStartTs=0,this.logoutUdbStartTs=0,this.loginApStartTs=0,this.logoutApStartTs=0}getSeqId(){return this.seqId+=1,this.seqId}logout(){this.bRetry=!1,this.seqContext={},this.uid="0",this.token=null,this.topSid=0,this.subSid=0,this.asid=0,this.channelJoined=!1,this.userType=r.UserType.ANONYMOUS,this.userGroups={subs:{},unsubs:{}},this.innerBcGroups={},this.userGroupsV2={subs:[],unsubs:[]}}get isAnonymous(){return this.userType===r.UserType.ANONYMOUS}get isMiniProgram(){return"undefined"==typeof window}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(28),r=n(5),i=n(37),s=n(3),a=n(23),u=n(24);o.util.Long=r,o.configure();const l=new s.Logger("HummerProto");t.default=class{static decodeRouteRes(e){if(l.debug("decodeRouteRes:",e),"cim.proto.ProxyService.SetUserRegion"==e.fnName)return i.hummerProto.SetUserRegionResponse.decode(new Uint8Array(e.data));if("CreateChatRoom"==e.fnName){let t=new a.default;return t.unmarshall(e.data),t}if("GetUserCount"==e.fnName){let t=new u.default;return t.unmarshall(e.data),t}return null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.uid="0",this.props=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.uid),e.pushUInt32(this.props.size);for(let[t,n]of this.props)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.roomid=0}marshall(){let e=new o.default(!1);return e.pushUInt32(this.appid),e.pushUInt32(this.roomid),e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);var i;!function(e){e[e.UNDEFINED=-1]="UNDEFINED",e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE",e[e.DISCONNECTED=2]="DISCONNECTED"}(i||(i={}));t.default=class{constructor(){this.appid=0,this.opUid="0",this.status={},this.rescode=0,this.msg=""}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.opUid=n.popUInt64String();let i=n.popUInt32();for(let e=0;e<i;e++){let e=n.popUInt64String(),t=n.popUInt32();this.status[e]=t}this.rescode=n.popUInt32(),this.msg=n.popString()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.opUid="0",this.rescode=0,this.msg=""}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.opUid=n.popUInt64String(),this.rescode=n.popUInt32(),this.msg=n.popUtf8String()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(2),r=n(1);t.default=class{constructor(){this.appid=0,this.opUid="0",this.rescode=0,this.msg=""}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new o.default(t,!1);this.appid=n.popUInt32(),this.opUid=n.popUInt64String(),this.rescode=n.popUInt32(),this.msg=n.popUtf8String()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(1),i=n(2),s=n(16),a=n(22);t.default=class{constructor(){this.appid=0,this.opUid="0",this.channelId="",this.region="",this.type=0,this.content=null,this.isOffline=!1,this.uuid="",this.timestamp=0,this.extensions=new Map,this.internal_extensions=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.opUid),e.pushUtf8String(this.channelId),e.pushString(this.region),e.pushUInt32(this.type),e.pushUint8Array32(this.content),e.pushBool(this.isOffline),e.pushString(this.uuid),e.pushNumber(this.timestamp),e.pushUInt32(this.extensions.size);for(let[t,n]of this.extensions)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());e.pushUInt32(this.internal_extensions.size);for(let[t,n]of this.internal_extensions)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new i.default(t);this.appid=n.popUInt32(),this.opUid=n.popUInt64String(),this.channelId=n.popUtf8String(),this.region=n.popString(),this.type=n.popUInt32(),this.content=n.popUint8Array32(),this.isOffline=n.popBool(),this.uuid=n.popString(),this.timestamp=n.popNumber();let o=n.popUInt32();for(let e=0;e<o;e++){let e=n.popUtf8String(),t=n.popUtf8String();this.extensions.set(e,t)}o=n.popUInt32();for(let e=0;e<o;e++){let e=n.popUtf8String(),t=n.popUtf8String();this.internal_extensions.set(e,t)}}toMessage(){switch(this.type){case s.MsgType.TEXT:let e=new a.default;return e.unmarshall(this.content),{opUid:this.opUid,message:{msgType:this.type,content:e.text},timestamp:this.timestamp,appExtras:r.default.toPlainObject(this.extensions)};default:return null}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0);t.default=class{constructor(){this.appid=0,this.opUid="0",this.uids=[]}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.opUid);let t=this.uids.length;e.pushUInt32(t);for(let t of this.uids)e.pushUInt64String(t);return e.marshall()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(0),r=n(1),i=n(2),s=n(16),a=n(22);t.default=class{constructor(){this.appid=0,this.opUid="0",this.toUid="0",this.type=0,this.content=null,this.isOffline=!1,this.uuid="",this.timestamp=0,this.extensions=new Map,this.internal_extensions=new Map}marshall(){let e=new o.default(!1);e.pushUInt32(this.appid),e.pushUInt64String(this.opUid),e.pushUInt64String(this.toUid),e.pushUInt32(this.type),e.pushUint8Array32(this.content),e.pushBool(this.isOffline),e.pushString(this.uuid),e.pushNumber(this.timestamp),e.pushUInt32(this.extensions.size);for(let[t,n]of this.extensions)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());e.pushUInt32(this.internal_extensions.size);for(let[t,n]of this.internal_extensions)e.pushUtf8String(t.toString()),e.pushUtf8String(n.toString());return e.marshall()}unmarshall(e){let t=r.default.payload2DataView(e);e=null;let n=new i.default(t);this.appid=n.popUInt32(),this.opUid=n.popUInt64String(),this.toUid=n.popUInt64String(),this.type=n.popUInt32(),this.content=n.popUint8Array32(),this.isOffline=n.popBool(),this.uuid=n.popString(),this.timestamp=n.popNumber();let o=n.popUInt32();for(let e=0;e<o;e++){let e=n.popUtf8String(),t=n.popUtf8String();this.extensions.set(e,t)}o=n.popUInt32();for(let e=0;e<o;e++){let e=n.popUtf8String(),t=n.popUtf8String();this.internal_extensions.set(e,t)}}toMessage(){switch(this.type){case s.MsgType.TEXT:let e=new a.default;return e.unmarshall(this.content),{opUid:this.opUid,message:{msgType:this.type,content:e.text},timestamp:this.timestamp,appExtras:r.default.toPlainObject(this.extensions)};default:return null}}}}]).default});