text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SDK=t():e.SDK=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";n(46),e.exports=n(144)},function(e,t,n){"use strict";var r=n(11),o=n(16),i=n(32),s=n(24);n(54);var a=n(3),c=n(33),u=c.getGlobal(),l=/\s+/;c.shouldDisplayInstallFlashHint=function(){var e=r.name.toLowerCase();if("ie"===e){var t=+r.version||0;return t=Math.floor(t),7===t&&!o.Transport.flashsocket.check()}return!1},c.deduplicate=function(e){var t=[];return e.forEach(function(e){t.indexOf(e)===-1&&t.push(e)}),t},c.capFirstLetter=function(e){return e?(e=""+e,e.slice(0,1).toUpperCase()+e.slice(1)):""},c.guid=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return function(){return e()+e()+e()+e()+e()+e()+e()+e()}}(),c.extend=function(e,t,n){for(var r in t)"undefined"!=typeof e[r]&&n!==!0||(e[r]=t[r])},c.filterObj=function(e,t){var n={};return c.isString(t)&&(t=t.split(l)),t.forEach(function(t){e.hasOwnProperty(t)&&(n[t]=e[t])}),n},c.simpleClone=function(e){return JSON.parse(JSON.stringify(e))},c.copy=function(e,t){return t=t||{},e?(Object.keys(e).forEach(function(n){c.exist(e[n])&&(t[n]=e[n])}),t):t},c.findObjIndexInArray=function(e,t){e=e||[];var n=t.keyPath||"id",r=-1;return e.some(function(e,o){if(s(e,n)===t.value)return r=o,!0}),r},c.findObjInArray=function(e,t){var n=c.findObjIndexInArray(e,t);return n===-1?null:e[n]},c.mergeObjArray=function(){var e=[],t=[].slice.call(arguments,0,-1),n=arguments[arguments.length-1];c.isArray(n)&&(t.push(n),n={});var r=n.keyPath=n.keyPath||"id";for(n.sortPath=n.sortPath||r;!e.length&&t.length;)e=t.shift()||[],e=e.slice(0);var o;return t.forEach(function(t){t&&t.forEach(function(t){o=c.findObjIndexInArray(e,{keyPath:r,value:s(t,r)}),o!==-1?e[o]=c.merge({},e[o],t):e.push(t)})}),n.notSort||(e=c.sortObjArray(e,n)),e},c.cutObjArray=function(e){var t=e.slice(0),n=arguments.length,r=[].slice.call(arguments,1,n-1),o=arguments[n-1];c.isObject(o)||(r.push(o),o={});var i,a=o.keyPath=o.keyPath||"id";return r.forEach(function(e){c.isArray(e)||(e=[e]),e.forEach(function(e){e&&(o.value=s(e,a),i=c.findObjIndexInArray(t,o),i!==-1&&t.splice(i,1))})}),t},c.sortObjArray=function(e,t){t=t||{};var n=t.sortPath||"id";i.insensitive=!!t.insensitive;var r,o,a,u=!!t.desc;return a=c.isFunction(t.compare)?t.compare:function(e,t){return r=s(e,n),o=s(t,n),u?i(o,r):i(r,o)},e.sort(a)},c.emptyFunc=function(){},c.isEmptyFunc=function(e){return e===c.emptyFunc},c.notEmptyFunc=function(e){return e!==c.emptyFunc},c.splice=function(e,t,n){return[].splice.call(e,t,n)},c.onError=function(e){throw new a(e)},c.verifyParamPresent=function(e,t,n){n=n||"";var r=!1;switch(c.typeOf(t)){case"undefined":case"null":r=!0;break;case"string":""===t&&(r=!0);break;case"object":Object.keys(t).length||(r=!0);break;case"array":t.length?t.some(function(e){if(c.notexist(e))return r=!0,!0}):r=!0}r&&c.onParamAbsent(n+e)},c.onParamAbsent=function(e){c.onParamError('缺少参数"'+e+'", 请确保参数不是 空字符串、空对象、空数组、null或undefined, 或者数组的内容不是 null/undefined')},c.verifyParamAbsent=function(e,t,n){n=n||"",void 0!==t&&c.onParamPresent(n+e)},c.onParamPresent=function(e){c.onParamError('多余的参数"'+e+'"')},c.verifyParamType=function(e,t,n){var r=c.typeOf(t).toLowerCase();c.isArray(n)||(n=[n]),n=n.map(function(e){return e.toLowerCase()});var o=!0;switch(n.indexOf(r)===-1&&(o=!1),r){case"number":isNaN(t)&&(o=!1)}o||c.onParamInvalidType(e,n)},c.onParamInvalidType=function(e,t,n){n=n||"",c.isArray(t)?(t=t.map(function(e){return'"'+e+'"'}),t=t.join(", ")):t='"'+t+'"',c.onParamError('参数"'+n+e+'"类型错误, 合法的类型包括: ['+t+"]")},c.verifyParamValid=function(e,t,n){c.isArray(n)||(n=[n]),n.indexOf(t)===-1&&c.onParamInvalidValue(e,n)},c.onParamInvalidValue=function(e,t){c.isArray(t)||(t=[t]),t=t.map(function(e){return'"'+e+'"'}),c.isArray(t)&&(t=t.join(", ")),c.onParamError('参数"'+e+'"值错误, 合法的值包括: ['+t+"]")},c.verifyParamMin=function(e,t,n){t<n&&c.onParamError("参数"+e+"的值不能小于"+n)},c.verifyParamMax=function(e,t,n){t>n&&c.onParamError("参数"+e+"的值不能大于"+n)},c.verifyArrayMax=function(e,t,n){t.length>n&&c.onParamError("参数"+e+"的长度不能大于"+n)},c.verifyEmail=function(){var e=/^\S+@\S+$/;return function(t,n){e.test(n)||c.onParamError("参数"+t+"邮箱格式错误, 合法格式必须包含@符号, @符号前后至少要各有一个字符")}}(),c.verifyTel=function(){var e=/^[+\-\(\)\d]+$/;return function(t,n){e.test(n)||c.onParamError("参数"+t+"电话号码格式错误, 合法字符包括+、-、英文括号和数字")}}(),c.verifyBirth=function(){var e=/^(\d{4})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/;return function(t,n){e.test(n)||c.onParamError("参数"+t+'生日格式错误, 合法为"yyyy-MM-dd"')}}(),c.onParamError=function(e){c.onError(e)},c.verifyOptions=function(e,t,n,r){if(e=e||{},t&&(c.isString(t)&&(t=t.split(l)),c.isArray(t))){n=void 0===n||!!n;var o=n?c.verifyParamPresent:c.verifyParamAbsent;t.forEach(function(t){o.call(c,t,e[t],r)})}return e},c.verifyParamAtLeastPresentOne=function(e,t){if(t&&(c.isString(t)&&(t=t.split(l)),c.isArray(t))){var n=t.some(function(t){return c.exist(e[t])});n||c.onParamError("以下参数["+t.join(", ")+"]至少需要传入一个")}},c.verifyParamPresentJustOne=function(e,t){if(t&&(c.isString(t)&&(t=t.split(l)),c.isArray(t))){var n=t.reduce(function(t,n){return c.exist(e[n])&&t++,t},0);1!==n&&c.onParamError("以下参数["+t.join(", ")+"]必须且只能传入一个")}},c.verifyBooleanWithDefault=function(e,t,n,r){c.undef(n)&&(n=!0),l.test(t)&&(t=t.split(l)),c.isArray(t)?t.forEach(function(t){c.verifyBooleanWithDefault(e,t,n,r)}):"undefined"==typeof e[t]?e[t]=n:c.isBoolean(e[t])||c.onParamInvalidType(t,"boolean",r)},c.verifyFileInput=function(e){return c.verifyParamPresent("fileInput",e),c.isString(e)&&(e=document.getElementById(e),e||c.onParamError("找不到要上传的文件对应的input, 请检查fileInput id")),e.tagName&&"input"===e.tagName.toLowerCase()&&"file"===e.type.toLowerCase()||c.onParamError("请提供正确的 fileInput, 必须为 file 类型的 input 节点"),e},c.verifyFileType=function(e){c.verifyParamValid("type",e,c.validFileTypes)},c.verifyCallback=function(e,t){l.test(t)&&(t=t.split(l)),c.isArray(t)?t.forEach(function(t){c.verifyCallback(e,t)}):e[t]?c.isFunction(e[t])||c.onParamInvalidType(t,"function"):e[t]=c.emptyFunc},c.verifyFileUploadCallback=function(e){c.verifyCallback(e,"uploadprogress uploaddone uploaderror uploadcancel")},c.validFileTypes=["image","audio","video","file"],c.validFileExts={image:["bmp","gif","jpg","jpeg","jng","png","webp"],audio:["mp3","wav","aac","wma","wmv","amr","mp2","flac","vorbis","ac3"],video:["mp4","rm","rmvb","wmv","avi","mpg","mpeg"]},c.filterFiles=function(e,t){t=t.toLowerCase();var n,r,o,i,s="file"===t,a=[];return[].forEach.call(e,function(e){if(s)a.push(e);else if(n=e.name.slice(e.name.lastIndexOf(".")+1),r=e.type.split("/"),r[0]&&r[1]){o=r[0].toLowerCase(),i=r[1].toLowerCase();var u=!1;u=o===t||c.validFileExts[t].indexOf(n)!==-1,u&&a.push(e)}}),a};var f=c.supportFormData=c.notundef(u.FormData);c.getFileName=function(){return function(e){return e=c.verifyFileInput(e),f?e.files[0].name:e.value.slice(e.value.lastIndexOf("\\")+1)}}(),c.sizeText=function(){var e=["B","KB","MB","GB","TB","PB","EB","ZB","BB"];return function(t){var n,r=0;do{t=Math.floor(100*t)/100;var o=e[r];n=t+o,t/=1024,r++}while(t>1);return n}}(),c.promises2cmds=function(e){return e.map(function(e){return e.cmd})},c.objs2accounts=function(e){return e.map(function(e){return e.account})},c.teams2ids=function(e){return e.map(function(e){return e.teamId})},c.objs2ids=function(e){return e.map(function(e){return e.id})},c.getMaxUpdateTime=function(e){var t=e.map(function(e){return+e.updateTime});return Math.max.apply(Math,t)},c.genCheckUniqueFunc=function(e,t){var n=[],r={};return e=e||"id",t=t||1e3,function(o){var i;return n.length>=t&&(i=n.shift(),delete r[i]),i=s(o,e),!r[i]&&(r[i]=!0,n.push(i),!0)}},e.exports=c,n(58)},function(e,t,n){(function(t,r){/*!
  	 * @overview es6-promise - a tiny implementation of Promises/A+.
  	 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  	 * @license   Licensed under MIT license
  	 *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
  	 * @version   4.0.5
  	 */
  !function(t,n){e.exports=n()}(this,function(){"use strict";function e(e){return"function"==typeof e||"object"==typeof e&&null!==e}function o(e){return"function"==typeof e}function i(e){K=e}function s(e){G=e}function a(){return function(){return t.nextTick(d)}}function c(){return"undefined"!=typeof z?function(){z(d)}:f()}function u(){var e=0,t=new Q(d),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}function l(){var e=new MessageChannel;return e.port1.onmessage=d,function(){return e.port2.postMessage(0)}}function f(){var e=setTimeout;return function(){return e(d,1)}}function d(){for(var e=0;e<V;e+=2){var t=ne[e],n=ne[e+1];t(n),ne[e]=void 0,ne[e+1]=void 0}V=0}function m(){try{var e=n(71);return z=e.runOnLoop||e.runOnContext,c()}catch(e){return f()}}function p(e,t){var n=arguments,r=this,o=new this.constructor(g);void 0===o[oe]&&R(o);var i=r._state;return i?!function(){var e=n[i-1];G(function(){return j(i,o,e,r._result)})}():x(r,o,e,t),o}function h(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(g);return w(n,e),n}function g(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function b(e){try{return e.then}catch(error){return ce.error=error,ce}}function M(e,t,n,r){try{e.call(t,n,r)}catch(e){return e}}function T(e,t,n){G(function(e){var r=!1,o=M(n,t,function(n){r||(r=!0,t!==n?w(e,n):O(e,n))},function(t){r||(r=!0,I(e,t))},"Settle: "+(e._label||" unknown promise"));!r&&o&&(r=!0,I(e,o))},e)}function k(e,t){t._state===se?O(e,t._result):t._state===ae?I(e,t._result):x(t,void 0,function(t){return w(e,t)},function(t){return I(e,t)})}function S(e,t,n){t.constructor===e.constructor&&n===p&&t.constructor.resolve===h?k(e,t):n===ce?I(e,ce.error):void 0===n?O(e,t):o(n)?T(e,t,n):O(e,t)}function w(t,n){t===n?I(t,y()):e(n)?S(t,n,b(n)):O(t,n)}function C(e){e._onerror&&e._onerror(e._result),P(e)}function O(e,t){e._state===ie&&(e._result=t,e._state=se,0!==e._subscribers.length&&G(P,e))}function I(e,t){e._state===ie&&(e._state=ae,e._result=t,G(C,e))}function x(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+se]=n,o[i+ae]=r,0===i&&e._state&&G(P,e)}function P(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,i=e._result,s=0;s<t.length;s+=3)r=t[s],o=t[s+n],r?j(n,r,o,i):o(i);e._subscribers.length=0}}function _(){this.error=null}function E(e,t){try{return e(t)}catch(e){return ue.error=e,ue}}function j(e,t,n,r){var i=o(n),s=void 0,a=void 0,c=void 0,u=void 0;if(i){if(s=E(n,r),s===ue?(u=!0,a=s.error,s=null):c=!0,t===s)return void I(t,v())}else s=r,c=!0;t._state!==ie||(i&&c?w(t,s):u?I(t,a):e===se?O(t,s):e===ae&&I(t,s))}function A(e,t){try{t(function(t){w(e,t)},function(t){I(e,t)})}catch(e){I(e,e)}}function F(){return le++}function R(e){e[oe]=le++,e._state=void 0,e._result=void 0,e._subscribers=[]}function N(e,t){this._instanceConstructor=e,this.promise=new e(g),this.promise[oe]||R(this.promise),J(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&O(this.promise,this._result))):I(this.promise,D())}function D(){return new Error("Array Methods must be provided an Array")}function U(e){return new N(this,e).promise}function B(e){var t=this;return new t(J(e)?function(n,r){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(n,r)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function L(e){var t=this,n=new t(g);return I(n,e),n}function W(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function q(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function H(e){this[oe]=F(),this._result=this._state=void 0,this._subscribers=[],g!==e&&("function"!=typeof e&&W(),this instanceof H?A(this,e):q())}function $(){var e=void 0;if("undefined"!=typeof r)e=r;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=H}var X=void 0;X=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var J=X,V=0,z=void 0,K=void 0,G=function(e,t){ne[V]=e,ne[V+1]=t,V+=2,2===V&&(K?K(d):re())},Y="undefined"!=typeof window?window:void 0,Z=Y||{},Q=Z.MutationObserver||Z.WebKitMutationObserver,ee="undefined"==typeof self&&"undefined"!=typeof t&&"[object process]"==={}.toString.call(t),te="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,ne=new Array(1e3),re=void 0;re=ee?a():Q?u():te?l():void 0===Y?m():f();var oe=Math.random().toString(36).substring(16),ie=void 0,se=1,ae=2,ce=new _,ue=new _,le=0;return N.prototype._enumerate=function(){for(var e=this.length,t=this._input,n=0;this._state===ie&&n<e;n++)this._eachEntry(t[n],n)},N.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=b(e);if(o===p&&e._state!==ie)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(n===H){var i=new n(g);S(i,e,o),this._willSettleAt(i,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(r(e),t)},N.prototype._settledAt=function(e,t,n){var r=this.promise;r._state===ie&&(this._remaining--,e===ae?I(r,n):this._result[t]=n),0===this._remaining&&O(r,this._result)},N.prototype._willSettleAt=function(e,t){var n=this;x(e,void 0,function(e){return n._settledAt(se,t,e)},function(e){return n._settledAt(ae,t,e)})},H.all=U,H.race=B,H.resolve=h,H.reject=L,H._setScheduler=i,H._setAsap=s,H._asap=G,H.prototype={constructor:H,then:p,"catch":function(e){return this.then(null,e)}},H.polyfill=$,H.Promise=H,H})}).call(t,n(10),function(){return this}())},function(e,t){"use strict";function n(e,t){var n=this;n.message=e,n.code=t,n.time=new Date,n.timetag=+n.time}n.prototype=Object.create(Error.prototype),n.prototype.name="NIMError",n.prototype.appendMessage=function(e){var t=this;t.message?e&&(t.message+="("+e+")"):t.message=e};var r={201:"客户端版本不对, 需升级sdk",302:"用户名或密码错误, 请检查appKey和token是否有效, account和token是否匹配",403:"非法操作或没有权限",404:"对象(用户/群/聊天室)不存在",405:"参数长度过长",408:"客户端请求超时",414:"参数错误",415:"服务不可用/没有聊天室服务器可分配",416:"频率控制",417:"重复操作",422:"帐号被禁用",500:"服务器内部错误",501:"数据库操作失败",503:"服务器繁忙",508:"删除有效期过了",509:"已失效",7101:"被拉黑",801:"群人数达到上限",802:"没有权限",803:"群不存在或未发生变化",804:"用户不在群里面",805:"群类型不匹配",806:"创建群数量达到限制",807:"群成员状态不对",809:"已经在群里",997:"协议已失效",998:"解包错误",999:"打包错误",13002:"聊天室状态异常",13003:"在黑名单中",13004:"在禁言名单中",13006:"聊天室处于整体禁言状态,只有管理员能发言",Connect_Failed:"无法建立连接, 请确保能 ping/telnet 到云信服务器; 如果是IE8/9, 请确保项目部署在 HTTPS 环境下",Error_Internet_Disconnected:"网断了",Error_Connection_is_not_Established:"连接未建立",Error_Timeout:"超时",Param_Error:"参数错误",No_File_Selected:"请选择文件",Wrong_File_Type:"文件类型错误",File_Too_Large:"文件过大",Cross_Origin_Iframe:"不能获取跨域Iframe的内容",Not_Support:"不支持",NO_DB:"无数据库",DB:"数据库错误",Still_In_Team:"还在群里",Session_Exist:"会话已存在",Session_Not_Exist:"会话不存在",Error_Unknown:"未知错误",Operation_Canceled:"操作取消"};[200,406,808,810].forEach(function(e){r[e]=null}),n.genError=function(e){var t=r[e];return void 0===t&&(t="操作失败"),null===t?null:new n(t,e)},n.multiInstance=function(){return new n("不允许初始化多个实例","Not_Allow_Multi_Instance")},n.newNetworkError=function(){var e="Error_Internet_Disconnected";return new n(r[e],e)},n.newConnectError=function(e){var t="Connect_Failed";return new n(r[t]||e,t)},n.newConnectionError=function(){var e="Error_Connection_is_not_Established";return new n(r[e],e)},n.newTimeoutError=function(){var e="Error_Timeout";return new n(r[e],e)},n.newFrequencyControlError=function(){var e=416,t=new n(r[e],e);return t.from="local",t},n.newParamError=function(e){var t="Param_Error";return new n(e||r[t],t)},n.newNoFileError=function(e){var t="No_File_Selected";return new n(e||r[t],t)},n.newWrongFileTypeError=function(e){var t="Wrong_File_Type";return new n(e||r[t],t)},n.newFileTooLargeError=function(e){var t="File_Too_Large";return new n(e||r[t],t)},n.newCORSIframeError=function(){var e="Cross_Origin_Iframe";return new n(r[e],e)},n.newSupportError=function(e,t){return new n("不支持"+e,"Not_Support_"+t)},n.newSupportDBError=function(){return n.newSupportError("数据库","DB")},n.noDBError=function(){var e="NO_DB";return new n(r[e],e)},n.newDBError=function(){var e="DB";return new n(r[e],e)},n.newUnknownError=function(){var e="Error_Unknown";return new n(r[e],e)},n.stillInTeamError=function(){var e="Still_In_Team";return new n(r[e],e)},n.sessionExist=function(){var e="Session_Exist";return new n(r[e],e)},n.sessionNotExist=function(){var e="Session_Not_Exist";return new n(r[e],e)},n.cancel=function(){var e="Operation_Canceled";return new n(r[e],e)},e.exports=n},function(e,t,n){"use strict";function r(e){var t=this;u.verifyOptions(e,"appKey account token"),u.verifyCallback(e,["onconnect","onerror","onwillreconnect","ondisconnect","onloginportschange","onmyinfo","onblacklist","onmutelist","onfriends","onusers","onteams","onsessions","onroamingmsgs","onofflinemsgs","onofflinefiltermsgs","onroamingsysmsgs","onofflinesysmsgs","onofflinefiltersysmsgs","onofflinecustomsysmsgs","onofflinefiltercustomsysmsgs","onsysmsgunread","onsyncdone","onteammembers","onsyncteammembersdone","onmsg","onsysmsg","oncustomsysmsg","onupdatemyinfo","onupdateuser","onupdateteammember","onCreateTeam","onUpdateTeam","onAddTeamMembers","onRemoveTeamMembers","onUpdateTeamManagers","onDismissTeam","onTransferTeam","onUpdateTeamMembersMute","onupdatesession","onupdatesysmsgunread","onupdatesysmsg","onsynccreateteam","onsyncmarkinblacklist","onsyncmarkinmutelist","onsyncfriendaction","shouldIgnoreNotification","onPushNotificationMultiportConfig","onPushNotificationMultiportConfigUpdate"]),t.db=e.api.db=new i({logger:e.logger}),s.call(t,e)}var o=n(2).Promise,i=n(7),s=n(9),a=n(3),c=n(6),u=n(1),l=u.undef,f=n(38),d=n(23),m=n(53),p=n(141),h=n(143),g=d.getInstance({type:"IM",configMap:m,serializeMap:p,unserializeMap:h}),y=n(19),v=s.fn,b=r.fn=r.prototype=Object.create(v);b.init=function(){var e=this;v.init.call(e),e.socketUrls=[],e.parser=g,e.syncing=!0,e.hasSynced=!1,e.hasSyncedTeamMembers=!1,e.syncPromiseArray=[],e.syncResult={},e.syncTeamMembersPromiseArray=[],e.syncTeamMembersResult={},e.timetags={},e.sysMsgUnread=y.completeUnread({}),e.resetUnsettledMsgs(),e.resetUnsettledSysMsgs(),e.msgPromise=o.resolve(),e.sysMsgPromise=o.resolve(),e.sessionSet={},e.msgReceiptTasks={},e.userSet={},e.pushNotificationMultiportConfig=f.getDefaultConfig()},b.reset=function(){var e=this;v.reset.call(e);var t=e.options;e.db.reset(t.db),l(t.lbsUrl)&&(t.lbsUrl=c.lbsUrl),e.resetAutoMarkRead()},b.resetAutoMarkRead=function(){var e=this.options;u.verifyBooleanWithDefault(e,"autoMarkRead",!0)},b.resetUnsettledMsgs=function(){var e=this;e.unhandledMsgs=[],e.unupdatedMsgs=[]},b.resetUnsettledSysMsgs=function(){var e=this;e.unhandledSysMsgs=[],e.unupdatedSysMsgs=[]},b.packetFromSync=function(e){return!e.obj||!!e.obj.sync},b.onDBError=function(e){var t=a.newDBError();t.event=e,this.notifyError(t)},e.exports=r,n(126),n(124),n(135),n(138),n(128),n(137),n(132),n(129),n(131),n(130),n(136),n(133),n(134),n(125),n(127)},function(e,t,n){"use strict";function r(e){var t=this;return t.subType="im",e.Protocol=i,e.Message=a,e.constructor=r,t.init(e)}var o=n(8),i=n(4),s=n(6),a=n(114);r.getInstance=o.getInstance,r.genInstanceName=function(e){return"NIM-account-"+e.account};var c=r.fn=r.prototype=Object.create(o.prototype);r.info=c.info=s.info,e.exports=r,n(79),n(76),n(84),n(88),n(78),n(87),n(85),n(80),n(86),n(75),n(81),n(82),n(74),n(77),n(83)},function(e,t,n){(function(t){"use strict";var n="0418f1369d299d4c006f1408a4369dfe2b16d8cd",r="0418f13",o="3.4.0",i=32,s=1,a="https://lbs.netease.im/lbs/webconf.jsp",c="development"===t.env.NODE_ENV?6e3:42e3,u={info:{hash:n,shortHash:r,version:o,sdkVersion:i,protocolVersion:s},lbsUrl:a,connectTimeout:c,xhrTimeout:c,socketTimeout:c,reconnectionDelay:656.25,reconnectionDelayMax:c,reconnectionJitter:.1,heartbeatInterval:18e4,cmdTimeout:c};u.formatSocketUrl=function(e){return e.indexOf("https")===-1?"https://"+e:e};var l="https://nos.netease.com/";u.fileServerUrl=l,u.genUploadUrl=function(e){return u.fileServerUrl+e},u.genDownloadUrl=function(e,t){if(u.fileServerUrl===l)return"http://"+e+".nos.netease.com/"+t},e.exports=u}).call(t,n(10))},function(e,t,n){"use strict";function r(e){g=e,l.set("db",e,c)}function o(e){this.concurrency=0,this.pendingTasks=[],this.queue=i.resolve(),this.logger=e.logger}var i=n(2).Promise,s=n(11),a=n(24),c=n(34),u=n(1),l=n(39),f=n(3),d=f.newSupportDBError,m=f.noDBError,p=n(89),h="nim-",g=!1,y=u.getGlobal();if(r(!!y.indexedDB),"IE"===s.name&&r(!1),"Microsoft Edge"===s.name&&r(!1),"Safari"===s.name){var v=parseInt(s.version.split(".")[0],10);v<9&&r(!1),r(!1)}var b=o.fn=o.prototype;b.reset=u.emptyFunc,g&&(b.reset=function(e){this.enable=e!==!1}),b.addTask=function(e){var t=this;return new i(function(n,r){function o(e){t.concurrency--;var n=t.pendingTasks.shift();n&&t.addTask(n),e()}return t.concurrency<100?(t.concurrency++,e().then(function(t){o(function(){n(t),e.resolve&&e.resolve(t)})},function(t){o(function(){r(t),e.reject&&e.reject(t)})})):(e.resolve||(e.resolve=n,e.reject=r),void t.pendingTasks.push(e))})},b.init=function(e){var t=this;return t.addTask(function(){return t.enable?t.server?i.resolve():(t.name=h+e,c.open({server:t.name,version:p.version,schema:p.schema}).then(function(e){t.logger.warn("init db",t.name),t.server=e},function(e){throw r(!1),t.server=null,t.name=null,e})):i.reject(d())})},b.destroy=function(){var e=this;return e.addTask(function(){return e.enable?e.server?c.remove(e.name).then(function(){e.logger.warn("delete db",e.name),e.server=null,e.name=null}):i.resolve():i.reject(d())})},b.clear=function(){var e=this;return e.addTask(function(){return e.enable?e.server?e.server.clear("timetag").then(function(){var t=[].slice.call(e.server.getIndexedDB().objectStoreNames),n=[];if(t.forEach(function(t){n.push(e.server.clear(t))}),n.length)return i.all(n).then(function(){e.logger.warn("clear db",e.name)})}):i.resolve():i.reject(d())})},b.close=function(){var e=this;e.server&&(e.server.close(),e.server=null,e.name=null)},b.remove=function(e,t){var n=this;return n.addTask(function(){return n.enable?n.server?(u.isArray(t)||(t=[t]),n.server.remove(e,t).then(function(){n.logger.warn("delete",e,1===t.length?t[0]:t)})):i.reject(m()):i.reject(d())})},b.put=function(e,t){var n=this;return n.addTask(function(){return n.enable?n.server?(u.isArray(t)||(t=[t]),n.server.update(e,t).then(function(t){var r=["put",e],o=p.keyPath(e),i=[];return o&&(t.forEach(function(e){i.push(a(e,o))}),r.push(1===i.length?i[0]:i)),r.push(1===t.length?t[0]:t),n.logger.warn.apply(n.logger.warn,r),t})):i.reject(m()):i.reject(d())})},b.modifyOrPut=function(e){var t=this,n=e.table,r=u.copy(e.obj),o=e.key,i=e.modifyObjWhenPut,s=u.copy(r);return delete s[o],t.getOne(n,null,r[o],{modifyObj:s}).then(function(e){return e?(t.logger.warn("update table "+n,r),e):(r=u.merge(r,i),t.put(n,r).then(function(e){return e[0]}))})},b.updateAndDelete=function(e,t,n){var r=this;return r.addTask(function(){return r.enable?r.server?r.server.updateAndDelete(e,t,n):i.reject(m()):i.reject(d())})},b.get=function(e,t){var n=this;return n.addTask(function(){return n.enable?n.server?n.server.get(e,t):i.reject(m()):i.reject(d())})},b.getAll=function(e,t){var n=this;return n.addTask(function(){return n.enable?n.server?(t=t||{},t.keys=t.keys===!0,t.desc=t.desc===!0,t.distinct=t.distinct===!0,n.server.query(e,t.index).filter(t.filter).keys(t.keys).desc(t.desc).limit(t.limit).distinct(t.distinct).map(t.mapper).modify(t.modifyObj).execute()):i.reject(m()):i.reject(d())})},b.getOnly=function(e,t,n,r){var o=this;return o.addTask(function(){if(!o.enable)throw d();if(!o.server)throw m();return r=r||{},r.keys=r.keys===!0,r.desc=r.desc===!0,r.distinct=r.distinct===!0,r.remove=r.remove===!0,o.server.query(e,t).only(n).filter(r.filter).keys(r.keys).desc(r.desc).limit(r.limit).distinct(r.distinct).map(r.mapper).modify(r.modifyObj).remove(r.remove).execute()})},b.getOne=function(){var e=this;return e.getOnly.apply(e,arguments).then(function(e){return e[0]})},b.clearTable=function(e){var t=this;return t.addTask(function(){if(!t.enable)throw d();if(!t.server)throw m();return t.server.clear(e)})},b.checkDB=function(){var e=this;if(!e.enable)throw d();if(!e.server)throw m()},e.exports=o,n(91),n(97),n(93),n(90),n(96),n(98),n(92),n(95),n(94)},function(e,t,n){"use strict";function r(){}var o=n(2).Promise,i=n(1),s=i.notundef,a=n(56),c={};r.getInstance=function(e){var t=this;i.verifyOptions(e,"account");var n=t.genInstanceName(e),o=c[n];return o?r.updateInstance(o,e):o=c[n]=new t(e),o},r.updateInstance=function(e,t){e.setOptions(t),e.connect()};var u=r.fn=r.prototype;u.init=function(e){var t=this;i.verifyOptions(e,"account");var n=t.account=e.account=e.account+"",o=e.constructor,s=o.genInstanceName(e),u=c[s];if(e._disableSingleton&&(u=null),u)return r.updateInstance(u,e),u;t.name=s,c[s]=t,t.logger=e.logger=new a({debug:e.debug,logFunc:e.logFunc,prefix:t.subType}),e.api=t;var l=t.protocol=new e.Protocol(e);return l.name="Protocol-"+s,l.account=n,l.api=t,l.message=t.message=new e.Message({account:n}),t.options=i.copy(e),t.reset(),t},u.reset=function(){var e=this,t=e.options;this._usePromise=!!t.promise,i.verifyBooleanWithDefault(t,"exifOrientation",!0)},u.usePromise=function(e){return this._usePromise||e.promise},u.setOptions=function(e){this.reset(),this.protocol.setOptions(e)},u.processCallback=function(e,t){var n=new o(function(n,r){i.verifyCallback(e,"done"),e.callback=function(o,a){var c=e.callback.options;if(a=a||c,t&&(a=c),i.isFunction(e.cbaop)){var u=e.cbaop(o,a);s(u)&&(a=u)}var l=e.done;i.isObject(a)&&(delete a.done,delete a.cb,delete a.callback),setTimeout(function(){o?r(o):n(a),l(o,a)},0)},e.callback.options=i.copy(e)});return this.usePromise(e)?n:void n.then(void 0,function(){})},u.processPs=function(e){i.notexist(e.ps)&&(e.ps="")},u.processCustom=function(e){i.notexist(e.custom)&&(e.custom="")},u.sendCmd=function(){this.protocol.sendCmd.apply(this.protocol,arguments)},e.exports=r,n(42),n(43),n(44),n(45)},function(e,t,n){"use strict";function r(e){var t=this;t.options=o.copy(e),t.init(),t.connect()}var o=n(1),i=n(6),s=n(3),a=r.fn=r.prototype;a.init=function(){var e=this;e.logger=e.options.logger,e.cmdTaskArray=[],e.timerMap={},e.cmdCallbackMap={},e.cmdContentMap={},e.initConnect(),e.reset()},a.reset=function(){var e=this;e.resetConnect()},a.setOptions=function(e){var t=this,n=t.options,r=Object.keys(n),i=r.indexOf("account");i!==-1&&r.splice(i,1),e=o.filterObj(e,r),t.options=o.merge(n,e),t.reset()},a.sendCmd=function(e,t,n){var r=this;r.heartbeat(),r.logger.log("Protocol Command    "+e+"\t",t?t:"");var o=e;e=r.parser.createCmd(e,t);var i,s=e.SER;t=t||{},r.cmdContentMap[s]=t,t.single&&(delete t.single,i=Object.keys(t),1===i.length&&(r.cmdContentMap[s]=t[i[0]])),t.NOTSTORE&&(i=t.NOTSTORE.split(" "),i.forEach(function(e){delete t[e]}),delete t.NOTSTORE),n=n||t.callback,n&&(r.cmdCallbackMap[s]=n),r.cmdTaskArray.push({cmdName:o,cmd:e}),r.startCmdTaskTimer()},a.startCmdTaskTimer=function(){var e=this;e.cmdTaskTimer||(e.cmdTaskTimer=setTimeout(function(){var t=e.cmdTaskArray.shift();t&&e.executeCmdTask(t),e.cmdTaskTimer=null,e.cmdTaskArray.length&&e.startCmdTaskTimer()},0))},a.executeCmdTask=function(e){var t=this,n=e.cmdName,r=e.cmd,o=r.SER;t.isFrequencyControlled(n)?(t.logger.warn("hit frequency control "+n),t.markCallbackInvalid(o,s.newFrequencyControlError())):t.isConnected()?t.doSendCmd(r):t.markCallbackInvalid(o,s.newConnectionError())},a.isFrequencyControlled=function(e){var t=this.frequencyControlMap&&this.frequencyControlMap[e];if(t){if(Date.now()<t.from+t.duration)return!0;delete this.frequencyControlMap[e]}},a.doSendCmd=function(e){var t=this,n=e.SER;t.timerMap[n]=setTimeout(function(){t.markCallbackInvalid(n,s.newTimeoutError())},i.cmdTimeout),t.socket.send(JSON.stringify(e))},a.getObjWithSer=function(e){var t=this,n=t.cmdContentMap[e];return delete t.cmdContentMap[e],n&&o.copy(n)},a.getCallbackWithSer=function(e){var t=this,n=t.cmdCallbackMap[e];return delete t.cmdCallbackMap[e],n},a.getTimerWithSer=function(e){var t=this,n=t.timerMap[e];return delete t.timerMap[e],n},a.clearTimerWithSer=function(e){var t=this,n=t.getTimerWithSer(e);n&&clearTimeout(n)},a.markCallbackInvalid=function(e,t){var n=this;n.getObjWithSer(e),n.clearTimerWithSer(e);var r=n.getCallbackWithSer(e);if(r){var o=r.options;setTimeout(function(){r(t||s.newUnknownError(),o)},0)}},a.markAllCallbackInvalid=function(e){var t=this;Object.keys(this.cmdCallbackMap).forEach(function(n){t.markCallbackInvalid(n,e)})},a.getPacketObj=function(e){if(e&&e.raw){var t=e.raw.ser;if(t)return this.getObjWithSer(t)}return null},a.callPacketAckCallback=function(e){var t=this;if(e&&e.raw){var n=e.raw.ser;if(n){t.clearTimerWithSer(n);var r=t.getCallbackWithSer(n);r&&(e.promise?e.promise.then(function(){r(e.error,e.obj)},function(n){var o=s.newDBError();o.event=n,t.logger.error("promise error",o,n),r(o,e.obj)}):r(e.error,e.obj))}}},a.onMessage=function(e){var t=this;t.heartbeat();var n=t.parser.parseResponse(e);n.notFound&&t.logger.log("no config for",n.notFound),n.frequencyControlDuration&&(t.logger.warn("server frequency control "+n.cmd),t.frequencyControlMap=t.frequencyControlMap||{},t.frequencyControlMap[n.cmd]={from:+new Date,duration:n.frequencyControlDuration}),n.obj=t.getPacketObj(n),t.logger.log("Protocol Response   "+n.cmd+"\t",n,n.error||(n.content?n.content:""));var r="process"+o.capFirstLetter(n.service);t[r]&&t[r].call(t,n),t.callPacketAckCallback(n)},a.onMiscError=function(e,t,n){e&&(e.appendMessage(n),this.notifyError(e,t))},a.notifyError=function(e,t){var n=this;if(n.isConnected()){var r=["onError "+n.name,e];e.event&&r.push(e.event),t&&r.push(t),n.logger.error.apply(n.logger.error,r),n.options.onerror(e,t)}},e.exports=r,n(50),n(49),n(51),n(52)},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(e){try{return l.call(null,e,0)}catch(e){return l.call(this,e,0)}}}function i(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(e){try{return f.call(null,e)}catch(e){return f.call(this,e)}}}function s(){h&&m&&(h=!1,m.length?p=m.concat(p):g=-1,p.length&&a())}function a(){if(!h){var e=o(s);h=!0;for(var t=p.length;t;){for(m=p,p=[];++g<t;)m&&m[g].run();g=-1,t=p.length}m=null,h=!1,i(e)}}function c(e,t){this.fun=e,this.array=t}function u(){}var l,f,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var m,p=[],h=!1,g=-1;d.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];p.push(new c(e,t)),1!==p.length||h||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=u,d.addListener=u,d.once=u,d.off=u,d.removeListener=u,d.removeAllListeners=u,d.emit=u,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){var r;(function(e,o){(function(){"use strict";function i(e){return e=String(e),e.charAt(0).toUpperCase()+e.slice(1)}function s(e,t,n){var r={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return t&&n&&/^Win/i.test(e)&&!/^Windows Phone /i.test(e)&&(r=r[/[\d.]+$/.exec(e)])&&(e="Windows "+r),e=String(e),t&&n&&(e=e.replace(RegExp(t,"i"),n)),e=c(e.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}function a(e,t){var n=-1,r=e?e.length:0;if("number"==typeof r&&r>-1&&r<=k)for(;++n<r;)t(e[n],n,e);else u(e,t)}function c(e){return e=p(e),/^(?:webOS|i(?:OS|P))/.test(e)?e:i(e)}function u(e,t){for(var n in e)O.call(e,n)&&t(e[n],n,e)}function l(e){return null==e?i(e):I.call(e).slice(8,-1)}function f(e,t){var n=null!=e?typeof e[t]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(n)||"object"==n&&!e[t])}function d(e){return String(e).replace(/([ -])(?!$)/g,"$1?")}function m(e,t){var n=null;return a(e,function(r,o){n=t(n,r,o,e)}),n}function p(e){return String(e).replace(/^ +| +$/g,"")}function h(e){function t(t){return m(t,function(t,n){return t||RegExp("\\b"+(n.pattern||d(n))+"\\b","i").exec(e)&&(n.label||n)})}function n(t){return m(t,function(t,n,r){return t||(n[K]||n[/^[a-z]+(?: +[a-z]+\b)*/i.exec(K)]||RegExp("\\b"+d(r)+"(?:\\b|\\w*\\d)","i").exec(e))&&r})}function r(t){return m(t,function(t,n){return t||RegExp("\\b"+(n.pattern||d(n))+"\\b","i").exec(e)&&(n.label||n)})}function o(t){return m(t,function(t,n){var r=n.pattern||d(n);return!t&&(t=RegExp("\\b"+r+"(?:/[\\d.]+|[ \\w.]*)","i").exec(e))&&(t=s(t,r,n.label||n)),t})}function i(t){return m(t,function(t,n){var r=n.pattern||d(n);return!t&&(t=RegExp("\\b"+r+" *\\d+[.\\w_]*","i").exec(e)||RegExp("\\b"+r+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(e))&&((t=String(n.label&&!RegExp(r,"i").test(n.label)?n.label:t).split("/"))[1]&&!/[\d.]+/.test(t[0])&&(t[0]+=" "+t[1]),n=n.label||n,t=c(t[0].replace(RegExp(r,"i"),n).replace(RegExp("; *(?:"+n+"[_-])?","i")," ").replace(RegExp("("+n+")[-_.]?(\\w)","i"),"$1 $2"))),t})}function a(t){return m(t,function(t,n){return t||(RegExp(n+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(e)||0)[1]||null})}function g(){return this.description||""}var b=y,M=e&&"object"==typeof e&&"String"!=l(e);M&&(b=e,e=null);var T=b.navigator||{},k=T.userAgent||"";e||(e=k);var C,O,x=M||w==v,P=M?!!T.likeChrome:/\bChrome\b/.test(e)&&!/internal|\n/i.test(I.toString()),_="Object",E=M?_:"ScriptBridgingProxyObject",j=M?_:"Environment",A=M&&b.java?"JavaPackage":l(b.java),F=M?_:"RuntimeObject",R=/\bJava/.test(A)&&b.java,N=R&&l(b.environment)==j,D=R?"a":"α",U=R?"b":"β",B=b.document||{},L=b.operamini||b.opera,W=S.test(W=M&&L?L["[[Class]]"]:l(L))?W:L=null,q=e,H=[],$=null,X=e==k,J=X&&L&&"function"==typeof L.version&&L.version(),V=t([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),z=r(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"Edge"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt","SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","WebPositive","Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chrome",{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),K=i([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation 3","PlayStation 4","PlayStation Vita","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),G=n({Apple:{iPad:1,iPhone:1,iPod:1},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{"PlayStation 4":1,"PlayStation 3":1,"PlayStation Vita":1}}),Y=o(["Windows Phone","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian","Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);if(V&&(V=[V]),G&&!K&&(K=i([G])),(C=/\bGoogle TV\b/.exec(K))&&(K=C[0]),/\bSimulator\b/i.test(e)&&(K=(K?K+" ":"")+"Simulator"),"Opera Mini"==z&&/\bOPiOS\b/.test(e)&&H.push("running in Turbo/Uncompressed mode"),"IE"==z&&/\blike iPhone OS\b/.test(e)?(C=h(e.replace(/like iPhone OS/,"")),G=C.manufacturer,K=C.product):/^iP/.test(K)?(z||(z="Safari"),Y="iOS"+((C=/ OS ([\d_]+)/i.exec(e))?" "+C[1].replace(/_/g,"."):"")):"Konqueror"!=z||/buntu/i.test(Y)?G&&"Google"!=G&&(/Chrome/.test(z)&&!/\bMobile Safari\b/i.test(e)||/\bVita\b/.test(K))||/\bAndroid\b/.test(Y)&&/^Chrome/.test(z)&&/\bVersion\//i.test(e)?(z="Android Browser",Y=/\bAndroid\b/.test(Y)?Y:"Android"):"Silk"==z?(/\bMobi/i.test(e)||(Y="Android",H.unshift("desktop mode")),/Accelerated *= *true/i.test(e)&&H.unshift("accelerated")):"PaleMoon"==z&&(C=/\bFirefox\/([\d.]+)\b/.exec(e))?H.push("identifying as Firefox "+C[1]):"Firefox"==z&&(C=/\b(Mobile|Tablet|TV)\b/i.exec(e))?(Y||(Y="Firefox OS"),K||(K=C[1])):z&&!(C=!/\bMinefield\b/i.test(e)&&/\b(?:Firefox|Safari)\b/.exec(z))||(z&&!K&&/[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(C+"/")+8))&&(z=null),(C=K||G||Y)&&(K||G||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(Y))&&(z=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(Y)?Y:C)+" Browser")):Y="Kubuntu",J||(J=a(["(?:Cloud9|CriOS|CrMo|Edge|FxiOS|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|Silk(?!/[\\d.]+$))","Version",d(z),"(?:Firefox|Minefield|NetFront)"])),(C="iCab"==V&&parseFloat(J)>3&&"WebKit"||/\bOpera\b/.test(z)&&(/\bOPR\b/.test(e)?"Blink":"Presto")||/\b(?:Midori|Nook|Safari)\b/i.test(e)&&!/^(?:Trident|EdgeHTML)$/.test(V)&&"WebKit"||!V&&/\bMSIE\b/i.test(e)&&("Mac OS"==Y?"Tasman":"Trident")||"WebKit"==V&&/\bPlayStation\b(?! Vita\b)/i.test(z)&&"NetFront")&&(V=[C]),"IE"==z&&(C=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e)||0)[1])?(z+=" Mobile",Y="Windows Phone "+(/\+$/.test(C)?C:C+".x"),H.unshift("desktop mode")):/\bWPDesktop\b/i.test(e)?(z="IE Mobile",Y="Windows Phone 8.x",H.unshift("desktop mode"),J||(J=(/\brv:([\d.]+)/.exec(e)||0)[1])):"IE"!=z&&"Trident"==V&&(C=/\brv:([\d.]+)/.exec(e))&&(z&&H.push("identifying as "+z+(J?" "+J:"")),z="IE",J=C[1]),X){if(f(b,"global"))if(R&&(C=R.lang.System,q=C.getProperty("os.arch"),Y=Y||C.getProperty("os.name")+" "+C.getProperty("os.version")),x&&f(b,"system")&&(C=[b.system])[0]){Y||(Y=C[0].os||null);try{C[1]=b.require("ringo/engine").version,J=C[1].join("."),z="RingoJS"}catch(e){C[0].global.system==b.system&&(z="Narwhal")}}else"object"==typeof b.process&&!b.process.browser&&(C=b.process)?(z="Node.js",q=C.arch,Y=C.platform,J=/[\d.]+/.exec(C.version)[0]):N&&(z="Rhino");else l(C=b.runtime)==E?(z="Adobe AIR",
  Y=C.flash.system.Capabilities.os):l(C=b.phantom)==F?(z="PhantomJS",J=(C=C.version||null)&&C.major+"."+C.minor+"."+C.patch):"number"==typeof B.documentMode&&(C=/\bTrident\/(\d+)/i.exec(e))&&(J=[J,B.documentMode],(C=+C[1]+4)!=J[1]&&(H.push("IE "+J[1]+" mode"),V&&(V[1]=""),J[1]=C),J="IE"==z?String(J[1].toFixed(1)):J[0]);Y=Y&&c(Y)}J&&(C=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(J)||/(?:alpha|beta)(?: ?\d)?/i.exec(e+";"+(X&&T.appMinorVersion))||/\bMinefield\b/i.test(e)&&"a")&&($=/b/i.test(C)?"beta":"alpha",J=J.replace(RegExp(C+"\\+?$"),"")+("beta"==$?U:D)+(/\d+\+?/.exec(C)||"")),"Fennec"==z||"Firefox"==z&&/\b(?:Android|Firefox OS)\b/.test(Y)?z="Firefox Mobile":"Maxthon"==z&&J?J=J.replace(/\.[\d.]+/,".x"):/\bXbox\b/i.test(K)?(Y=null,"Xbox 360"==K&&/\bIEMobile\b/.test(e)&&H.unshift("mobile mode")):!/^(?:Chrome|IE|Opera)$/.test(z)&&(!z||K||/Browser|Mobi/.test(z))||"Windows CE"!=Y&&!/Mobi/i.test(e)?"IE"==z&&X&&null===b.external?H.unshift("platform preview"):(/\bBlackBerry\b/.test(K)||/\bBB10\b/.test(e))&&(C=(RegExp(K.replace(/ +/g," *")+"/([.\\d]+)","i").exec(e)||0)[1]||J)?(C=[C,/BB10/.test(e)],Y=(C[1]?(K=null,G="BlackBerry"):"Device Software")+" "+C[0],J=null):this!=u&&"Wii"!=K&&(X&&L||/Opera/.test(z)&&/\b(?:MSIE|Firefox)\b/i.test(e)||"Firefox"==z&&/\bOS X (?:\d+\.){2,}/.test(Y)||"IE"==z&&(Y&&!/^Win/.test(Y)&&J>5.5||/\bWindows XP\b/.test(Y)&&J>8||8==J&&!/\bTrident\b/.test(e)))&&!S.test(C=h.call(u,e.replace(S,"")+";"))&&C.name&&(C="ing as "+C.name+((C=C.version)?" "+C:""),S.test(z)?(/\bIE\b/.test(C)&&"Mac OS"==Y&&(Y=null),C="identify"+C):(C="mask"+C,z=W?c(W.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(C)&&(Y=null),X||(J=null)),V=["Presto"],H.push(C)):z+=" Mobile",(C=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(e)||0)[1])&&(C=[parseFloat(C.replace(/\.(\d)$/,".0$1")),C],"Safari"==z&&"+"==C[1].slice(-1)?(z="WebKit Nightly",$="alpha",J=C[1].slice(0,-1)):J!=C[1]&&J!=(C[2]=(/\bSafari\/([\d.]+\+?)/i.exec(e)||0)[1])||(J=null),C[1]=(/\bChrome\/([\d.]+)/i.exec(e)||0)[1],537.36==C[0]&&537.36==C[2]&&parseFloat(C[1])>=28&&"WebKit"==V&&(V=["Blink"]),X&&(P||C[1])?(V&&(V[1]="like Chrome"),C=C[1]||(C=C[0],C<530?1:C<532?2:C<532.05?3:C<533?4:C<534.03?5:C<534.07?6:C<534.1?7:C<534.13?8:C<534.16?9:C<534.24?10:C<534.3?11:C<535.01?12:C<535.02?"13+":C<535.07?15:C<535.11?16:C<535.19?17:C<536.05?18:C<536.1?19:C<537.01?20:C<537.11?"21+":C<537.13?23:C<537.18?24:C<537.24?25:C<537.36?26:"Blink"!=V?"27":"28")):(V&&(V[1]="like Safari"),C=C[0],C=C<400?1:C<500?2:C<526?3:C<533?4:C<534?"4+":C<535?5:C<537?6:C<538?7:C<601?8:"8"),V&&(V[1]+=" "+(C+="number"==typeof C?".x":/[.+]/.test(C)?"":"+")),"Safari"==z&&(!J||parseInt(J)>45)&&(J=C)),"Opera"==z&&(C=/\bzbov|zvav$/.exec(Y))?(z+=" ",H.unshift("desktop mode"),"zvav"==C?(z+="Mini",J=null):z+="Mobile",Y=Y.replace(RegExp(" *"+C+"$"),"")):"Safari"==z&&/\bChrome\b/.exec(V&&V[1])&&(H.unshift("desktop mode"),z="Chrome Mobile",J=null,/\bOS X\b/.test(Y)?(G="Apple",Y="iOS 4.3+"):Y=null),J&&0==J.indexOf(C=/[\d.]+$/.exec(Y))&&e.indexOf("/"+C+"-")>-1&&(Y=p(Y.replace(C,""))),V&&!/\b(?:Avant|Nook)\b/.test(z)&&(/Browser|Lunascape|Maxthon/.test(z)||"Safari"!=z&&/^iOS/.test(Y)&&/\bSafari\b/.test(V[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Sleipnir|Web)/.test(z)&&V[1])&&(C=V[V.length-1])&&H.push(C),H.length&&(H=["("+H.join("; ")+")"]),G&&K&&K.indexOf(G)<0&&H.push("on "+G),K&&H.push((/^on /.test(H[H.length-1])?"":"on ")+K),Y&&(C=/ ([\d.+]+)$/.exec(Y),O=C&&"/"==Y.charAt(Y.length-C[0].length-1),Y={architecture:32,family:C&&!O?Y.replace(C[0],""):Y,version:C?C[1]:null,toString:function(){var e=this.version;return this.family+(e&&!O?" "+e:"")+(64==this.architecture?" 64-bit":"")}}),(C=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(q))&&!/\bi686\b/i.test(q)?(Y&&(Y.architecture=64,Y.family=Y.family.replace(RegExp(" *"+C),"")),z&&(/\bWOW64\b/i.test(e)||X&&/\w(?:86|32)$/.test(T.cpuClass||T.platform)&&!/\bWin64; x64\b/i.test(e))&&H.unshift("32-bit")):Y&&/^OS X/.test(Y.family)&&"Chrome"==z&&parseFloat(J)>=39&&(Y.architecture=64),e||(e=null);var Z={};return Z.description=e,Z.layout=V&&V[0],Z.manufacturer=G,Z.name=z,Z.prerelease=$,Z.product=K,Z.ua=e,Z.version=z&&J,Z.os=Y||{architecture:null,family:null,version:null,toString:function(){return"null"}},Z.parse=h,Z.toString=g,Z.version&&H.unshift(J),Z.name&&H.unshift(z),Y&&z&&(Y!=String(Y).split(" ")[0]||Y!=z.split(" ")[0]&&!K)&&H.push(K?"("+Y+")":"on "+Y),H.length&&(Z.description=H.join(" ")),Z}var g={"function":!0,object:!0},y=g[typeof window]&&window||this,v=y,b=g[typeof t]&&t,M=g[typeof e]&&e&&!e.nodeType&&e,T=b&&M&&"object"==typeof o&&o;!T||T.global!==T&&T.window!==T&&T.self!==T||(y=T);var k=Math.pow(2,53)-1,S=/\bOpera/,w=this,C=Object.prototype,O=C.hasOwnProperty,I=C.toString,x=h();y.platform=x,r=function(){return x}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}).call(this)}).call(t,n(22)(e),function(){return this}())},function(e,t,n){"use strict";function r(e){var t=this;e.resend?(o.verifyOptions(e,"idClient"),t.idClient=e.idClient):t.idClient=o.guid(),t.type=c[e.type],t.resend=e.resend?1:0,i(e.custom)&&(t.custom=""+e.custom),i(e.yidunEnable)&&(t.yidunEnable=e.yidunEnable?1:0),i(e.antiSpamContent)&&(t.antiSpamContent=""+e.antiSpamContent)}var o=n(1),i=o.notundef,s=n(17),a=n(40),c=a.typeMap;r.validTypes=a.validTypes,r.getType=a.getType,r.reverse=function(e){var t=o.filterObj(e,"chatroomId idClient from fromNick fromAvatar fromCustom userUpdateTime custom status");return t=o.merge(t,{fromClientType:s.reverseType(e.fromClientType),type:r.getType(e),time:+e.time,resend:1===+e.resend}),i(t.userUpdateTime)&&(t.userUpdateTime=+t.userUpdateTime),t.status=t.status||"success",t},r.setExtra=function(e,t){a.setFlow(e,t)},e.exports=r},function(e,t,n){"use strict";function r(e){o.verifyOptions(e,"scene to type"),o.verifyParamValid("scene",e.scene,m);var t=this;t.scene=f[e.scene],t.to=""+e.to,t.type=p[e.type],t.resend=e.resend?1:0,e.resend?(o.verifyOptions(e,"idClient"),t.idClient=e.idClient):t.idClient=o.guid(),s(e.text)&&(t.body=""+e.text),s(e.custom)&&(t.custom=""+e.custom),s(e.pushContent)&&(t.pushContent=""+e.pushContent),s(e.pushPayload)&&(t.pushPayload=""+e.pushPayload);var n=e.apns;if(s(n)&&"team"===e.scene){var r=n.accounts;s(r)&&o.verifyParamType("apns.accounts",r,"array"),t.apnsAccounts=r?JSON.stringify(r):l,t.apnsContent=n.content||e.pushContent||"",o.verifyBooleanWithDefault(n,"forcePush",!0,"options.apns"),t.apnsForcePush=n.forcePush?1:0}s(e.isHistoryable)&&(t.isHistoryable=e.isHistoryable?1:0),s(e.isRoamingable)&&(t.isRoamingable=e.isRoamingable?1:0),s(e.isSyncable)&&(t.isSyncable=e.isSyncable?1:0),s(e.cc)&&(t.cc=e.cc?1:0),s(e.isPushable)&&(t.isPushable=e.isPushable?1:0),s(e.isOfflinable)&&(t.isOfflinable=e.isOfflinable?1:0),s(e.isUnreadable)&&(t.isUnreadable=e.isUnreadable?1:0),s(e.needPushNick)&&(t.needPushNick=e.needPushNick?1:0),s(e.yidunEnable)&&(t.yidunEnable=e.yidunEnable?1:0),s(e.antiSpamContent)&&(t.antiSpamContent=""+e.antiSpamContent)}var o=n(1),i=o.undef,s=o.notundef,a=o.exist,c=n(17),u=n(40),l="#%@all@%#",f={p2p:0,team:1},d={0:"p2p",1:"team"},m=Object.keys(f),p=u.typeMap,h=u.validTypes;r.prototype.getScene=function(){return d[this.scene]},r.getScene=function(e){var t=e.scene;return d[t]||t},r.getType=u.getType,r.reverse=function(e){var t=d[e.scene],n={scene:t||e.scene,from:e.from,fromNick:e.fromNick,fromClientType:c.reverseType(e.fromClientType),fromDeviceId:e.fromDeviceId,to:""+e.to,time:+e.time,type:r.getType(e),text:a(e.body)?e.body:"",isHistoryable:i(e.isHistoryable)||1===+e.isHistoryable,isRoamingable:i(e.isRoamingable)||1===+e.isRoamingable,isSyncable:i(e.isSyncable)||1===+e.isSyncable,cc:i(e.cc)||1===+e.cc,isPushable:i(e.isPushable)||1===+e.isPushable,isOfflinable:i(e.isOfflinable)||1===+e.isOfflinable,isUnreadable:i(e.isUnreadable)||1===+e.isUnreadable,needPushNick:i(e.needPushNick)||1===+e.needPushNick,isLocal:!1};if(s(e.isMuted)&&(n.isMuted=1===+e.isMuted),s(e.resend)&&(n.resend=1===+e.resend),s(e.idClient)&&(n.idClient=e.idClient),s(e.idServer)&&(n.idServer=""+e.idServer),s(e.userUpdateTime)&&(n.userUpdateTime=+e.userUpdateTime),s(e.custom)&&(n.custom=e.custom),s(e.pushContent)&&(n.pushContent=e.pushContent),s(e.pushPayload)&&(n.pushPayload=e.pushPayload),s(e.apnsAccounts)){if(n.apns={},e.apnsAccounts!==l){var o=e.apnsAccounts;try{n.apns.accounts=JSON.parse(o)}catch(error){n.apns.accounts=[]}}n.apns.content=e.apnsContent||"",n.apns.forcePush=1===+e.apnsForcePush}return n.status=e.status||"success",s(e.filter)&&(n.filter=e.filter),n},r.setExtra=function(e,t){e.target=r.getMsgTarget(e,t),e.sessionId=e.scene+"-"+e.target,u.setFlow(e,t)},r.getMsgTarget=function(e,t){return"p2p"===e.scene?e.to===t?e.from:e.to:"team"===e.scene?e.to:void 0},r.deduplication=function(e){var t,n={},r=[];return e.forEach(function(e){t=e.idClient,n[t]||(n[t]=!0,r.push(e))}),r},r.sortMsgs=function(e){return e=e.slice(0),o.sortObjArray(e,{sortPath:"time"}),e},r.getLastMsg=function(e){return e=r.sortMsgs(e),e[e.length-1]},r.getLastNotIgnoredMsg=function(e){e=r.sortMsgs(e);for(var t=null,n=e.length-1;n>=0;n--)if(t=e[n],!t.ignore)return t;return null},r.getMaxTimetag=function(e){return r.getLastMsg(e).time},r.validScenes=m,r.validTypes=h,e.exports=r},function(e,t,n){"use strict";var r=n(1),o=n(55),i={};i.init=function(){var e="nim_web_sdk_deviceId",t=o.get(e);t||(t=r.guid(),o.set(e,t)),i.deviceId=t},i.init(),e.exports=i},function(e,t,n){"use strict";function r(e){var t=this;o.verifyOptions(e,"teamId"),o.verifyParamAtLeastPresentOne(e,"nickInTeam muteTeam custom"),t.teamId=e.teamId,i(e.account)&&(t.account=e.account),i(e.nickInTeam)&&(t.nickInTeam=e.nickInTeam),i(e.muteTeam)&&(t.bits=0,e.muteTeam&&(t.bits+=1)),i(e.mute)&&(t.mute=e.mute?1:0),i(e.custom)&&(t.custom=""+e.custom)}var o=n(1),i=o.notundef,s=o.fillPropertyWithDefault,a={0:"normal",1:"owner",2:"manager"};r.reverse=function(e){var t=o.copy(e);if(i(t.teamId)&&(t.teamId=""+t.teamId),i(t.type)&&(t.type=a[t.type]),i(t.active)&&(t.active=1===+t.active),i(t.valid)&&(t.valid=1===+t.valid),i(t.mute)&&(t.mute=1===+t.mute),i(t.joinTime)&&(t.joinTime=+t.joinTime),i(t.updateTime)&&(t.updateTime=+t.updateTime),i(t.bits)){var n=t.bits;delete t.bits,t.muteTeam=!!(1&n)}return i(t.teamId)&&i(t.account)&&(t.id=r.genId(t.teamId,t.account)),t},r.reverseMembers=function(e){return e.map(function(e){return r.reverse(e)})},r.fillProperties=function(e){var t=s(e,"mute",!1),n=s(e,"custom","");return t||n},r.genId=function(e,t){return e+"-"+t},r.accounts2ids=function(e,t){return t.map(function(t){return r.genId(e,t)})},r.assembleMembers=function(e,t){return o.isArray(t)||(t=[t]),t.map(function(t){return r.assembleMember(e,t)})},r.assembleMember=function(e,t){return{id:r.genId(e.teamId,t),account:t,teamId:e.teamId,type:"normal",nickInTeam:"",muteTeam:!1,mute:!1,joinTime:e.memberUpdateTime,updateTime:e.memberUpdateTime,active:!0,valid:!0}},r.assembleOwner=function(e){var t=r.assembleMember(e,e.owner);return t.type="owner",t},e.exports=r},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(module){/*! Socket.IO.js build:0.9.11, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */
  var io=module.exports;window.io?module&&(module.exports=io=window.io):window.io=io,function(){if(function(e,t){var n=e;n.version="0.9.11",n.protocol=1,n.transports=[],n.j=[],n.sockets={},n.connect=function(e,r){var o,i,s=n.util.parseUri(e);t&&t.location&&(s.protocol=s.protocol||t.location.protocol.slice(0,-1),s.host=s.host||(t.document?t.document.domain:t.location.hostname),s.port=s.port||t.location.port),o=n.util.uniqueUri(s);var a={host:s.host,secure:"https"==s.protocol,port:s.port||("https"==s.protocol?443:80),query:s.query||""};return n.util.merge(a,r),!a["force new connection"]&&n.sockets[o]||(i=new n.Socket(a)),!a["force new connection"]&&i&&(n.sockets[o]=i),i=i||n.sockets[o],i.of(s.path.length>1?s.path:"")}}(module.exports,window),function(e,t){var n=e.util={},r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];n.parseUri=function(e){for(var t=r.exec(e||""),n={},i=14;i--;)n[o[i]]=t[i]||"";return n},n.uniqueUri=function(e){var n=e.protocol,r=e.host,o=e.port;return"document"in t?(r=r||document.domain,o=o||("https"==n&&"https:"!==document.location.protocol?443:document.location.port)):(r=r||"localhost",o||"https"!=n||(o=443)),(n||"http")+"://"+r+":"+(o||80)},n.query=function(e,t){var r=n.chunkQuery(e||""),o=[];n.merge(r,n.chunkQuery(t||""));for(var i in r)r.hasOwnProperty(i)&&o.push(i+"="+r[i]);return o.length?"?"+o.join("&"):""},n.chunkQuery=function(e){for(var t,n={},r=e.split("&"),o=0,i=r.length;o<i;++o)t=r[o].split("="),t[0]&&(n[t[0]]=t[1]);return n};var i=!1;n.load=function(e){return"document"in t&&"complete"===document.readyState||i?e():void n.on(t,"load",e,!1)},n.on=function(e,t,n,r){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener&&e.addEventListener(t,n,r)},n.request=function(e){if(e&&"undefined"!=typeof XDomainRequest&&!n.ua.hasCORS)return new XDomainRequest;if("undefined"!=typeof XMLHttpRequest&&(!e||n.ua.hasCORS))return new XMLHttpRequest;if(!e)try{return new(window[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}return null},"undefined"!=typeof window&&n.load(function(){i=!0}),n.defer=function(e){return n.ua.webkit&&"undefined"==typeof importScripts?void n.load(function(){setTimeout(e,100)}):e()},n.merge=function(e,t,r,o){var i,s=o||[],a="undefined"==typeof r?2:r;for(i in t)t.hasOwnProperty(i)&&n.indexOf(s,i)<0&&("object"==typeof e[i]&&a?n.merge(e[i],t[i],a-1,s):(e[i]=t[i],s.push(t[i])));return e},n.mixin=function(e,t){n.merge(e.prototype,t.prototype)},n.inherit=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},n.intersect=function(e,t){for(var r=[],o=e.length>t.length?e:t,i=e.length>t.length?t:e,s=0,a=i.length;s<a;s++)~n.indexOf(o,i[s])&&r.push(i[s]);return r},n.indexOf=function(e,t,n){for(var r=e.length,n=n<0?n+r<0?0:n+r:n||0;n<r&&e[n]!==t;n++);return r<=n?-1:n},n.toArray=function(e){for(var t=[],n=0,r=e.length;n<r;n++)t.push(e[n]);return t},n.ua={},n.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){try{var e=new XMLHttpRequest}catch(e){return!1}return void 0!=e.withCredentials}(),n.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent),n.ua.iDevice="undefined"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)}("undefined"!=typeof io?io:module.exports,window),function(e,t){function n(){}e.EventEmitter=n,n.prototype.on=function(e,n){return this.$events||(this.$events={}),this.$events[e]?t.util.isArray(this.$events[e])?this.$events[e].push(n):this.$events[e]=[this.$events[e],n]:this.$events[e]=n,this},n.prototype.addListener=n.prototype.on,n.prototype.once=function(e,t){function n(){r.removeListener(e,n),t.apply(this,arguments)}var r=this;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,n){if(this.$events&&this.$events[e]){var r=this.$events[e];if(t.util.isArray(r)){for(var o=-1,i=0,s=r.length;i<s;i++)if(r[i]===n||r[i].listener&&r[i].listener===n){o=i;break}if(o<0)return this;r.splice(o,1),r.length||delete this.$events[e]}else(r===n||r.listener&&r.listener===n)&&delete this.$events[e]}return this},n.prototype.removeAllListeners=function(e){return void 0===e?(this.$events={},this):(this.$events&&this.$events[e]&&(this.$events[e]=null),this)},n.prototype.listeners=function(e){return this.$events||(this.$events={}),this.$events[e]||(this.$events[e]=[]),t.util.isArray(this.$events[e])||(this.$events[e]=[this.$events[e]]),this.$events[e]},n.prototype.emit=function(e){if(!this.$events)return!1;var n=this.$events[e];if(!n)return!1;var r=Array.prototype.slice.call(arguments,1);if("function"==typeof n)n.apply(this,r);else{if(!t.util.isArray(n))return!1;for(var o=n.slice(),i=0,s=o.length;i<s;i++)o[i].apply(this,r)}return!0}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(exports,nativeJSON){"use strict";function f(e){return e<10?"0"+e:e}function date(e,t){return isFinite(e.valueOf())?e.getUTCFullYear()+"-"+f(e.getUTCMonth()+1)+"-"+f(e.getUTCDate())+"T"+f(e.getUTCHours())+":"+f(e.getUTCMinutes())+":"+f(e.getUTCSeconds())+"Z":null}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,s,a=gap,c=t[e];switch(c instanceof Date&&(c=date(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?String(c):"null";case"boolean":case"null":return String(c);case"object":if(!c)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(c)){for(i=c.length,n=0;n<i;n+=1)s[n]=str(n,c)||"null";return o=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+a+"]":"["+s.join(",")+"]",gap=a,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;n<i;n+=1)"string"==typeof rep[n]&&(r=rep[n],o=str(r,c),o&&s.push(quote(r)+(gap?": ":":")+o));else for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(o=str(r,c),o&&s.push(quote(r)+(gap?": ":":")+o));return o=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+a+"}":"{"+s.join(",")+"}",gap=a,o}}if(nativeJSON&&nativeJSON.parse)return exports.JSON={parse:nativeJSON.parse,stringify:nativeJSON.stringify};var JSON=exports.JSON={},cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})},JSON.parse=function(text,reviver){function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(e,t,o)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof JSON?JSON:void 0),function(e,t){var n=e.parser={},r=n.packets=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],o=n.reasons=["transport not supported","client not handshaken","unauthorized"],i=n.advice=["reconnect"],s=t.JSON,a=t.util.indexOf;n.encodePacket=function(e){var t=a(r,e.type),n=e.id||"",c=e.endpoint||"",u=e.ack,l=null;switch(e.type){case"error":var f=e.reason?a(o,e.reason):"",d=e.advice?a(i,e.advice):"";""===f&&""===d||(l=f+(""!==d?"+"+d:""));break;case"message":""!==e.data&&(l=e.data);break;case"event":var m={name:e.name};e.args&&e.args.length&&(m.args=e.args),l=s.stringify(m);break;case"json":l=s.stringify(e.data);break;case"connect":e.qs&&(l=e.qs);break;case"ack":l=e.ackId+(e.args&&e.args.length?"+"+s.stringify(e.args):"")}var p=[t,n+("data"==u?"+":""),c];return null!==l&&void 0!==l&&p.push(l),p.join(":")},n.encodePayload=function(e){var t="";if(1==e.length)return e[0];for(var n=0,r=e.length;n<r;n++){var o=e[n];t+="�"+o.length+"�"+e[n]}return t};var c=/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;n.decodePacket=function(e){var t=e.match(c);if(!t)return{};var n=t[2]||"",e=t[5]||"",a={type:r[t[1]],endpoint:t[4]||""};switch(n&&(a.id=n,t[3]?a.ack="data":a.ack=!0),a.type){case"error":var t=e.split("+");a.reason=o[t[0]]||"",a.advice=i[t[1]]||"";break;case"message":a.data=e||"";break;case"event":try{var u=s.parse(e);a.name=u.name,a.args=u.args}catch(e){}a.args=a.args||[];break;case"json":try{a.data=s.parse(e)}catch(e){}break;case"connect":a.qs=e||"";break;case"ack":var t=e.match(/^([0-9]+)(\+)?(.*)/);if(t&&(a.ackId=t[1],a.args=[],t[3]))try{a.args=t[3]?s.parse(t[3]):[]}catch(e){}break;case"disconnect":case"heartbeat":}return a},n.decodePayload=function(e){var t=function(e,t){for(var n=0,r=e;r<t.length;r++){if("�"==t.charAt(r))return n;n++}return n};if("�"==e.charAt(0)){for(var r=[],o=1,i="";o<e.length;o++)if("�"==e.charAt(o)){var s=e.substr(o+1).substr(0,i);if("�"!=e.charAt(o+1+Number(i))&&o+1+Number(i)!=e.length){var a=Number(i);l=t(o+a+1,e),s=e.substr(o+1).substr(0,a+l),o+=l}r.push(n.decodePacket(s)),o+=Number(i)+1,i=""}else i+=e.charAt(o);return r}return[n.decodePacket(e)]}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t){function n(e,t){this.socket=e,this.sessid=t}e.Transport=n,t.util.mixin(n,t.EventEmitter),n.prototype.heartbeats=function(){return!0},n.prototype.onData=function(e){if(this!==this.socket.transport)return this;if(this.clearCloseTimeout(),(this.socket.connected||this.socket.connecting||this.socket.reconnecting)&&this.setCloseTimeout(),""!==e){var n=t.parser.decodePayload(e);if(n&&n.length)for(var r=0,o=n.length;r<o;r++)this.onPacket(n[r])}return this},n.prototype.onPacket=function(e){return this.socket.setHeartbeatTimeout(),"heartbeat"==e.type?this.onHeartbeat():("connect"==e.type&&""==e.endpoint&&this.onConnect(),"error"==e.type&&"reconnect"==e.advice&&(this.isOpen=!1),this.socket.onPacket(e),this)},n.prototype.setCloseTimeout=function(){if(!this.closeTimeout){var e=this;this.closeTimeout=setTimeout(function(){e.onDisconnect()},this.socket.closeTimeout)}},n.prototype.onDisconnect=function(){return this.isOpen&&this.close(),this.clearTimeouts(),this.socket.transport===this?this.socket.onDisconnect():this.socket.setBuffer(!1),this},n.prototype.onConnect=function(){return this.socket.onConnect(),this},n.prototype.clearCloseTimeout=function(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)},n.prototype.clearTimeouts=function(){this.clearCloseTimeout(),this.reopenTimeout&&clearTimeout(this.reopenTimeout)},n.prototype.packet=function(e){this.send(t.parser.encodePacket(e))},n.prototype.onHeartbeat=function(e){this.packet({type:"heartbeat"})},n.prototype.onOpen=function(){this.isOpen=!0,this.clearCloseTimeout(),this.socket.onOpen()},n.prototype.onClose=function(){this.isOpen=!1,this.socket.transport===this?this.socket.onClose():this.socket.setBuffer(!1),this.onDisconnect()},n.prototype.prepareUrl=function(){var e=this.socket.options;return this.scheme()+"://"+e.host+":"+e.port+"/"+e.resource+"/"+t.protocol+"/"+this.name+"/"+this.sessid},n.prototype.ready=function(e,t){t.call(this)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function r(e){if(this.options={port:80,secure:!1,document:"document"in n&&document,resource:"socket.io",transports:e.transports||t.transports,"connect timeout":1e4,"try multiple transports":!0,reconnect:!0,"reconnection delay":500,"reconnection limit":1/0,"reopen delay":3e3,"max reconnection attempts":10,"sync disconnect on unload":!1,"auto connect":!0,"flash policy port":10843,manualFlush:!1},t.util.merge(this.options,e),this.connected=!1,this.open=!1,this.connecting=!1,this.reconnecting=!1,this.namespaces={},this.buffer=[],this.doBuffer=!1,this.options["sync disconnect on unload"]&&(!this.isXDomain()||t.util.ua.hasCORS)){var r=this;t.util.on(n,"beforeunload",function(){r.disconnectSync()},!1)}this.options["auto connect"]&&this.connect()}function o(){}e.Socket=r,t.util.mixin(r,t.EventEmitter),r.prototype.of=function(e){return this.namespaces[e]||(this.namespaces[e]=new t.SocketNamespace(this,e),""!==e&&this.namespaces[e].packet({type:"connect"})),this.namespaces[e]},r.prototype.publish=function(){this.emit.apply(this,arguments);var e;for(var t in this.namespaces)this.namespaces.hasOwnProperty(t)&&(e=this.of(t),e.$emit.apply(e,arguments))},r.prototype.handshake=function(e){function n(t){t instanceof Error?(r.connecting=!1,r.onError(t.message)):e.apply(null,t.split(":"))}var r=this,i=this.options,s=["http"+(i.secure?"s":"")+":/",i.host+":"+i.port,i.resource,t.protocol,t.util.query(this.options.query,"t="+ +new Date)].join("/");if(this.isXDomain()&&!t.util.ua.hasCORS){var a=document.getElementsByTagName("script")[0],c=document.createElement("script");c.src=s+"&jsonp="+t.j.length,c.onreadystatechange=function(){"loaded"==this.readyState&&c.parentNode&&(c.parentNode.removeChild(c),r.connecting=!1,!r.reconnecting&&r.onError("Server down or port not open"),r.publish("handshake_failed"))},a.parentNode.insertBefore(c,a),t.j.push(function(e){n(e),c.parentNode.removeChild(c)})}else{var u=t.util.request();u.open("GET",s,!0),this.isXDomain()&&(u.withCredentials=!0),u.onreadystatechange=function(){4==u.readyState&&(u.onreadystatechange=o,200==u.status?n(u.responseText):403==u.status?(r.onError(u.responseText),r.publish("handshake_failed")):(r.connecting=!1,!r.reconnecting&&r.onError(u.responseText),r.publish("handshake_failed")))},u.send(null)}},r.prototype.connect=function(e){if(this.connecting)return this;var n=this;return n.connecting=!0,this.handshake(function(r,o,i,s){n.sessionid=r,n.closeTimeout=1e3*i,n.heartbeatTimeout=1e3*o,n.transports||(n.transports=n.origTransports=s?t.util.intersect(s.split(","),n.options.transports):n.options.transports),n.setHeartbeatTimeout(),n.once("connect",function(){clearTimeout(n.connectTimeoutTimer),n.connectTimeoutTimer=null,e&&"function"==typeof e&&e()}),n.doConnect()}),this},r.prototype.doConnect=function(){var e=this;return e.transport&&e.transport.clearTimeouts(),e.transport=e.getTransport(e.transports),e.transport?void e.transport.ready(e,function(){e.connecting=!0,e.publish("connecting",e.transport.name),e.transport.open(),e.options["connect timeout"]&&(e.connectTimeoutTimer&&clearTimeout(e.connectTimeoutTimer),e.connectTimeoutTimer=setTimeout(e.tryNextTransport.bind(e),e.options["connect timeout"]))}):e.publish("connect_failed")},r.prototype.getTransport=function(e){for(var n,r=e||this.transports,o=0;n=r[o];o++)if(t.Transport[n]&&t.Transport[n].check(this)&&(!this.isXDomain()||t.Transport[n].xdomainCheck(this))){var i=new t.Transport[n](this,this.sessionid);return i}return null},r.prototype.tryNextTransport=function(){var e=this;if(!e.connected&&(e.connecting=!1,e.options["try multiple transports"])){for(var t=e.transports;t.length>0&&t.splice(0,1)[0]!=e.transport.name;);t.length?e.doConnect():e.publish("connect_failed")}},r.prototype.setHeartbeatTimeout=function(){if(clearTimeout(this.heartbeatTimeoutTimer),!this.transport||this.transport.heartbeats()){var e=this;this.heartbeatTimeoutTimer=setTimeout(function(){e.transport&&e.transport.onClose()},this.heartbeatTimeout)}},r.prototype.packet=function(e){return this.connected&&!this.doBuffer?this.transport.packet(e):this.buffer.push(e),this},r.prototype.setBuffer=function(e){this.doBuffer=e,!e&&this.connected&&this.buffer.length&&(this.options.manualFlush||this.flushBuffer())},r.prototype.flushBuffer=function(){this.transport.payload(this.buffer),this.buffer=[]},r.prototype.disconnect=function(){return(this.connected||this.connecting)&&(this.open&&this.of("").packet({type:"disconnect"}),this.onDisconnect("booted")),this},r.prototype.disconnectSync=function(){var e=t.util.request(),n=["http"+(this.options.secure?"s":"")+":/",this.options.host+":"+this.options.port,this.options.resource,t.protocol,"",this.sessionid].join("/")+"/?disconnect=1";e.open("GET",n,!1),e.send(null),this.onDisconnect("booted")},r.prototype.isXDomain=function(){var e=n.location.port||("https:"==n.location.protocol?443:80);return this.options.host!==n.location.hostname||this.options.port!=e},r.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit("connect"))},r.prototype.onOpen=function(){this.open=!0},r.prototype.onClose=function(){this.open=!1,clearTimeout(this.heartbeatTimeoutTimer)},r.prototype.onPacket=function(e){this.of(e.endpoint).onPacket(e)},r.prototype.onError=function(e){e&&e.advice&&"reconnect"===e.advice&&(this.connected||this.connecting)&&(this.disconnect(),this.options.reconnect&&this.reconnect()),this.publish("error",e&&e.reason?e.reason:e)},r.prototype.onDisconnect=function(e){var t=this.connected,n=this.connecting;this.connected=!1,this.connecting=!1,this.open=!1,(t||n)&&(this.transport.close(),this.transport.clearTimeouts(),t&&(this.publish("disconnect",e),"booted"!=e&&this.options.reconnect&&!this.reconnecting&&this.reconnect()),n&&this.tryNextTransport())},r.prototype.reconnect=function(){function e(){if(n.connected){for(var e in n.namespaces)n.namespaces.hasOwnProperty(e)&&""!==e&&n.namespaces[e].packet({type:"connect"});n.publish("reconnect",n.transport.name,n.reconnectionAttempts)}clearTimeout(n.reconnectionTimer),n.removeListener("connect_failed",t),n.removeListener("connect",t),n.reconnecting=!1,delete n.reconnectionAttempts,delete n.reconnectionDelay,delete n.reconnectionTimer,delete n.redoTransports,n.options["try multiple transports"]=o}function t(){if(n.reconnecting)return n.connected?e():n.connecting&&n.reconnecting?n.reconnectionTimer=setTimeout(t,1e3):void(n.reconnectionAttempts++>=r?n.redoTransports?(n.publish("reconnect_failed"),e()):(n.on("connect_failed",t),n.options["try multiple transports"]=!0,n.transports=n.origTransports,n.transport=n.getTransport(),n.redoTransports=!0,n.connect()):(n.reconnectionDelay<i&&(n.reconnectionDelay*=2),n.connect(),n.publish("reconnecting",n.reconnectionDelay,n.reconnectionAttempts),n.reconnectionTimer=setTimeout(t,n.reconnectionDelay)))}this.reconnecting=!0,this.reconnectionAttempts=0,this.reconnectionDelay=this.options["reconnection delay"];var n=this,r=this.options["max reconnection attempts"],o=this.options["try multiple transports"],i=this.options["reconnection limit"];this.options["try multiple transports"]=!1,this.reconnectionTimer=setTimeout(t,this.reconnectionDelay),this.on("connect",t)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports,window),function(e,t){function n(e,t){this.socket=e,this.name=t||"",this.flags={},this.json=new r(this,"json"),this.ackPackets=0,this.acks={}}function r(e,t){this.namespace=e,this.name=t}e.SocketNamespace=n,t.util.mixin(n,t.EventEmitter),n.prototype.$emit=t.EventEmitter.prototype.emit,n.prototype.of=function(){return this.socket.of.apply(this.socket,arguments)},n.prototype.packet=function(e){return e.endpoint=this.name,this.socket.packet(e),this.flags={},this},n.prototype.send=function(e,t){var n={type:this.flags.json?"json":"message",data:e};return"function"==typeof t&&(n.id=++this.ackPackets,n.ack=!0,this.acks[n.id]=t),this.packet(n)},n.prototype.emit=function(e){var t=Array.prototype.slice.call(arguments,1),n=t[t.length-1],r={type:"event",name:e};return"function"==typeof n&&(r.id=++this.ackPackets,r.ack="data",this.acks[r.id]=n,t=t.slice(0,t.length-1)),r.args=t,this.packet(r)},n.prototype.disconnect=function(){return""===this.name?this.socket.disconnect():(this.packet({type:"disconnect"}),this.$emit("disconnect")),this},n.prototype.onPacket=function(e){function n(){r.packet({type:"ack",args:t.util.toArray(arguments),ackId:e.id})}var r=this;switch(e.type){case"connect":this.$emit("connect");break;case"disconnect":""===this.name?this.socket.onDisconnect(e.reason||"booted"):this.$emit("disconnect",e.reason);break;case"message":case"json":var o=["message",e.data];"data"==e.ack?o.push(n):e.ack&&this.packet({type:"ack",ackId:e.id}),this.$emit.apply(this,o);break;case"event":var o=[e.name].concat(e.args);"data"==e.ack&&o.push(n),this.$emit.apply(this,o);break;case"ack":this.acks[e.ackId]&&(this.acks[e.ackId].apply(this,e.args),delete this.acks[e.ackId]);break;case"error":e.advice?this.socket.onError(e):"unauthorized"==e.reason?this.$emit("connect_failed",e.reason):this.$emit("error",e.reason)}},r.prototype.send=function(){this.namespace.flags[this.name]=!0,this.namespace.send.apply(this.namespace,arguments)},r.prototype.emit=function(){this.namespace.flags[this.name]=!0,this.namespace.emit.apply(this.namespace,arguments)}}("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function r(e){t.Transport.apply(this,arguments)}e.websocket=r,t.util.inherit(r,t.Transport),r.prototype.name="websocket",r.prototype.open=function(){var e,r=t.util.query(this.socket.options.query),o=this;return e||(e=n.MozWebSocket||n.WebSocket),this.websocket=new e(this.prepareUrl()+r),this.websocket.onopen=function(){o.onOpen(),o.socket.setBuffer(!1)},this.websocket.onmessage=function(e){o.onData(e.data)},this.websocket.onclose=function(){o.socket.setBuffer(!0),o.onClose()},this.websocket.onerror=function(e){o.onError(e)},this},t.util.ua.iDevice?r.prototype.send=function(e){var t=this;return setTimeout(function(){t.websocket.send(e)},0),this}:r.prototype.send=function(e){return this.websocket.send(e),this},r.prototype.payload=function(e){for(var t=0,n=e.length;t<n;t++)this.packet(e[t]);return this},r.prototype.close=function(){return this.websocket.close(),this},r.prototype.onError=function(e){this.socket.onError(e)},r.prototype.scheme=function(){return this.socket.options.secure?"wss":"ws"},r.check=function(){return"WebSocket"in n&&!("__addTask"in WebSocket)||"MozWebSocket"in n},r.xdomainCheck=function(){return!0},t.transports.push("websocket")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,window),function(e,t){function n(){t.Transport.websocket.apply(this,arguments)}e.flashsocket=n,t.util.inherit(n,t.Transport.websocket),n.prototype.name="flashsocket",n.prototype.open=function(){var e=this,n=arguments;return WebSocket.__addTask(function(){t.Transport.websocket.prototype.open.apply(e,n)}),this},n.prototype.send=function(){var e=this,n=arguments;return WebSocket.__addTask(function(){t.Transport.websocket.prototype.send.apply(e,n)}),this},n.prototype.close=function(){return WebSocket.__tasks.length=0,t.Transport.websocket.prototype.close.call(this),this},n.prototype.ready=function(e,r){function o(){var t=e.options,o=t["flash policy port"],s=["http"+(t.secure?"s":"")+":/",t.host+":"+t.port,t.resource,"static/flashsocket","WebSocketMain"+(e.isXDomain()?"Insecure":"")+".swf"];n.loaded||("undefined"==typeof WEB_SOCKET_SWF_LOCATION&&(WEB_SOCKET_SWF_LOCATION=s.join("/")),843!==o&&WebSocket.loadFlashPolicyFile("xmlsocket://"+t.host+":"+o),WebSocket.__initialize(),n.loaded=!0),r.call(i)}var i=this;return document.body?o():void t.util.load(o)},n.check=function(){return!!("undefined"!=typeof WebSocket&&"__initialize"in WebSocket&&swfobject)&&swfobject.getFlashPlayerVersion().major>=10},n.xdomainCheck=function(){return!0},"undefined"!=typeof window&&(window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0),t.transports.push("flashsocket")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),"undefined"!=typeof window&&"undefined"!=typeof window.document)var swfobject=function(){function e(){if(!H){try{var e=N.getElementsByTagName("body")[0].appendChild(g("span"));e.parentNode.removeChild(e)}catch(aa){return}H=!0;for(var t=B.length,n=0;n<t;n++)B[n]()}}function t(e){H?e():B[B.length]=e}function n(e){if(typeof R.addEventListener!=x)R.addEventListener("load",e,!1);else if(typeof N.addEventListener!=x)N.addEventListener("load",e,!1);else if(typeof R.attachEvent!=x)y(R,"onload",e);else if("function"==typeof R.onload){var t=R.onload;R.onload=function(){t(),e()}}else R.onload=e}function r(){U?o():i()}function o(){var e=N.getElementsByTagName("body")[0],t=g(P);t.setAttribute("type",j);var n=e.appendChild(t);if(n){var r=0;!function(){if(typeof n.GetVariable!=x){var o=n.GetVariable("$version");o&&(o=o.split(" ")[1].split(","),J.pv=[parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10)])}else if(r<10)return r++,void setTimeout(arguments.callee,10);e.removeChild(t),n=null,i()}()}else i()}function i(){var e=L.length;if(e>0)for(var t=0;t<e;t++){var n=L[t].id,r=L[t].callbackFn,o={success:!1,id:n};if(J.pv[0]>0){var i=h(n);if(i)if(!v(L[t].swfVersion)||J.wk&&J.wk<312)if(L[t].expressInstall&&a()){var l={};l.data=L[t].expressInstall,l.width=i.getAttribute("width")||"0",l.height=i.getAttribute("height")||"0",i.getAttribute("class")&&(l.styleclass=i.getAttribute("class")),i.getAttribute("align")&&(l.align=i.getAttribute("align"));for(var f={},d=i.getElementsByTagName("param"),m=d.length,p=0;p<m;p++)"movie"!=d[p].getAttribute("name").toLowerCase()&&(f[d[p].getAttribute("name")]=d[p].getAttribute("value"));c(l,f,n,r)}else u(i),r&&r(o);else M(n,!0),r&&(o.success=!0,o.ref=s(n),r(o))}else if(M(n,!0),r){var g=s(n);g&&typeof g.SetVariable!=x&&(o.success=!0,o.ref=g),r(o)}}}function s(e){var t=null,n=h(e);if(n&&"OBJECT"==n.nodeName)if(typeof n.SetVariable!=x)t=n;else{var r=n.getElementsByTagName(P)[0];r&&(t=r)}return t}function a(){return!$&&v("6.0.65")&&(J.win||J.mac)&&!(J.wk&&J.wk<312)}function c(e,t,n,r){$=!0,w=r||null,C={success:!1,id:n};var o=h(n);if(o){"OBJECT"==o.nodeName?(k=l(o),S=null):(k=o,S=n),e.id=A,(typeof e.width==x||!/%$/.test(e.width)&&parseInt(e.width,10)<310)&&(e.width="310"),(typeof e.height==x||!/%$/.test(e.height)&&parseInt(e.height,10)<137)&&(e.height="137"),N.title=N.title.slice(0,47)+" - Flash Player Installation";var i=J.ie&&J.win?["Active"].concat("").join("X"):"PlugIn",s="MMredirectURL="+R.location.toString().replace(/&/g,"%26")+"&MMplayerType="+i+"&MMdoctitle="+N.title;if(typeof t.flashvars!=x?t.flashvars+="&"+s:t.flashvars=s,J.ie&&J.win&&4!=o.readyState){var a=g("div");n+="SWFObjectNew",a.setAttribute("id",n),o.parentNode.insertBefore(a,o),o.style.display="none",function(){4==o.readyState?o.parentNode.removeChild(o):setTimeout(arguments.callee,10)}()}f(e,t,n)}}function u(e){if(J.ie&&J.win&&4!=e.readyState){var t=g("div");e.parentNode.insertBefore(t,e),t.parentNode.replaceChild(l(e),t),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}else e.parentNode.replaceChild(l(e),e)}function l(e){var t=g("div");if(J.win&&J.ie)t.innerHTML=e.innerHTML;else{var n=e.getElementsByTagName(P)[0];if(n){var r=n.childNodes;if(r)for(var o=r.length,i=0;i<o;i++)1==r[i].nodeType&&"PARAM"==r[i].nodeName||8==r[i].nodeType||t.appendChild(r[i].cloneNode(!0))}}return t}function f(e,t,n){var r,o=h(n);if(J.wk&&J.wk<312)return r;if(o)if(typeof e.id==x&&(e.id=n),J.ie&&J.win){var i="";for(var s in e)e[s]!=Object.prototype[s]&&("data"==s.toLowerCase()?t.movie=e[s]:"styleclass"==s.toLowerCase()?i+=' class="'+e[s]+'"':"classid"!=s.toLowerCase()&&(i+=" "+s+'="'+e[s]+'"'));var a="";for(var c in t)t[c]!=Object.prototype[c]&&(a+='<param name="'+c+'" value="'+t[c]+'" />');o.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+i+">"+a+"</object>",W[W.length]=e.id,r=h(e.id)}else{var u=g(P);u.setAttribute("type",j);for(var l in e)e[l]!=Object.prototype[l]&&("styleclass"==l.toLowerCase()?u.setAttribute("class",e[l]):"classid"!=l.toLowerCase()&&u.setAttribute(l,e[l]));for(var f in t)t[f]!=Object.prototype[f]&&"movie"!=f.toLowerCase()&&d(u,f,t[f]);o.parentNode.replaceChild(u,o),r=u}return r}function d(e,t,n){var r=g("param");r.setAttribute("name",t),r.setAttribute("value",n),e.appendChild(r)}function m(e){var t=h(e);t&&"OBJECT"==t.nodeName&&(J.ie&&J.win?(t.style.display="none",function(){4==t.readyState?p(e):setTimeout(arguments.callee,10)}()):t.parentNode.removeChild(t))}function p(e){var t=h(e);if(t){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}}function h(e){var t=null;try{t=N.getElementById(e)}catch(Y){}return t}function g(e){return N.createElement(e)}function y(e,t,n){e.attachEvent(t,n),q[q.length]=[e,t,n]}function v(e){var t=J.pv,n=e.split(".");return n[0]=parseInt(n[0],10),n[1]=parseInt(n[1],10)||0,n[2]=parseInt(n[2],10)||0,t[0]>n[0]||t[0]==n[0]&&t[1]>n[1]||t[0]==n[0]&&t[1]==n[1]&&t[2]>=n[2]}function b(e,t,n,r){if(!J.ie||!J.mac){var o=N.getElementsByTagName("head")[0];if(o){var i=n&&"string"==typeof n?n:"screen";if(r&&(O=null,I=null),!O||I!=i){var s=g("style");s.setAttribute("type","text/css"),s.setAttribute("media",i),O=o.appendChild(s),J.ie&&J.win&&typeof N.styleSheets!=x&&N.styleSheets.length>0&&(O=N.styleSheets[N.styleSheets.length-1]),I=i}J.ie&&J.win?O&&typeof O.addRule==P&&O.addRule(e,t):O&&typeof N.createTextNode!=x&&O.appendChild(N.createTextNode(e+" {"+t+"}"))}}}function M(e,t){if(X){var n=t?"visible":"hidden";H&&h(e)?h(e).style.visibility=n:b("#"+e,"visibility:"+n)}}function T(e){var t=/[\\\"<>\.;]/,n=null!=t.exec(e);return n&&typeof encodeURIComponent!=x?encodeURIComponent(e):e}var k,S,w,C,O,I,x="undefined",P="object",_="Shockwave Flash",E="ShockwaveFlash.ShockwaveFlash",j="application/x-shockwave-flash",A="SWFObjectExprInst",F="onreadystatechange",R=window,N=document,D=navigator,U=!1,B=[r],L=[],W=[],q=[],H=!1,$=!1,X=!0,J=function(){var e=typeof N.getElementById!=x&&typeof N.getElementsByTagName!=x&&typeof N.createElement!=x,t=D.userAgent.toLowerCase(),n=D.platform.toLowerCase(),r=n?/win/.test(n):/win/.test(t),o=n?/mac/.test(n):/mac/.test(t),i=!!/webkit/.test(t)&&parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")),s=!1,a=[0,0,0],c=null;if(typeof D.plugins!=x&&typeof D.plugins[_]==P)c=D.plugins[_].description,!c||typeof D.mimeTypes!=x&&D.mimeTypes[j]&&!D.mimeTypes[j].enabledPlugin||(U=!0,s=!1,c=c.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),a[0]=parseInt(c.replace(/^(.*)\..*$/,"$1"),10),a[1]=parseInt(c.replace(/^.*\.(.*)\s.*$/,"$1"),10),a[2]=/[a-zA-Z]/.test(c)?parseInt(c.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof R[["Active"].concat("Object").join("X")]!=x)try{var u=new(window[["Active"].concat("Object").join("X")])(E);u&&(c=u.GetVariable("$version"),c&&(s=!0,c=c.split(" ")[1].split(","),a=[parseInt(c[0],10),parseInt(c[1],10),parseInt(c[2],10)]))}catch(Z){}return{w3:e,pv:a,wk:i,ie:s,win:r,mac:o}}();(function(){J.w3&&((typeof N.readyState!=x&&"complete"==N.readyState||typeof N.readyState==x&&(N.getElementsByTagName("body")[0]||N.body))&&e(),H||(typeof N.addEventListener!=x&&N.addEventListener("DOMContentLoaded",e,!1),J.ie&&J.win&&(N.attachEvent(F,function(){"complete"==N.readyState&&(N.detachEvent(F,arguments.callee),e())}),R==top&&!function(){if(!H){try{N.documentElement.doScroll("left")}catch(X){return void setTimeout(arguments.callee,0)}e()}}()),J.wk&&!function(){if(!H)return/loaded|complete/.test(N.readyState)?void e():void setTimeout(arguments.callee,0)}(),n(e)))})(),function(){J.ie&&J.win&&window.attachEvent("onunload",function(){
  for(var e=q.length,t=0;t<e;t++)q[t][0].detachEvent(q[t][1],q[t][2]);for(var n=W.length,r=0;r<n;r++)m(W[r]);for(var o in J)J[o]=null;J=null;for(var i in swfobject)swfobject[i]=null;swfobject=null})}();return{registerObject:function(e,t,n,r){if(J.w3&&e&&t){var o={};o.id=e,o.swfVersion=t,o.expressInstall=n,o.callbackFn=r,L[L.length]=o,M(e,!1)}else r&&r({success:!1,id:e})},getObjectById:function(e){if(J.w3)return s(e)},embedSWF:function(e,n,r,o,i,s,u,l,d,m){var p={success:!1,id:n};J.w3&&!(J.wk&&J.wk<312)&&e&&n&&r&&o&&i?(M(n,!1),t(function(){r+="",o+="";var t={};if(d&&typeof d===P)for(var h in d)t[h]=d[h];t.data=e,t.width=r,t.height=o;var g={};if(l&&typeof l===P)for(var y in l)g[y]=l[y];if(u&&typeof u===P)for(var b in u)typeof g.flashvars!=x?g.flashvars+="&"+b+"="+u[b]:g.flashvars=b+"="+u[b];if(v(i)){var T=f(t,g,n);t.id==n&&M(n,!0),p.success=!0,p.ref=T}else{if(s&&a())return t.data=s,void c(t,g,n,m);M(n,!0)}m&&m(p)})):m&&m(p)},switchOffAutoHideShow:function(){X=!1},ua:J,getFlashPlayerVersion:function(){return{major:J.pv[0],minor:J.pv[1],release:J.pv[2]}},hasFlashPlayerVersion:v,createSWF:function(e,t,n){return J.w3?f(e,t,n):void 0},showExpressInstall:function(e,t,n,r){J.w3&&a()&&c(e,t,n,r)},removeSWF:function(e){J.w3&&m(e)},createCSS:function(e,t,n,r){J.w3&&b(e,t,n,r)},addDomLoadEvent:t,addLoadEvent:n,getQueryParamValue:function(e){var t=N.location.search||N.location.hash;if(t){if(/\?/.test(t)&&(t=t.split("?")[1]),null==e)return T(t);for(var n=t.split("&"),r=0;r<n.length;r++)if(n[r].substring(0,n[r].indexOf("="))==e)return T(n[r].substring(n[r].indexOf("=")+1))}return""},expressInstallCallback:function(){if($){var e=h(A);e&&k&&(e.parentNode.replaceChild(k,e),S&&(M(S,!0),J.ie&&J.win&&(k.style.display="block")),w&&w(C)),$=!1}}}}();!function(){if("undefined"!=typeof window&&!window.WebSocket){var e=window.console;if(e&&e.log&&e.error||(e={log:function(){},error:function(){}}),!swfobject.hasFlashPlayerVersion("10.0.0"))return void e.error("Flash Player >= 10.0.0 is required.");"file:"==location.protocol&&e.error("WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://..."),WebSocket=function(e,t,n,r,o){var i=this;i.__id=WebSocket.__nextId++,WebSocket.__instances[i.__id]=i,i.readyState=WebSocket.CONNECTING,i.bufferedAmount=0,i.__events={},t?"string"==typeof t&&(t=[t]):t=[],setTimeout(function(){WebSocket.__addTask(function(){WebSocket.__flash.create(i.__id,e,t,n||null,r||0,o||null)})},0)},WebSocket.prototype.send=function(e){if(this.readyState==WebSocket.CONNECTING)throw"INVALID_STATE_ERR: Web Socket connection has not been established";var t=WebSocket.__flash.send(this.__id,encodeURIComponent(e));return t<0||(this.bufferedAmount+=t,!1)},WebSocket.prototype.close=function(){this.readyState!=WebSocket.CLOSED&&this.readyState!=WebSocket.CLOSING&&(this.readyState=WebSocket.CLOSING,WebSocket.__flash.close(this.__id))},WebSocket.prototype.addEventListener=function(e,t,n){e in this.__events||(this.__events[e]=[]),this.__events[e].push(t)},WebSocket.prototype.removeEventListener=function(e,t,n){if(e in this.__events)for(var r=this.__events[e],o=r.length-1;o>=0;--o)if(r[o]===t){r.splice(o,1);break}},WebSocket.prototype.dispatchEvent=function(e){for(var t=this.__events[e.type]||[],n=0;n<t.length;++n)t[n](e);var r=this["on"+e.type];r&&r(e)},WebSocket.prototype.__handleEvent=function(e){"readyState"in e&&(this.readyState=e.readyState),"protocol"in e&&(this.protocol=e.protocol);var t;if("open"==e.type||"error"==e.type)t=this.__createSimpleEvent(e.type);else if("close"==e.type)t=this.__createSimpleEvent("close");else{if("message"!=e.type)throw"unknown event type: "+e.type;var n=decodeURIComponent(e.message);t=this.__createMessageEvent("message",n)}this.dispatchEvent(t)},WebSocket.prototype.__createSimpleEvent=function(e){if(document.createEvent&&window.Event){var t=document.createEvent("Event");return t.initEvent(e,!1,!1),t}return{type:e,bubbles:!1,cancelable:!1}},WebSocket.prototype.__createMessageEvent=function(e,t){if(document.createEvent&&window.MessageEvent&&!window.opera){var n=document.createEvent("MessageEvent");return n.initMessageEvent("message",!1,!1,t,null,null,window,null),n}return{type:e,data:t,bubbles:!1,cancelable:!1}},WebSocket.CONNECTING=0,WebSocket.OPEN=1,WebSocket.CLOSING=2,WebSocket.CLOSED=3,WebSocket.__flash=null,WebSocket.__instances={},WebSocket.__tasks=[],WebSocket.__nextId=0,WebSocket.loadFlashPolicyFile=function(e){WebSocket.__addTask(function(){WebSocket.__flash.loadManualPolicyFile(e)})},WebSocket.__initialize=function(){if(!WebSocket.__flash){if(WebSocket.__swfLocation&&(window.WEB_SOCKET_SWF_LOCATION=WebSocket.__swfLocation),!window.WEB_SOCKET_SWF_LOCATION)return void e.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf");var t=document.createElement("div");t.id="webSocketContainer",t.style.position="absolute",WebSocket.__isFlashLite()?(t.style.left="0px",t.style.top="0px"):(t.style.left="-100px",t.style.top="-100px");var n=document.createElement("div");n.id="webSocketFlash",t.appendChild(n),document.body.appendChild(t),swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,"webSocketFlash","1","1","10.0.0",null,null,{hasPriority:!0,swliveconnect:!0,allowScriptAccess:"always"},null,function(t){t.success||e.error("[WebSocket] swfobject.embedSWF failed")})}},WebSocket.__onFlashInitialized=function(){setTimeout(function(){WebSocket.__flash=document.getElementById("webSocketFlash"),WebSocket.__flash.setCallerUrl(location.href),WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);for(var e=0;e<WebSocket.__tasks.length;++e)WebSocket.__tasks[e]();WebSocket.__tasks=[]},0)},WebSocket.__onFlashEvent=function(){return setTimeout(function(){try{for(var t=WebSocket.__flash.receiveEvents(),n=0;n<t.length;++n)WebSocket.__instances[t[n].webSocketId].__handleEvent(t[n])}catch(e){e.error(e)}},0),!0};var t=function(){var e=function(e,t){t=t||2;for(var n=""+e;n.length<t;)n="0"+n;return n},t=new Date,n=t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+" "+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+":"+e(t.getMilliseconds(),3);return n};WebSocket.__log=function(n){e.log(t(),decodeURIComponent(n))},WebSocket.__error=function(n){e.error(t(),decodeURIComponent(n))},WebSocket.__addTask=function(e){WebSocket.__flash?e():WebSocket.__tasks.push(e)},WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes)return!1;var e=window.navigator.mimeTypes["application/x-shockwave-flash"];return!!(e&&e.enabledPlugin&&e.enabledPlugin.filename)&&!!e.enabledPlugin.filename.match(/flashlite/i)},window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener("load",function(){WebSocket.__initialize()},!1):window.attachEvent("onload",function(){WebSocket.__initialize()}))}}(),function(e,t,n){function r(e){e&&(t.Transport.apply(this,arguments),this.sendBuffer=[])}function o(){}e.XHR=r,t.util.inherit(r,t.Transport),r.prototype.open=function(){return this.socket.setBuffer(!1),this.onOpen(),this.get(),this.setCloseTimeout(),this},r.prototype.payload=function(e){for(var n=[],r=0,o=e.length;r<o;r++)n.push(t.parser.encodePacket(e[r]));this.send(t.parser.encodePayload(n))},r.prototype.send=function(e){return this.post(e),this},r.prototype.post=function(e){function t(){4==this.readyState&&(this.onreadystatechange=o,i.posting=!1,200==this.status?i.socket.setBuffer(!1):i.onClose())}function r(){this.onload=o,i.socket.setBuffer(!1)}var i=this;this.socket.setBuffer(!0),this.sendXHR=this.request("POST"),n.XDomainRequest&&this.sendXHR instanceof XDomainRequest?this.sendXHR.onload=this.sendXHR.onerror=r:this.sendXHR.onreadystatechange=t,this.sendXHR.send(e)},r.prototype.close=function(){return this.onClose(),this},r.prototype.request=function(e){var n=t.util.request(this.socket.isXDomain()),r=t.util.query(this.socket.options.query,"t="+ +new Date);if(n.open(e||"GET",this.prepareUrl()+r,!0),"POST"==e)try{n.setRequestHeader?n.setRequestHeader("Content-type","text/plain;charset=UTF-8"):n.contentType="text/plain"}catch(e){}return n},r.prototype.scheme=function(){return this.socket.options.secure?"https":"http"},r.check=function(e,r){try{var o=t.util.request(r),i=n.XDomainRequest&&o instanceof XDomainRequest,s=e&&e.options&&e.options.secure?"https:":"http:",a=n.location&&s!=n.location.protocol;if(o&&(!i||!a))return!0}catch(e){}return!1},r.xdomainCheck=function(e){return r.check(e,!0)}}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,window),function(e,t){function n(e){t.Transport.XHR.apply(this,arguments)}e.htmlfile=n,t.util.inherit(n,t.Transport.XHR),n.prototype.name="htmlfile",n.prototype.get=function(){this.doc=new(window[["Active"].concat("Object").join("X")])("htmlfile"),this.doc.open(),this.doc.write("<html></html>"),this.doc.close(),this.doc.parentWindow.s=this;var e=this.doc.createElement("div");e.className="socketio",this.doc.body.appendChild(e),this.iframe=this.doc.createElement("iframe"),e.appendChild(this.iframe);var n=this,r=t.util.query(this.socket.options.query,"t="+ +new Date);this.iframe.src=this.prepareUrl()+r,t.util.on(window,"unload",function(){n.destroy()})},n.prototype._=function(e,t){this.onData(e);try{var n=t.getElementsByTagName("script")[0];n.parentNode.removeChild(n)}catch(e){}},n.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(e){}this.doc=null,this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,CollectGarbage()}},n.prototype.close=function(){return this.destroy(),t.Transport.XHR.prototype.close.call(this)},n.check=function(e){if("undefined"!=typeof window&&["Active"].concat("Object").join("X")in window)try{var n=new(window[["Active"].concat("Object").join("X")])("htmlfile");return n&&t.Transport.XHR.check(e)}catch(e){}return!1},n.xdomainCheck=function(){return!1},t.transports.push("htmlfile")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports),function(e,t,n){function r(){t.Transport.XHR.apply(this,arguments)}function o(){}e["xhr-polling"]=r,t.util.inherit(r,t.Transport.XHR),t.util.merge(r,t.Transport.XHR),r.prototype.name="xhr-polling",r.prototype.heartbeats=function(){return!1},r.prototype.open=function(){var e=this;return t.Transport.XHR.prototype.open.call(e),!1},r.prototype.get=function(){function e(){4==this.readyState&&(this.onreadystatechange=o,200==this.status?(i.onData(this.responseText),i.get()):i.onClose())}function t(){this.onload=o,this.onerror=o,i.retryCounter=1,i.onData(this.responseText),i.get()}function r(){i.retryCounter++,!i.retryCounter||i.retryCounter>3?i.onClose():i.get()}if(this.isOpen){var i=this;this.xhr=this.request(),n.XDomainRequest&&this.xhr instanceof XDomainRequest?(this.xhr.onload=t,this.xhr.onerror=r):this.xhr.onreadystatechange=e,this.xhr.send(null)}},r.prototype.onClose=function(){if(t.Transport.XHR.prototype.onClose.call(this),this.xhr){this.xhr.onreadystatechange=this.xhr.onload=this.xhr.onerror=o;try{this.xhr.abort()}catch(e){}this.xhr=null}},r.prototype.ready=function(e,n){var r=this;t.util.defer(function(){n.call(r)})},t.transports.push("xhr-polling")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,window),function(e,t,n){function r(e){t.Transport["xhr-polling"].apply(this,arguments),this.index=t.j.length;var n=this;t.j.push(function(e){n._(e)})}var o=n.document&&"MozAppearance"in n.document.documentElement.style;e["jsonp-polling"]=r,t.util.inherit(r,t.Transport["xhr-polling"]),r.prototype.name="jsonp-polling",r.prototype.post=function(e){function n(){r(),o.socket.setBuffer(!1)}function r(){o.iframe&&o.form.removeChild(o.iframe);try{s=document.createElement('<iframe name="'+o.iframeId+'">')}catch(e){s=document.createElement("iframe"),s.name=o.iframeId}s.id=o.iframeId,o.form.appendChild(s),o.iframe=s}var o=this,i=t.util.query(this.socket.options.query,"t="+ +new Date+"&i="+this.index);if(!this.form){var s,a=document.createElement("form"),c=document.createElement("textarea"),u=this.iframeId="socketio_iframe_"+this.index;a.className="socketio",a.style.position="absolute",a.style.top="0px",a.style.left="0px",a.style.display="none",a.target=u,a.method="POST",a.setAttribute("accept-charset","utf-8"),c.name="d",a.appendChild(c),document.body.appendChild(a),this.form=a,this.area=c}this.form.action=this.prepareUrl()+i,r(),this.area.value=t.JSON.stringify(e);try{this.form.submit()}catch(e){}this.iframe.attachEvent?s.onreadystatechange=function(){"complete"==o.iframe.readyState&&n()}:this.iframe.onload=n,this.socket.setBuffer(!0)},r.prototype.get=function(){var e=this,n=document.createElement("script"),r=t.util.query(this.socket.options.query,"t="+ +new Date+"&i="+this.index);this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),n.async=!0,n.src=this.prepareUrl()+r,n.onerror=function(){e.onClose()};var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i),this.script=n,o&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},r.prototype._=function(e){return this.onData(e),this.isOpen&&this.get(),this},r.prototype.ready=function(e,n){var r=this;return o?void t.util.load(function(){n.call(r)}):n.call(this)},r.check=function(){return"document"in n},r.xdomainCheck=function(){return!0},t.transports.push("jsonp-polling")}("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,window),__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return io}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(22)(module))},function(e,t){"use strict";function n(){}var r={1:"Android",2:"iOS",4:"PC",8:"WindowsPhone",16:"Web",32:"Server"};n.reverse=function(e){var t=e;return t.type=r[t.type],t},n.reverseType=function(e){return r[e]||e},e.exports=n},function(e,t,n){"use strict";function r(){}var o=n(1);r.parse=function(e){var t=e.split("|");return{scene:t[0],to:t[1]}},r.genSessionByMsg=function(e){var t={id:e.sessionId,scene:e.scene,to:e.target,updateTime:e.time,lastMsg:e};return t},r.appendLastMsg=function(e){var t=e.lastMsg,n=o.capFirstLetter(t.type);e["last"+n+"Msg"]=t;var r=o.capFirstLetter(t.flow);e["last"+r+"Msg"]=t},r.genSessionByMsgs=function(e,t){var n=e.getLastNotIgnoredMsg(t);return n?r.genSessionByMsg(n):null},r.trim=function(e){delete e.msgReceiptSendTime,delete e.msgReceiptServerTime,delete e.ack,delete e.unreadMsgs},r.isComplete=function(e){return e.id&&e.scene&&e.to},e.exports=r},function(e,t,n){"use strict";function r(e){var t=this;o.verifyOptions(e,"type to"),o.verifyParamValid("type",e.type,r.validTypes),e.type.indexOf("custom")!==-1&&(o.verifyOptions(e,"content"),t.attach=e.content,s(e.apnsText)&&(t.apnsText=""+e.apnsText),s(e.pushPayload)&&(t.pushPayload=""+e.pushPayload),s(e.sendToOnlineUsersOnly)&&(t.sendToOnlineUsersOnly=e.sendToOnlineUsersOnly?0:1),s(e.cc)&&(t.cc=e.cc?1:0),s(e.isPushable)&&(t.isPushable=e.isPushable?1:0),s(e.isUnreadable)&&(t.isUnreadable=e.isUnreadable?1:0),s(e.needPushNick)&&(t.needPushNick=e.needPushNick?1:0)),t.time=e.time||+new Date,t.type=l[e.type],t.to=e.to,s(e.from)&&(t.from=e.from),s(e.ps)&&(t.ps=e.ps),s(e.deletedIdClient)&&(t.deletedIdClient=e.deletedIdClient),s(e.deletedIdServer)&&(t.deletedIdServer=e.deletedIdServer),s(e.yidunEnable)&&(t.yidunEnable=e.yidunEnable?1:0),s(e.antiSpamContent)&&(t.antiSpamContent=""+e.antiSpamContent),t.idClient=e.idClient||o.guid()}var o=n(1),i=o.undef,s=o.notundef,a=n(23).getInstance("IM"),c=n(20),u=n(15),l={customP2p:100,customTeam:101,deleteMsgP2p:7,deleteMsgTeam:8},f={0:"applyTeam",1:"rejectTeamApply",2:"teamInvite",3:"rejectTeamInvite",5:"friendRequest",6:"deleteFriend",7:"deleteMsgP2p",8:"deleteMsgTeam",100:"customP2p",101:"customTeam",102:"customP2p"},d={1:"addFriend",2:"applyFriend",3:"passFriendApply",4:"rejectFriendApply"},m="team",p="friend",h="msg",g=[m,p,h],y={applyTeam:m,rejectTeamApply:m,teamInvite:m,rejectTeamInvite:m,addFriend:p,applyFriend:p,passFriendApply:p,rejectFriendApply:p,deleteFriend:p,deleteMsg:h};r.validTypes=Object.keys(l).concat(Object.keys(y)),r.validCategories=["team","friend"],r.isCustom=function(e){return"custom"===e.type},r.reverse=function(e){var t={time:+e.time,to:e.to,type:f[e.type]};if(s(e.from)&&(t.from=e.from),s(e.idServer)&&(t.idServer=""+e.idServer),s(e.deletedIdClient)&&(t.deletedIdClient=e.deletedIdClient),s(e.deletedIdServer)&&(t.deletedIdServer=""+e.deletedIdServer),s(e.deletedMsgTime)&&(t.deletedMsgTime=+e.deletedMsgTime),s(e.deletedMsgFromNick)&&(t.deletedMsgFromNick=""+e.deletedMsgFromNick),s(e.ps)&&(t.ps=e.ps),e.attach=e.attach?""+e.attach:"","customP2p"===t.type||"customTeam"===t.type)t.content=e.attach,s(e.apnsText)&&(t.apnsText=e.apnsText),s(e.pushPayload)&&(t.pushPayload=e.pushPayload),o.merge(t,{sendToOnlineUsersOnly:i(e.sendToOnlineUsersOnly)||0===+e.sendToOnlineUsersOnly,cc:i(e.cc)||1===+e.cc,isPushable:i(e.isPushable)||1===+e.isPushable,isUnreadable:i(e.isUnreadable)||1===+e.isUnreadable,needPushNick:s(e.needPushNick)&&1===+e.needPushNick}),t.scene=t.type.slice(6).toLowerCase(),t.type="custom";else if("deleteMsgP2p"===t.type||"deleteMsgTeam"===t.type)t.scene=t.type.slice(9).toLowerCase(),t.type="deleteMsg";else{if(e.attach){t.attach={};var n=JSON.parse(e.attach);s(n.vt)?(t.type=d[n.vt],delete t.attach):(s(n.tinfo)&&(t.attach.team=c.reverse(a.unserialize(n.tinfo,"team"))),s(n.tlist)&&(t.attach.member=u.reverse(a.unserialize(n.tlist,"teamMember"))),s(n.attach)&&(t.attach.custom=n.attach))}t.category=y[t.type],t.read=!1,t.state="init"}return s(e.cc)&&(t.cc=1===+e.cc),t.status=e.status||"success",s(e.filter)&&(t.filter=e.filter),t},r.reverseSysMsgs=function(e,t){t=t||{};var n=t.mapper,i=o.isFunction(n);return e.map(function(e){return e=r.reverse(e),i&&(e=n(e)),e})},r.completeUnread=function(e){e=e||{},g.forEach(function(t){delete e[t]});var t;return Object.keys(y).forEach(function(n){e[n]=e[n]||0,e[n]<0&&(e[n]=0),t=y[n],e[t]=e[t]||0,e[t]=e[t]+e[n]}),e.total=0,g.forEach(function(t){e.total+=e[t]}),e},e.exports=r},function(e,t,n){"use strict";function r(e){var t=this;switch(i.verifyOptions(e,"action"),e.action){case"create":i.verifyOptions(e,"teamId",!1),i.verifyOptions(e,"type name"),i.verifyParamValid("type",e.type,h);break;case"update":i.verifyOptions(e,"teamId"),i.verifyOptions(e,"type",!1)}s(e.teamId)&&(t.teamId=e.teamId),s(e.type)&&(t.type=m[e.type]),s(e.avatar)&&(t.avatar=""+e.avatar),s(e.name)&&(t.name=""+e.name),s(e.intro)&&(t.intro=""+e.intro),s(e.announcement)&&(t.announcement=""+e.announcement),f.forEach(t.setMode.bind(t,e)),s(e.custom)&&(t.custom=""+e.custom)}function o(e,t){t+="Mode",s(e[t])&&(e[t]=l[t][e[t]])}var i=n(1),s=i.notundef,a=i.fillPropertyWithDefault,c=Object.keys,u={},l={},f=[],d={},m={normal:0,advanced:1},p={0:"normal",1:"advanced"},h=c(m),g=u.joinMode={noVerify:0,needVerify:1,rejectAll:2};l.joinMode={0:"noVerify",1:"needVerify",2:"rejectAll"},f.push("join"),d.joinMode=c(g);var y=u.beInviteMode={needVerify:0,noVerify:1};l.beInviteMode={0:"needVerify",1:"noVerify"},f.push("beInvite"),d.beInviteMode=c(y);var v=u.inviteMode={manager:0,all:1};l.inviteMode={0:"manager",1:"all"},f.push("invite"),d.inviteMode=c(v);var b=u.updateTeamMode={manager:0,all:1};l.updateTeamMode={0:"manager",1:"all"},f.push("updateTeam"),d.updateTeamMode=c(b);var M=u.updateCustomMode={manager:0,all:1};l.updateCustomMode={0:"manager",1:"all"},f.push("updateCustom"),d.updateCustomMode=c(M);var T=r.prototype;T.setMode=function(e,t){var n=this;t+="Mode",s(e[t])&&(i.verifyParamValid(t,e[t],d[t]),n[t]=u[t][e[t]])},r.reverse=function(e){var t=i.copy(e);return s(t.teamId)&&(t.teamId=""+t.teamId),s(t.type)&&(t.type=p[t.type]),s(t.level)&&(t.level=+t.level),s(t.valid)&&(t.valid=1===+t.valid),s(t.memberNum)&&(t.memberNum=+t.memberNum),s(t.memberUpdateTime)&&(t.memberUpdateTime=+t.memberUpdateTime),s(t.createTime)&&(t.createTime=+t.createTime),s(t.updateTime)&&(t.updateTime=+t.updateTime),s(t.validToCurrentUser)&&(t.validToCurrentUser="1"===t.validToCurrentUser),s(t.mute)&&(t.mute="1"===t.mute),f.forEach(o.bind(null,t)),delete t.bits,r.fillProperties(t),t},r.fillProperties=function(e){var t=a(e,"beInviteMode","needVerify"),n=a(e,"inviteMode","manager"),r=a(e,"updateTeamMode","manager"),o=a(e,"updateCustomMode","manager"),i=a(e,"avatar","");return t||n||r||o||i},e.exports=r},function(e,t,n){"use strict";function r(e){var t=this;i.verifyOptions(e,"appKey account token chatroomId chatroomAddresses"),i.verifyParamType("chatroomAddresses",e.chatroomAddresses,"array"),i.verifyCallback(e,"onconnect onerror onwillreconnect ondisconnect onmsg onmsgs"),o.call(t,e)}var o=n(9),i=n(1),s=i.undef,a=i.notundef,c=n(6),u=n(23),l=n(139),f=n(140),d=n(142),m=u.getInstance({type:"Chatroom",configMap:l,serializeMap:f,unserializeMap:d}),p=n(47),h=n(37),g=o.fn,y=r.fn=r.prototype=Object.create(g);y.init=function(){var e=this;g.init.call(e),e.parser=m,e.syncResult={},e.timetags={},e.msgBuffer=[]},y.reset=function(){var e=this;g.reset.call(e);var t=e.options;s(t.msgBufferInterval)&&(t.msgBufferInterval=300),i.verifyParamType("msgBufferInterval",t.msgBufferInterval,"number"),s(t.msgBufferSize)&&(t.msgBufferSize=500),i.verifyParamType("msgBufferSize",t.msgBufferSize,"number"),a(t.chatroomAddresses)&&(e.socketUrls=t.chatroomAddresses.map(c.formatSocketUrl),e.socketUrlsBackup=e.socketUrls.slice(0))},y.processChatroom=function(e){var t=this;switch(e.cmd){case"login":e.error||(e.obj={chatroom:p.reverse(e.content.chatroom),member:h.reverse(e.content.chatroomMember)});break;case"kicked":t.onKicked(e);break;case"logout":break;case"sendMsg":t.onSendMsg(e);break;case"msg":t.onMsg(e);break;case"getChatroomMembers":t.onChatroomMembers(e);break;case"getHistoryMsgs":t.onHistoryMsgs(e);break;case"markChatroomMember":t.onMarkChatroomMember(e);break;case"closeChatroom":break;case"getChatroom":t.onChatroom(e);break;case"updateChatroom":break;case"updateMyChatroomMemberInfo":delete e.obj.chatroomMember;break;case"getChatroomMembersInfo":t.onChatroomMembersInfo(e);break;case"kickChatroomMember":break;case"updateChatroomMemberTempMute":}},y.onChatroom=function(e){e.error||(e.obj.chatroom=p.reverse(e.content.chatroom))},e.exports=r,n(121),n(120),n(123),n(122)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){this.configMap=e.configMap,this.serializeMap=e.serializeMap,this.unserializeMap=e.unserializeMap}var o=n(1),i=o.undef,s=n(3),a={};r.getInstance=function(e){var t=e.type||e;return a[t]||(a[t]=new r(e)),a[t]},r.prototype.createCmd=function(){var e=1;return function(t,n){var r=this,o=this.configMap.cmdConfig[t];return t={SID:o.sid,CID:o.cid,SER:e++},o.params&&(t.Q=[],o.params.forEach(function(e){var o=e.type,s=e.name,a=e.entity,c=n[s];if(!i(c)){switch(o){case"PropertyArray":o="ArrayMable",c=c.map(function(e){return{t:"Property",v:r.serialize(e,a)}});break;case"Property":c=r.serialize(c,s);break;case"bool":c=c?"true":"false"}t.Q.push({t:o,v:c})}})),t}}(),r.prototype.parseResponse=function(e){var t=this,n=JSON.parse(e),r={raw:n,error:s.genError(n.code)},i=t.configMap.packetConfig[n.sid+"_"+n.cid];if(!i)return r.notFound={sid:n.sid,cid:n.cid},r;var a=n.r,c="notify"===i.service&&!i.cmd;if(r.isNotify=c,c){var u=n.r[1].headerPacket;if(i=t.configMap.packetConfig[u.sid+"_"+u.cid],a=n.r[1].body,!i)return r.notFound={sid:u.sid,cid:u.cid},r}if(r.service=i.service,r.cmd=i.cmd,r.error&&416===r.error.code){var l=a[0];l&&(r.frequencyControlDuration=1e3*l)}var f=!1;return r.error&&i.trivialErrorCodes&&(f=i.trivialErrorCodes.indexOf(r.error.code)!==-1),r.error&&!f||!i.response||(r.content={},i.response.forEach(function(e,i){var s=a[i];if(!o.undef(s)){var u=e.type,l=e.name,f=e.entity||l;switch(u){case"Property":r.content[l]=t.unserialize(s,f);break;case"PropertyArray":r.content[l]=[],s.forEach(function(e){r.content[l].push(t.unserialize(e,f))});break;case"Number":r.content[l]=+s;break;default:r.content[l]=s}if(c&&"msg"===l||"sysMsg"===l){var d=r.content[l];o.isObject(d)&&!d.idServer&&(d.idServer=""+n.r[0])}}})),r},r.prototype.serialize=function(e,t){var n=this.serializeMap[t],r={};for(var o in n)e.hasOwnProperty(o)&&(r[n[o]]=e[o]);return r},r.prototype.unserialize=function(e,t){var n=this.unserializeMap[t],r={};if(e)for(var o in n)e.hasOwnProperty(o)&&(r[n[o]]=e[o]);return r},e.exports=r},function(e,t){function n(e,t){for(var n=t.split(".");n.length;){var r=n.shift(),o=!1;if("?"==r[r.length-1]&&(r=r.slice(0,-1),o=!0),e=e[r],!e&&o)return e}return e}e.exports=n},function(e,t,n){!function(t,r){e.exports=r(n(33))}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=n(1),o=n(11),i=n(12);r.json=o,r.upload=i,e.exports=r},function(e,t,n){"use strict";function r(e){var t=e.mode,n=m,r=d.getGlobal();return r.FormData||(t="iframe"),"iframe"===t&&(n=e.upload?p:h),new n(e)}function o(e){var t=e.upload="multipart/form-data"===(e.headers||d.o)["Content-Type"],n=!1;try{var o=(location.protocol+"//"+location.host).toLowerCase(),i=d.url2origin(e.url);n=o!==i}catch(error){}return e.cors=n,t||n||e.mode?r(e):new m(e)}function i(e){var t=g[e];t&&(t.req.destroy(),delete g[e])}function s(e,t){t={data:t};var n=e.result.headers;return n&&(t.headers=e.req.header(n)),t}function a(e,t,n){var r=g[e];if(r){"onload"===t&&r.result&&(n=s(r,n)),i(e);var o={type:t,result:n};y(o),o.stopped||r[t](o.result)}}function c(e,t){a(e,"onload",t)}function u(e,t){a(e,"onerror",t)}function l(e,t){var n=d.genUrlSep(e);return t=t||"",d.isObject(t)&&(t=d.object2query(t)),t&&(e+=n+t),e}function f(e,t){t=t||{};var n=d.uniqueID(),r={result:t.result,onload:t.onload||d.f,onerror:t.onerror||d.f};g[n]=r,t.onload=c.bind(null,n),t.onerror=u.bind(null,n),t.query&&(e=l(e,t.query));var i=t.method||"";return i&&!/get/i.test(i)||!t.data||(e=l(e,t.data),t.data=null),t.url=e,r.req=o(t),n}var d=n(2),m=n(3),p=n(7),h=n(10),g={},y=d.f;f.filter=function(e){d.isFunction(e)&&(y=e)},f.abort=function(e){var t=g[e];t&&t.req.abort()},e.exports=f},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){var t=this;e.onuploading&&t.on("uploading",e.onuploading),s.call(t,e)}var o=n(2),i=n(4),s=n(5),a=s.prototype,c=r.prototype=Object.create(a);c.doSend=function(){var e=this,t=e.options,n=t.headers,r=e.xhr=new XMLHttpRequest;if("multipart/form-data"===n["Content-Type"]){delete n["Content-Type"],r.upload.onprogress=e.onProgress.bind(e),r.upload.onload=e.onProgress.bind(e);var s=t.data;t.data=new window.FormData,s&&i.getKeys(s,t.putFileAtEnd).forEach(function(e){var n=s[e];n.tagName&&"INPUT"===n.tagName.toUpperCase()?"file"===n.type&&[].forEach.call(n.files,function(e){t.data.append(o.dataset(n,"name")||n.name||e.name||"file-"+o.uniqueID(),e)}):t.data.append(e,n)})}r.onreadystatechange=e.onStateChange.bind(e),0!==t.timeout&&(e.timer=setTimeout(e.onTimeout.bind(e),t.timeout)),r.open(t.method,t.url,!t.sync),Object.keys(n).forEach(function(e){r.setRequestHeader(e,n[e])}),t.cookie&&"withCredentials"in r&&(r.withCredentials=!0),r.send(t.data),e.afterSend()},c.onProgress=function(e){e.lengthComputable&&e.loaded<=e.total&&this.emit("uploading",e)},c.onStateChange=function(){var e=this,t=e.xhr;4===t.readyState&&e.onLoad({status:t.status,result:t.responseText||""})},c.getResponseHeader=function(e){var t=this.xhr;return t?t.getResponseHeader(e):""},c.destroy=function(){var e=this;clearTimeout(e.timer);try{e.xhr.onreadystatechange=o.f,e.xhr.abort()}catch(e){}a.destroy.call(e)},e.exports=r},function(e,t,n){"use strict";var r=n(2),o={};o.isFileInput=function(e){var t=r.getGlobal();return e.tagName&&"INPUT"===e.tagName.toUpperCase()||t.Blob&&e instanceof t.Blob},o.getKeys=function(e,t){var n=Object.keys(e);return t&&n.sort(function(t,n){var r=o.isFileInput(e[t]),i=o.isFileInput(e[n]);return r===i?0:r?1:-1}),n},e.exports=o},function(e,t,n){"use strict";function r(e){var t=this;e.onload&&t.once("load",e.onload),e.onerror&&t.once("error",e.onerror),e.onbeforesend&&t.once("beforesend",e.onbeforesend),e.onaftersend&&t.once("aftersend",e.onaftersend),e=t.options=o.fetch({method:"GET",url:"",sync:!1,data:null,headers:{},cookie:!1,timeout:6e4,type:"text",form:null,input:null,putFileAtEnd:!1,proxyUrl:""},e);var n=e.headers,r="Content-Type";o.notexist(n[r])&&(n[r]="application/x-www-form-urlencoded"),t.send()}var o=n(2),i=o.f,s=n(6),a=r.prototype=Object.create(s.prototype);a.send=function(){var e=this,t=e.options;setTimeout(function(){try{try{e.emit("beforesend",t)}catch(error){}e.doSend()}catch(error){e.onError("serverError","请求失败:"+error.message)}},0)},a.doSend=i,a.afterSend=function(){var e=this;setTimeout(function(){e.emit("aftersend",e.options)},0)},a.onLoad=function(e){var t=this,n=t.options,r=e.status,o=e.result;if(0!==(""+r).indexOf("2"))return void t.onError("serverError","服务器返回异常状态",{status:r,result:o});if("json"===n.type)try{o=JSON.parse(o)}catch(e){return void t.onError("parseError",o)}t.emit("load",o)},a.onError=function(e,t,n){var r=o.isObject(n)?n:{};r.code=e||"error",r.message=t||"发生错误",this.emit("error",r)},a.onTimeout=function(){this.onError("timeout","请求超时")},a.abort=function(){this.onError("abort","客户端中止")},a.header=function(e){var t=this;if(!o.isArray(e))return t.getResponseHeader(e||"");var n={};return e.forEach(function(e){n[e]=t.header(e)}),n},a.getResponseHeader=i,a.destroy=i,e.exports=r},function(e,t,n){var r;!function(t){"use strict";function o(){}function i(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function s(e){return function(){return this[e].apply(this,arguments)}}function a(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&a(e.listener)}var c=o.prototype,u=t.EventEmitter;c.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},c.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},c.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},c.addListener=function(e,t){if(!a(t))throw new TypeError("listener must be a function");var n,r=this.getListenersAsObject(e),o="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&i(r[n],t)===-1&&r[n].push(o?t:{listener:t,once:!1});return this},c.on=s("addListener"),c.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},c.once=s("addOnceListener"),c.defineEvent=function(e){return this.getListeners(e),this},c.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},c.removeListener=function(e,t){var n,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(n=i(o[r],t),n!==-1&&o[r].splice(n,1));return this},c.off=s("removeListener"),c.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},c.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},c.manipulateListeners=function(e,t,n){var r,o,i=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)i.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(o=t[r])&&("function"==typeof o?i.call(this,r,o):s.call(this,r,o));return this},c.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},c.removeAllListeners=s("removeEvent"),c.emitEvent=function(e,t){var n,r,o,i,s,a=this.getListenersAsObject(e);for(i in a)if(a.hasOwnProperty(i))for(n=a[i].slice(0),
  o=0;o<n.length;o++)r=n[o],r.once===!0&&this.removeListener(e,r.listener),s=r.listener.apply(this,t||[]),s===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},c.trigger=s("emitEvent"),c.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},c.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},c._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},c._getEvents=function(){return this._events||(this._events={})},o.noConflict=function(){return t.EventEmitter=u,o},r=function(){return o}.call(t,n,t,e),!(void 0!==r&&(e.exports=r))}(this||{})},function(e,t,n){"use strict";function r(e){var t=this;t.init(),s.call(t,e)}var o=n(2),i=n(4),s=n(5),a=n(8),c="NEJ-UPLOAD-RESULT:",u={},l=s.prototype,f=r.prototype=Object.create(l);f.init=function(){function e(e){var t=e.data;if(0===t.indexOf(c)){t=JSON.parse(t.replace(c,""));var n=t.key,r=u[n];r&&(delete u[n],t.result=decodeURIComponent(t.result||""),r.onLoad(t.result))}}function t(){if(!n){n=!0;var t=o.getGlobal();t.postMessage?o.on(t,"message",e):(a.addMsgListener(e),a.startTimer())}}var n=!1;return function(){t()}}(),f.doSend=function(){function e(){f.forEach(function(e,t){var n=d[t];n.parentNode&&(e.name=n.name,o.isFunction(e.setAttribute)&&e.setAttribute("form",n.getAttribute("form")),n.parentNode.replaceChild(e,n))})}var t=this,n=t.options,r=t.key="zoro-ajax-upload-iframe-"+o.uniqueID();u[r]=t;var s=t.form=o.html2node('<form style="display:none;"></form>');document.body.appendChild(s),s.target=r,s.method="POST",s.enctype="multipart/form-data",s.encoding="multipart/form-data";var a=n.url,c=o.genUrlSep(a);s.action=a+c+"_proxy_=form";var l=n.data,f=[],d=[];l&&i.getKeys(l,n.putFileAtEnd).forEach(function(e){var t=l[e];if(t.tagName&&"INPUT"===t.tagName.toUpperCase()){if("file"===t.type){var n=t,r=n.cloneNode(!0);n.parentNode.insertBefore(r,n);var i=o.dataset(n,"name");i&&(n.name=i),s.appendChild(n),o.isFunction(n.setAttribute)&&(n.setAttribute("form",""),n.removeAttribute("form")),f.push(t),d.push(r)}}else{var a=o.html2node('<input type="hidden"/>');a.name=e,a.value=t,s.appendChild(a)}});var m=t.iframe=o.createIframe({name:r,onload:function(){return t.aborted?void e():(o.on(m,"load",t.checkResult.bind(t)),s.submit(),e(),void t.afterSend())}})},f.checkResult=function(){var e,t,n=this;try{if(e=n.iframe.contentWindow.document.body,t=(e.innerText||e.textContent||"").trim(),t.indexOf(c)>=0||e.innerHTML.indexOf(c)>=0)return}catch(error){return}n.onLoad(t)},f.onLoad=function(e){var t=this;l.onLoad.call(t,{status:200,result:e}),o.remove(t.form),o.remove(t.iframe),l.destroy.call(t)},f.destroy=function(){o.remove(this.iframe),o.remove(this.form)},f.abort=function(){var e=this;e.aborted=!0,delete u[e.key],l.abort.call(e)},e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=n(9),i=r(o),s=i["default"].getGlobal(),a={},c=s.name||"_parent",u=[],l="MSG|",f=[];a.addMsgListener=function(e){u.push(e)};var d=function(e){for(var t=0,n=u.length;t<n;t++)try{u[t].call(null,e)}catch(e){}},m=function(){var e=/^([\w]+?:\/\/.*?(?=\/|$))/i;return function(t){return t=t||"",e.test(t)?RegExp.$1:"*"}}(),p=function(){var e=unescape(s.name||"").trim();if(e&&0===e.indexOf(l)){s.name="";var t=i["default"].string2object(e.replace(l,""),"|"),n=(t.origin||"").toLowerCase();n&&"*"!==n&&0!==location.href.toLowerCase().indexOf(n)||d({data:JSON.parse(t.data||"null"),source:s.frames[t.self]||t.self,origin:m(t.ref||document.referrer)})}},h=function(){var e,t=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return!0;return!1};return function(){if(f.length){e=[];for(var n,r=f.length-1;r>=0;r--)n=f[r],t(e,n.w)||(e.push(n.w),f.splice(r,1),n.w.name=n.d);e=null}}}(),g=a.startTimer=function(){var e=!1;return function(){e||(e=!0,s.postMessage||(setInterval(h,100),setInterval(p,20)))}}();a.postMessage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(i["default"].fillUndef(t,{origin:"*",source:c}),s.postMessage){var n=t.data;s.FormData||(n=JSON.stringify(n)),e.postMessage(n,t.origin)}else{if(g(),i["default"].isObject(t)){var r={};r.origin=t.origin||"",r.ref=location.href,r.self=t.source,r.data=JSON.stringify(t.data),t=l+i["default"].object2string(r,"|",!0)}f.unshift({w:e,d:escape(t)})}},e.exports=a},function(e,t,n){"use strict";e.exports=n(2)},function(e,t,n){"use strict";function r(e){var t=this;t.init(),s.call(t,e)}var o=n(2),i=n(8),s=n(5),a={},c=s.prototype,u=r.prototype=Object.create(c);u.init=function(){function e(e){var t=e.data;if(0===t.indexOf(n)){t=JSON.parse(t.replace(n,""));var r=t.key,o=a[r];o&&(delete a[r],t.result=decodeURIComponent(t.result||""),o.onLoad(t))}}function t(){if(!r){r=!0;var t=o.getGlobal();t.postMessage?o.on(t,"message",e):i.addMsgListener(e)}}var n="NEJ-AJAX-DATA:",r=!1;return function(){t()}}(),u.doSend=function(){var e=this,t=e.options,n=o.url2origin(t.url),r=t.proxyUrl||n+"/res/nej_proxy_frame.html",s=a[r];if(o.isArray(s))return void s.push(e.doSend.bind(e,t));if(!s)return a[r]=[e.doSend.bind(e,t)],void o.createIframe({src:r,onload:function(e){var t=a[r];a[r]=o.target(e).contentWindow,t.forEach(function(e){try{e()}catch(e){}})}});if(!e.aborted){var c=e.key=o.uniqueID();a[c]=e;var u=o.fetch({method:"GET",url:"",data:null,headers:{},timeout:0},t);u.key=c,i.postMessage(s,{data:u}),e.afterSend()}},u.abort=function(){var e=this;e.aborted=!0,delete a[e.key],c.abort.call(e)},e.exports=r},function(e,t,n){"use strict";var r=n(2),o=n(1),i=function(){var e=/json/i,t=/post/i;return function(n,i){i=i||{};var s=i.data=i.data||{},a=i.headers=i.headers||{},c=r.checkWithDefault(a,"Accept","application/json"),u=r.checkWithDefault(a,"Content-Type","application/json");return e.test(c)&&(i.type="json"),t.test(i.method)&&e.test(u)&&(i.data=JSON.stringify(s)),o(n,i)}}();e.exports=i},function(e,t,n){"use strict";var r=n(1),o=function(e,t){return t.method="POST",t.headers=t.headers||{},t.headers["Content-Type"]="multipart/form-data",t.timeout=0,t.type=t.type||"json",r(e,t)};e.exports=o}])})},function(e,t,n){"use strict";function r(e){switch(i.notundef(e.type)?i.verifyFileType(e.type):e.type="file",i.verifyOptions(e,"file"),i.verifyOptions(e.file,"url ext size md5",!0,"file."),e.type){case"image":s.verifyFile(e.file);break;case"audio":a.verifyFile(e.file);break;case"video":c.verifyFile(e.file)}o.call(this,e),this.attach=JSON.stringify(e.file)}var o=n(12),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return e.attach=e.attach?""+e.attach:"",t.file=e.attach?JSON.parse(e.attach):{},"audio"===t.type&&(t.file.mp3Url=t.file.url+"?audioTrans&type=mp3"),t},e.exports=r;var s=n(104),a=n(101),c=n(109)},function(e,t,n){"use strict";function r(e){switch(i.notundef(e.type)?i.verifyFileType(e.type):e.type="file",i.verifyOptions(e,"file"),i.verifyOptions(e.file,"url ext size md5",!0,"file."),e.type){case"image":s.verifyFile(e.file);break;case"audio":a.verifyFile(e.file);break;case"video":c.verifyFile(e.file)}o.call(this,e),this.attach=JSON.stringify(e.file)}var o=n(13),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return e.attach=e.attach?""+e.attach:"",t.file=e.attach?JSON.parse(e.attach):{},"audio"===t.type&&(t.file.mp3Url=t.file.url+"?audioTrans&type=mp3"),t},e.exports=r;var s=n(113),a=n(110),c=n(118)},function(e,t,n){"use strict";function r(e){o.merge(this,e),o.notundef(this.gender)&&(o.verifyParamValid("gender",this.gender,r.validGenders),this.gender=i[this.gender]),o.notundef(this.email)&&""!==this.email&&o.verifyEmail("email",this.email),o.notundef(this.birth)&&""!==this.birth&&o.verifyBirth("birth",this.birth),o.notundef(this.tel)&&""!==this.tel&&o.verifyTel("tel",this.tel)}var o=n(1),i={unknown:0,male:1,female:2},s={0:"unknown",1:"male",2:"female"};r.reverse=function(e){var t=o.filterObj(e,"account nick avatar sign gender email birth tel custom createTime updateTime");return o.notundef(t.gender)&&(t.gender=s[t.gender]),o.notundef(t.createTime)&&(t.createTime=+t.createTime),o.notundef(t.updateTime)&&(t.updateTime=+t.updateTime),t},r.reverseUsers=function(e){return e.map(function(e){return r.reverse(e)})},r.validGenders=Object.keys(i),e.exports=r},function(e,t,n){"use strict";function r(e){o.verifyOptions(e,"type"),o.verifyParamValid("type",e.type,r.validTypes),o.merge(this,e),this.type=i[e.type]}var o=n(1),i={stripmeta:0,blur:2,quality:3,crop:4,rotate:5,thumbnail:7,interlace:9},s={0:"stripmeta",1:"type",2:"blur",3:"quality",4:"crop",5:"rotate",6:"pixel",7:"thumbnail",8:"watermark",9:"interlace",10:"tmp"};r.validTypes=Object.keys(i),r.reverse=function(e){var t=o.copy(e);return t.type=s[t.type],t},r.reverseImageOps=function(e){return e.map(function(e){return r.reverse(e)})},e.exports=r},function(e,t,n){"use strict";var r=n(1),o={};o.fromDataURL=r.blobFromDataURL,e.exports=o},function(e,t){function n(e){var t=r.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}e.exports=n;var r=Object.prototype.toString},function(e,t){e.exports=function n(e,t){"use strict";var r,o,i=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,s=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,u=/^0/,l=function(e){return n.insensitive&&(""+e).toLowerCase()||""+e},f=l(e).replace(s,"")||"",d=l(t).replace(s,"")||"",m=f.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=d.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=parseInt(f.match(c),16)||1!==m.length&&f.match(a)&&Date.parse(f),g=parseInt(d.match(c),16)||h&&d.match(a)&&Date.parse(d)||null;if(g){if(h<g)return-1;if(h>g)return 1}for(var y=0,v=Math.max(m.length,p.length);y<v;y++){if(r=!(m[y]||"").match(u)&&parseFloat(m[y])||m[y]||0,o=!(p[y]||"").match(u)&&parseFloat(p[y])||p[y]||0,isNaN(r)!==isNaN(o))return isNaN(r)?1:-1;if(typeof r!=typeof o&&(r+="",o+=""),r<o)return-1;if(r>o)return 1}return 0}},function(e,t,n){!function(t,n){e.exports=n()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}t.__esModule=!0;var i=n(1),s=o(i),a=n(3),c=o(a),u=n(4),l=o(u),f=n(5),d=o(f),m=n(6),p=o(m),h=n(8),g=r(h),y=n(2),v=r(y),b=n(9),M=o(b),T=n(10),k=o(T),S=n(11),w=r(S),C=n(12),O=o(C),I=n(7),x=o(I),P=n(13),_=o(P),E=O.merge({},s,c,l,d,p,{forOwn:g["default"],getGlobal:v["default"]},M,k,{mixin:w["default"]},O,x,_);delete E.__esModule,t["default"]=E,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=(0,a["default"])(),n=void 0;n=e.split(",")[0].indexOf("base64")>=0?t.atob(e.split(",")[1]):t.decodeURIComponent(e.split(",")[1]);for(var r=e.split(",")[0].split(":")[1].split(";")[0],o=new Uint8Array(n.length),i=0;i<n.length;i++)o[i]=n.charCodeAt(i);return new t.Blob([o],{type:r})}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/jpeg",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e.toBlob)e.toBlob(t,n,r);else{var i=e.toDataURL(n,r);t(o(i))}}t.__esModule=!0,t.blobFromDataURL=o,t.blobFromCanvas=i;var s=n(2),a=r(s)},function(e,t){(function(n){"use strict";t.__esModule=!0,t["default"]=function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof n?n:{}},e.exports=t["default"]}).call(t,function(){return this}())},function(e,t){"use strict";function n(e){var t=!1,n="Webkit Moz ms O".split(" "),r=document.createElement("div"),o=null;if(e=e.toLowerCase(),void 0!==r.style[e]&&(t=!0),t===!1){o=e.charAt(0).toUpperCase()+e.substr(1);for(var i=0;i<n.length;i++)if(void 0!==r.style[n[i]+o]){t=!0;break}}return t}t.__esModule=!0,t.detectCSSFeature=n},function(e,t){"use strict";t.__esModule=!0;t.o={},t.emptyObj={},t.f=function(){},t.emptyFunc=function(){},t.regBlank=/\s+/gi,t.regWhiteSpace=/\s+/gi},function(e,t){"use strict";function n(e,t){t=t||2;for(var n=""+e;n.length<t;)n="0"+n;return n}function r(e){return""+e.getFullYear()}function o(e){return n(e.getMonth()+1)}function i(e){return n(e.getDate())}function s(e){return n(e.getHours())}function a(e){return n(e.getMinutes())}function c(e){return n(e.getSeconds())}function u(e){return n(e.getMilliseconds(),3)}function l(e){return e=""+e,new Date(e.replace(/-/g,"/").replace("T"," "))}t.__esModule=!0,t.fix=n,t.getYearStr=r,t.getMonthStr=o,t.getDayStr=i,t.getHourStr=s,t.getMinuteStr=a,t.getSecondStr=c,t.getMillisecondStr=u,t.dateFromDateTimeLocal=l;t.format=function(){var e=/yyyy|MM|dd|hh|mm|ss|SSS/g,t={yyyy:r,MM:o,dd:i,hh:s,mm:a,ss:c,SSS:u};return function(n,r){return n=new Date(n),isNaN(+n)?"invalid date":(r=r||"yyyy-MM-dd",r.replace(e,function(e){return t[e](n)}))}}()},function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;for(;t.parentNode;){if(t.parentNode===e)return!0;t=t.parentNode}return!1}function o(e){var t=e.parentNode||document.body;e=e.cloneNode(!0),e.style.display="block",e.style.opacity=0,e.style.height="auto",t.appendChild(e);var n=e.offsetHeight;return t.removeChild(e),n}function i(e){e.parentNode&&e.parentNode.removeChild(e)}function s(e,t,n){return(0,l.exist)(n)?void e.setAttribute("data-"+t,n):e.getAttribute("data-"+t)}function a(e){return e.target||e.srcElement}function c(e){function t(r){n.src&&(e.multi||p(n,"load",t),e.onload(r))}e=e||{};var n;if(e.name)try{n=document.createElement('<iframe name="'+e.name+'"></iframe>'),n.frameBorder=0}catch(error){n=document.createElement("iframe"),n.name=e.name}else n=document.createElement("iframe");e.visible||(n.style.display="none"),(0,l.isFunction)(e.onload)&&d(n,"load",t);var r=e.parent;(r||document.body).appendChild(n);var o=e.src||"about:blank";return setTimeout(function(){n.src=o},0),n}function u(e){var t=document.createElement("div");t.innerHTML=e;var n=[],r=void 0,o=void 0;if(t.children)for(r=0,o=t.children.length;r<o;r++)n.push(t.children[r]);else for(r=0,o=t.childNodes.length;r<o;r++){var i=t.childNodes[r];1===i.nodeType&&n.push(i)}return n.length>1?t:n[0]}t.__esModule=!0,t.off=t.removeEventListener=t.on=t.addEventListener=void 0,t.containsNode=r,t.calcHeight=o,t.remove=i,t.dataset=s,t.target=a,t.createIframe=c,t.html2node=u;var l=n(7),f=t.addEventListener=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},d=t.on=f,m=t.removeEventListener=function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)},p=t.off=m},function(e,t){"use strict";function n(e){return Object.prototype.toString.call(e).slice(8,-1)}function r(e){return n(e).toLowerCase()}function o(e){return"string"===r(e)}function i(e){return"number"===r(e)}function s(e){return"boolean"===r(e)}function a(e){return"array"===r(e)}function c(e){return"function"===r(e)}function u(e){return"date"===r(e)}function l(e){return"regexp"===r(e)}function f(e){return"error"===r(e)}function d(e){return null===e}function m(e){return null!==e}function p(e){return"undefined"==typeof e}function h(e){return"undefined"!=typeof e}function g(e){return h(e)&&m(e)}function y(e){return p(e)||d(e)}function v(e){return g(e)&&"object"===r(e)}function b(e){return y(e)||(o(e)||a(e))&&0===e.length}t.__esModule=!0,t.getClass=n,t.typeOf=r,t.isString=o,t.isNumber=i,t.isBoolean=s,t.isArray=a,t.isFunction=c,t.isDate=u,t.isRegExp=l,t.isError=f,t.isnull=d,t.notnull=m,t.undef=p,t.notundef=h,t.exist=g,t.notexist=y,t.isObject=v,t.isEmpty=b},function(e,t){"use strict";t.__esModule=!0,t["default"]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments[2];for(var r in e)e.hasOwnProperty(r)&&t.call(n,r,e[r])},e.exports=t["default"]},function(e,t){"use strict";t.__esModule=!0;t.uniqueID=function(){var e=0;return function(){return""+e++}}()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return(0,c.isString)(e)&&0===e.indexOf("{")&&e.lastIndexOf("}")===e.length-1}function i(e){try{o(e)&&(e=JSON.parse(e)),(0,c.isObject)(e)&&(0,a["default"])(e,function(t,n){switch((0,c.typeOf)(n)){case"string":case"object":e[t]=i(n)}})}catch(error){}return e}t.__esModule=!0,t.isJSON=o,t.parseJSON=i;var s=n(8),a=r(s),c=n(7)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(8),i=r(o);t["default"]=function(e,t){(0,i["default"])(t,function(t,n){e[t]=n})},e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return JSON.parse(JSON.stringify(e))}function i(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach(function(t){(0,d["default"])(e,t)}),e}function s(e,t){return(0,p["default"])(t,function(t,n){(0,h.undef)(e[t])&&(e[t]=n)}),e}function a(e,t,n){var r=e[t]||e[t.toLowerCase()];return(0,h.notexist)(r)&&(r=n,e[t]=r),r}function c(e,t){return(0,p["default"])(e,function(n,r){(0,h.exist)(t[n])&&(e[n]=t[n])}),e}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n={};return e.split(t).forEach(function(e){var t=e.split("="),r=t.shift();r&&(n[decodeURIComponent(r)]=decodeURIComponent(t.join("=")))}),n}function l(e,t,n){if(!e)return"";var r=[];return(0,p["default"])(e,function(e,t){(0,h.isFunction)(t)||((0,h.isDate)(t)?t=t.getTime():(0,h.isArray)(t)?t=t.join(","):(0,h.isObject)(t)&&(t=JSON.stringify(t)),n&&(t=encodeURIComponent(t)),r.push(encodeURIComponent(e)+"="+t))}),r.join(t||",")}t.__esModule=!0,t.simpleClone=o,t.merge=i,t.fillUndef=s,t.checkWithDefault=a,t.fetch=c,t.string2object=u,t.object2string=l;var f=n(11),d=r(f),m=n(8),p=r(m),h=n(7)},function(e,t,n){"use strict";function r(e){return e.indexOf("?")<0?"?":"&"}function o(e){return(0,i.object2string)(e,"&",!0)}t.__esModule=!0,t.url2origin=void 0,t.genUrlSep=r,t.object2query=o;var i=n(12);t.url2origin=function(){var e=/^([\w]+?:\/\/.*?(?=\/|$))/i;return function(t){return e.test(t||"")?RegExp.$1.toLowerCase():""}}()}])})},function(e,t,n){var r;(function(o){!function(i,s){"use strict";function a(){return"undefined"!=typeof i?i:"undefined"!=typeof self?self:"undefined"!=typeof o?o:{}}i=a();var c,u=i.IDBKeyRange||i.webkitIDBKeyRange,l={readonly:"readonly",readwrite:"readwrite"},f=Object.prototype.hasOwnProperty,d=function(){if(!c&&(c=i.indexedDB||i.webkitIndexedDB||i.mozIndexedDB||i.oIndexedDB||i.msIndexedDB||(null===i.indexedDB&&i.shimIndexedDB?i.shimIndexedDB:s),!c))throw"IndexedDB required";return c},m=function(e){return e},p=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},h=function(e){return"function"==typeof e},g=function(e){return"number"===p(e)},y=function(e){return"array"===p(e)},v=function(e){return e===s},b=function(e,t){var n=this,r=!1;this.name=t,this.getIndexedDB=function(){return e},this.add=function(t){if(r)throw"Database has been closed";for(var o=[],i=0,s=0;s<arguments.length-1;s++)if(Array.isArray(arguments[s+1]))for(var a=0;a<arguments[s+1].length;a++)o[i]=arguments[s+1][a],i++;else o[i]=arguments[s+1],i++;var c=e.transaction(t,l.readwrite),u=c.objectStore(t);return new Promise(function(e,t){o.forEach(function(e){var t;if(e.item&&e.key){var n=e.key;e=e.item,t=u.add(e,n)}else t=u.add(e);t.onsuccess=function(t){var n=t.target,r=n.source.keyPath;null===r&&(r="__id__"),Object.defineProperty(e,r,{value:n.result,enumerable:!0})}}),c.oncomplete=function(){e(o,n)},c.onerror=function(e){e.preventDefault(),t(e)},c.onabort=function(e){t(e)}})},this.updateAndDelete=function(t,n,o){if(r)throw"Database has been closed";var i=e.transaction(t,l.readwrite),s=i.objectStore(t),a=s.keyPath;return new Promise(function(e,t){n.forEach(function(e){if(e.item&&e.key){var t=e.key;e=e.item,s.put(e,t)}else s.put(e)}),o.forEach(function(e){s["delete"](e[a])}),i.oncomplete=function(){e([n,o])},i.onerror=function(e){t(e)}})},this.update=function(t){if(r)throw"Database has been closed";for(var o,i=[],s=1;s<arguments.length;s++)o=arguments[s],Array.isArray(o)?i=i.concat(o):i.push(o);var a=e.transaction(t,l.readwrite),c=a.objectStore(t);c.keyPath;return new Promise(function(e,t){i.forEach(function(e){var t;if(e.item&&e.key){var n=e.key;e=e.item,t=c.put(e,n)}else t=c.put(e);t.onsuccess=function(e){},t.onerror=function(e){}}),a.oncomplete=function(){e(i,n)},a.onerror=function(e){t(e)},a.onabort=function(e){t(e)}})},this.remove=function(t,n){if(r)throw"Database has been closed";var o=e.transaction(t,l.readwrite),i=o.objectStore(t);return new Promise(function(e,t){Array.isArray(n)||(n=[n]),n.forEach(function(e){i["delete"](e)}),o.oncomplete=function(){e(n)},o.onerror=function(e){t(e)},o.onabort=function(e){t(e)}})},this.clear=function(t){if(r)throw"Database has been closed";var n=e.transaction(t,l.readwrite),o=n.objectStore(t);o.clear();return new Promise(function(e,t){n.oncomplete=function(){e()},n.onerror=function(e){t(e)}})},this.close=function(){r||(e.close(),r=!0,delete S[t])},this.get=function(t,n){if(r)throw"Database has been closed";var o=e.transaction(t),i=o.objectStore(t),s=i.get(n);return new Promise(function(e,t){s.onsuccess=function(t){e(t.target.result)},o.onerror=function(e){t(e)}})},this.query=function(t,n){if(r)throw"Database has been closed";return new M(t,e,n)},this.count=function(t,n){if(r)throw"Database has been closed";var o=e.transaction(t);o.objectStore(t)};for(var o=0,i=e.objectStoreNames.length;o<i;o++)!function(e){n[e]={};for(var t in n)f.call(n,t)&&"close"!==t&&(n[e][t]=function(t){return function(){var r=[e].concat([].slice.call(arguments,0));return n[t].apply(n,r)}}(t))}(e.objectStoreNames[o])},M=function(e,t,n){var r=this,o=!1,i=!1,a=function(r,a,c,f,d,m,p){return new Promise(function(g,y){var v=o||i?l.readwrite:l.readonly,b=t.transaction(e,v),M=b.objectStore(e),T=n?M.index(n):M,k=r?u[r].apply(null,a):null,S=[],w=[k],C=0;d=d?d:null,m=m?m:[],"count"!==c&&w.push(f||"next");var O=!!o&&Object.keys(o),I=function(e){for(var t=0;t<O.length;t++){var n=O[t],r=o[n];r instanceof Function&&(r=r(e)),e[n]=r}return e};T[c].apply(T,w).onsuccess=function(e){var t=e.target.result;if("number"==typeof t)S=t;else if(t)if(null!==d&&d[0]>C)C=d[0],t.advance(d[0]);else if(null!==d&&C>=d[0]+d[1]);else{var n=!0,r="value"in t?t.value:t.key;m.forEach(function(e){e&&e.length&&(2===e.length?n=n&&r[e[0]]===e[1]:h(e[0])&&(n=n&&e[0].apply(s,[r])))}),n&&(C++,S.push(p(r)),i?t["delete"]():o&&(r=I(r),t.update(r))),t["continue"]()}},b.oncomplete=function(){g(S)},b.onerror=function(e){y(e)},b.onabort=function(e){y(e)}})},c=function(e,t){var n="next",r="openCursor",s=[],c=null,u=m,l=!1,f=function(){return a(e,t,r,l?n+"unique":n,c,s,u)},d=function(){return n=null,r="count",{execute:f}},p=function(){return c=y(arguments[0])?arguments[0]:Array.prototype.slice.call(arguments,0,2),1==c.length&&c.unshift(0),g(c[1])||(c=null),{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}},b=function(e){return e=!!v(e)||!!e,e&&(r="openKeyCursor"),{execute:f,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}},M=function(){return s.push(Array.prototype.slice.call(arguments,0,2)),{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}},T=function(e){return e=!!v(e)||!!e,n=e?"next":"prev",{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}},k=function(e){return e=!!v(e)||!!e,n=e?"prev":"next",{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}},S=function(e){return e=!!v(e)||!!e,l=e,{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}},w=function(e){return o=e,{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}},C=function(e){return h(e)&&(u=e),{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}},O=function(e){return e=!!v(e)||!!e,i=e,{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}};return{execute:f,count:d,keys:b,filter:M,asc:T,desc:k,distinct:S,modify:w,limit:p,map:C,remove:O}};"only bound upperBound lowerBound".split(" ").forEach(function(e){r[e]=function(){return new c(e,arguments)}}),this.filter=function(){var e=new c(null,null);return e.filter.apply(e,arguments)},this.all=function(){return this.filter()}},T=function(e,t,n){"function"==typeof t&&(t=t());for(var r in t){var o,i=t[r];o=!f.call(t,r)||n.objectStoreNames.contains(r)?e.currentTarget.transaction.objectStore(r):n.createObjectStore(r,i.key);for(var s in i.indexes){var a=i.indexes[s];try{o.index(s)}catch(e){o.createIndex(s,a.key||s,Object.keys(a).length?a:{unique:!1})}}}},k=function(e,t,n,r){var o=e.target.result,i=new b(o,t);return S[t]=o,Promise.resolve(i)},S={},w={version:"0.10.2",open:function(e){var t;return new Promise(function(n,r){if(S[e.server])k({target:{result:S[e.server]}},e.server,e.version,e.schema).then(n,r);else{try{t=d().open(e.server,e.version)}catch(e){r(e)}t.onsuccess=function(t){k(t,e.server,e.version,e.schema).then(n,r)},t.onupgradeneeded=function(t){T(t,e.schema,t.target.result)},t.onerror=function(e){r(e)}}})},remove:function(e){return new Promise(function(t,n){if(!e)return t();typeof e===b&&(e=e.name);var r;"string"==typeof e&&(r=S[e]),r&&"function"==typeof r.close&&r.close();var o;try{o=d().deleteDatabase(e)}catch(e){n(e)}o.onsuccess=function(n){delete S[e],t(e)},o.onerror=function(e){n(e)},o.onblocked=function(e){n(e)}})}};"undefined"!=typeof e&&"undefined"!=typeof e.exports?e.exports=w:(r=function(){return w}.call(t,n,t,e),!(r!==s&&(e.exports=r)))}(window)}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){var t=this;return t.subType="chatroom",e.Protocol=i,e.Message=c,e.constructor=r,t.init(e)}var o=n(8),i=n(21),s=n(6),a=n(47),c=n(105),u=n(1),l=u.verifyOptions,f=u.verifyParamType;r.getInstance=o.getInstance,r.genInstanceName=function(e){return u.verifyOptions(e,"chatroomId"),"Chatroom-account-"+e.account+"-chatroomId-"+e.chatroomId};var d=r.fn=r.prototype=Object.create(o.prototype);r.info=d.info=s.info,d.getChatroom=function(e){var t=this;t.processCallback(e),t.sendCmd("getChatroom",e)},d.updateChatroom=function(e){l(e,"chatroom needNotify"),f("needNotify",e.needNotify,"boolean"),this.processCustom(e),this.processCallback(e),e.chatroom=new a(e.chatroom),this.sendCmd("updateChatroom",e)},d.closeChatroom=function(e){var t=this;t.processCustom(e),t.processCallback(e),t.sendCmd("closeChatroom",e)},e.exports=r,n(73),n(72)},function(e,t,n){"use strict";t.__esModule=!0,t["default"]=function(e){u.merge(e,{platform:r,xhr:o,io:i,naturalSort:s,deepAccess:a,db:c,util:u,support:l,blob:f,ajax:d,Promise:m})};var r=n(11),o=n(68),i=n(16),s=n(32),a=n(24),c=n(34),u=n(1),l=n(39),f=n(30),d=n(25),m=n(2).Promise;e.exports=t["default"]},function(e,t,n){"use strict";function r(e){var t=this;i(e.nick)&&(t.nick=""+e.nick),i(e.avatar)&&(t.avatar=""+e.avatar),i(e.custom)&&(t.custom=""+e.custom)}var o=n(1),i=o.notundef,s={"-1":"restricted",0:"common",1:"owner",2:"manager"};r.reverse=function(e){var t=o.copy(e);return i(t.chatroomId)&&(t.chatroomId=""+t.chatroomId),i(t.type)&&(t.type=s[t.type]),i(t.level)&&(t.level=+t.level),i(t.online)&&(t.online=1===+t.online),i(t.enterTime)&&(t.enterTime=+t.enterTime),i(t.guest)&&(t.guest=1===+t.guest),i(t.blacked)&&(t.blacked=1===+t.blacked),i(t.gaged)&&(t.gaged=1===+t.gaged),i(t.valid)&&(t.valid=1===+t.valid),i(t.updateTime)&&(t.updateTime=+t.updateTime),i(t.tempMuted)?t.tempMuted=1===+t.tempMuted:t.tempMuted=!1,i(t.tempMuteDuration)?t.tempMuteDuration=+t.tempMuteDuration:t.tempMuteDuration=0,t.online||delete t.enterTime,t.guest&&(t.type="guest",delete t.valid),"common"!==t.type&&delete t.level,delete t.guest,t},r.reverseMembers=function(e){return e.map(function(e){return r.reverse(e)})},r.validTypes=Object.keys(s),e.exports=r},function(e,t,n){"use strict";function r(e){var t=this;i(e.shouldPushNotificationWhenPCOnline)&&(t.open=e.shouldPushNotificationWhenPCOnline?2:1)}var o=n(1),i=o.notundef;r.getDefaultConfig=function(){return{shouldPushNotificationWhenPCOnline:!0}},r.reverse=function(e){var t={shouldPushNotificationWhenPCOnline:1!==+e.open};return t},e.exports=r},function(e,t){"use strict";var n={};n.set=function(e,t,r){n[e]=t,r&&(r.support=t)},e.exports=n},function(e,t,n){"use strict";function r(){}var o=n(14);r.typeMap={text:0,image:1,audio:2,video:3,geo:4,notification:5,file:6,tip:10,custom:100};var i=r.typeReverseMap={0:"text",1:"image",2:"audio",3:"video",4:"geo",5:"notification",6:"file",10:"tip",100:"custom"};r.validTypes=Object.keys(r.typeMap),r.setFlow=function(e,t){var n=t===e.from;n&&t===e.to&&(n=o.deviceId===e.fromDeviceId),e.flow=n?"out":"in"},r.getType=function(e){var t=e.type;return i[t]||t},e.exports=r},function(e,t){"use strict";var n={link:{id:1,heartbeat:2},misc:{id:6,getNosToken:2,audioToText:5,processImage:6}},r={heartbeat:{sid:n.link.id,cid:n.link.heartbeat},getNosToken:{sid:n.misc.id,cid:n.misc.getNosToken,params:[{type:"String",name:"responseBody"}]},audioToText:{sid:n.misc.id,cid:n.misc.audioToText,params:[{type:"Property",name:"audioToText"}]},processImage:{sid:n.misc.id,cid:n.misc.processImage,params:[{type:"String",name:"url"},{type:"PropertyArray",name:"imageOps",entity:"imageOp"}]}},o={"1_2":{service:"link",cmd:"heartbeat"},"6_2":{service:"misc",cmd:"getNosToken",response:[{type:"Property",name:"nosToken"}]},"6_5":{service:"misc",cmd:"audioToText",response:[{type:"String",name:"text"}]},"6_6":{service:"misc",cmd:"processImage",response:[{type:"String",name:"url"}]}};e.exports={idMap:n,cmdConfig:r,packetConfig:o}},function(e,t,n){"use strict";var r=n(8).fn;r.isConnected=function(){return this.protocol.isConnected()},r.connect=function(){this.protocol.connect()},r.disconnect=function(){this.protocol.disconnect()}},function(e,t,n){(function(e){"use strict";var t=n(8).fn,r=n(1),o=n(3),i=n(6),s=n(57),a=n(59),c=n(30);t.sendText=function(e){var t=this;return t.processCallback(e),e.msg=new t.message.TextMessage(e),t.sendMsg(e)},t.previewFile=function(e){if(r.verifyOptions(e,"done"),e.type||(e.type="file"),r.verifyParamPresentJustOne(e,"dataURL blob fileInput wxFilePath"),e.dataURL)e.blob=c.fromDataURL(e.dataURL);else if(e.blob);else if(e.fileInput){if(e.fileInput=r.verifyFileInput(e.fileInput),e.fileInput.files&&!e.fileInput.files.length)return void e.done(o.newNoFileError("请选择"+e.type+"文件"),e);e.fileInputName=r.getFileName(e.fileInput)}this.processCallback(e);var t=s.genResponseBody(e.type)||{};this.getNosToken({responseBody:JSON.stringify(t).replace(/\"/gi,'\\"'),callback:function(t,n){return t?void e.done(t,e.callback.options):(e.nosToken=n,void this._doPreviewFile(e))}.bind(this)})},t._doPreviewFile=function(t){function n(n,a){if(t.uploaddone=c,n)return n.appendMessage("上传文件失败"),void t.done(n,t.callback.options);if(a=s.parseResponse(a,o.options.exifOrientation),a.url=i.genDownloadUrl(t.nosToken.bucket,l.Object),r.exist(t.fileInputName))a.name=t.fileInputName;else if(t.blob){var u=t.blob.name;if(a.name=u||"blob-"+a.md5,!u){var f=t.blob.type;a.ext=f.slice(f.lastIndexOf("/")+1)}}if(e.env.WEIXIN_APP&&(a.name=t.wxFilePath),!a.ext){var d=a.name.lastIndexOf(".");d===-1?a.ext="unknown":a.ext=a.name.slice(d+1)}return void t.done(null,r.copy(a))}var o=this,c=t.uploaddone,u=i.genUploadUrl(t.nosToken.bucket),l=this.assembleUploadParams(t.nosToken),f="file";
  e.env.WEIXIN_APP?(r.verifyOptions(t,"wxFilePath"),wx.uploadFile({url:u,filePath:t.wxFilePath,name:f,formData:l,fail:function(e){},success:function(e){if(200===e.statusCode)try{n(null,JSON.parse(e.data))}catch(e){n({code:"PARSE_WX_UPLOAD_FILE_RES_ERROR",str:e.data,msg:e.errMsg})}else n({code:e.statusCode,msg:e.errMsg})}})):(t.uploaddone=n,t.url=u,t.params=l,t.fileName=f,new a(t))},t.sendFile=function(e){var t=this;if(e.type||(e.type="file"),r.verifyParamPresentJustOne(e,"dataURL blob fileInput file wxFilePath"),t.processCallback(e),e.dataURL)t._previewAndSendFile(e);else if(e.blob)t._previewAndSendFile(e);else if(e.fileInput){if(e.fileInput=r.verifyFileInput(e.fileInput),e.fileInput.files&&!e.fileInput.files.length)return void e.done(o.newNoFileError("请选择"+e.type+"文件"),e.callback.options);t._previewAndSendFile(e)}else if(e.wxFilePath)t._previewAndSendFile(e);else if(e.file)return e.msg=new t.message.FileMessage(e),t.sendMsg(e)},t._previewAndSendFile=function(e){var t=this;r.verifyCallback(e,"uploaddone beforesend");var n=e.done;e.done=function(o,i){e.done=n,o?e.uploaddone(o,e.callback.options):(e.uploaddone(null,r.copy(i)),e.file=i,e.msg=new t.message.FileMessage(e),e.beforesend(t.sendMsg(e)))}.bind(t),t.previewFile(e)},t.assembleUploadParams=function(e){return e?{Object:decodeURIComponent(e.objectName),"x-nos-token":e.token,"x-nos-entity-type":"json"}:null},t.sendGeo=function(e){var t=this;return t.processCallback(e),e.msg=new t.message.GeoMessage(e),t.sendMsg(e)},t.sendTipMsg=function(e){var t=this;return t.processCallback(e),e.msg=new t.message.TipMessage(e),t.sendMsg(e)},t.sendCustomMsg=function(e){var t=this;return t.processCallback(e),e.msg=new t.message.CustomMessage(e),t.sendMsg(e)},t.sendMsg=function(e){var t=this,n=t.protocol,o=e.msg,i={},s=!!e.isLocal;if(s&&e.time&&(o.time=e.time),e.resend&&("out"!==e.flow||"fail"!==e.status))return r.onError("只能重发发送失败的消息");e.callback.options.idClient=o.idClient,t.beforeSendMsg(e,i);var a=e.rtnMsg=t.formatReturnMsg(o);return s&&(a.status="success",a.isLocal=!0),n.storeSendMsg&&(i.promise=n.storeSendMsg(a)),e.cbaop=function(e){if(e&&"server"!==e.from)return a.status="fail",n.updateSendMsgError&&n.updateSendMsgError(a),a},s||(i.msg=o,t.sendCmd(e.cmd,i,e.callback)),t.afterSendMsg(e),s&&setTimeout(function(){a=r.simpleClone(a),e.done(null,a)},0),r.copy(a)},t.beforeSendMsg=function(){},t.afterSendMsg=function(){},t.formatReturnMsg=function(e){var t=this;return e=r.copy(e),t.protocol.completeMsg(e),e.status="sending",e=t.message.reverse(e)},t.resendMsg=function(e){var t=this;return r.verifyOptions(e,"msg"),t.trimMsgFlag(e),e.resend=!0,t._sendMsgByType(e)},t.forwardMsg=function(e){var t=this;return r.verifyOptions(e,"msg"),t.beforeForwardMsg(e),t.trimMsgFlag(e),e.forward=!0,t._sendMsgByType(e)},t.trimMsgFlag=function(e){e&&e.msg&&(e.mgs=r.copy(e.msg),delete e.msg.resend,delete e.msg.forward)},t.beforeForwardMsg=function(){},t._sendMsgByType=function(e){var t=this;switch(r.verifyOptions(e,"msg"),r.verifyParamValid("msg.type",e.msg.type,t.message.validTypes),r.merge(e,e.msg),e.type){case"text":return t.sendText(e);case"image":case"audio":case"video":case"file":return t.sendFile(e);case"geo":return t.sendGeo(e);case"custom":return t.sendCustomMsg(e);case"tip":return t.sendTipMsg(e);default:throw new o("不能发送类型为 "+e.type+" 的消息")}}}).call(t,n(10))},function(e,t,n){"use strict";var r=n(1),o=n(8).fn,i=n(29);o.getNosToken=function(e){this.sendCmd("getNosToken",{responseBody:e.responseBody},e.callback)},o.packFileDownloadName=function(e){r.verifyOptions(e,"url name");var t=e.url;return t+r.genUrlSep(t)+"download="+encodeURIComponent(e.name)},o.audioToMp3=function(e){r.verifyOptions(e,"url");var t=e.url;return t+r.genUrlSep(t)+"audioTrans&type=mp3"},o.stripImageMeta=function(e){return this.beforeProcessImage(e,"stripmeta")},o.qualityImage=function(e){return this.beforeProcessImage(e,"quality")},o.interlaceImage=function(e){return this.beforeProcessImage(e,"interlace")},o.rotateImage=function(e){return this.beforeProcessImage(e,"rotate")},o.blurImage=function(e){return this.beforeProcessImage(e,"blur")},o.cropImage=function(e){return this.beforeProcessImage(e,"crop")},o.thumbnailImage=function(e){return this.beforeProcessImage(e,"thumbnail")},o.beforeProcessImage=function(e,t){var n=r.copy(e);return n.type=t,e.ops=[n],this.processImage(e)},o.processImage=function(e){var t=this;r.verifyOptions(e,"url ops"),r.verifyParamType("ops",e.ops,"array");var n=e.ops.map(function(e){return r.verifyOptions(e,"type"),r.verifyParamValid("type",e.type,i.validTypes),t["gen"+e.type.slice(0,1).toUpperCase()+e.type.slice(1)+"Op"](e)});t.processCallback(e),t.sendCmd("processImage",{url:e.url,imageOps:n},e.callback)},o.genStripmetaOp=function(e){return new i({type:e.type,stripmeta:e.strip?1:0})},o.genQualityOp=function(e){r.verifyOptions(e,"quality"),r.verifyParamType("quality",e.quality,"number"),r.verifyParamMin("quality",e.quality,0),r.verifyParamMax("quality",e.quality,100);var t=Math.round(e.quality);return new i({type:e.type,qualityQuality:t})},o.genInterlaceOp=function(e){return new i({type:e.type})},o.genRotateOp=function(e){for(r.verifyOptions(e,"angle"),r.verifyParamType("angle",e.angle,"number");e.angle<0;)e.angle=e.angle+360;e.angle=e.angle%360;var t=Math.round(e.angle);return new i({type:e.type,rotateAngle:t})},o.genBlurOp=function(e){r.verifyOptions(e,"radius sigma"),r.verifyParamType("radius",e.radius,"number"),r.verifyParamMin("radius",e.radius,1),r.verifyParamMax("radius",e.radius,50),r.verifyParamType("sigma",e.sigma,"number"),r.verifyParamMin("sigma",e.sigma,0);var t=Math.round(e.radius),n=Math.round(e.sigma);return new i({type:e.type,blurRadius:t,blurSigma:n})},o.genCropOp=function(e){r.verifyOptions(e,"x y width height"),r.verifyParamType("x",e.x,"number"),r.verifyParamMin("x",e.x,0),r.verifyParamType("y",e.y,"number"),r.verifyParamMin("y",e.y,0),r.verifyParamType("width",e.width,"number"),r.verifyParamMin("width",e.width,0),r.verifyParamType("height",e.height,"number"),r.verifyParamMin("height",e.height,0);var t=Math.round(e.x),n=Math.round(e.y),o=Math.round(e.width),s=Math.round(e.height);return new i({type:e.type,cropX:t,cropY:n,cropWidth:o,cropHeight:s})},o.genThumbnailOp=function(){var e={cover:"z",contain:"x",crop:"y"};return function(t){r.verifyOptions(t,"mode"),r.verifyParamValid("mode",t.mode,Object.keys(e)),"contain"===t.mode?r.verifyParamAtLeastPresentOne(t,"width height"):r.verifyOptions(t,"width height"),r.undef(t.width)&&(t.width=0),r.undef(t.height)&&(t.height=0),r.verifyParamType("width",t.width,"number"),r.verifyParamMin("width",t.width,0),r.verifyParamType("height",t.height,"number"),r.verifyParamMin("height",t.height,0);var n=Math.round(t.width),o=Math.round(t.height),s=new i({type:t.type,thumbnailMode:e[t.mode],thumbnailWidth:n,thumbnailHeight:o});if("crop"===t.mode&&r.notundef(t.axis)){r.undef(t.axis.x)&&(t.axis.x=5),r.undef(t.axis.y)&&(t.axis.y=5),r.verifyParamMin("axis.x",t.axis.x,0),r.verifyParamMax("axis.x",t.axis.x,10),r.verifyParamMin("axis.y",t.axis.y,0),r.verifyParamMax("axis.y",t.axis.y,10);var a=Math.round(t.axis.x),c=Math.round(t.axis.y);s.thumbnailAxisX=a,s.thumbnailAxisY=c}return r.notundef(t.enlarge)&&(r.verifyParamType("enlarge",t.enlarge,"boolean"),t.enlarge&&(s.thumbnailEnlarge=1)),s}}()},function(e,t,n){"use strict";function r(e){e=""+e;var t=e.indexOf("?")===-1?"?imageView&":"&";return t}var o=n(1),i=n(8).fn;i.viewImageStripMeta=function(e){o.verifyOptions(e,"url strip"),o.verifyParamType("strip",e.strip,"boolean");var t="stripmeta="+(e.strip?1:0),n=r(e.url);return e.url+n+t},i.viewImageQuality=function(e){o.verifyOptions(e,"url quality"),o.verifyParamType("quality",e.quality,"number"),o.verifyParamMin("quality",e.quality,0),o.verifyParamMax("quality",e.quality,100);var t=Math.round(e.quality),n="quality="+t,i=r(e.url);return e.url+i+n},i.viewImageInterlace=function(e){o.verifyOptions(e,"url");var t="interlace=1",n=r(e.url);return e.url+n+t},i.viewImageRotate=function(e){for(o.verifyOptions(e,"url angle"),o.verifyParamType("angle",e.angle,"number");e.angle<0;)e.angle=e.angle+360;e.angle=e.angle%360;var t=Math.round(e.angle),n="rotate="+t,i=r(e.url);return e.url+i+n},i.viewImageBlur=function(e){o.verifyOptions(e,"url radius sigma"),o.verifyParamType("radius",e.radius,"number"),o.verifyParamMin("radius",e.radius,1),o.verifyParamMax("radius",e.radius,50),o.verifyParamType("sigma",e.sigma,"number"),o.verifyParamMin("sigma",e.sigma,0);var t=Math.round(e.radius),n=Math.round(e.sigma),i="blur="+t+"x"+n,s=r(e.url);return e.url+s+i},i.viewImageCrop=function(e){o.verifyOptions(e,"url x y width height"),o.verifyParamType("x",e.x,"number"),o.verifyParamMin("x",e.x,0),o.verifyParamType("y",e.y,"number"),o.verifyParamMin("y",e.y,0),o.verifyParamType("width",e.width,"number"),o.verifyParamMin("width",e.width,0),o.verifyParamType("height",e.height,"number"),o.verifyParamMin("height",e.height,0);var t=Math.round(e.x),n=Math.round(e.y),i=Math.round(e.width),s=Math.round(e.height),a="crop="+t+"_"+n+"_"+i+"_"+s,c=r(e.url);return e.url+c+a},i.viewImageThumbnail=function(){var e={cover:"z",contain:"x",crop:"y"};return function(t){o.verifyOptions(t,"url mode"),o.verifyParamValid("mode",t.mode,Object.keys(e)),"contain"===t.mode?o.verifyParamAtLeastPresentOne(t,"width height"):o.verifyOptions(t,"width height"),o.undef(t.width)&&(t.width=0),o.undef(t.height)&&(t.height=0),o.verifyParamType("width",t.width,"number"),o.verifyParamMin("width",t.width,0),o.verifyParamType("height",t.height,"number"),o.verifyParamMin("height",t.height,0);var n=Math.round(t.width),i=Math.round(t.height),s="thumbnail="+n+e[t.mode]+i;if("crop"===t.mode&&o.notundef(t.axis)){o.undef(t.axis.x)&&(t.axis.x=5),o.undef(t.axis.y)&&(t.axis.y=5),o.verifyParamMin("axis.x",t.axis.x,0),o.verifyParamMax("axis.x",t.axis.x,10),o.verifyParamMin("axis.y",t.axis.y,0),o.verifyParamMax("axis.y",t.axis.y,10);var a=Math.round(t.axis.x),c=Math.round(t.axis.y);s=s+"&axis="+a+"_"+c}o.notundef(t.enlarge)&&(o.verifyParamType("enlarge",t.enlarge,"boolean"),t.enlarge&&(s+="&enlarge=1"));var u=r(t.url);return t.url+u+s}}()},function(e,t,n){"use strict";n(62),n(61),n(65),n(2).polyfill()},function(e,t,n){"use strict";function r(e){var t=this;i(e.name)&&(t.name=""+e.name),i(e.announcement)&&(t.announcement=""+e.announcement),i(e.broadcastUrl)&&(t.broadcastUrl=""+e.broadcastUrl),i(e.custom)&&(t.custom=""+e.custom)}var o=n(1),i=o.notundef,s=o.undef;r.reverse=function(e){var t=o.copy(e);return s(t.announcement)&&(t.announcement=""),s(t.broadcastUrl)&&(t.broadcastUrl=""),s(t.custom)&&(t.custom=""),i(t.createTime)&&(t.createTime=+t.createTime),i(t.updateTime)&&(t.updateTime=+t.updateTime),i(t.onlineMemberNum)&&(t.onlineMemberNum=+t.onlineMemberNum),i(t.mute)&&(t.mute="1"===t.mute),t},e.exports=r},function(e,t,n){"use strict";function r(e){o.verifyOptions(e,"account"),o.verifyParamAtLeastPresentOne(e,"alias custom"),this.account=e.account,i(e.alias)&&(this.alias=e.alias),i(e.custom)&&(this.custom=e.custom)}var o=n(1),i=o.notundef,s={addFriend:1,applyFriend:2,passFriendApply:3,rejectFriendApply:4},a={1:"addFriend",2:"applyFriend",3:"passFriendApply",4:"rejectFriendApply"};r.reverse=function(e){var t=o.filterObj(e,"account alias custom createTime updateTime");return i(e.flag)&&(t.valid="1"===e.flag),i(t.createTime)&&(t.createTime=+t.createTime),i(t.updateTime)&&(t.updateTime=+t.updateTime),t},r.validTypes=function(){return Object.keys(s)},r.getByteFromType=function(e){return s[e]},r.getTypeFromByte=function(e){return a[e]},r.assembleFriend=function(e){var t=+new Date;return{account:e,alias:"",createTime:t,custom:"",updateTime:t,valid:!0}},e.exports=r},function(e,t,n){"use strict";var r=n(9).fn,o=n(3),i=n(11),s=n(17),a=n(14),c=n(6),u=n(1),l=u.notundef;r.login=function(){var e=this;e.sendCmd("login",e.assembleLogin(),e.onLogin.bind(e)),e.autoconnect=!1},r.genSessionKey=function(){var e={};return function(){var t=this,n=t.name,r=e[n]=e[n]||u.guid();return r}}(),r.assembleIMLogin=function(){var e=this,t=e.options,n=t.account,r=e.autoconnect?0:1;return{appLogin:r,appKey:t.appKey,account:n,token:t.token,sdkVersion:c.info.sdkVersion,protocolVersion:c.info.protocolVersion,os:i.os.toString(),browser:i.name+" "+i.version,session:e.genSessionKey(),deviceId:a.deviceId}},r.onLogin=function(e,t){var n=this;n.loginResult=t,e?n.onAuthError(e):(n.startHeartbeat(),n.afterLogin(t))},r.afterLogin=u.emptyFunc,r.notifyLogin=function(){var e=this,t=e.loginResult;e.logger.info("onConnect",t),e.options.onconnect(t)},r.logout=function(){var e=this;if(e.isConnected()){var t=new o("主动退出","logout");e.onAuthError(t)}},r.onKicked=function(e){var t=this,n=e.content,r=n.from,i=n.reason,a=n.custom,c={reason:t.kickedReasons[i]||"unknown",message:t.kickedMessages[i]||"未知原因"};if(l(r)&&(c.from=s.reverseType(r)),l(a)&&(c.custom=a),t.shouldNotifyKicked(c)){var f=new o("被踢了","kicked");u.merge(f,c),t.onAuthError(f)}else t.logger.warn("silentlyKick"),t.shouldReconnect=!1,t.hasNotifyDisconnected=!0,t.disconnectSocket()},r.shouldNotifyKicked=function(e){return"silentlyKick"!==e.reason},r.onAuthError=function(e){var t=this;t.shouldReconnect=!1,t.markAllCallbackInvalid(e||o.newConnectionError()),t.notifyDisconnect(e)}},function(e,t,n){(function(e){"use strict";var t=n(9).fn,r=n(3),o=n(60),i=n(16),s=n(6),a=n(1);t.initConnect=function(){var e=this;e.socket=null,e.retryCount=0,e.connecting=!1,e.shouldReconnect=!0,e.hasNotifyDisconnected=!1},t.resetConnect=function(){var e=this,t=e.options;a.notundef(t.needReconnect)?(a.verifyParamType("needReconnect",t.needReconnect,"boolean"),e.needReconnect=t.needReconnect):e.needReconnect=!0,a.notundef(t.reconnectionAttempts)&&a.verifyParamType("reconnectionAttempts",t.reconnectionAttempts,"number"),e.reconnectionAttempts=t.reconnectionAttempts||1/0,e.backoff=new o({min:s.reconnectionDelay,max:s.reconnectionDelayMax,jitter:s.reconnectionJitter})},t.connect=function(){var e=this;if(!e.isConnected()&&!e.connecting)if(e.connecting=!0,e.hasNotifyDisconnected=!1,e.socket)e.logger.info("connecting"),e.socket.socket.connect();else{var t=e.getNextSocketUrl();t?e.connectToUrl(t):e.refreshSocketUrl()}},t.getNextSocketUrl=function(){return this.socketUrls.shift()},t.isConnected=function(){var e=this;return!!e.socket&&!!e.socket.socket&&e.socket.socket.connected},t.connectToUrl=function(t){var n=this;if(n.logger.log("try connect to ",t),e.env.WEIXIN_APP&&!window.location){var r=t.split(":");window.location={protocol:r[0],hostname:r[1].slice(2),port:r[2]}}n.socket=i.connect(t,{transports:["websocket","flashsocket","xhr-polling"],reconnect:!1,"force new connection":!0,"connect timeout":s.connectTimeout}),n.socket.on("connect",n.onConnect.bind(n)),n.socket.on("handshake_failed",n.onHandshakeFailed.bind(n)),n.socket.on("connect_failed",n.onConnectFailed.bind(n)),n.socket.on("error",n.onError.bind(n)),n.socket.on("message",n.onMessage.bind(n)),n.socket.on("disconnect",function(){n.onDisconnect(!0)})},t.disconnect=function(){var e=this;e.isConnected()&&(e.logger.info("disconnecting"),e.logout())},t.onConnect=function(){var e=this;e.backoff&&e.backoff.reset(),e.retryCount=0,e.connecting=!1,e.shouldReconnect=!0,e.hasNotifyDisconnected=!1,e.login()},t.onHandshakeFailed=function(){this.onDisconnect()},t.onConnectFailed=function(){this.onDisconnect()},t.onError=function(){var e=arguments[0];e&&this.notifyError(new r(e))},t.onDisconnect=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;t.connected=e,t.connecting=!1,t.markAllCallbackInvalid(r.newNetworkError()),t.stopHeartbeat(),t.reconnect()},t.willReconnect=function(){var e=this;return e.shouldReconnect&&e.needReconnect&&e.retryCount<e.reconnectionAttempts},t.reconnect=function(){var e=this;if(e.willReconnect()){e.socket=null,e.connected&&(e.autoconnect=!0),e.retryCount++;var t=e.backoff.duration();e.logger.log("will retry after",t+"ms",", retryCount",e.retryCount),e.options.onwillreconnect({retryCount:e.retryCount,duration:t}),setTimeout(function(){e.connect()},t)}else e.notifyDisconnect()},t.notifyConnectError=function(e){var t=this,n=r.newConnectError(e);t.logger.error(n),t.options.onerror(n)},t.notifyDisconnect=function(e){var t=this;t.hasNotifyDisconnected||(t.hasNotifyDisconnected=!0,t.disconnectSocket(),e=e||new r,e.retryCount=t.retryCount,e.willReconnect=t.willReconnect(),t.backoff&&t.backoff.reset(),t.retryCount=0,t.connecting=!1,t.logger.info("onDisconnect",e),t.options.ondisconnect(e))},t.disconnectSocket=function(){var e=this;if(e.isConnected())try{e.socket.disconnect(),e.socket=null}catch(e){}}}).call(t,n(10))},function(e,t,n){"use strict";var r=n(9).fn,o=n(6);r.processLink=function(e){switch(e.cmd){case"heartbeat":}},r.startHeartbeat=function(){var e=this;e.stopHeartbeat(),e.heartbeatTimer=setTimeout(function(){e.sendCmd("heartbeat",null,e.onHeartbeat.bind(e))},o.heartbeatInterval)},r.stopHeartbeat=function(){var e=this;e.heartbeatTimer&&(clearTimeout(e.heartbeatTimer),e.heartbeatTimer=null)},r.onHeartbeat=function(e,t){var n=this;e||n.startHeartbeat(),n.onMiscError(e,t,"heartbeat")},r.heartbeat=function(){}},function(e,t,n){"use strict";var r=n(9).fn,o=n(29);r.processMisc=function(e){switch(e.cmd){case"getNosToken":e.error||(e.obj=e.content.nosToken);break;case"audioToText":e.error||(e.obj.text=e.content.text);break;case"processImage":e.obj.imageOps=o.reverseImageOps(e.obj.imageOps),e.error||(e.obj={url:e.content.url})}}},function(e,t,n){"use strict";var r=n(1),o=n(41),i=r.merge({},o.idMap,{auth:{id:2,login:3,kicked:5,logout:6,multiPortLogin:7,kick:8},user:{id:3,markInBlacklist:3,getBlacklist:4,markInMutelist:5,getMutelist:6,getRelations:8,getUsers:7,updateMyInfo:10,updateDonnop:15,syncMyInfo:109,syncUpdateMyInfo:110},notify:{id:4,markRead:3,syncOfflineMsgs:4,batchMarkRead:5,syncOfflineSysMsgs:6,syncRoamingMsgs:9,syncMsgReceipts:12},sync:{id:5,sync:1,syncTeamMembers:2},msg:{id:7,sendMsg:1,msg:2,sysMsg:3,getHistoryMsgs:6,sendCustomSysMsg:7,searchHistoryMsgs:8,deleteSessions:9,getSessions:10,syncSendMsg:101,sendMsgReceipt:11,msgReceipt:12,deleteMsg:13,msgDeleted:14,markSessionAck:16},team:{id:8,createTeam:1,sendTeamMsg:2,teamMsg:3,teamMsgs:4,addTeamMembers:5,removeTeamMembers:6,updateTeam:7,leaveTeam:8,getTeam:9,getTeams:10,getTeamMembers:11,dismissTeam:12,applyTeam:13,passTeamApply:14,rejectTeamApply:15,addTeamManagers:16,removeTeamManagers:17,transferTeam:18,updateInfoInTeam:19,updateNickInTeam:20,acceptTeamInvite:21,rejectTeamInvite:22,getTeamHistoryMsgs:23,searchTeamHistoryMsgs:24,updateMuteStateInTeam:25,getMyTeamMembers:26,getMutedTeamMembers:27,syncMyTeamMembers:126,syncTeams:109,syncTeamMembers:111,syncCreateTeam:101,syncSendTeamMsg:102,syncUpdateTeamMember:119},friend:{id:12,friendRequest:1,syncFriendRequest:101,deleteFriend:2,syncDeleteFriend:102,updateFriend:3,syncUpdateFriend:103,getFriends:4},chatroom:{id:13,getChatroomAddress:1},filter:{id:101,sendFilterMsg:1,filterMsg:2,filterSysMsg:3,sendFilterCustomSysMsg:7}}),s=r.merge({},o.cmdConfig,{login:{sid:i.auth.id,cid:i.auth.login,params:[{type:"Property",name:"login"}]},logout:{sid:i.auth.id,cid:i.auth.logout},kick:{sid:i.auth.id,cid:i.auth.kick,params:[{type:"StrArray",name:"deviceIds"}]},markInBlacklist:{sid:i.user.id,cid:i.user.markInBlacklist,params:[{type:"String",name:"account"},{type:"bool",name:"isAdd"}]},getBlacklist:{sid:i.user.id,cid:i.user.getBlacklist,params:[{type:"long",name:"time"}]},markInMutelist:{sid:i.user.id,cid:i.user.markInMutelist,params:[{type:"String",name:"account"},{type:"bool",name:"isAdd"}]},getMutelist:{sid:i.user.id,cid:i.user.getMutelist,params:[{type:"long",name:"time"}]},getRelations:{sid:i.user.id,cid:i.user.getRelations,params:[{type:"long",name:"timetag"}]},getUsers:{sid:i.user.id,cid:i.user.getUsers,params:[{type:"StrArray",name:"accounts"}]},updateMyInfo:{sid:i.user.id,cid:i.user.updateMyInfo,params:[{type:"Property",name:"user"}]},updateDonnop:{sid:i.user.id,cid:i.user.updateDonnop,params:[{type:"Property",name:"donnop"}]},markRead:{sid:i.notify.id,cid:i.notify.markRead,params:[{type:"long",name:"id"},{type:"ph",name:"ph"}]},batchMarkRead:{sid:i.notify.id,cid:i.notify.batchMarkRead,params:[{type:"byte",name:"sid"},{type:"byte",name:"cid"},{type:"LongArray",name:"ids"}]},sync:{sid:i.sync.id,cid:i.sync.sync,params:[{type:"Property",name:"sync"}]},syncTeamMembers:{sid:i.sync.id,cid:i.sync.syncTeamMembers,params:[{type:"LongLongMap",name:"sync"}]},sendMsg:{sid:i.msg.id,cid:i.msg.sendMsg,params:[{type:"Property",name:"msg"}]},getHistoryMsgs:{sid:i.msg.id,cid:i.msg.getHistoryMsgs,params:[{type:"String",name:"to"},{type:"long",name:"beginTime"},{type:"long",name:"endTime"},{type:"long",name:"lastMsgId"},{type:"int",name:"limit"},{type:"bool",name:"reverse"}]},sendCustomSysMsg:{sid:i.msg.id,cid:i.msg.sendCustomSysMsg,params:[{type:"Property",name:"sysMsg"}]},searchHistoryMsgs:{sid:i.msg.id,cid:i.msg.searchHistoryMsgs,params:[{type:"String",name:"to"},{type:"long",name:"beginTime"},{type:"long",name:"endTime"},{type:"String",name:"keyword"},{type:"int",name:"limit"},{type:"bool",name:"reverse"}]},getSessions:{sid:i.msg.id,cid:i.msg.getSessions,params:[{type:"long",name:"time"}]},deleteSessions:{sid:i.msg.id,cid:i.msg.deleteSessions,params:[{type:"StrArray",name:"sessions"}]},sendMsgReceipt:{sid:i.msg.id,cid:i.msg.sendMsgReceipt,params:[{type:"Property",name:"msgReceipt"}]},deleteMsg:{sid:i.msg.id,cid:i.msg.deleteMsg,params:[{type:"Property",name:"sysMsg"}]},markSessionAck:{sid:i.msg.id,cid:i.msg.markSessionAck,params:[{type:"byte",name:"scene"},{type:"String",name:"to"},{type:"long",name:"timetag"}]},createTeam:{sid:i.team.id,cid:i.team.createTeam,params:[{type:"Property",name:"team"},{type:"StrArray",name:"accounts"},{type:"String",name:"ps"}]},sendTeamMsg:{sid:i.team.id,cid:i.team.sendTeamMsg,params:[{type:"Property",name:"msg"}]},addTeamMembers:{sid:i.team.id,cid:i.team.addTeamMembers,params:[{type:"long",name:"teamId"},{type:"StrArray",name:"accounts"},{type:"String",name:"ps"}]},removeTeamMembers:{sid:i.team.id,cid:i.team.removeTeamMembers,params:[{type:"long",name:"teamId"},{type:"StrArray",name:"accounts"}]},updateTeam:{sid:i.team.id,cid:i.team.updateTeam,params:[{type:"Property",name:"team"}]},leaveTeam:{sid:i.team.id,cid:i.team.leaveTeam,params:[{type:"long",name:"teamId"}]},getTeam:{sid:i.team.id,cid:i.team.getTeam,params:[{type:"long",name:"teamId"}]},getTeams:{sid:i.team.id,cid:i.team.getTeams,params:[{type:"long",name:"timetag"}]},getTeamMembers:{sid:i.team.id,cid:i.team.getTeamMembers,params:[{type:"long",name:"teamId"},{type:"long",name:"timetag"}]},dismissTeam:{sid:i.team.id,cid:i.team.dismissTeam,params:[{type:"long",name:"teamId"}]},applyTeam:{sid:i.team.id,cid:i.team.applyTeam,params:[{type:"long",name:"teamId"},{type:"String",name:"ps"}]},passTeamApply:{sid:i.team.id,cid:i.team.passTeamApply,params:[{type:"long",name:"teamId"},{type:"String",name:"from"}]},rejectTeamApply:{sid:i.team.id,cid:i.team.rejectTeamApply,params:[{type:"long",name:"teamId"},{type:"String",name:"from"},{type:"String",name:"ps"}]},addTeamManagers:{sid:i.team.id,cid:i.team.addTeamManagers,params:[{type:"long",name:"teamId"},{type:"StrArray",name:"accounts"}]},removeTeamManagers:{sid:i.team.id,cid:i.team.removeTeamManagers,params:[{type:"long",name:"teamId"},{type:"StrArray",name:"accounts"}]},transferTeam:{sid:i.team.id,cid:i.team.transferTeam,params:[{type:"long",name:"teamId"},{type:"String",name:"account"},{type:"bool",name:"leave"}]},updateInfoInTeam:{sid:i.team.id,cid:i.team.updateInfoInTeam,params:[{type:"Property",name:"teamMember"}]},updateNickInTeam:{sid:i.team.id,cid:i.team.updateNickInTeam,params:[{type:"Property",name:"teamMember"}]},acceptTeamInvite:{sid:i.team.id,cid:i.team.acceptTeamInvite,params:[{type:"long",name:"teamId"},{type:"String",name:"from"}]},rejectTeamInvite:{sid:i.team.id,cid:i.team.rejectTeamInvite,params:[{type:"long",name:"teamId"},{type:"String",name:"from"},{type:"String",name:"ps"}]},getTeamHistoryMsgs:{sid:i.team.id,cid:i.team.getTeamHistoryMsgs,params:[{type:"long",name:"to"},{type:"long",name:"beginTime"},{type:"long",name:"endTime"},{type:"long",name:"lastMsgId"},{type:"int",name:"limit"},{type:"bool",name:"reverse"}]},searchTeamHistoryMsgs:{sid:i.team.id,cid:i.team.searchTeamHistoryMsgs,params:[{type:"long",name:"to"},{type:"long",name:"beginTime"},{type:"long",name:"endTime"},{type:"String",name:"keyword"},{type:"int",name:"limit"},{type:"bool",name:"reverse"}]},updateMuteStateInTeam:{sid:i.team.id,cid:i.team.updateMuteStateInTeam,params:[{type:"long",name:"teamId"},{type:"String",name:"account"},{type:"int",name:"mute"}]},getMyTeamMembers:{sid:i.team.id,cid:i.team.getMyTeamMembers,params:[{type:"LongArray",name:"teamIds"}]},getMutedTeamMembers:{sid:i.team.id,cid:i.team.getMutedTeamMembers,params:[{type:"long",name:"teamId"}]},friendRequest:{sid:i.friend.id,cid:i.friend.friendRequest,params:[{type:"String",name:"account"},{type:"byte",name:"type"},{type:"String",name:"ps"}]},deleteFriend:{sid:i.friend.id,cid:i.friend.deleteFriend,params:[{type:"String",name:"account"}]},updateFriend:{sid:i.friend.id,cid:i.friend.updateFriend,params:[{type:"Property",name:"friend"}]},getFriends:{sid:i.friend.id,cid:i.friend.getFriends,params:[{type:"long",name:"timetag"}]},getChatroomAddress:{sid:i.chatroom.id,cid:i.chatroom.getChatroomAddress,params:[{type:"long",name:"chatroomId"}]},sendFilterMsg:{sid:i.filter.id,cid:i.filter.sendFilterMsg,params:[{type:"Property",name:"msg"}]},sendFilterCustomSysMsg:{sid:i.filter.id,cid:i.filter.sendFilterCustomSysMsg,params:[{type:"Property",name:"sysMsg"}]}}),a=r.merge({},o.packetConfig,{"2_3":{service:"auth",cmd:"login",response:[{type:"Property",name:"loginRes"},{type:"PropertyArray",name:"loginPorts",entity:"loginPort"}]},"2_5":{service:"auth",cmd:"kicked",response:[{type:"Number",name:"from"},{type:"Number",name:"reason"}]},"2_6":{service:"auth",cmd:"logout"},"2_7":{service:"auth",cmd:"multiPortLogin",response:[{type:"Number",name:"state"},{type:"PropertyArray",name:"loginPorts",entity:"loginPort"}]},"2_8":{service:"auth",cmd:"kick",response:[{type:"StrArray",name:"deviceIds"}]},"3_3":{service:"user",cmd:"markInBlacklist"},"3_103":{service:"user",cmd:"syncMarkInBlacklist",response:[{type:"String",name:"account"},{type:"Boolean",name:"isAdd"}]},"3_4":{service:"user",cmd:"getBlacklist",response:[{type:"StrArray",name:"blacklist"}]},"3_5":{service:"user",cmd:"markInMutelist"},"3_105":{service:"user",cmd:"syncMarkInMutelist",response:[{type:"String",name:"account"},{type:"Boolean",name:"isAdd"}]},"3_6":{service:"user",cmd:"getMutelist",response:[{type:"StrArray",name:"mutelist"}]},"3_8":{service:"user",cmd:"getRelations",response:[{type:"PropertyArray",name:"specialRelations",entity:"specialRelation"},{type:"Number",name:"timetag"}]},"3_7":{service:"user",cmd:"getUsers",response:[{type:"PropertyArray",name:"users",entity:"user"}]},"3_10":{service:"user",cmd:"updateMyInfo",response:[{type:"Number",name:"timetag"}]},"3_15":{service:"user",cmd:"updateDonnop",response:[{type:"Number",name:"timetag"}]},"3_115":{service:"user",cmd:"syncUpdateDonnop",response:[{type:"Property",name:"donnop"},{type:"Number",name:"timetag"}]},"3_109":{service:"user",cmd:"syncMyInfo",response:[{type:"Property",name:"user"},{type:"Number",name:"timetag"}]},"3_110":{service:"user",cmd:"syncUpdateMyInfo",response:[{type:"Property",name:"user"}]},"4_1":{service:"notify"},"4_2":{service:"notify"},"4_3":{service:"notify",cmd:"markRead"},"4_4":{service:"notify",cmd:"syncOfflineMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"4_5":{service:"notify",cmd:"batchMarkRead"},"4_6":{service:"notify",cmd:"syncOfflineSysMsgs",response:[{type:"PropertyArray",name:"sysMsgs",entity:"sysMsg"}]},"4_9":{service:"notify",cmd:"syncRoamingMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"4_12":{service:"notify",cmd:"syncMsgReceipts",response:[{type:"PropertyArray",name:"msgReceipts",entity:"msgReceipt"},{type:"Number",name:"timetag"}]},"4_13":{service:"notify",cmd:"syncDonnop",response:[{type:"Property",name:"donnop"},{type:"Number",name:"timetag"}]},"4_14":{service:"notify",cmd:"syncSessionAck",response:[{type:"StrLongMap",name:"p2p"},{type:"LongLongMap",name:"team"},{type:"Number",name:"timetag"}]},"4_100":{service:"notify",cmd:"syncOfflineFilterMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"4_101":{service:"notify",cmd:"syncOfflineFilterSysMsgs",response:[{type:"PropertyArray",name:"sysMsgs",entity:"sysMsg"}]},"5_1":{service:"sync",cmd:"syncDone",response:[{type:"Number",name:"timetag"}]},"5_2":{service:"sync",cmd:"syncTeamMembersDone",response:[{type:"Number",name:"timetag"}]},"7_1":{service:"msg",cmd:"sendMsg",response:[{type:"Property",name:"msg"}],trivialErrorCodes:[7101]},"7_2":{service:"msg",cmd:"msg",response:[{type:"Property",name:"msg"}]},"7_3":{service:"msg",cmd:"sysMsg",response:[{type:"Property",name:"sysMsg"}]},"7_6":{service:"msg",cmd:"getHistoryMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"7_7":{service:"msg",cmd:"sendCustomSysMsg",trivialErrorCodes:[7101]},"7_8":{service:"msg",cmd:"searchHistoryMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"7_9":{service:"msg",cmd:"deleteSessions"},"7_10":{service:"msg",cmd:"getSessions",response:[{type:"StrArray",name:"sessions"}]},"7_101":{service:"msg",cmd:"syncSendMsg",response:[{type:"Property",name:"msg"}]},"7_11":{service:"msg",cmd:"sendMsgReceipt",response:[{type:"Property",name:"msgReceipt"}]},"7_12":{service:"msg",cmd:"msgReceipt",response:[{type:"Property",name:"msgReceipt"}]},"7_13":{service:"msg",cmd:"onDeleteMsg"},"7_14":{service:"msg",cmd:"onMsgDeleted",response:[{type:"Property",name:"sysMsg"}]},"7_15":{service:"msg",cmd:"onDeleteMsgOfflineRoaming",response:[{type:"PropertyArray",name:"sysMsgs",entity:"sysMsg"},{type:"Number",name:"timetag"},{type:"Number",name:"type"}]},"7_16":{service:"msg",cmd:"onMarkSessionAck"},"7_116":{service:"msg",cmd:"syncMarkSessionAck",response:[{type:"Number",name:"scene"},{type:"String",name:"to"},{type:"Number",name:"timetag"}]},"8_1":{service:"team",cmd:"createTeam",response:[{type:"Property",name:"team"}]},"8_2":{service:"team",cmd:"sendTeamMsg",response:[{type:"Property",name:"msg"}]},"8_3":{service:"team",cmd:"teamMsg",response:[{type:"Property",name:"msg"}]},"8_4":{service:"team",cmd:"teamMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"8_5":{service:"team",cmd:"addTeamMembers"},"8_6":{service:"team",cmd:"removeTeamMembers"},"8_7":{service:"team",cmd:"updateTeam",response:[{type:"Number",name:"id"},{type:"Number",name:"time"}]},"8_8":{service:"team",cmd:"leaveTeam"},"8_9":{service:"team",cmd:"getTeam",response:[{type:"Property",name:"team"}]},"8_10":{service:"team",cmd:"getTeams",response:[{type:"PropertyArray",name:"teams",entity:"team"},{type:"Number",name:"timetag"}]},"8_11":{service:"team",cmd:"getTeamMembers",response:[{type:"Number",name:"teamId"},{type:"PropertyArray",name:"members",entity:"teamMember"},{type:"Number",name:"timetag"}]},"8_12":{service:"team",cmd:"dismissTeam"},"8_13":{service:"team",cmd:"applyTeam",response:[{type:"Property",name:"team"}]},"8_14":{service:"team",cmd:"passTeamApply"},"8_15":{service:"team",cmd:"rejectTeamApply"},"8_16":{service:"team",cmd:"addTeamManagers"},"8_17":{service:"team",cmd:"removeTeamManagers"},"8_18":{service:"team",cmd:"transferTeam"},"8_19":{service:"team",cmd:"updateInfoInTeam"},"8_20":{service:"team",cmd:"updateNickInTeam"},"8_21":{service:"team",cmd:"acceptTeamInvite",response:[{type:"Property",name:"team"}]},"8_22":{service:"team",cmd:"rejectTeamInvite"},"8_23":{service:"team",cmd:"getTeamHistoryMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"8_24":{service:"team",cmd:"searchTeamHistoryMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"8_25":{service:"team",cmd:"updateMuteStateInTeam"},"8_26":{service:"team",cmd:"getMyTeamMembers",response:[{type:"PropertyArray",name:"teamMembers",entity:"teamMember"}]},"8_27":{service:"team",cmd:"getMutedTeamMembers",response:[{
  type:"Number",name:"teamId"},{type:"PropertyArray",name:"teamMembers",entity:"teamMember"}]},"8_126":{service:"team",cmd:"syncMyTeamMembers",response:[{type:"PropertyArray",name:"teamMembers",entity:"teamMember"},{type:"Number",name:"timetag"}]},"8_109":{service:"team",cmd:"syncTeams",response:[{type:"Number",name:"timetag"},{type:"PropertyArray",name:"teams",entity:"team"}]},"8_111":{service:"team",cmd:"syncTeamMembers",response:[{type:"Number",name:"teamId"},{type:"PropertyArray",name:"members",entity:"teamMember"},{type:"Number",name:"timetag"}]},"8_101":{service:"team",cmd:"syncCreateTeam",response:[{type:"Property",name:"team"}]},"8_102":{service:"team",cmd:"syncSendTeamMsg",response:[{type:"Property",name:"msg"}]},"8_119":{service:"team",cmd:"syncUpdateTeamMember",response:[{type:"Property",name:"teamMember"}]},"12_1":{service:"friend",cmd:"friendRequest"},"12_101":{service:"friend",cmd:"syncFriendRequest",response:[{type:"String",name:"account"},{type:"Number",name:"type"},{type:"String",name:"ps"}]},"12_2":{service:"friend",cmd:"deleteFriend"},"12_102":{service:"friend",cmd:"syncDeleteFriend",response:[{type:"String",name:"account"}]},"12_3":{service:"friend",cmd:"updateFriend"},"12_103":{service:"friend",cmd:"syncUpdateFriend",response:[{type:"Property",name:"friend"}]},"12_4":{service:"friend",cmd:"getFriends",response:[{type:"PropertyArray",name:"friends",entity:"friend"},{type:"Number",name:"timetag"}]},"12_5":{service:"friend",cmd:"syncFriends",response:[{type:"PropertyArray",name:"friends",entity:"friend"},{type:"Number",name:"timetag"}]},"12_6":{service:"friend",cmd:"syncFriendUsers",response:[{type:"PropertyArray",name:"users",entity:"user"},{type:"Number",name:"timetag"}]},"13_1":{service:"chatroom",cmd:"getChatroomAddress",response:[{type:"StrArray",name:"address"}]},"101_1":{service:"filter",cmd:"sendFilterMsg",response:[{type:"Property",name:"msg"}]},"101_2":{service:"filter",cmd:"filterMsg",response:[{type:"Property",name:"msg"}]},"101_3":{service:"filter",cmd:"filterSysMsg",response:[{type:"Property",name:"sysMsg"}]},"101_7":{service:"filter",cmd:"sendFilterCustomSysMsg"}});e.exports={idMap:i,cmdConfig:s,packetConfig:a}},function(e,t,n){(function(e){"use strict";"undefined"!=typeof window&&(window.console||e.env.WEIXIN_APP||(window.console={log:function(){},info:function(){},warn:function(){},error:function(){}}))}).call(t,n(10))},function(e,t){"use strict";var n=e.exports;n.get=function(e){try{return localStorage&&localStorage[e]}catch(error){}},n.set=function(e,t){try{localStorage[e]=t}catch(error){}}},function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.merge(this,{options:e,debug:!1,api:"log",style:"color:blue;",log:i.emptyFunc,info:i.emptyFunc,warn:i.emptyFunc,error:i.emptyFunc}),this.prefix=e.prefix||"",this.setDebug(e.debug)}var o=n(11),i=n(1),s=r.prototype,a=["Chrome","Safari","Firefox"];s.setDebug=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this;if(t.debug=e,e.style&&(t.style=e.style),t.debug&&i.exist(console)){var n=console;t.log=function(){var e=t.formatArgs(arguments);a.indexOf(o.name)!==-1&&i.isString(e[0])&&(e[0]="%c"+e[0],e.splice(1,0,t.style)),t._log("log",e)},t.info=function(){var e=t.formatArgs(arguments);t._log("info",e)},t.warn=function(){var e=t.formatArgs(arguments);t._log("warn",e)},t.error=function(){var e=t.formatArgs(arguments);t._log("error",e)},t._log=function(e,r){var o=t.options.logFunc;if(o&&(o[e]&&(o=o[e]),i.isFunction(o)))return void o.apply(null,r);if(n[e])try{n[e].apply?t.chrome(e,r):t.ie(e,r)}catch(e){}},t.chrome=function(e,r){a.indexOf(o.name)!==-1?n[e].apply(n,r):t.ie(e,r)},t.ie=function(e,t){t.forEach(function(t){n[e](JSON.stringify(t,null,4))})}}},s.formatArgs=function(e){var t=this;e=[].slice.call(e,0);var n=new Date,r=n.getFullYear()+"-"+c(n.getMonth()+1)+"-"+c(n.getDate())+" "+c(n.getHours())+":"+c(n.getMinutes())+":"+c(n.getSeconds())+":"+c(n.getMilliseconds(),3),o="[NIM SDK LOG "+r+" "+ +n+" "+t.prefix+"]\t";return i.isString(e[0])?e[0]=o+e[0]:e.splice(0,0,o),e.forEach(function(t,n){(i.isArray(t)||i.isObject(t))&&(e[n]=i.simpleClone(t))}),e};var c=function(e,t){t=t||2;for(var n=""+e;n.length<t;)n="0"+n;return n};e.exports=r},function(e,t,n){"use strict";var r=n(1),o={file:{md5:"$(Etag)",size:"$(ObjectSize)"},image:{md5:"$(Etag)",size:"$(ObjectSize)",w:"$(ImageInfo.Width)",h:"$(ImageInfo.Height)",orientation:"$(ImageInfo.Orientation)"},audio:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Audio.Duration)"},video:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Video.Duration)",w:"$(AVinfo.Video.Width)",h:"$(AVinfo.Video.Height)"}},i={};i.genResponseBody=function(e){return e=e||"file",o[e]},i.parseResponse=function(e,t){r.notundef(e.size)&&(e.size=+e.size),r.notundef(e.w)&&(e.w=+e.w),r.notundef(e.h)&&(e.h=+e.h),r.notundef(e.dur)&&(e.dur=+e.dur);var n=e.orientation;if(r.notundef(n)&&(delete e.orientation,t&&("right, top"===n||"left, bottom"===n))){var o=e.w;e.w=e.h,e.h=o}return e},e.exports=i},function(e,t,n){"use strict";var r=n(1);r.fillPropertyWithDefault=function(e,t,n){return!!r.undef(e[t])&&(e[t]=n,!0)}},function(e,t,n){"use strict";function r(e){var t=this;t.options=o.copy(e),o.verifyOptions(e,"url fileName"),o.verifyParamPresentJustOne(e,"blob fileInput"),o.verifyCallback(e,"beginupload uploadprogress uploaddone"),e.fileInput&&(e.fileInput=o.verifyFileInput(e.fileInput)),e.type&&o.verifyFileType(e.type),e.timeout?o.verifyParamType("timeout",e.timeout,"number"):e.timeout=6e5,o.verifyFileUploadCallback(e),e.data={};var n=e.fileName,r=e.fileInput;if(a)if(r){var u=e.type?o.filterFiles(r.files,e.type):[].slice.call(r.files,0);if(!u||!u.length)return void e.uploaddone(i.newWrongFileTypeError("未读取到"+e.type+"类型的文件, 请确保文件选择节点的文件不为空, 并且请确保选择了"+e.type+"类型的文件"));var l=r.files[0].size;if(l>c)return void e.uploaddone(i.newFileTooLargeError("文件大小超过100M"));e.data[n]=u[0]}else e.blob&&(e.data[n]=e.blob);else o.dataset(r,"name",n),e.data.input=r;e.params&&o.merge(e.data,e.params);var f={data:e.data,onaftersend:function(){e.beginupload(t)},onuploading:function(t){var n=Math.floor(1e4*t.loaded/t.total)/100,r={total:t.total,loaded:t.loaded,percentage:n,percentageText:n+"%"};e.uploadprogress(r)},onload:function(n){n.Error?t.onError(n):e.uploaddone(null,n)},onerror:function(n){try{var r=JSON.parse(n.result);t.onError(r)}catch(error){e.uploaddone(new i(n.message,n.code),t.options)}}};a||(f.mode="iframe"),f.putFileAtEnd=!0,t.sn=s(e.url,f)}var o=n(1),i=n(3),s=n(25).upload,a=o.supportFormData,c=104857600;r.prototype.onError=function(e){var t,n,r,o=this,s=o.options;e=e||{},t=e.Error||{},n=t.Code||"unknown",r=t.Message||"未知错误",s.uploaddone(new i(n+"("+r+")",n))},r.prototype.abort=function(){s.abort(this.sn)},e.exports=r},function(e,t){function n(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e.exports=n,n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}},function(e,t,n){var r,o;!function(i,s){"use strict";r=s,o="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==o&&(e.exports=o))}(this,function(){var e,t,n,r,o=Function.call,i=Object.prototype,s=o.bind(i.hasOwnProperty),a=o.bind(i.propertyIsEnumerable),c=o.bind(i.toString),u=s(i,"__defineGetter__");u&&(e=o.bind(i.__defineGetter__),t=o.bind(i.__defineSetter__),n=o.bind(i.__lookupGetter__),r=o.bind(i.__lookupSetter__));var l=function(e){return null==e||"object"!=typeof e&&"function"!=typeof e};Object.getPrototypeOf||(Object.getPrototypeOf=function(e){var t=e.__proto__;return t||null===t?t:"[object Function]"===c(e.constructor)?e.constructor.prototype:e instanceof Object?i:null});var f=function(e){try{return e.sentinel=0,0===Object.getOwnPropertyDescriptor(e,"sentinel").value}catch(exception){return!1}};if(Object.defineProperty){var d=f({}),m="undefined"==typeof document||f(document.createElement("div"));if(!m||!d)var p=Object.getOwnPropertyDescriptor}if(!Object.getOwnPropertyDescriptor||p){var h="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(e,t){if(l(e))throw new TypeError(h+e);if(p)try{return p.call(Object,e,t)}catch(exception){}var o;if(!s(e,t))return o;if(o={enumerable:a(e,t),configurable:!0},u){var c=e.__proto__,f=e!==i;f&&(e.__proto__=i);var d=n(e,t),m=r(e,t);if(f&&(e.__proto__=c),d||m)return d&&(o.get=d),m&&(o.set=m),o}return o.value=e[t],o.writable=!0,o}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var g,y=!({__proto__:null}instanceof Object),v=function(){if(!document.domain)return!1;try{return!!new ActiveXObject("htmlfile")}catch(exception){return!1}},b=function(){var e,t;t=new ActiveXObject("htmlfile");var n="script";return t.write("<"+n+"></"+n+">"),t.close(),e=t.parentWindow.Object.prototype,t=null,e},M=function(){var e,t=document.createElement("iframe"),n=document.body||document.documentElement;return t.style.display="none",n.appendChild(t),t.src="javascript:",e=t.contentWindow.Object.prototype,n.removeChild(t),t=null,e};g=y||"undefined"==typeof document?function(){return{__proto__:null}}:function(){var e=v()?b():M();delete e.constructor,delete e.hasOwnProperty,delete e.propertyIsEnumerable,delete e.isPrototypeOf,delete e.toLocaleString,delete e.toString,delete e.valueOf;var t=function(){};return t.prototype=e,g=function(){return new t},new t},Object.create=function(e,t){var n,r=function(){};if(null===e)n=g();else{if(null!==e&&l(e))throw new TypeError("Object prototype may only be an Object or null");r.prototype=e,n=new r,n.__proto__=e}return void 0!==t&&Object.defineProperties(n,t),n}}var T=function(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(exception){return!1}};if(Object.defineProperty){var k=T({}),S="undefined"==typeof document||T(document.createElement("div"));if(!k||!S)var w=Object.defineProperty,C=Object.defineProperties}if(!Object.defineProperty||w){var O="Property description must be an object: ",I="Object.defineProperty called on non-object: ",x="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(o,s,a){if(l(o))throw new TypeError(I+o);if(l(a))throw new TypeError(O+a);if(w)try{return w.call(Object,o,s,a)}catch(exception){}if("value"in a)if(u&&(n(o,s)||r(o,s))){var c=o.__proto__;o.__proto__=i,delete o[s],o[s]=a.value,o.__proto__=c}else o[s]=a.value;else{var f="get"in a,d="set"in a;if(!u&&(f||d))throw new TypeError(x);f&&e(o,s,a.get),d&&t(o,s,a.set)}return o}}Object.defineProperties&&!C||(Object.defineProperties=function(e,t){if(C)try{return C.call(Object,e,t)}catch(exception){}return Object.keys(t).forEach(function(n){"__proto__"!==n&&Object.defineProperty(e,n,t[n])}),e}),Object.seal||(Object.seal=function(e){if(Object(e)!==e)throw new TypeError("Object.seal can only be called on Objects.");return e}),Object.freeze||(Object.freeze=function(e){if(Object(e)!==e)throw new TypeError("Object.freeze can only be called on Objects.");return e});try{Object.freeze(function(){})}catch(exception){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(e){if(Object(e)!==e)throw new TypeError("Object.preventExtensions can only be called on Objects.");return e}),Object.isSealed||(Object.isSealed=function(e){if(Object(e)!==e)throw new TypeError("Object.isSealed can only be called on Objects.");return!1}),Object.isFrozen||(Object.isFrozen=function(e){if(Object(e)!==e)throw new TypeError("Object.isFrozen can only be called on Objects.");return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)!==e)throw new TypeError("Object.isExtensible can only be called on Objects.");for(var t="";s(e,t);)t+="?";e[t]=!0;var n=s(e,t);return delete e[t],n})})},function(e,t,n){var r,o;!function(i,s){"use strict";r=s,o="function"==typeof r?r.call(t,n,t,e):r,!(void 0!==o&&(e.exports=o))}(this,function(){var e,t,n=Array,r=n.prototype,o=Object,i=o.prototype,s=Function,a=s.prototype,c=String,u=c.prototype,l=Number,f=l.prototype,d=r.slice,m=r.splice,p=r.push,h=r.unshift,g=r.concat,y=r.join,v=a.call,b=a.apply,M=Math.max,T=Math.min,k=i.toString,S="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,w=Function.prototype.toString,C=/^\s*class /,O=function(e){try{var t=w.call(e),n=t.replace(/\/\/.*\n/g,""),r=n.replace(/\/\*[.\s\S]*\*\//g,""),o=r.replace(/\n/gm," ").replace(/ {2}/g," ");return C.test(o)}catch(e){return!1}},I=function(e){try{return!O(e)&&(w.call(e),!0)}catch(e){return!1}},x="[object Function]",P="[object GeneratorFunction]",e=function(e){if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(S)return I(e);if(O(e))return!1;var t=k.call(e);return t===x||t===P},_=RegExp.prototype.exec,E=function(e){try{return _.call(e),!0}catch(e){return!1}},j="[object RegExp]";t=function(e){return"object"==typeof e&&(S?E(e):k.call(e)===j)};var A,F=String.prototype.valueOf,R=function(e){try{return F.call(e),!0}catch(e){return!1}},N="[object String]";A=function(e){return"string"==typeof e||"object"==typeof e&&(S?R(e):k.call(e)===N)};var D=o.defineProperty&&function(){try{var e={};o.defineProperty(e,"x",{enumerable:!1,value:e});for(var t in e)return!1;return e.x===e}catch(e){return!1}}(),U=function(e){var t;return t=D?function(e,t,n,r){!r&&t in e||o.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:n})}:function(e,t,n,r){!r&&t in e||(e[t]=n)},function(n,r,o){for(var i in r)e.call(r,i)&&t(n,i,r[i],o)}}(i.hasOwnProperty),B=function(e){var t=typeof e;return null===e||"object"!==t&&"function"!==t},L=l.isNaN||function(e){return e!==e},W={ToInteger:function(e){var t=+e;return L(t)?t=0:0!==t&&t!==1/0&&t!==-(1/0)&&(t=(t>0||-1)*Math.floor(Math.abs(t))),t},ToPrimitive:function(t){var n,r,o;if(B(t))return t;if(r=t.valueOf,e(r)&&(n=r.call(t),B(n)))return n;if(o=t.toString,e(o)&&(n=o.call(t),B(n)))return n;throw new TypeError},ToObject:function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return o(e)},ToUint32:function(e){return e>>>0}},q=function(){};U(a,{bind:function(t){var n=this;if(!e(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var r,i=d.call(arguments,1),a=function(){if(this instanceof r){var e=b.call(n,this,g.call(i,d.call(arguments)));return o(e)===e?e:this}return b.call(n,t,g.call(i,d.call(arguments)))},c=M(0,n.length-i.length),u=[],l=0;l<c;l++)p.call(u,"$"+l);return r=s("binder","return function ("+y.call(u,",")+"){ return binder.apply(this, arguments); }")(a),n.prototype&&(q.prototype=n.prototype,r.prototype=new q,q.prototype=null),r}});var H=v.bind(i.hasOwnProperty),$=v.bind(i.toString),X=v.bind(d),J=b.bind(d),V=v.bind(u.slice),z=v.bind(u.split),K=v.bind(u.indexOf),G=v.bind(p),Y=v.bind(i.propertyIsEnumerable),Z=v.bind(r.sort),Q=n.isArray||function(e){return"[object Array]"===$(e)},ee=1!==[].unshift(0);U(r,{unshift:function(){return h.apply(this,arguments),this.length}},ee),U(n,{isArray:Q});var te=o("a"),ne="a"!==te[0]||!(0 in te),re=function(e){var t=!0,n=!0,r=!1;if(e)try{e.call("foo",function(e,n,r){"object"!=typeof r&&(t=!1)}),e.call([1],function(){"use strict";n="string"==typeof this},"x")}catch(e){r=!0}return!!e&&!r&&t&&n};U(r,{forEach:function(t){var n,r=W.ToObject(this),o=ne&&A(this)?z(this,""):r,i=-1,s=W.ToUint32(o.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.forEach callback must be a function");for(;++i<s;)i in o&&("undefined"==typeof n?t(o[i],i,r):t.call(n,o[i],i,r))}},!re(r.forEach)),U(r,{map:function(t){var r,o=W.ToObject(this),i=ne&&A(this)?z(this,""):o,s=W.ToUint32(i.length),a=n(s);if(arguments.length>1&&(r=arguments[1]),!e(t))throw new TypeError("Array.prototype.map callback must be a function");for(var c=0;c<s;c++)c in i&&("undefined"==typeof r?a[c]=t(i[c],c,o):a[c]=t.call(r,i[c],c,o));return a}},!re(r.map)),U(r,{filter:function(t){var n,r,o=W.ToObject(this),i=ne&&A(this)?z(this,""):o,s=W.ToUint32(i.length),a=[];if(arguments.length>1&&(r=arguments[1]),!e(t))throw new TypeError("Array.prototype.filter callback must be a function");for(var c=0;c<s;c++)c in i&&(n=i[c],("undefined"==typeof r?t(n,c,o):t.call(r,n,c,o))&&G(a,n));return a}},!re(r.filter)),U(r,{every:function(t){var n,r=W.ToObject(this),o=ne&&A(this)?z(this,""):r,i=W.ToUint32(o.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.every callback must be a function");for(var s=0;s<i;s++)if(s in o&&!("undefined"==typeof n?t(o[s],s,r):t.call(n,o[s],s,r)))return!1;return!0}},!re(r.every)),U(r,{some:function(t){var n,r=W.ToObject(this),o=ne&&A(this)?z(this,""):r,i=W.ToUint32(o.length);if(arguments.length>1&&(n=arguments[1]),!e(t))throw new TypeError("Array.prototype.some callback must be a function");for(var s=0;s<i;s++)if(s in o&&("undefined"==typeof n?t(o[s],s,r):t.call(n,o[s],s,r)))return!0;return!1}},!re(r.some));var oe=!1;r.reduce&&(oe="object"==typeof r.reduce.call("es5",function(e,t,n,r){return r})),U(r,{reduce:function(t){var n=W.ToObject(this),r=ne&&A(this)?z(this,""):n,o=W.ToUint32(r.length);if(!e(t))throw new TypeError("Array.prototype.reduce callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduce of empty array with no initial value");var i,s=0;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in r){i=r[s++];break}if(++s>=o)throw new TypeError("reduce of empty array with no initial value")}for(;s<o;s++)s in r&&(i=t(i,r[s],s,n));return i}},!oe);var ie=!1;r.reduceRight&&(ie="object"==typeof r.reduceRight.call("es5",function(e,t,n,r){return r})),U(r,{reduceRight:function(t){var n=W.ToObject(this),r=ne&&A(this)?z(this,""):n,o=W.ToUint32(r.length);if(!e(t))throw new TypeError("Array.prototype.reduceRight callback must be a function");if(0===o&&1===arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var i,s=o-1;if(arguments.length>=2)i=arguments[1];else for(;;){if(s in r){i=r[s--];break}if(--s<0)throw new TypeError("reduceRight of empty array with no initial value")}if(s<0)return i;do s in r&&(i=t(i,r[s],s,n));while(s--);return i}},!ie);var se=r.indexOf&&[0,1].indexOf(1,2)!==-1;U(r,{indexOf:function(e){var t=ne&&A(this)?z(this,""):W.ToObject(this),n=W.ToUint32(t.length);if(0===n)return-1;var r=0;for(arguments.length>1&&(r=W.ToInteger(arguments[1])),r=r>=0?r:M(0,n+r);r<n;r++)if(r in t&&t[r]===e)return r;return-1}},se);var ae=r.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;U(r,{lastIndexOf:function(e){var t=ne&&A(this)?z(this,""):W.ToObject(this),n=W.ToUint32(t.length);if(0===n)return-1;var r=n-1;for(arguments.length>1&&(r=T(r,W.ToInteger(arguments[1]))),r=r>=0?r:n-Math.abs(r);r>=0;r--)if(r in t&&e===t[r])return r;return-1}},ae);var ce=function(){var e=[1,2],t=e.splice();return 2===e.length&&Q(t)&&0===t.length}();U(r,{splice:function(e,t){return 0===arguments.length?[]:m.apply(this,arguments)}},!ce);var ue=function(){var e={};return r.splice.call(e,0,0,1),1===e.length}();U(r,{splice:function(e,t){if(0===arguments.length)return[];var n=arguments;return this.length=M(W.ToInteger(this.length),0),arguments.length>0&&"number"!=typeof t&&(n=X(arguments),n.length<2?G(n,this.length-e):n[1]=W.ToInteger(t)),m.apply(this,n)}},!ue);var le=function(){var e=new n(1e5);return e[8]="x",e.splice(1,1),7===e.indexOf("x")}(),fe=function(){var e=256,t=[];return t[e]="a",t.splice(e+1,0,"b"),"a"===t[e]}();U(r,{splice:function(e,t){for(var n,r=W.ToObject(this),o=[],i=W.ToUint32(r.length),s=W.ToInteger(e),a=s<0?M(i+s,0):T(s,i),u=T(M(W.ToInteger(t),0),i-a),l=0;l<u;)n=c(a+l),H(r,n)&&(o[l]=r[n]),l+=1;var f,d=X(arguments,2),m=d.length;if(m<u){l=a;for(var p=i-u;l<p;)n=c(l+u),f=c(l+m),H(r,n)?r[f]=r[n]:delete r[f],l+=1;l=i;for(var h=i-u+m;l>h;)delete r[l-1],l-=1}else if(m>u)for(l=i-u;l>a;)n=c(l+u-1),f=c(l+m-1),H(r,n)?r[f]=r[n]:delete r[f],l-=1;l=a;for(var g=0;g<d.length;++g)r[l]=d[g],l+=1;return r.length=i-u+m,o}},!le||!fe);var de,me=r.join;try{de="1,2,3"!==Array.prototype.join.call("123",",")}catch(e){de=!0}de&&U(r,{join:function(e){var t="undefined"==typeof e?",":e;return me.call(A(this)?z(this,""):this,t)}},de);var pe="1,2"!==[1,2].join(void 0);pe&&U(r,{join:function(e){var t="undefined"==typeof e?",":e;return me.call(this,t)}},pe);var he=function(e){for(var t=W.ToObject(this),n=W.ToUint32(t.length),r=0;r<arguments.length;)t[n+r]=arguments[r],r+=1;return t.length=n+r,n+r},ge=function(){var e={},t=Array.prototype.push.call(e,void 0);return 1!==t||1!==e.length||"undefined"!=typeof e[0]||!H(e,0)}();U(r,{push:function(e){return Q(this)?p.apply(this,arguments):he.apply(this,arguments)}},ge);var ye=function(){var e=[],t=e.push(void 0);return 1!==t||1!==e.length||"undefined"!=typeof e[0]||!H(e,0)}();U(r,{push:he},ye),U(r,{slice:function(e,t){var n=A(this)?z(this,""):this;return J(n,arguments)}},ne);var ve=function(){try{return[1,2].sort(null),[1,2].sort({}),!0}catch(e){}return!1}(),be=function(){try{return[1,2].sort(/a/),!1}catch(e){}return!0}(),Me=function(){try{return[1,2].sort(void 0),!0}catch(e){}return!1}();U(r,{sort:function(t){if("undefined"==typeof t)return Z(this);if(!e(t))throw new TypeError("Array.prototype.sort callback must be a function");return Z(this,t)}},ve||!Me||!be);var Te=!Y({toString:null},"toString"),ke=Y(function(){},"prototype"),Se=!H("x","0"),we=function(e){var t=e.constructor;return t&&t.prototype===e},Ce={$window:!0,$console:!0,$parent:!0,$self:!0,$frame:!0,$frames:!0,$frameElement:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$external:!0},Oe=function(){if("undefined"==typeof window)return!1;for(var e in window)try{!Ce["$"+e]&&H(window,e)&&null!==window[e]&&"object"==typeof window[e]&&we(window[e])}catch(e){return!0}return!1}(),Ie=function(e){if("undefined"==typeof window||!Oe)return we(e);try{return we(e)}catch(e){return!1}},xe=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Pe=xe.length,_e=function(e){return"[object Arguments]"===$(e)},Ee=function(t){return null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&!Q(t)&&e(t.callee)},je=_e(arguments)?_e:Ee;U(o,{keys:function(t){var n=e(t),r=je(t),o=null!==t&&"object"==typeof t,i=o&&A(t);if(!o&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var s=[],a=ke&&n;if(i&&Se||r)for(var u=0;u<t.length;++u)G(s,c(u));if(!r)for(var l in t)a&&"prototype"===l||!H(t,l)||G(s,c(l));if(Te)for(var f=Ie(t),d=0;d<Pe;d++){var m=xe[d];f&&"constructor"===m||!H(t,m)||G(s,m)}return s}});var Ae=o.keys&&function(){return 2===o.keys(arguments).length}(1,2),Fe=o.keys&&function(){var e=o.keys(arguments);return 1!==arguments.length||1!==e.length||1!==e[0]}(1),Re=o.keys;U(o,{keys:function(e){return Re(je(e)?X(e):e)}},!Ae||Fe);var Ne,De,Ue=0!==new Date(-0xc782b5b342b24).getUTCMonth(),Be=new Date(-0x55d318d56a724),Le=new Date(14496624e5),We="Mon, 01 Jan -45875 11:59:59 GMT"!==Be.toUTCString(),qe=Be.getTimezoneOffset();qe<-720?(Ne="Tue Jan 02 -45875"!==Be.toDateString(),De=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Le.toString())):(Ne="Mon Jan 01 -45875"!==Be.toDateString(),De=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Le.toString()));var He=v.bind(Date.prototype.getFullYear),$e=v.bind(Date.prototype.getMonth),Xe=v.bind(Date.prototype.getDate),Je=v.bind(Date.prototype.getUTCFullYear),Ve=v.bind(Date.prototype.getUTCMonth),ze=v.bind(Date.prototype.getUTCDate),Ke=v.bind(Date.prototype.getUTCDay),Ge=v.bind(Date.prototype.getUTCHours),Ye=v.bind(Date.prototype.getUTCMinutes),Ze=v.bind(Date.prototype.getUTCSeconds),Qe=v.bind(Date.prototype.getUTCMilliseconds),et=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],tt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nt=function(e,t){return Xe(new Date(t,e,0))};U(Date.prototype,{getFullYear:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this);return e<0&&$e(this)>11?e+1:e},getMonth:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this),t=$e(this);return e<0&&t>11?0:t},getDate:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=He(this),t=$e(this),n=Xe(this);if(e<0&&t>11){if(12===t)return n;var r=nt(0,e+1);return r-n+1}return n},getUTCFullYear:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Je(this);return e<0&&Ve(this)>11?e+1:e},getUTCMonth:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Je(this),t=Ve(this);return e<0&&t>11?0:t},getUTCDate:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Je(this),t=Ve(this),n=ze(this);if(e<0&&t>11){if(12===t)return n;var r=nt(0,e+1);return r-n+1}return n}},Ue),U(Date.prototype,{toUTCString:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=Ke(this),t=ze(this),n=Ve(this),r=Je(this),o=Ge(this),i=Ye(this),s=Ze(this);return et[e]+", "+(t<10?"0"+t:t)+" "+tt[n]+" "+r+" "+(o<10?"0"+o:o)+":"+(i<10?"0"+i:i)+":"+(s<10?"0"+s:s)+" GMT"}},Ue||We),U(Date.prototype,{toDateString:function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=this.getDay(),t=this.getDate(),n=this.getMonth(),r=this.getFullYear();return et[e]+" "+tt[n]+" "+(t<10?"0"+t:t)+" "+r}},Ue||Ne),(Ue||De)&&(Date.prototype.toString=function(){if(!(this&&this instanceof Date))throw new TypeError("this is not a Date object.");var e=this.getDay(),t=this.getDate(),n=this.getMonth(),r=this.getFullYear(),o=this.getHours(),i=this.getMinutes(),s=this.getSeconds(),a=this.getTimezoneOffset(),c=Math.floor(Math.abs(a)/60),u=Math.floor(Math.abs(a)%60);return et[e]+" "+tt[n]+" "+(t<10?"0"+t:t)+" "+r+" "+(o<10?"0"+o:o)+":"+(i<10?"0"+i:i)+":"+(s<10?"0"+s:s)+" GMT"+(a>0?"-":"+")+(c<10?"0"+c:c)+(u<10?"0"+u:u)},D&&o.defineProperty(Date.prototype,"toString",{configurable:!0,enumerable:!1,writable:!0}));var rt=-621987552e5,ot="-000001",it=Date.prototype.toISOString&&new Date(rt).toISOString().indexOf(ot)===-1,st=Date.prototype.toISOString&&"1969-12-31T23:59:59.999Z"!==new Date(-1).toISOString(),at=v.bind(Date.prototype.getTime);U(Date.prototype,{toISOString:function(){if(!isFinite(this)||!isFinite(at(this)))throw new RangeError("Date.prototype.toISOString called on non-finite value.");var e=Je(this),t=Ve(this);e+=Math.floor(t/12),t=(t%12+12)%12;var n=[t+1,ze(this),Ge(this),Ye(this),Ze(this)];e=(e<0?"-":e>9999?"+":"")+V("00000"+Math.abs(e),0<=e&&e<=9999?-4:-6);for(var r=0;r<n.length;++r)n[r]=V("00"+n[r],-2);return e+"-"+X(n,0,2).join("-")+"T"+X(n,2).join(":")+"."+V("000"+Qe(this),-3)+"Z"}},it||st);var ct=function(){try{return Date.prototype.toJSON&&null===new Date(NaN).toJSON()&&new Date(rt).toJSON().indexOf(ot)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return!0}})}catch(e){return!1}}();ct||(Date.prototype.toJSON=function(t){var n=o(this),r=W.ToPrimitive(n);if("number"==typeof r&&!isFinite(r))return null;var i=n.toISOString;if(!e(i))throw new TypeError("toISOString property is not callable");return i.call(n)});var ut=1e15===Date.parse("+033658-09-27T01:46:40.000Z"),lt=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z")),ft=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(ft||lt||!ut){var dt=Math.pow(2,31)-1,mt=L(new Date(1970,0,1,0,0,0,dt+1).getTime());Date=function(e){var t=function(n,r,o,i,s,a,u){var l,f=arguments.length;if(this instanceof e){var d=a,m=u;if(mt&&f>=7&&u>dt){var p=Math.floor(u/dt)*dt,h=Math.floor(p/1e3);d+=h,m-=1e3*h}l=1===f&&c(n)===n?new e(t.parse(n)):f>=7?new e(n,r,o,i,s,d,m):f>=6?new e(n,r,o,i,s,d):f>=5?new e(n,r,o,i,s):f>=4?new e(n,r,o,i):f>=3?new e(n,r,o):f>=2?new e(n,r):f>=1?new e(n instanceof e?+n:n):new e}else l=e.apply(this,arguments);return B(l)||U(l,{constructor:t},!0),l},n=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:(\\.\\d{1,}))?)?(Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$"),r=[0,31,59,90,120,151,181,212,243,273,304,334,365],o=function(e,t){var n=t>1?1:0;return r[t]+Math.floor((e-1969+n)/4)-Math.floor((e-1901+n)/100)+Math.floor((e-1601+n)/400)+365*(e-1970)},i=function(t){var n=0,r=t;if(mt&&r>dt){var o=Math.floor(r/dt)*dt,i=Math.floor(o/1e3);n+=i,r-=1e3*i}return l(new e(1970,0,1,0,0,n,r))};for(var s in e)H(e,s)&&(t[s]=e[s]);U(t,{now:e.now,UTC:e.UTC},!0),t.prototype=e.prototype,U(t.prototype,{constructor:t},!0);var a=function(t){var r=n.exec(t);if(r){var s,a=l(r[1]),c=l(r[2]||1)-1,u=l(r[3]||1)-1,f=l(r[4]||0),d=l(r[5]||0),m=l(r[6]||0),p=Math.floor(1e3*l(r[7]||0)),h=Boolean(r[4]&&!r[8]),g="-"===r[9]?1:-1,y=l(r[10]||0),v=l(r[11]||0),b=d>0||m>0||p>0;return f<(b?24:25)&&d<60&&m<60&&p<1e3&&c>-1&&c<12&&y<24&&v<60&&u>-1&&u<o(a,c+1)-o(a,c)&&(s=60*(24*(o(a,c)+u)+f+y*g),s=1e3*(60*(s+d+v*g)+m)+p,h&&(s=i(s)),-864e13<=s&&s<=864e13)?s:NaN}return e.parse.apply(this,arguments)};return U(t,{parse:a}),t}(Date)}Date.now||(Date.now=function(){return(new Date).getTime()});var pt=f.toFixed&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0)),ht={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function(e,t){for(var n=-1,r=t;++n<ht.size;)r+=e*ht.data[n],ht.data[n]=r%ht.base,r=Math.floor(r/ht.base)},divide:function(e){for(var t=ht.size,n=0;--t>=0;)n+=ht.data[t],ht.data[t]=Math.floor(n/e),n=n%e*ht.base},numToString:function(){for(var e=ht.size,t="";--e>=0;)if(""!==t||0===e||0!==ht.data[e]){var n=c(ht.data[e]);""===t?t=n:t+=V("0000000",0,7-n.length)+n}return t},pow:function Rt(e,t,n){return 0===t?n:t%2===1?Rt(e,t-1,n*e):Rt(e*e,t/2,n)},log:function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}},gt=function(e){var t,n,r,o,i,s,a,u;if(t=l(e),t=L(t)?0:Math.floor(t),t<0||t>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(n=l(this),L(n))return"NaN";if(n<=-1e21||n>=1e21)return c(n);if(r="",n<0&&(r="-",n=-n),o="0",n>1e-21)if(i=ht.log(n*ht.pow(2,69,1))-69,s=i<0?n*ht.pow(2,-i,1):n/ht.pow(2,i,1),s*=4503599627370496,i=52-i,i>0){for(ht.multiply(0,s),a=t;a>=7;)ht.multiply(1e7,0),a-=7;for(ht.multiply(ht.pow(10,a,1),0),a=i-1;a>=23;)ht.divide(1<<23),a-=23;ht.divide(1<<a),ht.multiply(1,1),ht.divide(2),o=ht.numToString()}else ht.multiply(0,s),ht.multiply(1<<-i,0),o=ht.numToString()+V("0.00000000000000000000",2,2+t);return t>0?(u=o.length,o=u<=t?r+V("0.0000000000000000000",0,t-u+2)+o:r+V(o,0,u-t)+"."+V(o,u-t)):o=r+o,o};U(f,{toFixed:gt},pt);var yt=function(){try{return"1"===1..toPrecision(void 0)}catch(e){return!0}}(),vt=f.toPrecision;U(f,{toPrecision:function(e){return"undefined"==typeof e?vt.call(this):vt.call(this,e)}},yt),2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?!function(){var e="undefined"==typeof/()??/.exec("")[1],n=Math.pow(2,32)-1;u.split=function(r,o){var i=String(this);if("undefined"==typeof r&&0===o)return[];if(!t(r))return z(this,r,o);var s,a,c,u,l=[],f=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(r.sticky?"y":""),d=0,m=new RegExp(r.source,f+"g");e||(s=new RegExp("^"+m.source+"$(?!\\s)",f));var h="undefined"==typeof o?n:W.ToUint32(o);for(a=m.exec(i);a&&(c=a.index+a[0].length,!(c>d&&(G(l,V(i,d,a.index)),!e&&a.length>1&&a[0].replace(s,function(){for(var e=1;e<arguments.length-2;e++)"undefined"==typeof arguments[e]&&(a[e]=void 0)}),a.length>1&&a.index<i.length&&p.apply(l,X(a,1)),u=a[0].length,d=c,
  l.length>=h)));)m.lastIndex===a.index&&m.lastIndex++,a=m.exec(i);return d===i.length?!u&&m.test("")||G(l,""):G(l,V(i,d)),l.length>h?X(l,0,h):l}}():"0".split(void 0,0).length&&(u.split=function(e,t){return"undefined"==typeof e&&0===t?[]:z(this,e,t)});var bt=u.replace,Mt=function(){var e=[];return"x".replace(/x(.)?/g,function(t,n){G(e,n)}),1===e.length&&"undefined"==typeof e[0]}();Mt||(u.replace=function(n,r){var o=e(r),i=t(n)&&/\)[*?]/.test(n.source);if(o&&i){var s=function(e){var t=arguments.length,o=n.lastIndex;n.lastIndex=0;var i=n.exec(e)||[];return n.lastIndex=o,G(i,arguments[t-2],arguments[t-1]),r.apply(this,i)};return bt.call(this,n,s)}return bt.call(this,n,r)});var Tt=u.substr,kt="".substr&&"b"!=="0b".substr(-1);U(u,{substr:function(e,t){var n=e;return e<0&&(n=M(this.length+e,0)),Tt.call(this,n,t)}},kt);var St="\t\n\x0B\f\r   ᠎             　\u2028\u2029\ufeff",wt="​",Ct="["+St+"]",Ot=new RegExp("^"+Ct+Ct+"*"),It=new RegExp(Ct+Ct+"*$"),xt=u.trim&&(St.trim()||!wt.trim());U(u,{trim:function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return c(this).replace(Ot,"").replace(It,"")}},xt);var Pt=v.bind(String.prototype.trim),_t=u.lastIndexOf&&"abcあい".lastIndexOf("あい",2)!==-1;U(u,{lastIndexOf:function(e){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");for(var t=c(this),n=c(e),r=arguments.length>1?l(arguments[1]):NaN,o=L(r)?1/0:W.ToInteger(r),i=T(M(o,0),t.length),s=n.length,a=i+s;a>0;){a=M(0,a-s);var u=K(V(t,a,i+s),n);if(u!==-1)return a+u}return-1}},_t);var Et=u.lastIndexOf;if(U(u,{lastIndexOf:function(e){return Et.apply(this,arguments)}},1!==u.lastIndexOf.length),8===parseInt(St+"08")&&22===parseInt(St+"0x16")||(parseInt=function(e){var t=/^[\-+]?0[xX]/;return function(n,r){var o=Pt(String(n)),i=l(r)||(t.test(o)?16:10);return e(o,i)}}(parseInt)),1/parseFloat("-0")!==-(1/0)&&(parseFloat=function(e){return function(t){var n=Pt(String(t)),r=e(n);return 0===r&&"-"===V(n,0,1)?-0:r}}(parseFloat)),"RangeError: test"!==String(new RangeError("test"))){var jt=function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");var e=this.name;"undefined"==typeof e?e="Error":"string"!=typeof e&&(e=c(e));var t=this.message;return"undefined"==typeof t?t="":"string"!=typeof t&&(t=c(t)),e?t?e+": "+t:e:t};Error.prototype.toString=jt}if(D){var At=function(e,t){if(Y(e,t)){var n=Object.getOwnPropertyDescriptor(e,t);n.configurable&&(n.enumerable=!1,Object.defineProperty(e,t,n))}};At(Error.prototype,"message"),""!==Error.prototype.message&&(Error.prototype.message=""),At(Error.prototype,"name")}if("/a/gim"!==String(/a/gim)){var Ft=function(){var e="/"+this.source+"/";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),e};RegExp.prototype.toString=Ft}})},function(e,t,n){function r(e,t,n){if(!a(t))throw new TypeError("iterator must be a function");arguments.length<3&&(n=this),"[object Array]"===c.call(e)?o(e,t,n):"string"==typeof e?i(e,t,n):s(e,t,n)}function o(e,t,n){for(var r=0,o=e.length;r<o;r++)u.call(e,r)&&t.call(n,e[r],r,e)}function i(e,t,n){for(var r=0,o=e.length;r<o;r++)t.call(n,e.charAt(r),r,e)}function s(e,t,n){for(var r in e)u.call(e,r)&&t.call(n,e[r],r,e)}var a=n(31);e.exports=r;var c=Object.prototype.toString,u=Object.prototype.hasOwnProperty},function(e,t){(function(t){"undefined"!=typeof window?e.exports=window:"undefined"!=typeof t?e.exports=t:"undefined"!=typeof self?e.exports=self:e.exports={}}).call(t,function(){return this}())},function(e,t,n){var r;(function(e,o){(function(){function i(e,t){function n(e){if(n[e]!==g)return n[e];var i;if("bug-string-char-index"==e)i="a"!="a"[0];else if("json"==e)i=n("json-stringify")&&n("json-parse");else{var s,a='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var u=t.stringify,l="function"==typeof u&&b;if(l){(s=function(){return 1}).toJSON=s;try{l="0"===u(0)&&"0"===u(new r)&&'""'==u(new o)&&u(v)===g&&u(g)===g&&u()===g&&"1"===u(s)&&"[1]"==u([s])&&"[null]"==u([g])&&"null"==u(null)&&"[null,null,null]"==u([g,v,null])&&u({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==a&&"1"===u(null,s)&&"[\n 1,\n 2\n]"==u([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==u(new c(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==u(new c(864e13))&&'"-000001-01-01T00:00:00.000Z"'==u(new c(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==u(new c(-1))}catch(exception){l=!1}}i=l}if("json-parse"==e){var f=t.parse;if("function"==typeof f)try{if(0===f("0")&&!f(!1)){s=f(a);var d=5==s.a.length&&1===s.a[0];if(d){try{d=!f('"\t"')}catch(exception){}if(d)try{d=1!==f("01")}catch(exception){}if(d)try{d=1!==f("1.")}catch(exception){}}}}catch(exception){d=!1}i=d}}return n[e]=!!i}e||(e=u.Object()),t||(t=u.Object());var r=e.Number||u.Number,o=e.String||u.String,s=e.Object||u.Object,c=e.Date||u.Date,l=e.SyntaxError||u.SyntaxError,f=e.TypeError||u.TypeError,d=e.Math||u.Math,m=e.JSON||u.JSON;"object"==typeof m&&m&&(t.stringify=m.stringify,t.parse=m.parse);var p,h,g,y=s.prototype,v=y.toString,b=new c(-0xc782b5b800cec);try{b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}catch(exception){}if(!n("json")){var M="[object Function]",T="[object Date]",k="[object Number]",S="[object String]",w="[object Array]",C="[object Boolean]",O=n("bug-string-char-index");if(!b)var I=d.floor,x=[0,31,59,90,120,151,181,212,243,273,304,334],P=function(e,t){return x[t]+365*(e-1970)+I((e-1969+(t=+(t>1)))/4)-I((e-1901+t)/100)+I((e-1601+t)/400)};if((p=y.hasOwnProperty)||(p=function(e){var t,n={};return(n.__proto__=null,n.__proto__={toString:1},n).toString!=v?p=function(e){var t=this.__proto__,n=e in(this.__proto__=null,this);return this.__proto__=t,n}:(t=n.constructor,p=function(e){var n=(this.constructor||t).prototype;return e in this&&!(e in n&&this[e]===n[e])}),n=null,p.call(this,e)}),h=function(e,t){var n,r,o,i=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(o in r)p.call(r,o)&&i++;return n=r=null,i?h=2==i?function(e,t){var n,r={},o=v.call(e)==M;for(n in e)o&&"prototype"==n||p.call(r,n)||!(r[n]=1)||!p.call(e,n)||t(n)}:function(e,t){var n,r,o=v.call(e)==M;for(n in e)o&&"prototype"==n||!p.call(e,n)||(r="constructor"===n)||t(n);(r||p.call(e,n="constructor"))&&t(n)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],h=function(e,t){var n,o,i=v.call(e)==M,s=!i&&"function"!=typeof e.constructor&&a[typeof e.hasOwnProperty]&&e.hasOwnProperty||p;for(n in e)i&&"prototype"==n||!s.call(e,n)||t(n);for(o=r.length;n=r[--o];s.call(e,n)&&t(n));}),h(e,t)},!n("json-stringify")){var _={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},E="000000",j=function(e,t){return(E+(t||0)).slice(-e)},A="\\u00",F=function(e){for(var t='"',n=0,r=e.length,o=!O||r>10,i=o&&(O?e.split(""):e);n<r;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+=A+j(2,s.toString(16));break}t+=o?i[n]:e.charAt(n)}}return t+'"'},R=function(e,t,n,r,o,i,s){var a,c,u,l,d,m,y,b,M,O,x,_,E,A,N,D;try{a=t[e]}catch(exception){}if("object"==typeof a&&a)if(c=v.call(a),c!=T||p.call(a,"toJSON"))"function"==typeof a.toJSON&&(c!=k&&c!=S&&c!=w||p.call(a,"toJSON"))&&(a=a.toJSON(e));else if(a>-1/0&&a<1/0){if(P){for(d=I(a/864e5),u=I(d/365.2425)+1970-1;P(u+1,0)<=d;u++);for(l=I((d-P(u,0))/30.42);P(u,l+1)<=d;l++);d=1+d-P(u,l),m=(a%864e5+864e5)%864e5,y=I(m/36e5)%24,b=I(m/6e4)%60,M=I(m/1e3)%60,O=m%1e3}else u=a.getUTCFullYear(),l=a.getUTCMonth(),d=a.getUTCDate(),y=a.getUTCHours(),b=a.getUTCMinutes(),M=a.getUTCSeconds(),O=a.getUTCMilliseconds();a=(u<=0||u>=1e4?(u<0?"-":"+")+j(6,u<0?-u:u):j(4,u))+"-"+j(2,l+1)+"-"+j(2,d)+"T"+j(2,y)+":"+j(2,b)+":"+j(2,M)+"."+j(3,O)+"Z"}else a=null;if(n&&(a=n.call(t,e,a)),null===a)return"null";if(c=v.call(a),c==C)return""+a;if(c==k)return a>-1/0&&a<1/0?""+a:"null";if(c==S)return F(""+a);if("object"==typeof a){for(A=s.length;A--;)if(s[A]===a)throw f();if(s.push(a),x=[],N=i,i+=o,c==w){for(E=0,A=a.length;E<A;E++)_=R(E,a,n,r,o,i,s),x.push(_===g?"null":_);D=x.length?o?"[\n"+i+x.join(",\n"+i)+"\n"+N+"]":"["+x.join(",")+"]":"[]"}else h(r||a,function(e){var t=R(e,a,n,r,o,i,s);t!==g&&x.push(F(e)+":"+(o?" ":"")+t)}),D=x.length?o?"{\n"+i+x.join(",\n"+i)+"\n"+N+"}":"{"+x.join(",")+"}":"{}";return s.pop(),D}};t.stringify=function(e,t,n){var r,o,i,s;if(a[typeof t]&&t)if((s=v.call(t))==M)o=t;else if(s==w){i={};for(var c,u=0,l=t.length;u<l;c=t[u++],s=v.call(c),(s==S||s==k)&&(i[c]=1));}if(n)if((s=v.call(n))==k){if((n-=n%1)>0)for(r="",n>10&&(n=10);r.length<n;r+=" ");}else s==S&&(r=n.length<=10?n:n.slice(0,10));return R("",(c={},c[""]=e,c),o,i,r,"",[])}}if(!n("json-parse")){var N,D,U=o.fromCharCode,B={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},L=function(){throw N=D=null,l()},W=function(){for(var e,t,n,r,o,i=D,s=i.length;N<s;)switch(o=i.charCodeAt(N)){case 9:case 10:case 13:case 32:N++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=O?i.charAt(N):i[N],N++,e;case 34:for(e="@",N++;N<s;)if(o=i.charCodeAt(N),o<32)L();else if(92==o)switch(o=i.charCodeAt(++N)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=B[o],N++;break;case 117:for(t=++N,n=N+4;N<n;N++)o=i.charCodeAt(N),o>=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70||L();e+=U("0x"+i.slice(t,N));break;default:L()}else{if(34==o)break;for(o=i.charCodeAt(N),t=N;o>=32&&92!=o&&34!=o;)o=i.charCodeAt(++N);e+=i.slice(t,N)}if(34==i.charCodeAt(N))return N++,e;L();default:if(t=N,45==o&&(r=!0,o=i.charCodeAt(++N)),o>=48&&o<=57){for(48==o&&(o=i.charCodeAt(N+1),o>=48&&o<=57)&&L(),r=!1;N<s&&(o=i.charCodeAt(N),o>=48&&o<=57);N++);if(46==i.charCodeAt(N)){for(n=++N;n<s&&(o=i.charCodeAt(n),o>=48&&o<=57);n++);n==N&&L(),N=n}if(o=i.charCodeAt(N),101==o||69==o){for(o=i.charCodeAt(++N),43!=o&&45!=o||N++,n=N;n<s&&(o=i.charCodeAt(n),o>=48&&o<=57);n++);n==N&&L(),N=n}return+i.slice(t,N)}if(r&&L(),"true"==i.slice(N,N+4))return N+=4,!0;if("false"==i.slice(N,N+5))return N+=5,!1;if("null"==i.slice(N,N+4))return N+=4,null;L()}return"$"},q=function(e){var t,n;if("$"==e&&L(),"string"==typeof e){if("@"==(O?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=W(),"]"!=e;n||(n=!0))n&&(","==e?(e=W(),"]"==e&&L()):L()),","==e&&L(),t.push(q(e));return t}if("{"==e){for(t={};e=W(),"}"!=e;n||(n=!0))n&&(","==e?(e=W(),"}"==e&&L()):L()),","!=e&&"string"==typeof e&&"@"==(O?e.charAt(0):e[0])&&":"==W()||L(),t[e.slice(1)]=q(W());return t}L()}return e},H=function(e,t,n){var r=$(e,t,n);r===g?delete e[t]:e[t]=r},$=function(e,t,n){var r,o=e[t];if("object"==typeof o&&o)if(v.call(o)==w)for(r=o.length;r--;)H(o,r,n);else h(o,function(e){H(o,e,n)});return n.call(e,t,o)};t.parse=function(e,t){var n,r;return N=0,D=""+e,n=q(W()),"$"!=W()&&L(),N=D=null,t&&v.call(t)==M?$((r={},r[""]=n,r),"",t):n}}}return t.runInContext=i,t}var s=n(70),a={"function":!0,object:!0},c=a[typeof t]&&t&&!t.nodeType&&t,u=a[typeof window]&&window||this,l=c&&a[typeof e]&&e&&!e.nodeType&&"object"==typeof o&&o;if(!l||l.global!==l&&l.window!==l&&l.self!==l||(u=l),c&&!s)i(u,c);else{var f=u.JSON,d=u.JSON3,m=!1,p=i(u,u.JSON3={noConflict:function(){return m||(m=!0,u.JSON=f,u.JSON3=d,f=d=null),p}});u.JSON={parse:p.parse,stringify:p.stringify}}s&&(r=function(){return p}.call(t,n,t,e),!(void 0!==r&&(e.exports=r)))}).call(this)}).call(t,n(22)(e),function(){return this}())},function(e,t,n){var r=n(67),o=n(63),i=function(e){return"[object Array]"===Object.prototype.toString.call(e)};e.exports=function(e){if(!e)return{};var t={};return o(r(e).split("\n"),function(e){var n=e.indexOf(":"),o=r(e.slice(0,n)).toLowerCase(),s=r(e.slice(n+1));"undefined"==typeof t[o]?t[o]=s:i(t[o])?t[o].push(s):t[o]=[t[o],s]}),t}},function(e,t){function n(e){return e.replace(/^\s*|\s*$/g,"")}t=e.exports=n,t.left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<e.length;n++)t(e[n])}function o(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function i(e,t,n){var r=e;return f(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=m(t,{uri:e}),r.callback=n,r}function s(e,t,n){return t=i(e,t,n),a(t)}function a(e){function t(){4===f.readyState&&i()}function n(){var e=void 0;if(e=f.response?f.response:f.responseText||c(f),T)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(h),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,u(e,l)}function i(){if(!p){var t;clearTimeout(h),t=e.useXDR&&void 0===f.status?200:1223===f.status?204:f.status;var r=l,o=null;return 0!==t?(r={body:n(),statusCode:t,method:y,headers:{},url:g,rawRequest:f},f.getAllResponseHeaders&&(r.headers=d(f.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),u(o,r,r.body)}}if("undefined"==typeof e.callback)throw new Error("callback argument missing");var a=!1,u=function(t,n,r){a||(a=!0,e.callback(t,n,r))},l={body:void 0,headers:{},statusCode:0,method:y,url:g,rawRequest:f},f=e.xhr||null;f||(f=e.cors||e.useXDR?new s.XDomainRequest:new s.XMLHttpRequest);var m,p,h,g=f.url=e.uri||e.url,y=f.method=e.method||"GET",v=e.body||e.data||null,b=f.headers=e.headers||{},M=!!e.sync,T=!1;if("json"in e&&e.json!==!1&&(T=!0,b.accept||b.Accept||(b.Accept="application/json"),"GET"!==y&&"HEAD"!==y&&(b["content-type"]||b["Content-Type"]||(b["Content-Type"]="application/json"),v=JSON.stringify(e.json===!0?v:e.json))),f.onreadystatechange=t,f.onload=i,f.onerror=r,f.onprogress=function(){},f.onabort=function(){p=!0},f.ontimeout=r,f.open(y,g,!M,e.username,e.password),M||(f.withCredentials=!!e.withCredentials),!M&&e.timeout>0&&(h=setTimeout(function(){if(!p){p=!0,f.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}},e.timeout)),f.setRequestHeader)for(m in b)b.hasOwnProperty(m)&&f.setRequestHeader(m,b[m]);else if(e.headers&&!o(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(f.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(f),f.send(v),f}function c(e){if("document"===e.responseType)return e.responseXML;var t=204===e.status&&e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function u(){}var l=n(64),f=n(31),d=n(66),m=n(69);e.exports=s,s.XMLHttpRequest=l.XMLHttpRequest||u,s.XDomainRequest="withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:l.XDomainRequest,r(["get","put","post","patch","head","delete"],function(e){s["delete"===e?"del":e]=function(t,n,r){return n=i(t,n,r),n.method=e.toUpperCase(),a(n)}})},function(e,t){function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var o in n)r.call(n,o)&&(e[o]=n[o])}return e}e.exports=n;var r=Object.prototype.hasOwnProperty},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t){},function(e,t,n){"use strict";var r=n(1),o=r.undef,i=r.verifyOptions,s=r.verifyParamType,a=n(37),c=n(35).fn;c.updateMyChatroomMemberInfo=function(e){i(e,"member needNotify"),s("needNotify",e.needNotify,"boolean"),this.processCustom(e),this.processCallback(e),e.chatroomMember=new a(e.member),this.sendCmd("updateMyChatroomMemberInfo",e)},c.getChatroomMembers=function(e){var t=this;i(e,"guest"),s("guest",e.guest,"boolean"),o(e.time)?e.time=0:s("time",e.time,"number"),o(e.limit)?e.limit=100:s("limit",e.limit,"number"),t.processCallback(e),e.type=e.guest?1:0,!e.guest&&e.onlyOnline&&(e.type=2),t.sendCmd("getChatroomMembers",e)},c.getChatroomMembersInfo=function(e){var t=this;i(e,"accounts"),s("accounts",e.accounts,"array"),t.processCallback(e),t.sendCmd("getChatroomMembersInfo",e)},c.markChatroomManager=function(e){e.type=1,this.markChatroomMember(e)},c.markChatroomCommonMember=function(e){e.type=2,this.markChatroomMember(e)},c.markChatroomBlacklist=function(e){e.type=-1,this.markChatroomMember(e)},c.markChatroomGaglist=function(e){e.type=-2,this.markChatroomMember(e)},c.markChatroomMember=function(e){i(e,"account type isAdd"),s("isAdd",e.isAdd,"boolean"),o(e.level)?e.level=0:s("level",e.level,"number");var t=this;t.processCustom(e),t.processCallback(e),t.sendCmd("markChatroomMember",e)},c.kickChatroomMember=function(e){var t=this;i(e,"account"),t.processCustom(e),t.processCallback(e),t.sendCmd("kickChatroomMember",e)},c.updateChatroomMemberTempMute=function(e){var t=this;i(e,"account duration needNotify"),s("duration",e.duration,"number"),s("needNotify",e.needNotify,"boolean"),t.processCustom(e),t.processCallback(e),t.sendCmd("updateChatroomMemberTempMute",e)}},function(e,t,n){"use strict";var r=n(1),o=r.undef,i=n(35).fn;i.beforeSendMsg=function(e){e.cmd="sendMsg"},i.getHistoryMsgs=function(e){r.verifyOptions(e),o(e.timetag)?e.timetag=0:r.verifyParamType("timetag",e.timetag,"number"),o(e.limit)?e.limit=100:r.verifyParamType("limit",e.limit,"number");var t=this;t.processCallback(e),t.sendCmd("getHistoryMsgs",e,e.callback)}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1);r.audioToText=function(e){o.verifyOptions(e,"url"),e.audioToText=o.filterObj(e,"url");var t=this;t.processCallback(e),t.sendCmd("audioToText",e)}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1);r.getChatroomAddress=function(e){o.verifyOptions(e,"chatroomId");var t=this;t.processCallback(e),t.sendCmd("getChatroomAddress",e)}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1);r.kick=function(e){o.verifyOptions(e,"deviceIds"),this.processCallback(e),this.sendCmd("kick",{deviceIds:e.deviceIds.slice(0)},e.callback)}},function(e,t,n){"use strict";var r=n(5).fn;r.clearDB=function(e){var t=this,n=t.db;t.processCallback(e);var r=e.done;n.enable?n.clear().then(r,r):r()},r.removeDB=function(e){var t=this,n=t.db;t.processCallback(e);var r=e.done;n.enable?n.destroy().then(r,r):r()}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1),i=o.notundef,s=n(48);r.friendRequest=function(e){o.verifyOptions(e,"type account"),o.verifyParamValid("type",e.type,s.validTypes()),this.processPs(e),this.processCallback(e);var t={account:e.account,type:s.getByteFromType(e.type),ps:e.ps};i(e.idServer)&&(t.idServer=e.idServer),this.sendCmd("friendRequest",t,e.callback)},r.addFriend=function(e){e.type="addFriend",this.friendRequest(e)},r.applyFriend=function(e){e.type="applyFriend",this.friendRequest(e)},r.passFriendApply=function(e){o.verifyOptions(e,"idServer"),e.type="passFriendApply",this.friendRequest(e)},r.rejectFriendApply=function(e){o.verifyOptions(e,"idServer"),e.type="rejectFriendApply",this.friendRequest(e)},r.deleteFriend=function(e){o.verifyOptions(e,"account"),this.processCallback(e),this.sendCmd("deleteFriend",{account:e.account},e.callback)},r.updateFriend=function(e){this.processCallback(e);var t=new s(e);this.sendCmd("updateFriend",{friend:t,single:!0},e.callback)},r.getFriends=function(e){function t(){n.sendCmd("getFriends",{timetag:i,NOTSTORE:"timetag"},e.callback)}var n=this,r=n.db,i=0;o.verifyOptions(e),n.processCallback(e),r.enable?r.getFriendsTimetag().then(function(e){i=e,t()},t):t()}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1),i=o.isArray,s=n(15);r.mergeObjArray=function(e,t,n){return e||(e=[]),t?(i(t)||(t=[t]),t.length?(n=n||{},o.mergeObjArray(e,t,n)):e):e},r.cutObjArray=function(e,t,n){return e&&t?(i(t)||(t=[t]),t.length?(n=n||{},o.cutObjArray(e,t,n)):e):e},r.mergeLoginPorts=function(e,t){return this.mergeObjArray(e,t,{keyPath:"deviceId"})},r.cutLoginPorts=function(e,t){return this.cutObjArray(e,t,{keyPath:"deviceId",sortPath:"type"})},r.mergeRelations=function(e,t){return this.mergeObjArray(e,t,{keyPath:"account"})},r.cutRelations=function(e,t){return this.cutObjArray(e,t,{keyPath:"account"})},r.findRelation=function(e,t){return o.findObjInArray(e,{keyPath:"account",value:t})},r.mergeFriends=function(e,t){return this.mergeObjArray(e,t,{keyPath:"account"})},r.cutFriends=function(e,t){return this.cutObjArray(e,t,{keyPath:"account"})},r.cutFriendsByAccounts=function(e,t){i(t)||(t=[t]);var n=t.map(function(e){return{account:e}});return this.cutFriends(e,n)},r.findFriend=function(e,t){return o.findObjInArray(e,{keyPath:"account",value:t})},r.mergeUsers=function(e,t){return this.mergeObjArray(e,t,{keyPath:"account"})},r.findUser=function(e,t){return o.findObjInArray(e,{keyPath:"account",value:t})},r.mergeTeams=function(e,t){return this.mergeObjArray(e,t,{keyPath:"teamId"})},r.cutTeams=function(e,t){return this.cutObjArray(e,t,{keyPath:"teamId"})},r.findTeam=function(e,t){return o.findObjInArray(e,{keyPath:"teamId",value:t})},r.assembleTeamOwner=s.assembleOwner,r.assembleTeamMembers=s.assembleMembers,r.genTeamMemberId=s.genId,r.mergeTeamMembers=function(e,t){return this.mergeObjArray(e,t)},r.cutTeamMembers=function(e,t){return this.cutObjArray(e,t)},r.cutTeamMembersByAccounts=function(e,t,n){i(n)||(n=[n]);var r=s.assembleMembers({teamId:t},n);return this.cutTeamMembers(e,r)},r.findTeamMember=function(e,t){return o.findObjInArray(e,{keyPath:"id",value:t})},r.mergeSessions=function(e,t){return this.mergeObjArray(e,t,{sortPath:"updateTime",desc:!0})},r.cutSessions=function(e,t){return this.cutObjArray(e,t)},r.cutSessionsByIds=function(e,t){i(t)||(t=[t]);var n=t.map(function(e){return{id:e}});return this.cutSessions(e,n)},r.findSession=function(e,t){return o.findObjInArray(e,{keyPath:"id",value:t})},r.mergeMsgs=function(e,t){return this.mergeObjArray(e,t,{keyPath:"idClient",sortPath:"time"})},r.cutMsgs=function(e,t){return this.cutObjArray(e,t,{keyPath:"idClient"})},r.cutMsgsByIdClients=function(e,t){i(t)||(t=[t]);var n=t.map(function(e){return{idClient:e}});return this.cutMsgs(e,n)},r.findMsg=function(e,t){return o.findObjInArray(e,{keyPath:"idClient",value:t})},r.mergeSysMsgs=function(e,t){return this.mergeObjArray(e,t,{keyPath:"idServer",desc:!0})},r.cutSysMsgs=function(e,t){return this.cutObjArray(e,t,{keyPath:"idServer"})},r.cutSysMsgsByIdServers=function(e,t){i(t)||(t=[t]);var n=t.map(function(e){return{idServer:e}});return this.cutSysMsgs(e,n)},r.findSysMsg=function(e,t){return o.findObjInArray(e,{keyPath:"idServer",value:t})}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1),i=o.undef,s=o.notundef,a=n(14),c=n(18),u=n(19),l=n(3);r.beforeSendMsg=function(e){var t=this,n=t.protocol,r=e.msg;r.to===t.account&&(r.fromDeviceId=a.deviceId),r.userUpdateTime=n.myInfo&&n.myInfo.updateTime;var o;switch(r.getScene()){case"p2p":o="sendMsg";break;case"team":o="sendTeamMsg"}e.filter&&(o="sendFilterMsg",r.filter=!0),e.cmd=o},r.afterSendMsg=function(e){var t=e.rtnMsg,n=c.genSessionByMsg(t);this.protocol.onUpdateSession(n)},r.beforeForwardMsg=function(e){o.verifyOptions(e,"msg scene to"),e.msg.scene=e.scene,e.msg.to=e.to},r.markMsgRead=function(e){var t=this,n=t.protocol;return!e||t.db.enable||n.options.autoMarkRead?void t.logger.warn("不需要标记消息为已收到 (没有消息, 或者启用了数据库, 或者启用了自动标记已收到)"):void n.markMsgRead(e,!0)},r.sendMsgReceipt=function(e){var t=this;if(o.verifyOptions(e),t.processCallback(e),!e.msg)return void e.done();var n="target idClient time";o.verifyOptions(e,"msg");var r=e.msg;o.verifyOptions(r,n,!0,"msg."),t.protocol.shouldSendMsgReceipt(r)?t.sendCmd("sendMsgReceipt",{msgReceipt:{to:r.target,idClient:r.idClient,time:r.time}},e.callback):e.done()},r.isMsgRemoteRead=function(e){return this.protocol.isMsgRemoteRead(e)},r.deleteMsg=function(e){var t=this;o.verifyOptions(e,"msg");var n=e.msg;if("out"!==n.flow||"success"!==n.status||n.from===n.to||n.isLocal)return e.done(l.newParamError("只能删除自己发送给别人的, 并且发送成功的消息"),e);o.verifyOptions(n,["scene","to","from","time","idClient","idServer"],!0,"msg."),o.verifyParamValid("msg.scene",n.scene,t.message.validScenes);var r=o.simpleClone(n);this.processPs(r),this.processCallback(e),"p2p"===r.scene?r.type="deleteMsgP2p":r.type="deleteMsgTeam",r.deletedIdClient=r.idClient,r.deletedIdServer=r.idServer,r=new u(r),t.sendCmd("deleteMsg",{sysMsg:r,msg:n},e.callback)},r.getHistoryMsgs=function(e){var t=this;o.verifyOptions(e,"scene to"),o.verifyParamValid("scene",e.scene,t.message.validScenes),"undefined"==typeof e.beginTime&&(e.beginTime=0),o.verifyParamType("beginTime",e.beginTime,"number"),"undefined"==typeof e.endTime&&(e.endTime=0),o.verifyParamType("endTime",e.endTime,"number"),"undefined"==typeof e.lastMsgId&&(e.lastMsgId="0"),"undefined"==typeof e.limit&&(e.limit=100),o.verifyParamType("limit",e.limit,"number"),o.verifyParamMax("limit",e.limit,100),s(e.reverse)?o.verifyParamType("reverse",e.reverse,"boolean"):e.reverse=!1,s(e.asc)?o.verifyParamType("asc",e.asc,"boolean"):e.asc=!1,t.processCallback(e),e.asc&&(e.cbaop=function(e,t){e||(t.msgs=t.msgs.reverse())});var n;switch(e.scene){case"p2p":n="getHistoryMsgs";break;case"team":n="getTeamHistoryMsgs"}var r={scene:e.scene,to:e.to,beginTime:e.beginTime,endTime:e.endTime,lastMsgId:e.lastMsgId,limit:e.limit,reverse:e.reverse};t.sendCmd(n,r,e.callback)},r.searchHistoryMsgs=function(e){var t=this;o.verifyOptions(e,"scene to keyword"),o.verifyParamValid("scene",e.scene,t.message.validScenes),"undefined"==typeof e.beginTime&&(e.beginTime=0),o.verifyParamType("beginTime",e.beginTime,"number"),"undefined"==typeof e.endTime&&(e.endTime=0),o.verifyParamType("endTime",e.endTime,"number"),"undefined"==typeof e.limit&&(e.limit=100),o.verifyParamType("limit",e.limit,"number"),o.verifyParamMax("limit",e.limit,100),s(e.reverse)?o.verifyParamType("reverse",e.reverse,"boolean"):e.reverse=!1,s(e.asc)?o.verifyParamType("asc",e.asc,"boolean"):e.asc=!1,t.processCallback(e),e.asc&&(e.cbaop=function(e,t){e||(t.msgs=t.msgs.reverse())});var n;switch(e.scene){case"p2p":n="searchHistoryMsgs";break;case"team":n="searchTeamHistoryMsgs"}var r=o.filterObj(e,"scene to beginTime endTime keyword limit reverse");t.sendCmd(n,r,e.callback)},r.getLocalMsgs=function(e){function t(){e.msgs=c,e.done(n,e)}var n,r=this,a=r.db,c=[];o.verifyOptions(e);var u=!1;s(e.start)&&(u=!0,o.verifyParamType("start",e.start,"number"));var l=!1;s(e.end)&&(l=!0,o.verifyParamType("end",e.end,"number")),u&&l&&e.end<=e.start&&o.onParamError("参数 end 必须晚于 start"),i(e.limit)&&(e.limit=100),o.verifyParamType("limit",e.limit,"number"),o.verifyParamMin("limit",e.limit,1),r.processCallback(e),a.enable?a.getMsgs(e).then(function(e){c=e,t()},function(e){n=e,t()}):t()},r.getLocalMsgByIdClient=function(e){function t(){e.msg=s,e.done(n,e)}var n,r=this,i=r.db,s=null;o.verifyOptions(e,"idClient"),r.processCallback(e),i.enable?i.getMsgByIdClient(e.idClient).then(function(e){e&&(s=e),t()},function(e){n=e,t()}):t()},r.getLocalMsgsByIdClients=function(e){function t(){e.msgs=s,e.done(n,e)}var n,r=this,i=r.db,s=[];o.verifyOptions(e,"idClients"),o.verifyParamType("idClients",e.idClients,"array"),r.processCallback(e),i.enable?i.getMsgsByIdClients(e.idClients).then(function(e){s=e.filter(function(e){return!!e}),t()},function(e){n=e,t()}):t()},r.updateLocalMsg=function(e){function t(){e.msg=s,e.done(n,e)}var n,r=this,i=r.db,s=null;if(o.verifyOptions(e,"idClient"),r.processCallback(e),i.enable){var a=o.filterObj(e,"idClient localCustom");i.updateMsg(a).then(function(e){s=e,t()},function(e){n=e,t()})}else t()},r.deleteLocalMsg=function(e){function t(){e.done(n,e)}var n,r=this;o.verifyOptions(e,"msg");var i=e.msg;o.verifyOptions(i,"idClient sessionId",!0,"msg."),r.processCallback(e),r.protocol.deleteLocalMsg(i).then(t,function(e){n=e,t()})},r.deleteLocalMsgsBySession=function(e){function t(){e.done(n,e)}var n,r=this,i=r.db;o.verifyOptions(e,"scene to"),o.verifyParamValid("scene",e.scene,r.message.validScenes),e.sessionId=e.scene+"-"+e.to,r.processCallback(e),i.enable?i.deleteMsgsBySessionId(e.sessionId).then(function(){t()},function(e){n=e,t()}):t()},r.deleteAllLocalMsgs=function(e){function t(){e.done(n,e)}var n,r=this,o=r.db;r.processCallback(e),o.enable&&o.deleteAllMsgs().then(function(){t()},function(e){n=e,t()})}},function(e,t){"use strict"},function(e,t){"use strict"},function(e,t,n){"use strict";var r=n(5).fn,o=n(38),i=n(1),s=i.undef;r.getPushNotificationMultiportConfig=function(){return this.protocol.getPushNotificationMultiportConfig()},r.updatePushNotificationMultiportConfig=function(e){i.verifyOptions(e),s(e.shouldPushNotificationWhenPCOnline)&&(e.shouldPushNotificationWhenPCOnline=!0),e.donnop=new o(e),this.processCallback(e),this.sendCmd("updateDonnop",e)}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1);r.markInBlacklist=function(e){o.verifyOptions(e,"account isAdd"),o.verifyParamType("isAdd",e.isAdd,"boolean");var t=this.processCallback(e);return this.sendCmd("markInBlacklist",{account:e.account,isAdd:e.isAdd},e.callback),t},r.addToBlacklist=function(e){return e.isAdd=!0,this.markInBlacklist(e)},r.removeFromBlacklist=function(e){return e.isAdd=!1,this.markInBlacklist(e)},r.markInMutelist=function(e){o.verifyOptions(e,"account"),o.verifyParamType("isAdd",e.isAdd,"boolean");var t=this.processCallback(e);return this.sendCmd("markInMutelist",{account:e.account,isAdd:e.isAdd},e.callback),t},r.addToMutelist=function(e){return e.isAdd=!0,this.markInMutelist(e)},r.removeFromMutelist=function(e){return e.isAdd=!1,this.markInMutelist(e)},r.getRelations=function(e){function t(){n.sendCmd("getRelations",{timetag:i,NOTSTORE:"timetag"},e.callback)}var n=this,r=n.db,i=0;e=o.verifyOptions(e);var s=n.processCallback(e);return r.enable?r.getRelationsTimetag().then(function(e){i=e,t()},t):t(),s}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1),i=o.undef,s=o.notundef;r.setCurrSession=function(e){var t=this;t.resetSessionUnread(e),t.protocol.setCurrSession(e)},r.resetSessionUnread=function(e){var t=this;if(t.protocol.resetSessionUnread(e),t.options.syncSessionUnread){var n=t.protocol.findSession(e);if(!n)return void t.logger.warn("no session, "+e);if(!n.lastMsg)return void t.logger.warn("no session.lastMsg, session "+e);if(!n.scene||!n.to)return void t.logger.warn("no scene or to, session "+e);var r=n.lastMsg.time;if(n&&n.ack&&n.ack>=r)return void t.logger.warn("no need to ack, session "+e);var o={scene:"p2p"===n.scene?0:1,to:n.to,timetag:r};t.sendCmd("markSessionAck",o)}},r.resetCurrSession=function(){this.protocol.setCurrSession("")},r.insertLocalSession=function(e){function t(){e.session=r,e.done(n,e)}var n,r,i=this;o.verifyOptions(e,"scene to"),o.verifyParamValid("scene",e.scene,i.message.validScenes),i.processCallback(e),i.protocol.insertLocalSession(e).then(function(e){r=e,t()},function(e){n=e,t()})},r.getLocalSessions=function(e){function t(){e.sessions=c,e.done(n,e)}var n,r=this,a=r.db,c=[];o.verifyOptions(e),i(e.limit)&&(e.limit=100),o.verifyParamType("limit",e.limit,"number"),o.verifyParamMax("limit",e.limit,100),s(e.reverse)?o.verifyParamType("reverse",e.reverse,"boolean"):e.reverse=!1,r.processCallback(e),a.enable?a.getSessions(e).then(function(e){c=e,r.protocol.mergeSessions(c),t()},function(e){n=e,t()}):t()},r.updateLocalSession=function(e){function t(){r.protocol.onUpdateSession(s),e.session=s,e.done(n,e)}var n,r=this,i=r.db;o.verifyOptions(e,"id"),r.processCallback(e);var s=o.filterObj(e,"id localCustom");i.enable?i.updateSession(s).then(function(e){s=e,t()},function(e){n=e,t()}):t()},r.deleteLocalSession=function(e){function t(){e.done(n,e)}var n,r=this,i=r.db;o.verifyOptions(e,"id"),r.processCallback(e),i.enable?i.deleteSession(e.id).then(function(){r.protocol.deleteLocalSession(e.id),t()},function(e){n=e,t()}):t()},r.deleteSession=function(e){o.verifyOptions(e,"scene to"),this.processCallback(e),e.sessions=[{scene:e.scene,to:e.to}],this.deleteSessions(e)},r.deleteSessions=function(e){o.verifyOptions(e,"sessions"),o.verifyParamType("sessions",e.sessions,"array"),e.sessions.forEach(function(e,t){o.verifyOptions(e,"scene to",!0,"sessions["+t+"].")}),this.processCallback(e),this.sendCmd("deleteSessions",{sessions:e.sessions.map(function(e){return e.scene+"|"+e.to})},e.callback)}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(5).fn,i=n(1),s=i.undef,a=i.notundef,c=n(19);o.markSysMsgRead=function(e){function t(){e.done(n,e)}var n,o=this,s=o.db,a=r.resolve(),c=o.protocol;i.verifyOptions(e,"sysMsgs");var u=e.sysMsgs;i.isArray(u)||(u=[u]),s.enable?a=s.markSysMsgRead(u).then(function(e){
  u=e,c.onUpdateSysMsg(e)}):(u=u.filter(function(e){return!e.read}),u.length&&(c.options.autoMarkRead||c.markSysMsgRead(u,!0),u.forEach(function(e){e.read=!0}),c.onUpdateSysMsg(u))),a.then(function(){return c.reduceSysMsgUnread(u)}).then(t,function(e){n=e,t()})},o.sendCustomSysMsg=function(e){var t=this;i.verifyOptions(e,"scene to content"),i.verifyParamValid("scene",e.scene,t.message.validScenes),t.processCallback(e),"p2p"===e.scene?e.type="customP2p":e.type="customTeam",e.sysMsg=new c(e);var n="sendCustomSysMsg";return e.filter&&(n="sendFilterCustomSysMsg"),t.sendCmd(n,{sysMsg:e.sysMsg,single:!0},e.callback),t.formatReturnSysMsg(e.sysMsg)},o.formatReturnSysMsg=function(e){var t=this;return e=i.copy(e),t.protocol.completeSysMsg(e),e.status="sending",e=c.reverse(e)},o.getLocalSysMsgs=function(e){function t(){e.sysMsgs=u,e.done(n,e)}var n,r=this,o=r.db,u=[];i.verifyOptions(e),e.category&&i.verifyParamValid("category",e.category,c.validCategories),e.type&&i.verifyParamValid("type",e.type,c.validTypes),s(e.limit)&&(e.limit=100),i.verifyParamType("limit",e.limit,"number"),i.verifyParamMax("limit",e.limit,100),a(e.reverse)?i.verifyParamType("reverse",e.reverse,"boolean"):e.reverse=!1,r.processCallback(e),o.enable?o.getSysMsgs(e).then(function(e){u=e,t()},function(e){n=e,t()}):t()},o.updateLocalSysMsg=function(e){function t(){e.sysMsg=s,e.done(n,e)}var n,r=this,o=r.db,s=null;if(i.verifyOptions(e,"idServer"),r.processCallback(e),o.enable){var a=i.filterObj(e,"idServer state localCustom");o.updateSysMsg(a).then(function(e){s=e,t()},function(e){n=e,t()})}else t()},o.deleteLocalSysMsg=function(e){function t(){e.done(n,e)}var n,r=this,o=r.db;i.verifyOptions(e,"idServer"),r.processCallback(e),o.enable?o.deleteSysMsg(e.idServer).then(function(){t()},function(e){n=e,t()}):t()},o.deleteAllLocalSysMsgs=function(e){function t(){r.protocol.onUpdateSysMsgUnread({}),e.done(n,e)}var n,r=this,o=r.db;r.processCallback(e),o.enable&&o.deleteAllSysMsgs().then(function(){t()},function(e){n=e,t()})}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1),i=o.undef,s=n(20),a=n(15);r.createTeam=function(e){o.verifyOptions(e,"type name"),i(e.accounts)?e.accounts=[]:o.verifyParamType("accounts",e.accounts,"array"),e.action="create",this.processPs(e),this.processCallback(e),e.team=new s(e);var t={team:e.team,accounts:e.accounts.slice(0),ps:e.ps};this.sendCmd("createTeam",t,e.callback)},r.updateTeam=function(e){o.verifyOptions(e,"teamId"),e.action="update",this.processCallback(e),e.team=new s(e),this.sendCmd("updateTeam",{team:e.team,single:!0},e.callback)},r.addTeamMembers=function(e){o.verifyOptions(e,"teamId accounts"),o.verifyParamType("accounts",e.accounts,"array"),this.processPs(e),this.processCallback(e);var t={teamId:e.teamId,accounts:e.accounts.slice(0),ps:e.ps};this.sendCmd("addTeamMembers",t,e.callback)},r.removeTeamMembers=function(e){o.verifyOptions(e,"teamId accounts"),o.verifyParamType("accounts",e.accounts,"array"),this.processCallback(e);var t={teamId:e.teamId,accounts:e.accounts.slice(0)};this.sendCmd("removeTeamMembers",t,e.callback)},r.acceptTeamInvite=function(e){o.verifyOptions(e,"idServer teamId from"),this.processCallback(e);var t={idServer:e.idServer,teamId:e.teamId,from:e.from};this.sendCmd("acceptTeamInvite",t,e.callback)},r.rejectTeamInvite=function(e){o.verifyOptions(e,"idServer teamId from"),this.processPs(e),this.processCallback(e);var t={idServer:e.idServer,teamId:e.teamId,from:e.from,ps:e.ps};this.sendCmd("rejectTeamInvite",t,e.callback)},r.applyTeam=function(e){o.verifyOptions(e,"teamId"),this.processPs(e),this.processCallback(e);var t={teamId:e.teamId,ps:e.ps};this.sendCmd("applyTeam",t,e.callback)},r.passTeamApply=function(e){o.verifyOptions(e,"idServer teamId from"),this.processCallback(e);var t={idServer:e.idServer,teamId:e.teamId,from:e.from};this.sendCmd("passTeamApply",t,e.callback)},r.rejectTeamApply=function(e){o.verifyOptions(e,"idServer teamId from"),this.processPs(e),this.processCallback(e);var t={idServer:e.idServer,teamId:e.teamId,from:e.from,ps:e.ps};this.sendCmd("rejectTeamApply",t,e.callback)},r.addTeamManagers=function(e){o.verifyOptions(e,"teamId accounts"),o.verifyParamType("accounts",e.accounts,"array"),this.processCallback(e);var t={teamId:e.teamId,accounts:e.accounts.slice(0)};this.sendCmd("addTeamManagers",t,e.callback)},r.removeTeamManagers=function(e){o.verifyOptions(e,"teamId accounts"),o.verifyParamType("accounts",e.accounts,"array"),this.processCallback(e);var t={teamId:e.teamId,accounts:e.accounts.slice(0)};this.sendCmd("removeTeamManagers",t,e.callback)},r.updateInfoInTeam=function(e){o.verifyOptions(e,"teamId"),this.processCallback(e),this.sendCmd("updateInfoInTeam",{teamMember:new a(e),single:!0},e.callback)},r.updateNickInTeam=function(e){o.verifyOptions(e,"teamId account"),this.processCallback(e),this.sendCmd("updateNickInTeam",{teamMember:new a(e),single:!0},e.callback)},r.updateMuteStateInTeam=function(e){var t=this;o.verifyOptions(e,"teamId account mute"),t.processCallback(e),e.mute=e.mute?1:0,t.sendCmd("updateMuteStateInTeam",e)},r.getMutedTeamMembers=function(e){var t=this;o.verifyOptions(e,"teamId");var n=t.processCallback(e);return t.sendCmd("getMutedTeamMembers",e),n},r.leaveTeam=function(e){o.verifyOptions(e,"teamId"),this.processCallback(e);var t={teamId:e.teamId};this.sendCmd("leaveTeam",t,e.callback)},r.transferTeam=function(e){o.verifyOptions(e,"teamId account leave"),o.verifyParamType("leave",e.leave,"boolean"),this.processCallback(e);var t={teamId:e.teamId,account:e.account,leave:e.leave};this.sendCmd("transferTeam",t,e.callback)},r.dismissTeam=function(e){o.verifyOptions(e,"teamId"),this.processCallback(e);var t={teamId:e.teamId};this.sendCmd("dismissTeam",t,e.callback)},r.getTeam=function(e){function t(){i.sendCmd("getTeam",{teamId:e.teamId},e.callback)}function n(e){i.logger.warn("get team",r,e)}var r,i=this,s=i.db;o.verifyOptions(e,"teamId"),i.processCallback(e),e.cbaop=function(e,t){e||n(t)},r=e.teamId,s.enable&&!e.sync?s.getTeam(r).then(function(r){r?(n(r),e.done(null,r)):t()},t):t()},r.getTeams=function(e){function t(){n.sendCmd("getTeams",{timetag:i,NOTSTORE:"timetag"},e.callback)}var n=this,r=n.db,i=0;o.verifyOptions(e),n.processCallback(e),r.enable?r.getTeamsTimetag().then(function(e){i=e,t()},t):t()},r.getTeamMembers=function(e){function t(){n.sendCmd("getTeamMembers",{teamId:e.teamId,timetag:i,NOTSTORE:"timetag"},e.callback)}var n=this,r=n.db,i=0;o.verifyOptions(e,"teamId"),n.processCallback(e),r.enable&&!e.sync?r.getTeam(e.teamId).then(function(n){if(n){var o=n.memberUpdateTime;r.getTeamMembersTimetag(e.teamId).then(function(n){!isNaN(o)&&!isNaN(n)&&o<=n?r.getTeamMembers(e.teamId).then(function(t){e.done(null,{teamId:e.teamId,members:t})},t):(i=n,t())},t)}else t()},t):t()},r.notifyForNewTeamMsg=function(e){var t=this;o.verifyOptions(e,"teamIds");var n=t.protocol.notifyForNewTeamMsg(e.teamIds);return t.usePromise(e)?n:void n.then(function(t){e.done(null,t)},function(t){e.done(t)})},r.getMyTeamMembers=function(e){var t=this;o.verifyOptions(e,"teamIds");var n=t.processCallback(e);return t.sendCmd("getMyTeamMembers",e),n},r.getLocalTeams=function(e){function t(){e.teams=s,e.done(n,e)}var n,r=this,i=r.db,s=[];o.verifyOptions(e,"teamIds"),o.verifyParamType("teamIds",e.teamIds,"array"),r.processCallback(e),i.enable?i.getTeamsByTeamIds(e.teamIds).then(function(e){s=e.filter(function(e){return!!e}),t()},function(e){n=e,t()}):t()},r.getLocalTeamMembers=function(e){function t(){e.members=s,e.done(n,e)}var n,r=this,i=r.db,s=[];o.verifyOptions(e,"teamId accounts"),o.verifyParamType("accounts",e.accounts,"array"),r.processCallback(e),i.enable?i.getInvalidTeamMembers(e.teamId,e.accounts).then(function(e){s=e.filter(function(e){return!!e}),t()},function(e){n=e,t()}):t()},r.deleteLocalTeam=function(e){function t(){e.done(n,e)}var n,r=this,i=r.db;o.verifyOptions(e,"teamId"),r.processCallback(e),i.enable?i.deleteTeam(e.teamId).then(function(){t()},function(e){n=e,t()}):t()}},function(e,t,n){"use strict";var r=n(5).fn,o=n(1),i=o.objs2accounts,s=n(28);r.updateMyInfo=function(e){o.verifyOptions(e),this.processCallback(e),e.user=new s(e),delete e.user.account,this.sendCmd("updateMyInfo",{user:e.user,single:!0},e.callback)},r.getMyInfo=function(e){var t=this;return e=e||{},e.account=t.account,t.getUser(e)},r.getUser=function(e){function t(){i.sendCmd("getUsers",{accounts:[r],single:!0},e.callback)}function n(e){i.logger.warn("get user",r,e)}var r,i=this,s=i.db;o.verifyOptions(e,"account"),i.processCallback(e),e.cbaop=function(e,t){if(!e)return t=t[0]||null,n(t),t},r=e.account,e.sync?t():s.enable?s.getUser(r).then(function(r){r?(n(r),e.done(null,r)):t()},t):t()},r.getUsers=function(e){function t(){s.sendCmd("getUsers",{accounts:r,single:!0},e.callback)}function n(e){s.logger.warn("get users",i(e),e)}var r,s=this,a=s.db,c=[];o.verifyOptions(e,"accounts"),o.verifyParamType("accounts",e.accounts,"array"),s.processCallback(e),e.cbaop=function(e,t){if(!e)return t=t.concat(c),n(t),t},r=o.deduplicate(e.accounts),o.verifyArrayMax("accounts",e.accounts,150),e.sync?t():a.enable?a.getUsers(r).then(function(o){if(o&&o.length===r.length)n(o),e.done(null,o);else{c=o;var s=i(o),a=[];r.forEach(function(e){s.indexOf(e)===-1&&a.push(e)}),r=a,t()}},t):t()}},function(e,t){"use strict";var n={version:7},r={kv:{key:{keyPath:"key"}},timetag:{key:{keyPath:"name"}},blacklist:{key:{keyPath:"account"}},mutelist:{key:{keyPath:"account"}},friend:{key:{keyPath:"account"}},user:{key:{keyPath:"account"}},team:{key:{keyPath:"teamId"}},teamMember:{key:{keyPath:"id"},indexes:{teamId:{unique:!1},account:{unique:!1}}},msg:{key:{autoIncrement:!0},indexes:{idClient:{unique:!0},sessionId:{unique:!1},time:{unique:!1},type:{unique:!1},sessionType:{unique:!1},status:{unique:!1},sessionTime:{key:["sessionId","time"],unique:!1}}},msg1:{key:{keyPath:"idClient"},indexes:{sessionId:{unique:!1},time:{unique:!1},status:{unique:!1},sessionTime:{key:["sessionId","time"],unique:!1}}},sysMsg:{key:{autoIncrement:!0},indexes:{idServer:{unique:!0},category:{unique:!1},type:{unique:!1}}},sysMsgUnread:{key:{keyPath:"type"}},session:{key:{keyPath:"id"},indexes:{updateTime:{unique:!1}}}};n.keyPath=function(e){return r[e].key.keyPath},n.schema=function(){return window._nimForceSyncIM=!0,r},e.exports=n},function(e,t,n){"use strict";var r=n(2).Promise,o=n(7).fn,i=n(1),s="friend";o.mergeFriends=function(e,t,n){var r=this;return r.updateAndDelete(s,e,t).then(function(){return r.logger.warn("merge friends"),n&&r.updateFriendTimetag(n),[e,t,n]})},o.putFriend=function(e){return this.put(s,e)},o.updateFriend=function(e){var t=this;e=i.copy(e);var n=e.account;return this.getOne(s,null,n,{modifyObj:e}).then(function(r){return r?t.logger.warn("update friend",n,e):t.logger.warn("update friend no",n),r})},o.deleteFriend=function(e){var t=this,n=t.remove(s,e),o=t.deleteUser(e);return r.all([n,o])},o.getFriends=function(){var e=function(e){return e.valid};return this.getAll(s,{filter:e})},o.getFriend=function(e){return this.getOne(s,null,e)}},function(e,t,n){"use strict";var r=n(7).fn,o="kv";r.setKey=function(e,t){return this.put(o,{key:e,value:t})},r.getKey=function(e){return this.get(o,e).then(function(e){return e&&e.value})},r.setDonnop=function(e){return this.setKey("donnop",e)},r.getDonnop=function(){return this.getKey("donnop")}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(7).fn,i=n(1),s="session",a="msg1",c="sessionId",u="time",l="status",f="sessionTime";o.putMsg=function(e){var t=this;return i.isArray(e)||(e=[e]),!e.length||e[0].filter?r.resolve():(e=e.filter(function(e){return!e.ignore}),t.put(a,e))},o.updateMsg=function(e){var t=this;if(!e.filter){var n=e.idClient,r=i.filterObj(e,"resend status idServer time localCustom");return t.getOne(a,null,n,{modifyObj:r}).then(function(e){return e?t.logger.warn("update msg",n,r):t.logger.warn("udpate msg no",n),e})}},o.getMsgs=function(e){var t=this;t.checkDB(),e=e||{};var n=u,r=!1,o=!1,s=e.sessionId,c=e.sessionIds;i.exist(s)?(r=!0,n=f):i.exist(c)&&(r=!0,i.isString(c)?(n=f,s=c):Array.isArray(c)&&(1===c.length?(n=f,s=c[0]):o=!0));var l=e.start||0,d=e.end||1/0,m=l,p=d;r&&!o&&(m=[s,l],p=[s,d]);var h=e.desc!==!1,g=e.limit||100,y=!1,v=!1,b=e.type,M=e.types;i.exist(b)?y=!0:i.exist(M)&&(y=!0,i.isString(M)?b=M:Array.isArray(M)&&(1===M.length?b=M[0]:v=!0));var T=e.keyword||"",k=e.filterFunc,S=void 0;return(o||y||T||i.isFunction(k))&&(S=function(e){if(o&&c.indexOf(e.sessionId)===-1)return!1;if(y)if(v){if(M.indexOf(e.type)===-1)return!1}else if(b!==e.type)return!1;if(T){var t=e.text||e.tip||"";if(t.indexOf(T)===-1)return!1}return!k||k(e)}),t.server.query(a,n).bound(m,p,!0,!0).desc(h).limit(g).filter(S).execute()},o.getMsgCountAfterAck=function(e){var t=this;e=e||{};var n=e,r=n.sessionId;return t.checkDB(),t.server.query(a,f).bound([r,e.ack],[r,1/0],!0,!0).count().execute()},o.amendMsg=function(e){return e?(i.notexist(e.text)&&(e.text=""),e):null},o.getMsgByIdClient=function(e){var t=this;return t.getOne(a,null,e).then(function(e){return t.amendMsg(e)})},o.getMsgsByIdClients=function(e){var t,n=this,o=[];return e.forEach(function(e){t=n.getMsgByIdClient(e),o.push(t)}),r.all(o)},o.clearSendingMsgs=function(){var e=this;return e.getOnly(a,l,"sending",{modifyObj:{status:"fail"}}).then(function(t){e.logger.warn("fail msgs",t)})},o.deleteMsg=function(e){var t,n=this,o=[];return i.isArray(e)||(e=[e]),e.forEach(function(e){t=n.getOne(a,null,e,{remove:!0}).then(function(e){return n.logger.warn("delete msg",e),e}),o.push(t)}),1===o.length?o[0]:r.all(o)},o.deleteMsgsBySessionId=function(e){var t=this;return t.getOnly(a,c,e,{remove:!0})},o.deleteAllMsgs=function(){var e=this,t=e.clearTable(a),n=e.clearTable(s);return r.all([t,n])}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(7).fn,i=n(1),s="blacklist",a="mutelist";o.mergeRelations=function(e,t,n,o,i){var c=this,u=c.updateAndDelete(s,e,t),l=c.updateAndDelete(a,n,o);return r.all([u,l]).then(function(){return c.logger.warn("merge relations"),c.updateRelationTimetag(i),[e,t,n,o,i]})},o.getRelations=function(){var e=this,t=e.getAll(s),n=e.getAll(a);return r.all([t,n])},o.markInBlacklist=function(e){var t=this;if(e=i.copy(e),e.isAdd){var n=e.record;return t.put(s,n)}var r=e.account;return t.remove(s,r)},o.markInMutelist=function(e){var t=this;if(e=i.copy(e),e.isAdd){var n=e.record;return t.put(a,n)}var r=e.account;return t.remove(a,r)}},function(e,t,n){"use strict";var r=n(7).fn,o=n(1),i=o.notundef,s="session",a="updateTime";r.putSession=function(e){return e=o.merge({},e),delete e.unread,this.modifyOrPut({table:s,obj:e,key:"id",modifyObjWhenPut:{unread:0}})},r.getSessions=function(e){e=e||{};var t,n=!e.reverse,r=e.limit||100,o=e.lastSessionId,c=!1;return i(o)&&(t=function(e){return!!c||(e.id===o&&(c=!0),!1)}),this.getAll(s,{index:a,desc:n,limit:r,filter:t})},r.getSession=function(e){return this.get(s,e)},r.updateSession=function(e){var t=this,n=e.id,r=o.filterObj(e,"ack unread lastMsg localCustom");return Object.keys(e).forEach(function(t){0===t.indexOf("last")&&(r[t]=e[t])}),this.getOne(s,null,n,{modifyObj:r}).then(function(e){return e?t.logger.warn("update session",n,r):t.logger.warn("update session no",n),e})},r.resetSessionUnread=function(e){return this.updateSession({id:e,unread:0})},r.deleteSession=function(e){return this.remove(s,e)}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(7).fn,i=n(1),s=i.notundef,a="sysMsg",c="idServer",u="type",l="category",f="sysMsgUnread";o.putSysMsg=function(e){var t=this;return new r(function(n){function r(){s--,0===s&&n(o)}if(i.isArray(e)||(e=[e]),!e[0].filter){var o=[],s=e.length;e.forEach(function(e){e=i.copy(e),t.put(a,e).then(function(e){o.push(e[0]),r()},r)})}})},o.getSysMsgs=function(e){var t=this;e=e||{};var n=!e.reverse,r=e.limit||100,o=null,i=null;e.category&&(o=l,i=e.category),e.type&&(o=u,i=e.type);var c,f=e.lastIdServer,d=!1,m=e.read;return(s(f)||s(m))&&(c=function(e){function t(){return!s(m)||e.read===m}return s(f)?(f=""+f,d?t():(e.idServer===f&&(d=!0),!1)):t()}),e={filter:c,desc:n,limit:r},o?t.getOnly(a,o,i,e):t.getAll(a,e)},o.getSysMsgByIdServer=function(e){return this.getOne(a,c,e)},o.updateSysMsg=function(e){var t=this;if(!e.filter){var n=""+e.idServer,r=i.filterObj(e,"read state error localCustom");return this.getOne(a,c,n,{modifyObj:r}).then(function(e){return e?t.logger.warn("update sysMsg",n,r):t.logger.warn("update sysMsg no",n),e})}},o.markSysMsgRead=function(e){var t=this;return new r(function(n,o){i.isArray(e)||(e=[e]);var s,a,c=[],u=[];e.forEach(function(e){s=t.getSysMsgByIdServer(e.idServer).then(function(e){e&&!e.read&&(a=t.updateSysMsg({idServer:e.idServer,read:!0}),u.push(a))},o),c.push(s)}),r.all(c).then(function(){r.all(u).then(function(e){n(e)},o)},o)})},o.deleteSysMsg=function(e){var t,n=this,o=[];return i.isArray(e)||(e=[e]),e.forEach(function(e){e=""+e,t=n.getOne(a,c,e,{remove:!0}),o.push(t)}),1===o.length?o[0]:r.all(o)},o.deleteAllSysMsgs=function(){var e=this,t=e.clearTable(a),n=e.clearTable(f);return r.all([t,n])},o.getSysMsgUnread=function(){return this.getAll(f).then(function(e){var t={};return e.forEach(function(e){t[e.type]=e.num}),t})},o.updateSysMsgUnread=function(e){var t=this;e=i.copy(e);var n=[];return Object.keys(e).forEach(function(t){n.push({type:t,num:e[t]})}),this.put(f,n).then(function(){return t.logger.warn("update sysMsg unread",e),e})}},function(e,t,n){"use strict";function r(e){return e.valid&&e.validToCurrentUser}function o(e){return e&&e.valid}function i(e){return e&&c.fillUndef(e,{mute:!1,custom:""}),e}var s=n(2).Promise,a=n(7).fn,c=n(1),u=n(3),l=n(20),f=n(15),d="team",m="teamId",p="account",h="teamMember";a.mergeTeams=function(e,t,n){var r=this,o=r.put(d,e),i=r.leaveTeams(t,n);return s.all([o,i]).then(function(){return r.logger.warn("merge teams"),r.updateTeamTimetag(n),[e,t,n]})},a.putTeam=function(e){if(e)return c.isArray(e)||(e=[e]),e.forEach(function(e){e.validToCurrentUser=!0}),this.put(d,e)},a.updateTeam=function(e){var t=this;e=c.copy(e);var n=e.teamId;return t.getOne(d,null,n,{modifyObj:e}).then(function(r){return r?(t.logger.warn("update team",n,e),r):(t.logger.warn("update team no",n),t.putTeam(e))})},a.transferTeam=function(e,t,n){var r=this,o=e.teamId,i=e.memberUpdateTime,s={teamId:o,account:t,type:"normal",updateTime:i},a={teamId:o,account:n,type:"owner",updateTime:i};return r.updateTeamMembers([s,a]).then(function(){return r.putTeam(e).then(function(){return r.logger.warn("transfer team",e.teamId,t,n),[e,t,n]})})},a.leaveTeam=function(e){var t=this;return t.updateTeam({teamId:e,validToCurrentUser:!1}).then(function(){return t.removeAllTeamMembers(e)})},a.dismissTeam=function(e,t){var n=this,r={teamId:e,valid:!1,validToCurrentUser:!1,updateTime:t};return n.updateTeam(r).then(function(){return n.removeAllTeamMembers(e)})},a.leaveTeams=function(e,t){var n,r=this,o=[];return e.forEach(function(e){n=r.leaveTeam(e.teamId,t),o.push(n)}),s.all(o)},a.getTeamsByTeamIds=function(e){var t,n=this,r=[];return e.forEach(function(e){t=n.getTeam(e),r.push(t)}),s.all(r)},a.getTeam=function(e){e=""+e;var t=this;return t.getOne(d,null,e).then(function(e){return t.updateTeamProperties([e]),e})},a.getTeams=function(){var e=this;return e.getAll(d,{filter:r}).then(function(t){return e.updateTeamProperties(t),t})},a.updateTeamProperties=function(e){e.forEach(function(e){l.fillProperties(e)})},a.mergeTeamMembers=function(e,t,n,r){var o=this,i=o.putTeamMembers(t),a=o.updateTeamMembers(n);return s.all([i,a]).then(function(){return o.logger.warn("merge members",e),o.updateTeamMemberTimetag(e,r)})},a.putTeamMembers=function(e){return this.put(h,e)},a.getTeamMembersByAccount=function(e){var t=this;return t.getOnly(h,p,e,{filter:o,mapper:i}).then()},a.getTeamMembers=function(e){var t=this;e=""+e;var n=function(e){return e.valid};return t.getOnly(h,m,e,{filter:n,mapper:i}).then(function(e){return t.updateTeamMemberProperties(e).then(function(){return e})})},a.updateTeamMemberProperties=function(e){var t,n=this,r=[];return e.forEach(function(e){f.fillProperties(e)&&(t=n.updateTeamMember(e),r.push(t))}),s.all(r)},a.getInvalidTeamMembers=function(e,t){var n=this;e=""+e;var r,o=[];return t.forEach(function(t){r=n.getOne(h,null,f.genId(e,t)).then(function(e){return i(e)}),o.push(r)}),s.all(o)},a.updateTeamMember=function(e){var t=this,n=e.teamId,r=e.account,o=f.genId(n,r),s=c.filterObj(e,"nickInTeam muteTeam mute custom updateTime type valid");return this.getOne(h,null,o,{modifyObj:s,mapper:i}).then(function(e){return e?t.logger.warn("update member",n,r,s):t.logger.warn("update member no",n,r),e})},a.updateTeamMembers=function(e){var t=this;if(!e.length)return s.resolve();var n,r=[];return e.forEach(function(e){n=t.updateTeamMember(e),r.push(n)}),s.all(r)},a.updateTeamManagers=function(e,t,n,r){var o=t.map(function(t){return{teamId:e,account:t,type:n?"manager":"normal",updateTime:r}});return this.updateTeamMembers(o)},a.removeTeamMembersByAccounts=function(e,t){var n=t.map(function(t){return{teamId:e,account:t,valid:!1}});return this.updateTeamMembers(n)},a.removeAllTeamMembers=function(e){var t=this,n={valid:!1};return t.getOnly(h,m,e,{modifyObj:n}).then(function(){return t.logger.warn("invalid all teamMembers",e),t.deleteTeamMemberTimetag(e)})},a.deleteTeamMembers=function(e){var t=this;return t.getOnly(h,m,e,{remove:!0}).then(function(){t.logger.warn("delete all teamMembers",e),t.deleteTeamMemberTimetag(e)})},a.deleteTeam=function(e){var t,n=this,o=[];return c.isArray(e)||(e=[e]),e.forEach(function(e){e=""+e,t=n.get(d,e).then(function(t){if(t&&r(t))throw u.stillInTeamError();var o=n.remove(d,e),i=n.deleteTeamMembers(e);return s.all([o,i])}),o.push(t)}),1===o.length?o[0]:s.all(o)}},function(e,t,n){"use strict";var r=n(7).fn;r.getTimetags=function(e){var t={},n=function(e){return t[e.name]=e.value,e};return this.getAll("timetag",{filter:e,mapper:n}).then(function(){return t})},r.getTeamMemberTimetags=function(){return this.getTimetags(function(e){return e.name.indexOf("team-")!==-1})},r.getTimetag=function(e){return this.getOne("timetag",null,e).then(function(e){return e=e||{value:0},e.value})},r.getTeamMemberTimetag=function(e){return this.getTimetag("team-"+e)},r.updateTimetag=function(e,t){var n={name:e,value:t};return this.put("timetag",n)},r.updateMyInfoTimetag=function(e){return this.updateTimetag("myInfo",e)},r.updateRelationTimetag=function(e){return this.updateTimetag("relations",e)},r.getRelationsTimetag=function(){return this.getTimetag("relations")},r.updateFriendTimetag=function(e){return this.updateTimetag("friends",e)},r.getFriendsTimetag=function(){return this.getTimetag("friends")},r.updateFriendUserTimetag=function(e){return this.updateTimetag("friendUsers",e)},r.updateTeamTimetag=function(e){return this.updateTimetag("teams",e)},r.getTeamsTimetag=function(){return this.getTimetag("teams")},r.updateTeamMemberTimetag=function(e,t){return this.updateTimetag("team-"+e,t)},r.getTeamMembersTimetag=function(e){return this.getTimetag("team-"+e)},r.updateMyTeamMembersTimetag=function(e){return this.updateTimetag("myTeamMembers",e)},r.updateRoamingMsgTimetag=function(e){return this.updateTimetag("roamingMsgs",e)},r.updateMsgReceiptsTimetag=function(e){return this.updateTimetag("msgReceipts",e)},r.updateDonnopTimetag=function(e){return this.updateTimetag("donnop",e)},r.updateDeleteMsgTimetag=function(e){return this.updateTimetag("deleteMsg",e)},r.updateSessionAck=function(e){return this.updateTimetag("sessionAck",e)},r.deleteTimetag=function(e){return this.remove("timetag",e)},r.deleteTeamMemberTimetag=function(e){return this.deleteTimetag("team-"+e)}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(7).fn,i=n(1),s="user";o.mergeMyInfo=function(e,t){var n=this;return n.put(s,e).then(function(){return t?n.updateMyInfoTimetag(e.updateTime):e})},o.mergeFriendUsers=function(e,t){var n=this;return n.putUsers(e).then(function(){n.updateFriendUserTimetag(t)})},o.putUsers=function(e){return this.put(s,e)},o.putUser=function(e){return this.put(s,e)},o.updateUser=function(e){var t=this;e=i.copy(e);var n=e.account;return this.getOne(s,null,n,{modifyObj:e}).then(function(r){return r?t.logger.warn("update user",n,e):t.logger.warn("update user no",n),r})},o.putUsersIfIsFriend=function(e){var t,n=this,o=[],i=[];return e.forEach(function(e){t=n.getFriend(e.account).then(function(r){return r&&(t=n.putUser(e),i.push(t)),r}),o.push(t)}),r.all(o).then(function(){return r.all(i).then(function(e){return e})})},o.deleteUser=function(e){return this.remove(s,e)},o.getUser=function(e){return this.getOne(s,null,e)},o.getUsers=function(e){function t(t){return e.indexOf(t.account)!==-1}return this.getAll(s,{filter:t})},o.getAllUsers=function(){return this.getAll(s)}},function(e,t,n){"use strict";var r=n(35),o=n(36);o(r),e.exports=r},function(e,t,n){"use strict";var r=n(5),o=n(36);o(r),e.exports=r},function(e,t,n){"use strict";function r(){}var o=n(26),i=n(1);r.prototype=Object.create(o.prototype),r.verifyFile=function(e){i.verifyOptions(e,"dur",!0,"file.")},e.exports=r},function(e,t,n){"use strict";function r(e){i.verifyOptions(e,"content"),e.type="custom",o.call(this,e),this.attach=e.content}var o=n(12),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return t.content=e.attach,t},e.exports=r},function(e,t,n){"use strict";function r(e){e.type="geo",i.verifyOptions(e,"geo"),i.verifyOptions(e.geo,"lng lat title",!0,"geo."),i.verifyParamType("geo.lng",e.geo.lng,"number"),i.verifyParamType("geo.lat",e.geo.lat,"number"),i.verifyParamType("geo.title",e.geo.title,"string"),o.call(this,e),this.attach=JSON.stringify(e.geo)}var o=n(12),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return e.attach=e.attach?""+e.attach:"",t.geo=e.attach?JSON.parse(e.attach):{},t},e.exports=r},function(e,t,n){"use strict";function r(){}var o=n(1),i=n(26);r.prototype=Object.create(i.prototype),r.verifyFile=function(e){o.verifyOptions(e,"w h",!0,"file.")},e.exports=r},function(e,t,n){"use strict";var r=n(1),o=function(e){this.account=e.account},i=o.prototype,s=i.Message=n(12),a=i.TextMessage=n(107),c=i.FileMessage=n(26),u=i.GeoMessage=n(103),l=i.NotificationMessage=n(106),f=i.CustomMessage=n(102),d=i.TipMessage=n(108);i.validTypes=s.validTypes,i.reverse=function(e){var t,n=s.getType(e);switch(n){case"text":t=a.reverse(e);break;case"image":case"audio":case"video":case"file":t=c.reverse(e);break;case"geo":t=u.reverse(e);break;case"notification":t=l.reverse(e);break;case"custom":t=f.reverse(e);break;case"tip":t=d.reverse(e);break;default:t=s.reverse(e)}return s.setExtra(t,this.account),t},i.reverseMsgs=function(e,t){var n,o,i=this;return e.map(function(e){return e=i.reverse(e),t&&(n=t.modifyObj,n&&(e=r.merge(e,n)),o=t.mapper,r.isFunction(o)&&(e=o(e))),e})},e.exports=o},function(e,t,n){"use strict";function r(){}var o=n(1),i=o.notundef,s=n(12),a={301:"memberEnter",302:"memberExit",303:"blackMember",304:"unblackMember",305:"gagMember",306:"ungagMember",307:"addManager",308:"removeManager",309:"addCommon",310:"removeCommon",311:"closeChatroom",312:"updateChatroom",313:"kickMember",314:"addTempMute",315:"removeTempMute",316:"updateMemberInfo",318:"muteRoom",319:"unmuteRoom"};r.prototype=Object.create(s.prototype),r.reverse=function(e){var t=s.reverse(e);if(e.attach=e.attach?""+e.attach:"",e.attach){var n=JSON.parse(e.attach);if(t.attach={type:a[n.id]},i(n.data)){var r=n.data;i(r.operator)&&(t.attach.from=r.operator),i(r.opeNick)&&(t.attach.fromNick=r.opeNick),i(r.target)&&(t.attach.to=r.target),i(r.tarNick)&&(t.attach.toNick=r.tarNick),i(r.muteDuration)&&(t.attach.duration=parseInt(r.muteDuration,10)),"memberEnter"===t.attach.type&&(i(r.muted)?t.attach.gaged=1===+r.muted:t.attach.gaged=!1,i(r.tempMuted)?t.attach.tempMuted=1===+r.tempMuted:t.attach.tempMuted=!1,i(r.muteTtl)?t.attach.tempMuteDuration=+r.muteTtl:t.attach.tempMuteDuration=0),i(r.ext)&&(t.attach.custom=r.ext)}}else t.attach={};return t},e.exports=r},function(e,t,n){"use strict";function r(e){i.verifyOptions(e,"text"),e.type="text",o.call(this,e),this.attach=e.text}var o=n(12),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return t.text=e.attach,t},e.exports=r},function(e,t,n){"use strict";function r(e){i.verifyOptions(e,"tip"),e.type="tip",o.call(this,e),this.attach=e.tip}var o=n(12),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return t.tip=e.attach,t},e.exports=r},function(e,t,n){"use strict";function r(){}var o=n(26),i=n(1);r.prototype=Object.create(o.prototype),r.verifyFile=function(e){i.verifyOptions(e,"dur w h",!0,"file.")},e.exports=r},function(e,t,n){"use strict";function r(){}var o=n(27),i=n(1);r.prototype=Object.create(o.prototype),r.verifyFile=function(e){i.verifyOptions(e,"dur",!0,"file.")},e.exports=r},function(e,t,n){"use strict";function r(e){i.verifyOptions(e,"content"),e.type="custom",o.call(this,e),this.attach=e.content}var o=n(13),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return t.content=e.attach,t},e.exports=r},function(e,t,n){"use strict";function r(e){e.type="geo",i.verifyOptions(e,"geo"),i.verifyOptions(e.geo,"lng lat title",!0,"geo."),i.verifyParamType("geo.lng",e.geo.lng,"number"),i.verifyParamType("geo.lat",e.geo.lat,"number"),i.verifyParamType("geo.title",e.geo.title,"string"),o.call(this,e),this.attach=JSON.stringify(e.geo)}var o=n(13),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return e.attach=e.attach?""+e.attach:"",t.geo=e.attach?JSON.parse(e.attach):{},t},e.exports=r},function(e,t,n){"use strict";function r(){}var o=n(1),i=n(27);r.prototype=Object.create(i.prototype),r.verifyFile=function(e){o.verifyOptions(e,"w h",!0,"file.")},e.exports=r},function(e,t,n){"use strict";var r=n(1),o=function(e){this.account=e.account},i=o.prototype,s=i.Message=n(13),a=i.TextMessage=n(116),c=i.FileMessage=n(27),u=i.GeoMessage=n(112),l=i.NotificationMessage=n(115),f=i.CustomMessage=n(111),d=i.TipMessage=n(117);i.validScenes=s.validScenes,i.validTypes=s.validTypes,i.reverse=function(e){var t,n=s.getType(e);switch(n){case"text":t=a.reverse(e);break;case"image":case"audio":case"video":case"file":t=c.reverse(e);break;case"geo":t=u.reverse(e);break;case"notification":t=l.reverse(e);break;case"custom":t=f.reverse(e);break;case"tip":t=d.reverse(e);break;default:t=s.reverse(e)}return s.setExtra(t,this.account),t},i.reverseMsgs=function(e,t){var n,o,i=this;return e.map(function(e){return e=i.reverse(e),t&&(n=t.modifyObj,n&&(e=r.merge(e,n)),o=t.mapper,r.isFunction(o)&&(e=o(e))),e})},e.exports=o},function(e,t,n){"use strict";function r(){}var o=n(1),i=o.notundef,s=n(13),a=n(23).getInstance("IM"),c=n(20),u=n(28),l={0:"addTeamMembers",1:"removeTeamMembers",2:"leaveTeam",3:"updateTeam",4:"dismissTeam",5:"passTeamApply",6:"transferTeam",7:"addTeamManagers",8:"removeTeamManagers",9:"acceptTeamInvite",10:"updateTeamMute"};r.prototype=Object.create(s.prototype),r.reverse=function(e){var t=s.reverse(e);if(e.attach=e.attach?""+e.attach:"",e.attach){var n=JSON.parse(e.attach);if(t.attach={type:l[n.id]},i(n.data)){var r=n.data;i(r.tinfo)&&(t.attach.team=c.reverse(a.unserialize(r.tinfo,"team"))),i(r.ids)&&(t.attach.accounts=r.ids),i(r.id)&&(t.attach.account=r.id),i(r.uinfos)&&(t.attach.users=r.uinfos.map(function(e){return u.reverse(a.unserialize(e,"user"))})),i(r.mute)&&(t.attach.mute=1===+r.mute),i(r.attach)&&(t.attach.custom=r.attach)}}else t.attach={};return t},e.exports=r},function(e,t,n){"use strict";function r(e){i.verifyOptions(e,"text"),e.type="text",o.call(this,e)}var o=n(13),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return t},e.exports=r},function(e,t,n){"use strict";function r(e){i.verifyOptions(e,"tip"),e.type="tip",o.call(this,e),this.body=e.tip}var o=n(13),i=n(1);r.prototype=Object.create(o.prototype),r.reverse=function(e){var t=o.reverse(e);return t.text="",t.tip=e.body,e.attach&&(t.attach=e.attach),t},e.exports=r},function(e,t,n){"use strict";function r(){}
  var o=n(27),i=n(1);r.prototype=Object.create(o.prototype),r.verifyFile=function(e){i.verifyOptions(e,"dur w h",!0,"file.")},e.exports=r},function(e,t,n){"use strict";function r(){}var o=n(1);r.parse=function(e){var t=o.copy(e);return t.isBlacked="1"===t.isBlacked,t.isMuted="1"===t.isMuted,t.createTime=+t.createTime,t.updateTime=+t.updateTime,t},e.exports=r},function(e,t,n){"use strict";var r=n(21).fn,o=n(14),i=n(1);r.assembleLogin=function(){var e=this,t=e.options,n={appKey:t.appKey,account:t.account,deviceId:o.deviceId,chatroomId:t.chatroomId,session:e.genSessionKey()};return n=i.merge(n,i.filterObj(t,"chatroomNick chatroomAvatar chatroomCustom chatroomEnterCustom")),{type:1,login:n,imLogin:e.assembleIMLogin()}},r.afterLogin=function(e){var t=this,n=e.chatroom;t.chatroom=n,t.notifyLogin()},r.kickedReasons=["","chatroomClosed","managerKick","samePlatformKick","silentlyKick","blacked"],r.kickedMessages=["","聊天室关闭了","被房主或者管理员踢出","不允许同一个帐号在多个地方同时登录","悄悄被踢","被拉黑了"]},function(e,t,n){"use strict";var r=n(21).fn;r.refreshSocketUrl=function(){var e=this;e.socketUrls=e.socketUrlsBackup.slice(0),e.connectToUrl(e.getNextSocketUrl())}},function(e,t,n){"use strict";var r=n(21).fn,o=n(37);r.onChatroomMembersInfo=r.onChatroomMembers=function(e){e.error||(e.obj.members=o.reverseMembers(e.content.members))},r.onMarkChatroomMember=function(e){e.error||(e.obj.member=o.reverse(e.content.chatroomMember))}},function(e,t,n){"use strict";var r=n(21).fn,o=n(1);r.completeMsg=function(e){var t=this;e.chatroomId=t.chatroom.id,e.from=t.options.account,e.fromClientType="Web",e.time||(e.time=+new Date)},r.onMsg=function(e){var t=this,n=t.message.reverse(e.content.msg);t.checkMsgUnique(n)&&(t.msgBuffer.push(n),t.msgFlushTimer||t.startMsgFlushTimer())},r.startMsgFlushTimer=function(){var e=this,t=e.options;e.msgFlushTimer=setTimeout(function(){var n=e.msgBuffer.splice(0,t.msgBufferSize);e.options.onmsgs(n),e.msgBuffer.length?e.startMsgFlushTimer():delete e.msgFlushTimer},t.msgBufferInterval)},r.checkMsgUnique=o.genCheckUniqueFunc("idClient"),r.onSendMsg=function(e){var t=e.obj.msg;e.error?t.status="fail":(t=e.content.msg,t.status="success"),t=this.message.reverse(t),e.obj=t},r.onHistoryMsgs=function(e){e.error||(e.obj.msgs=this.message.reverseMsgs(e.content.msgs))}},function(e,t,n){"use strict";var r=n(4).fn,o=n(17);r.assembleLogin=function(){return{login:this.assembleIMLogin()}},r.afterLogin=function(){var e=this,t=e.db;if(t.enable){var n=e.account;e.options.appendAppKeyForDBName&&(n+="-"+e.options.appKey),e.db.init(n).then(function(){e.syncData()},function(n){e.logger.warn("no db",n),t.reset(!1),e.syncData()})}else e.logger.warn("no db"),e.syncData()},r.processAuth=function(e){var t=this;switch(e.cmd){case"login":e.error||(e.obj=e.content.loginRes,t.connectionId=e.content.loginRes.connectionId,t.onLoginPortsChange(e,2));break;case"kicked":return void t.onKicked(e);case"multiPortLogin":t.onLoginPortsChange(e,e.content.state);break;case"kick":e.error||(e.obj.deviceIds=e.content.deviceIds)}},r.onLoginPortsChange=function(e,t){var n=this,r=e.content.loginPorts;if(r&&r.length){var i=!0;switch(t){case 2:i=!0;break;case 3:i=!1}r.forEach(function(e){e.type=o.reverseType(e.type),e.time=+e.time,e.online=i}),r=r.filter(function(e){return e.connectionId!==n.connectionId}),r.length&&(n.logger.info("on login ports",r),n.options.onloginportschange(r))}},r.kickedReasons=["","samePlatformKick","serverKick","otherPlatformKick","silentlyKick"],r.kickedMessages=["","不允许同一个帐号在多个地方同时登录","被服务器踢了","被其它端踢了","悄悄被踢"]},function(e,t,n){"use strict";var r=n(4).fn;r.processChatroom=function(e){var t=this;switch(e.cmd){case"getChatroomAddress":t.onChatroomAddress(e)}},r.onChatroomAddress=function(e){e.error||(e.obj.address=e.content.address)}},function(e,t,n){"use strict";var r=n(4).fn,o=n(6),i=n(1),s=n(25);r.refreshSocketUrl=function(){function e(e){n.socketUrls=[],e=JSON.parse(e),e.common.link.forEach(function(e){n.socketUrls.push(o.formatSocketUrl(e))}),e.common["link.default"].forEach(function(e){e=o.formatSocketUrl(e),n.socketUrls.indexOf(e)===-1&&n.socketUrls.push(e)}),n.logger.log("got socket urls",n.socketUrls),n.connectToUrl(n.getNextSocketUrl())}function t(e){n.onDisconnect()}var n=this,r=n.options,a=o.info,c=r.lbsUrl;c=c+i.genUrlSep(c)+"k="+r.appKey+"&id="+r.account+"&sv="+a.sdkVersion+"&pv="+a.protocolVersion,n.logger.log("refresh lbs",c),s(c,{proxyUrl:i.url2origin(c)+"/lbs/res/cors/nej_proxy_frame.html",timeout:o.xhrTimeout,onload:e,onerror:t})}},function(e,t,n){"use strict";var r=n(4).fn;r.processFilter=function(e){var t=this;switch(e.cmd){case"sendFilterMsg":t.onSendMsg(e,!0);break;case"filterMsg":t.onMsg(e,!0);break;case"filterSysMsg":t.onSysMsg(e,!0);break;case"sendFilterCustomSysMsg":t.onSendSysMsg(e,!0)}}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(1),s=i.objs2accounts,a=n(48),c=n(28);o.processFriend=function(e){var t=this,n=e.obj,r=e.content,o=e.error;switch(e.cmd){case"friendRequest":t.updateFriendSysMsg(e),o||t.onFriendRequest(n);break;case"syncFriendRequest":t.onFriendRequest(r,!0);break;case"deleteFriend":o||t.onDeleteFriend(n);break;case"syncDeleteFriend":t.onDeleteFriend(r,!0);break;case"updateFriend":o||t.onUpdateFriend(n);break;case"syncUpdateFriend":t.onUpdateFriend(r.friend,!0);break;case"getFriends":t.onFriends(e);break;case"syncFriends":t.onFriends(e);break;case"syncFriendUsers":t.onFriendUsers(e)}},o.onFriends=function(e){function t(){m&&d.forEach(function(e){e=a.reverse(e),e.valid?p.push(e):h.push(e)}),c.logger.warn("parse friends",s(p),p,"delete",s(h),h),d.length?(m=!0,i=e.content.timetag):m=!1}function n(t,n){e.promise=new r(function(e,r){function s(){f?(o(),e(),t()):u.getFriends().then(function(n){p=n,o(),e(),t()}).then(void 0,function(e){e._msg="get friends error",r(e),n(e)})}m?u.mergeFriends(p,h,i).then(function(){s()}).then(void 0,function(e){e._msg="merge friends error",r(e),n(e)}):(c.logger.warn("no merge friends"),s())}).then(void 0,function(e){throw e._msg="merge friends data error",n(e),e})}function o(){c.timetags.friends=i,p.invalid=h,f?(c.syncResult.friends=p,c.syncResult.invalidFriends=h):(c.logger.warn("get friends",s(p),p),e.obj=p)}var i,c=this,u=c.db,l=e.error,f=c.packetFromSync(e),d=e.content.friends,m=!0,p=[],h=[],g=new r(function(e,r){l?f&&r(l):(t(),u.enable?n(e,r):(o(),e()))});f&&(g.cmd="friends",c.syncPromiseArray.push(g))},o.onFriendRequest=function(e,t){var n=r.resolve(),o=this,i=o.db,s=e.type;s=e.type=a.getTypeFromByte(s)||s;var c="addFriend"===s||"passFriendApply"===s;if(c){var u=e.friend=a.assembleFriend(e.account);i.enable&&(n=i.putFriend(u))}return t&&o.onSyncFriendAction(e),n},o.onSyncFriendAction=function(e){var t=this;t.logger.info("on sync friendAction",e),t.options.onsyncfriendaction(e)},o.onDeleteFriend=function(e,t){var n=r.resolve(),o=this,i=o.db;return i.enable&&(n=i.deleteFriend(e.account)),t&&(e.type="deleteFriend",o.onSyncFriendAction(e)),n},o.onUpdateFriend=function(e,t){var n=this,r=n.db,o=a.reverse(e);r.enable&&r.updateFriend(o),t&&n.onSyncFriendAction({type:"updateFriend",friend:o})},o.onFriendUsers=function(e){var t=this,n=t.db,o=e.content,i=o.users.map(function(e){return c.reverse(e)});t.logger.warn("parse users",s(i),i);var a=o.timetag,u=r.resolve();n.enable&&(u=n.mergeFriendUsers(i,a)),t.timetags.friendUsers=a,u.cmd="friendUsers",t.syncPromiseArray.push(u),t.syncResult.users=i},o.updateFriendSysMsg=function(e){var t,n,r=e.obj,o=e.error;if(e.obj.idServer){if(o)t="error",o=i.filterObj(o,"code message");else{var s=r.type;switch(s=a.getTypeFromByte(s)||s){case"passFriendApply":t="passed";break;case"rejectFriendApply":t="rejected"}}n={idServer:r.idServer,state:t},o&&(n.error=o),this.updateSysMsg(n)}}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(1),s=i.undef,a=n(14),c=n(15),u=n(18),l=n(53);o.processMsg=function(e){var t=this;switch(e.cmd){case"sendMsg":t.onSendMsg(e);break;case"msg":t.onMsg(e);break;case"sysMsg":t.onSysMsg(e);break;case"sendCustomSysMsg":t.onSendSysMsg(e);break;case"getHistoryMsgs":case"searchHistoryMsgs":t.onHistoryMsgs(e);break;case"syncSendMsg":t.onMsg(e);break;case"deleteSessions":t.onDeleteSessions(e);break;case"sendMsgReceipt":t.onSendMsgReceipt(e);break;case"msgReceipt":t.onMsgReceipt(e);break;case"onDeleteMsg":t.onDeleteMsg(e);break;case"onMsgDeleted":t.onMsgDeleted(e);break;case"onDeleteMsgOfflineRoaming":t.onDeleteMsgOfflineRoaming(e);break;case"onMarkSessionAck":t.onMarkSessionAck(e);break;case"syncMarkSessionAck":t.syncMarkSessionAck(e)}},o.checkIgnore=function(e){var t=this;e.forEach(function(e){"notification"===e.type&&!e.ignore&&t.options.shouldIgnoreNotification(e)&&(e.ignore=!0)})},o.filterIgnore=function(e){return e.filter(function(e){return!e.ignore})},o.genSessionByMsgs=function(e){var t=this;return t.checkIgnore(e),u.genSessionByMsgs(t.message.Message,e)},o.onRoamingMsgs=function(e){var t=this,n=t.message,r=n.Message,o=r.getMaxTimetag,i=n.reverseMsgs(e.content.msgs),s=o(i);i=r.sortMsgs(i),i=r.deduplication(i);var a=i[0],c=a.sessionId,u=t.genSessionByMsgs(i);t.cacheSyncedSession(u);var l=t.putMsg(i,"roamingMsgs").then(function(e){i=e,i=t.filterIgnore(i),i.length&&(t.logger.warn("sync roamingMsgs",c,i.length,i),t.syncResult.roamingMsgs=t.syncResult.roamingMsgs||[],t.syncResult.roamingMsgs.push({sessionId:c,scene:a.scene,to:a.target,msgs:i,timetag:s}))});l.cmd="roamingMsgs-"+c,t.syncPromiseArray.push(l)},o.onOfflineMsgs=function(e,t){function n(){if(l.length){var e=i.getMaxTimetag(l),t=l[0].scene,n=l[0].target;r.markMsgRead(l),l=i.sortMsgs(l),l=i.deduplication(l);var o=r.genSessionByMsgs(l);r.cacheSyncedSession(o),c=r.putMsg(l,"offlineMsgs").then(function(o){l=o,l=r.filterIgnore(l),l.length&&(r.logger.warn("sync",d,f,l.length,l),r.syncResult[d]=r.syncResult[d]||[],r.syncResult[d].push({sessionId:f,scene:t,to:n,msgs:l,timetag:e}))}),c.cmd="offlineMsgs-"+f,r.syncPromiseArray.push(c)}}var r=this,o=r.message,i=o.Message,s=null;t&&(s={filter:!0});var a,c,u=o.reverseMsgs(e.content.msgs,{modifyObj:s}),l=[],f="",d=t?"offlineFilterMsgs":"offlineMsgs";u.forEach(function(e){a=e.sessionId,a!==f?(n(),l=[],l.push(e),f=a):l.push(e)}),n()},o.completeMsg=function(e){var t=this;return e.from=t.account,e.fromNick=t.myInfo&&t.myInfo.nick,e.fromClientType="Web",e.fromDeviceId=a.deviceId,e.time||(e.time=+new Date),e},o.onMsgs=function(e){var t=this;t.message.reverseMsgs(e.content.msgs,{mapper:function(e){t.handleMsg(e)}})},o.onMsg=function(e,t){var n=this,r=n.message.reverse(e.content.msg);t&&(r.filter=!0),n.syncing?n.unhandledMsgs.push({type:"onMsg",msg:r}):n.handleMsg(r)},o.pushMsgTask=function(e){var t=this;t.msgPromise=t.msgPromise.then(function(){return e()})},o.handleMsg=function(e){var t=this,n=e.time;t.markMsgRead(e),t.msgPromise=t.msgPromise.then(function(){return t.putMsg(e,"onMsg")}).then(function(r){return e=r[0],t.updateRoamingMsgTimetag(n)}).then(function(){if(e)return t.checkUserUpdate(e)}).then(function(){if(e){var n=e.type;switch(t.logger.log("handle "+e.scene+" "+n+" msg"+("notification"===n?" "+e.attach.type:""),e),n){case"notification":return t.onTeamNotificationMsg(e)}}}).then(function(){e&&!e.ignore&&(t.logger.info("on msg",e),setTimeout(function(){t.options.onmsg(i.copy(e))},0))}).then(void 0,function(e){e._msg="handle msg error",t.onDBError(e)})},o.putMsg=function(e,t){function n(e){"roamingMsgs"!==t&&"offlineMsgs"!==t||o.cacheSyncedSession(e)}if(i.isArray(e)||(e=[e]),e[0].filter)return r.resolve(e);var o=this,a=o.db,c=a.enable,u=r.resolve(),l=o.message.Message,f=l.getLastMsg(e),d=f.flow,m=f.sessionId!==o.currSessionId,p=o.genSessionByMsgs(e);n(p);var h=!1,g=[];o.checkIgnore(e),u=u.then(function(){return c&&"roamingMsgs"!==t&&"offlineMsgs"!==t?a.putMsg(e):e}).then(function(t){var n=[];e.forEach(function(e){o.checkMsgUnique(e)&&n.push(e)}),e=n,g=c?t:e}),u=u.then(function(){if(e.length&&(p=o.genSessionByMsgs(e),n(p),c))if(g.length){if(p)return a.putSession(p)}else h=!0,g=e});var y="roamingMsgs"===t,v=o.options.syncSessionUnread,b=p.id,M=o.findSession(b)||{},T=M.ack||0,k="offlineMsgs"===t||y&&v||"onMsg"===t&&"in"===d&&m;return k&&(u=u.then(function(e){if(p&&g.length){c&&e?(p=e,T=T||p.ack||0):(e=M,e&&(p.unread=e.unread||0)),n(p),p.unread=p.unread||0;var t=0;return g.forEach(function(e){var n="notification"!==e.type&&(s(e.isUnreadable)||e.isUnreadable);if(n&&v&&(n=e.time>T),n&&(t++,v&&!c)){var r=M.unreadMsgs||[];r.push(e),p.unreadMsgs=r}}),p.unread+=t,n(p),c&&!h?a.updateSession({id:p.id,unread:p.unread}):void 0}})),"onMsg"===t&&(u=u.then(function(){e.length&&p&&o.onUpdateSession(p)})),u.then(function(){return e})},o.cacheSyncedSession=function(e){if(e){e=i.merge({},e),e.unread=e.unread||0;var t=this;t.syncResult.sessions=t.syncResult.sessions||{};var n=e.id;t.syncResult.sessions[n]=i.merge(t.syncResult.sessions[n],e),t.mergeSession(t.syncResult.sessions[n])}},o.checkMsgUnique=i.genCheckUniqueFunc("idClient"),o.storeSendMsg=function(e){var t=this;if(!t.syncing){var n=t.putMsg(e,"sendMsg");return t.msgPromise=t.msgPromise.then(function(){return n}),n}t.unhandledMsgs.push({type:"sendMsg",msg:e})},o.updateSendMsgError=function(e){var t=this;if(!t.syncing){var n=t.updateMsg(e);return t.msgPromise=t.msgPromise.then(function(){return n}),n}t.unupdatedMsgs.push(e)},o.onSendMsg=function(e,t){var n=this,o=e.obj.msg;n.completeMsg(o);var i=e.error&&7101===e.error.code;e.error&&!i||(o.idServer=e.content.msg.idServer,o.time=+e.content.msg.time),e.error?o.status="fail":o.status="success",o=n.message.reverse(o),t&&(o.filter=!0),e.obj=o,n.syncing?n.unupdatedMsgs.push(o):n.msgPromise=r.all([n.msgPromise,e.obj.promise]).then(function(e){return e.length||(o.resend=!0),n.updateMsg(o).then(function(){return n.resolveMsgReceiptTask(o),o})})},o.updateLocalMsg=function(e){var t=this,n=t.updateMsg(e);return t.msgPromise=t.msgPromise.then(function(){return n}),n},o.updateMsg=function(e){if(e.filter)return r.resolve(e);var t=this,n=t.db,o="success"===e.status,i=u.genSessionByMsg(e),s=!!e.isLocal;return t.onUpdateSession(i),n.enable?n.updateMsg(e).then(function(e){var t=n.updateSession(i),a=r.resolve();return o&&e&&!s&&(a=n.updateRoamingMsgTimetag(e.time)),r.all([t,a])}):(o&&!s&&(t.timetags.roamingMsgs=e.time),r.resolve(e))},o.updateRoamingMsgTimetag=function(e){var t=this,n=t.db;return n.enable?n.updateRoamingMsgTimetag(e):(t.timetags.roamingMsgs=e,r.resolve(e))},o.checkUserUpdate=function(e){var t=this,n=e.from;return n===t.account?r.resolve():new r(function(r){function o(){t.api.getUser({account:n,sync:!0,done:function(e,n){e||setTimeout(function(){t.logger.info("on update user",n.account,n),t.options.onupdateuser(n)},0),r()}})}var s=t.userSet[n];if(s){var a=+s.updateTime,c=+e.userUpdateTime;!isNaN(a)&&!isNaN(c)&&i.isNumber(a)&&i.isNumber(c)&&a<c?o():r()}else o()})},o.processUnsettledMsgs=function(){var e=this;e.unhandledMsgs.forEach(function(t){var n=t.msg;switch(t.type){case"onMsg":e.handleMsg(n);break;case"sendMsg":e.msgPromise=e.msgPromise.then(function(){return e.putMsg(n)})}}),e.unupdatedMsgs.forEach(function(t){e.msgPromise=e.msgPromise.then(function(){return e.updateMsg(t)})}),e.resetUnsettledMsgs()},o.onTeamNotificationMsg=function(e){var t=this,n=t.db,r=e.attach,o=r.type,i=e.from,s=e.to,a=e.time,c=r.team,u=r.account,l=r.accounts;switch(o){case"updateTeam":if(!n.enable)return;return c.updateTime=a,t.onUpdateTeam(c),n.updateTeam(c);case"addTeamMembers":return t.onAddTeamMembers(e,c,l);case"removeTeamMembers":return t.onRemoveTeamMembers(c,s,l);case"acceptTeamInvite":return t.onAddTeamMembers(e,c,[i]);case"passTeamApply":return t.onAddTeamMembers(e,c,[u]);case"addTeamManagers":return t.updateTeamManagers(e,s,l,!0,a);case"removeTeamManagers":return t.updateTeamManagers(e,s,l,!1,a);case"leaveTeam":return t.onRemoveTeamMembers(c,s,[i]);case"dismissTeam":return t.onDismissTeam(s,a);case"transferTeam":return t.transferTeam(e,c,i,u);case"updateTeamMute":return t.onUpdateTeamMembersMute(e,c,[u],r.mute)}},o.onAddTeamMembers=function(e,t,n){var o=this,s=o.db,a=t.teamId,u=c.assembleMembers(t,n);e.attach.members=u;var l={team:t,accounts:n,members:u};if(o.logger.info("on add team members",l),o.options.onAddTeamMembers(i.simpleClone(l)),s.enable){var f,d=s.putTeam(t),m=n.indexOf(o.account)===-1;return m?f=s.putTeamMembers(u):(o.logger.warn("join team",a),d=new r(function(e){o.api.getTeamMembers({teamId:a,sync:!0,done:function(){e()}})})),r.all([f,d])}},o.onRemoveTeamMembers=function(e,t,n){var o=this,s=o.db,a={team:e,accounts:n};if(o.logger.info("on remove team members",a),o.options.onRemoveTeamMembers(i.simpleClone(a)),s.enable){if(n.indexOf(o.account)===-1){var c=s.removeTeamMembersByAccounts(t,n),u=r.resolve();return e&&(u=s.putTeam(e)),r.all([c,u])}return s.leaveTeam(t)}},o.updateTeamManagers=function(e,t,n,o,s){var a=this,u=a.db,l=e.attach.members=n.map(function(e){return{id:c.genId(t,e),type:o?"manager":"normal",updateTime:s}}),f={teamId:""+t,memberUpdateTime:s};e.attach.team=f;var d={team:f,accounts:n,isManager:o,members:l};if(a.logger.info("on update team managers",d),a.options.onUpdateTeamManagers(i.simpleClone(d)),u.enable){var m=u.updateTeam(f),p=u.updateTeamManagers(t,n,o,s);return r.all([m,p])}},o.onDismissTeam=function(e,t){var n=this,r=n.db,o={teamId:e};if(n.logger.info("on dismiss team",o),n.options.onDismissTeam(o),r.enable)return r.dismissTeam(e,t)},o.transferTeam=function(e,t,n,r){var o=this,s=o.db,a=t.teamId,u=t.memberUpdateTime,l={id:c.genId(a,n),type:"normal",updateTime:u},f={id:c.genId(a,r),type:"owner",updateTime:u};e.attach.members=[l,f];var d={team:t,from:l,to:f};if(o.logger.info("on transfer team",d),o.options.onTransferTeam(i.simpleClone(d)),s.enable)return s.transferTeam(t,n,r)},o.onUpdateTeamMembersMute=function(e,t,n,o){var s=this,a=s.db,u=n.map(function(e){return{id:c.genId(t.teamId,e),account:e,teamId:t.teamId,mute:o,updateTime:t.memberUpdateTime}});e.attach.members=u;var l={team:t,accounts:n,members:u,mute:o};if(s.logger.info("on update team members mute",l),s.options.onUpdateTeamMembersMute(i.simpleClone(l)),a.enable){var f=a.updateTeamMembers(u),d=a.putTeam(t);return r.all([f,d])}},o.onHistoryMsgs=function(e){e.error||(e.obj.msgs=this.message.reverseMsgs(e.content.msgs))},o.isFilterMsgs=function(e){return!!e[0].filter},o.splitMsgs=function(e,t,n,r){e.forEach(function(e){if(e.filter)r.push(e);else switch(e.scene){case"p2p":t.push(e);break;case"team":n.push(e)}})},o.markMsgRead=function(e,t){i.isArray(e)||(e=[e]);var n=this,r=n.db;if(r.enable||n.options.autoMarkRead||t){var o=[],s=[],a=[];n.splitMsgs(e,o,s,a),n.markP2pMsgsRead(o),n.markTeamMsgsRead(s),n.markFilterMsgsRead(a)}},o.markP2pMsgsRead=function(e){if(e.length){var t=l.idMap.msg.id,n=l.idMap.msg.msg;this.doMarkMsgsRead(t,n,e)}},o.markTeamMsgsRead=function(e){if(e.length){var t=l.idMap.team.id,n=l.idMap.team.teamMsg;this.doMarkMsgsRead(t,n,e)}},o.markFilterMsgsRead=function(e){if(e.length){var t=l.idMap.filter.id,n=l.idMap.filter.filterMsg;this.doMarkMsgsRead(t,n,e)}},o.markSysMsgRead=function(e,t){i.isArray(e)||(e=[e]);var n=this,r=n.db;if(r.enable||n.options.autoMarkRead||t){var o,s;n.isFilterMsgs(e)?(o=l.idMap.filter.id,s=l.idMap.filter.filterSysMsg):(o=l.idMap.msg.id,s=l.idMap.msg.sysMsg),n.doMarkMsgsRead(o,s,e)}},o.doMarkMsgsRead=function(e,t,n){n.length&&this.sendCmd("batchMarkRead",{sid:e,cid:t,ids:n.map(function(e){return e.idServer})})}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(19),s=n(18),a=n(1);o.onDeleteMsg=function(e){delete e.obj.sysMsg,e.error||(e.promise=this.deleteLocalMsg(e.obj.msg))},o.onMsgDeleted=function(e){if(!e.error){var t=this,n=t.db,r=i.reverse(e.content.sysMsg);r=t.processDeleteMsgSysMsg(r),t.markSysMsgRead(r),t.deleteLocalMsg(r.msg).then(function(){n.enable&&n.updateDeleteMsgTimetag(r.time+1),t.handleSysMsg(r)})}},o.processDeleteMsgSysMsg=function(e){var t=this;return e.msg={},["scene","from","to"].forEach(function(t){e.msg[t]=e[t]}),e.msg.idClient=e.deletedIdClient,e.msg.idServer=e.deletedIdServer,e.msg.time=e.deletedMsgTime,e.msg.fromNick=e.deletedMsgFromNick,t.message.Message.setExtra(e.msg,t.account),e},o.onDeleteMsgOfflineRoaming=function(e){if(!e.error){var t=this,n=1===+e.content.type?"offline":"roaming",r=i.reverseSysMsgs(e.content.sysMsgs,{mapper:function(e){return t.processDeleteMsgSysMsg(e)}});t.logger.warn("sync deleteMsgSysMsgs "+n,r),"offline"===n&&t.markSysMsgRead(r);var o=e.content.timetag;t.timetags.deleteMsg=o,t.syncResult.deleteMsgTimetag=o;var s=t.putSysMsg(r,"offlineSysMsgs");s.cmd="deleteMsgSysMsgs "+n,t.syncPromiseArray.push(s),t.syncResult.deleteMsgSysMsgs=t.syncResult.deleteMsgSysMsgs||[],t.syncResult.deleteMsgSysMsgs.push({type:n,sysMsgs:r})}},o.deleteMsgOfflineRoaming=function(e,t){if(!e)return r.resolve();var n=this;n.logger.warn("deleting msgs",e);var o=n.db,i=[];return e.forEach(function(e){e.sysMsgs.forEach(function(e){var r=n.deleteLocalMsg(e.msg,{cbUpdateSession:function(e){e=n.mergeSession(e),e=a.simpleClone(e),s.trim(e);var r=a.findObjIndexInArray(t,{value:e.id});if(r!==-1&&(t[r]=a.merge({},t[r],e)),o.enable)return o.updateSession(e)}});i.push(r)})}),r.all(i).then(function(){if(o.enable)return o.updateDeleteMsgTimetag(n.syncResult.deleteMsgTimetag)})},o.deleteLocalMsg=function(e,t){var n=this,o=n.db;t=t||{};var i=t.cbUpdateSession||n.updateLocalSession.bind(n);if(o.enable&&e){var s=!1,a=null,c=e.sessionId;return o.getMsgs({sessionId:c,limit:1}).then(function(t){t&&t[0]&&t[0].idClient===e.idClient&&(s=!0)}).then(function(){return o.deleteMsg(e.idClient)}).then(function(){if(s)return o.getMsgs({sessionId:c,limit:1})}).then(function(e){if(s)return e&&e[0]&&(a=e[0]),i({id:c,lastMsg:a})})}return r.resolve()}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn;o.onOfflineMsgReceipts=function(e){var t,n=this,o=n.db,i=e.content.msgReceipts,s=n.syncResult.msgReceipts=[],a=[],c="msgReceipts",u=n.syncResult.sessions||{};i.forEach(function(e){e.time=+e.time;var i=e.sessionId="p2p-"+e.from;c+="-"+i,t=r.resolve();var l=u[i];o.enable?t=o.getSession(i).then(function(t){if(t=t||l,t&&n.shouldUpdateSessionFromMsgReceipt(t,e)){var r=n.genSessionFromMsgReceipt(t,e);return o.putSession(r).then(function(e){e&&n.cacheSyncedSession(e)})}}):l&&s.push(e),a.push(t)}),t=r.all(a).then(function(){if(o.enable)return o.updateMsgReceiptsTimetag(e.content.timetag)}),t.cmd=c,n.syncPromiseArray.push(t)},o.mergeSessionAndMsgReceipts=function(e,t){var n=this,r={};return e=e||[],t=t||[],e.forEach(function(e){r[e.id]=e}),t.forEach(function(t){var o=r[t.sessionId];if(n.shouldUpdateSessionFromMsgReceipt(o,t)){var i=n.genSessionFromMsgReceipt(o,t);e=n.api.mergeSessions(e,i)}}),e},o.shouldUpdateSessionFromMsgReceipt=function(e,t){return!e||!e.msgReceiptServerTime||t.time>e.msgReceiptServerTime},o.genSessionFromMsgReceipt=function(e,t){var n=t.time,r={id:t.sessionId,msgReceiptTime:n,msgReceiptServerTime:n};return e&&e.updateTime||(r.updateTime=n),r},o.onMsgReceipt=function(e){var t=this,n=t.db,o=e.content.msgReceipt;o.time=+o.time;var i=o.idClient,s=r.resolve();n.enable&&i&&(s=n.getMsgByIdClient(i)),s.then(function(e){var n;if(e){if(!e.idServer)return void(t.msgReceiptTasks[i]=o);n=e.time}else n=o.time;o.msgReceiptTime=n,t.updateSessionMsgReceiptTime(o)})},o.resolveMsgReceiptTask=function(e){var t=this,n=t.msgReceiptTasks[e.idClient];n&&(n.msgReceiptTime=e.time,this.updateSessionMsgReceiptTime(n))},o.updateSessionMsgReceiptTime=function(e){var t=this,n=t.db,r={id:"p2p-"+e.from,msgReceiptTime:e.msgReceiptTime,msgReceiptServerTime:e.time};n.enable&&n.putSession(r),t.onUpdateSession(r)},o.onSendMsgReceipt=function(e){var t=this;if(!e.error){var n=e.obj.msgReceipt,r=+n.time,o=+e.content.msgReceipt.time,i=t.sessionSet["p2p-"+n.to];i.msgReceiptSendTime=Math.min(r,o)}},o.shouldSendMsgReceipt=function(e){if(e&&"p2p"===e.scene&&"success"===e.status){var t=this.sessionSet[e.sessionId];if(t){var n=t.msgReceiptSendTime;return!n||n<e.time}}return!1},o.isMsgRemoteRead=function(e){var t=this;if(e&&"p2p"===e.scene&&"out"===e.flow&&"success"===e.status){var n=t.sessionSet[e.sessionId];if(n&&n.msgReceiptTime)return e.time<=n.msgReceiptTime}return!1}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(1),s=n(38);o.processNotify=function(e){var t=this;switch(e.cmd){case"syncOfflineMsgs":t.onOfflineMsgs(e);break;case"batchMarkRead":break;case"syncOfflineSysMsgs":t.onOfflineSysMsgs(e);break;case"syncRoamingMsgs":t.onRoamingMsgs(e);break;case"syncOfflineFilterMsgs":t.onOfflineMsgs(e,!0);break;case"syncOfflineFilterSysMsgs":t.onOfflineSysMsgs(e,!0);break;case"syncMsgReceipts":t.onOfflineMsgReceipts(e);break;case"syncDonnop":t.onDonnop(e,!0);break;case"syncSessionAck":t.syncSessionAck(e)}},o.onDonnop=function(e,t){if(!e.error){var n=this,r=n.db,o=s.reverse(e.content.donnop);n.mergeDonnop(o);var i=n.dbDonnop();if(t){var a=e.content.timetag;n.timetags.donnop=a,r.enable&&(i=i.then(function(){return n.db.updateDonnopTimetag(a)})),i.cmd="donnop",n.syncPromiseArray.push(i)}else n.onPushNotificationMultiportConfigUpdate()}},o.onUpdateDonnop=function(e){var t=this;if(!e.error){var n=e.obj;n&&(t.mergeDonnop(i.filterObj(n,["shouldPushNotificationWhenPCOnline"])),t.dbDonnop(),t.onPushNotificationMultiportConfigUpdate())}},o.getPushNotificationMultiportConfig=function(){var e=this;return i.merge({},e.pushNotificationMultiportConfig)},o.mergeDonnop=function(e){var t=this;t.pushNotificationMultiportConfig=i.merge({},t.pushNotificationMultiportConfig,e)},o.dbDonnop=function(){var e=this,t=e.db;return t.enable?e.db.setDonnop(e.pushNotificationMultiportConfig):r.resolve()},o.onPushNotificationMultiportConfigUpdate=function(){var e=this;setTimeout(function(){var t=e.getPushNotificationMultiportConfig();e.logger.info("on update pushNotificationMultiportConfig",t),e.options.onPushNotificationMultiportConfigUpdate(t)})}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(1),s=n(18),a=n(3);o.mergeSession=function(e){e=i.copy(e);var t=this.sessionSet,n=e.id,r=t[n];if(r&&r.lastMsg&&e&&e.lastMsg){var o=r.lastMsg.time||0,s=e.lastMsg.time||0;s<o&&delete e.lastMsg}return t[n]=i.merge(r,e),e=t[n],i.undef(e.unread)&&(e.unread=0),e},o.mergeSessions=function(e){var t=this;e.forEach(function(e){t.mergeSession(e)})},o.deleteLocalSession=function(e){var t=this;i.isArray(e)||(e=[e]),e.forEach(function(e){delete t.sessionSet[e]})},o.onDeleteSessions=function(e){e.obj=e.obj.sessions.map(function(e){return s.parse(e)})},o.onUpdateSession=function(e){var t=this;return new r(function(n){e?(e=t.mergeSession(e),e=i.simpleClone(e),s.trim(e),s.isComplete(e)&&setTimeout(function(){t.logger.info("on update session",e.id,i.simpleClone(e)),t.options.onupdatesession(e),n(e)},0)):n(e)})},o.setCurrSession=function(e){var t=this;e=""+e,t.currSessionId=e,t.logger.warn("set curr session",e)},o.findSession=function(e){return this.sessionSet[e]},o.resetSessionUnread=function(e){function t(){n={id:e,unread:0},r.onUpdateSession(n)}e=""+e;var n,r=this,o=r.db;return r.findSession(e)?(o.enable&&o.resetSessionUnread(e),void t()):void r.logger.warn("reset session unread, no session "+e)},o.insertLocalSession=function(e){var t=this,n=t.db,o=t.sessionSet;return new r(function(c,u){var l=e.scene,f=e.to,d=l+"-"+f,m=t.findSession(d);if(m)t.logger.warn("session exist"),u(a.sessionExist());else{var p;if(i.isNumber(e.updateTime))p=e.updateTime;else{var h,g=[];for(var y in o)o.hasOwnProperty(y)&&(h=o[y],i.isNumber(h.updateTime)&&g.push(h.updateTime));p=Math.max.apply(Math,g)+1,p=Math.max(p,+new Date)}var v=r.resolve();n.enable&&(v=n.getMsgs({sessionId:d,limit:1})),v.then(function(e){if(i.isArray(e)&&1===e.length){var r=e[0];m=s.genSessionByMsg(r),m.updateTime=p}else m={id:d,scene:l,to:f,updateTime:p,lastMsg:null};n.enable?n.putSession(m).then(c,u):c(m),t.onUpdateSession(m)})}})},o.updateLocalSession=function(e){var t=this;return new r(function(n,o){var s=t.db,c=t.findSession(e.id);if(c){var u=r.resolve(),l=i.filterObj(e,"id lastMsg localCustom");s.enable&&(u=s.updateSession(l)),u.then(function(e){return t.onUpdateSession(e)}).then(n,function(e){o(e)})}else t.logger.warn("no session ",e.id),o(a.sessionNotExist())})}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn;o.syncSessionAck=function(e){var t=this,n=t.db,o=r.resolve();[[e.content.p2p,"p2p"],[e.content.team.m_map,"team"]].forEach(function(e){var r=e[0],i=e[1];Object.keys(r).forEach(function(e){var s=i+"-"+e,a={id:s,ack:r[e]};n.enable&&(o=o.then(function(){return n.putSession(a)})),t.mergeSession(a)})}),t.logger.warn("parse offline session ack",t.sessionSet);var i=e.content.timetag;n.enable&&(o=o.then(function(){return t.db.updateSessionAck(i)})),o.cmd="sessionAck",t.syncPromiseArray.push(o)},o.onMarkSessionAck=function(e){e.error||this.storeSessionAck(e.obj)},o.syncMarkSessionAck=function(e){this.storeSessionAck(e.content)},o.storeSessionAck=function(e){var t=this,n=t.options.syncSessionUnread;if(n){var r=t.db,o=0===e.scene?"p2p":"team",i=o+"-"+e.to,s=e.timetag,a=t.findSession(i)||{},c=a.ack||0;if(s<=c)return void t.logger.warn("useless ack, no store session ack",s);var u={id:i,ack:s};if(t.mergeSession(u),r.enable&&r.updateSession(u),t.logger.warn("store session ack",u),r.enable)t.pushMsgTask(function(){return r.getMsgCountAfterAck({sessionId:i,ack:u.ack}).then(function(e){var n={id:i,unread:e};return t.logger.warn("update unread via session ack"),t.onUpdateSession(n),r.updateSession(n)})});else{var l=t.findSession(i);if(l){var f=l.unreadMsgs;if(f&&f.length){for(var d=0,m=[],p=f.length-1;p>=0;p--){var h=f[p];if(!(h.time>s))break;d++,m.push(h)}l.unreadMsgs=m,l.unread=d,t.logger.warn("update unread via session ack"),t.onUpdateSession(l)}}}}}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(1),s=i.undef,a=i.objs2ids,c=i.objs2accounts,u=i.teams2ids,l=n(18);o.beforeSync=function(){var e=this,t=e.db;return t.enable?t.clearSendingMsgs():r.resolve()},o.syncData=function(){function e(e){t.syncPromiseArray=[],t.syncResult={},t.syncTeamMembersPromiseArray=[],t.syncTeamMembersResult={},i.verifyBooleanWithDefault(r,"syncRelations syncFriends syncFriendUsers syncTeams syncRoamingMsgs syncMsgReceipts syncExtraTeamInfo syncTeamMembers",!0),i.verifyBooleanWithDefault(r,"syncFilter",!1);var n={};e=e||{},window._nimForceSyncIM&&(t.logger.warn("upgrade force sync"),e={},window._nimForceSyncIM=!1),n.myInfo=e.myInfo||0,n.offlineMsgs=0,r.syncRelations&&(n.relations=e.relations||0),r.syncFriends&&(n.friends=e.friends||0),r.syncFriendUsers&&(n.friendUsers=e.friendUsers||0),r.syncTeams&&(n.teams=e.teams||0),r.syncRoamingMsgs&&(n.roamingMsgs=e.roamingMsgs||0),r.syncMsgReceipts&&(n.msgReceipts=e.msgReceipts||0),r.syncExtraTeamInfo&&(n.myTeamMembers=e.myTeamMembers||0),r.syncSessionUnread&&(n.sessionAck=e.sessionAck||0),n.donnop=e.donnop||0,n.deleteMsg=e.deleteMsg||0,r.syncFilter&&(n.filterMsgs=0),t.sendCmd("sync",{sync:n},t.onSyncData.bind(t))}var t=this,n=t.db,r=t.options,o=n.enable;t.notifyLogin(),t.syncing=!0,o?t.beforeSync().then(function(){return t.db.getTimetags()}).then(function(t){e(t)},function(){e()}):e(t.timetags)},o.onSyncData=function(e,t){this.onMiscError(e,t,"sync error")},o.processSync=function(e){var t=this;switch(e.cmd){case"syncDone":t.timetags.sync=e.content.timetag,t.onSyncDone();break;case"syncTeamMembersDone":t.onSyncTeamMembersDone()}},o.onSyncDone=function(){function e(){if(D.logger.warn("after sync",i.promises2cmds(W)),W=[],g=q.blacklist||[],y=q.invalidBlacklist||[],v=q.mutelist||[],b=q.invalidMutelist||[],M=q.friends,T=q.invalidFriends||[],k=q.myInfo,S=q.users,w=q.teams,C=q.invalidTeams||[],O=q.sessions,I=q.msgReceipts,x=q.roamingMsgs,P=q.offlineMsgs,_=q.offlineFilterMsgs,j=q.offlineSysMsgs,A=q.offlineCustomSysMsgs,F=q.offlineFilterSysMsgs,R=q.offlineFilterCustomSysMsgs,N=q.sysMsgUnread,O){var e=[];Object.keys(O).forEach(function(t){e.push(O[t])}),O=e.sort(function(e,t){return t.updateTime-e.updateTime})}var s=r.resolve();B&&(s=t()),s.then(function(){B&&!D.hasSynced&&(D.hasSynced=!0,n()),r.all(W).then(o).then(d,D.onDBError.bind(D))})}function t(){var e,t=[],n=[];return x&&x.forEach(function(e){n=[].concat(n,e.msgs)}),P&&P.forEach(function(e){n=[].concat(n,e.msgs)}),e=U.putMsg(n),t.push(e),r.all(t);
  }function n(){L.syncRelations&&(h=U.getRelations().then(function(e){g=e[0],v=e[1],g.invalid=y,v.invalid=b},function(e){return e._msg="on relations error",e}),W.push(h)),L.syncFriends&&(h=U.getFriends().then(function(e){M=e,M.invalid=T},function(e){return e._msg="on friends error",e}),W.push(h)),s(k)&&(h=U.getUser(D.account).then(function(e){k=e},function(e){return e._msg="on myInfo error",e}),W.push(h)),L.syncFriendUsers&&(h=U.getFriends().then(function(e){return e.map(function(e){return e.account})}).then(function(e){return U.getUsers(e)}).then(function(e){S=e},function(e){return e._msg="on users error",e}),W.push(h)),L.syncTeams&&(h=U.getTeams().then(function(e){w=e,w.invalid=C},function(e){return e._msg="on teams error",e}),W.push(h)),h=U.getTeamMembersByAccount(D.account).then(function(e){D.mergeMyTeamMembers(e)}),W.push(h),h=U.getDonnop().then(function(e){D.mergeDonnop(e)}),W.push(h),h=U.getSessions().then(function(e){O=e},function(e){return e._msg="on sessions error",e}),W.push(h),h=U.getSysMsgUnread().then(function(e){N=e},function(e){return e._msg="on sysMsgUnread error",e}),W.push(h)}function o(){D.logger.warn("taskAfterSync"),f();var e=[];return e.push(D.deleteMsgOfflineRoaming(q.deleteMsgSysMsgs,O)),r.all(e)}function f(){if(q.deleteMsgSysMsgs){var e={};x&&x.forEach(function(t){e[t.sessionId]=t});var t={};P&&P.forEach(function(e){t[e.sessionId]=e});var n=D.api;q.deleteMsgSysMsgs.forEach(function(r){r.sysMsgs.forEach(function(r){var o=r.msg,i=o.sessionId;[e,t].forEach(function(e){e[i]&&(e[i].msgs=n.cutMsgs(e[i].msgs,o))})})}),U.enable||[x,P].forEach(function(e){e&&e.forEach(function(e){if(e.msgs.length){var t=D.genSessionByMsgs(e.msgs);D.cacheSyncedSession(t),O=n.mergeSessions(O,t)}else O=n.cutSessions(O,{id:e.sessionId})})})}}function d(){setTimeout(m,0)}function m(){var e,t,n=[];g&&(D.logger.info("on blacklist",c(g),g),L.onblacklist(g)),v&&(D.logger.info("on mutelist",c(v),v),L.onmutelist(v)),M&&(D.logger.info("on friends",c(M),M),L.onfriends(M)),k&&(D.logger.info("on myInfo",k),D.myInfo=k,L.onmyinfo(i.copy(k))),S&&(S.forEach(function(e){D.mergeUser(e)}),D.logger.info("on users",c(S),S),L.onusers(S)),w&&(D.logger.info("on teams",u(w),w),L.onteams(w)),I&&(!D.hasSynced&&O&&O.length||D.hasSynced)&&(O=D.mergeSessionAndMsgReceipts(O,I)),O&&O.length&&(O.forEach(function(e){D.mergeSession(e),l.trim(e)}),D.logger.info("on sessions",a(O),O),L.onsessions(O)),x&&x.forEach(function(e){n.push(e.timetag),t=e.msgs,t.length&&(D.logger.info("on roaming msgs",e.sessionId,t.length,t),L.onroamingmsgs(e))}),P&&P.forEach(function(e){n.push(e.timetag),t=e.msgs,t.length&&(D.logger.info("on offline msgs",e.sessionId,t.length,t),L.onofflinemsgs(e))}),_&&_.forEach(function(e){n.push(e.timetag),t=e.msgs,t.length&&(D.logger.info("on offline filter msgs",e.sessionId,t.length,t),L.onofflinefiltermsgs(t))});var r=[],o=[];q.deleteMsgSysMsgs&&q.deleteMsgSysMsgs.forEach(function(e){"roaming"===e.type?r=r.concat(e.sysMsgs):o=o.concat(e.sysMsgs)}),r.length&&(E=E||[],E=E.concat(r)),o.length&&(j=j||[],j=j.concat(o)),E&&(D.logger.info("on roaming sys msgs",E.length,E),L.onroamingsysmsgs(E)),j&&(D.logger.info("on offline sys msgs",j.length,j),L.onofflinesysmsgs(j)),F&&(D.logger.info("on offline filter sys msgs",F.length,F),L.onofflinefiltersysmsgs(F)),A&&(D.logger.info("on offline custom sys msgs",A.length,A),L.onofflinecustomsysmsgs(A)),R&&(D.logger.info("on offline filter custom sys msgs",R.length,R),L.onofflinefiltercustomsysmsgs(R)),N&&(N=i.merge({},D.sysMsgUnread,N),D.sysMsgUnread=i.merge({},N),D.logger.info("on sysMsgUnread",N),L.onsysmsgunread(N));var s=D.getPushNotificationMultiportConfig();D.logger.info("on pushNotificationMultiportConfig",s),L.onPushNotificationMultiportConfig(s),n.length?(e=Math.max.apply(Math,n),D.updateRoamingMsgTimetag(e).then(p,p)):p(),D.syncPromiseArray=null,D.syncResult=null}function p(){D.processUnsettledMsgs(),D.processUnsettledSysMsgs(),D.syncing=!1,D.logger.info("sync done"),L.onsyncdone(),L.syncTeamMembers&&w&&w.length?D.syncTeamMembers(w):setTimeout(function(){D.onSyncTeamMembersDone()},0)}var h,g,y,v,b,M,T,k,S,w,C,O,I,x,P,_,E,j,A,F,R,N,D=this,U=D.db,B=U.enable,L=D.options,W=D.syncPromiseArray,q=D.syncResult;W.length?r.all(W).then(e,function(e){D.onDBError(e)}):e()},o.syncTeamMembers=function(e){function t(t){var r={};t=t||{},e.forEach(function(e){r[e.teamId]=t["team-"+e.teamId]||0},n),n.sendCmd("syncTeamMembers",{sync:r},n.onSyncTeamMembers.bind(n))}var n=this,r=n.db;r.enable?r.getTeamMemberTimetags().then(function(e){t(e)},function(){t()}):t(n.timetags)},o.onSyncTeamMembers=function(e,t){this.onMiscError(e,t,"sync teamMembers error")},o.onSyncTeamMembersDone=function(){function e(){l.logger.warn("after sync members",i.promises2cmds(p)),p=[],f.enable&&!l.hasSyncedTeamMembers?(l.hasSyncedTeamMembers=!0,t()):n()}function t(){return d.syncTeams&&d.syncTeamMembers?void f.getTeams().then(function(e){e.forEach(function(e){var t=e.teamId;u=f.getTeamMembers(t).then(function(e){m[t]=e},function(e){return e._msg="on members error",e}),p.push(u)}),p.length?r.all(p).then(n,function(e){l.onDBError(e)}):n()},function(e){e._msg="on members error",l.onDBError(e)}):a()}function n(){setTimeout(o,0)}function o(){var e,t;Object.keys(m).forEach(function(n){n.indexOf("invalid")===-1&&(e=m[n],t=m[n+"-invalid"]||[],e.invalid=t,s(n,e))}),a()}function s(e,t){l.logger.info("on members",e,c(t),t),d.onteammembers({teamId:e,members:t})}function a(){l.logger.info("sync members done"),d.onsyncteammembersdone(),l.syncTeamMembersResult=null,l.syncTeamMembersPromiseArray=null}var u,l=this,f=l.db,d=l.options,m=l.syncTeamMembersResult,p=l.syncTeamMembersPromiseArray;p.length?r.all(p).then(e,function(e){l.onDBError(e)}):e()}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(1),s=n(19);o.splitSysMsgs=function(e,t){for(var n,r=e.length-1;r>=0;r--)n=e[r],s.isCustom(n)&&(e.splice(r,1),t.push(n))},o.onOfflineSysMsgs=function(e,t){var n=this,r=e.content.sysMsgs.map(function(e){return e=s.reverse(e),t&&(e.filter=!0),e});r=r.reverse(),n.markSysMsgRead(r);var o=[];n.splitSysMsgs(r,o);var i=t?"offlineFilterSysMsgs":"offlineSysMsgs",a=t?"offlineFilterCustomSysMsgs":"offlineCustomSysMsgs";if(r.length){var c=n.putSysMsg(r,"offlineSysMsgs").then(function(e){r=e,r.length&&(n.logger.warn("sync",i,r.length,r),n.syncResult[i]=r)});c.cmd="sysMsgs",n.syncPromiseArray.push(c)}o.length&&(n.logger.warn("sync "+a,o),n.syncResult[a]=o)},o.onSendSysMsg=function(e,t){var n=this,r=e.obj;n.completeSysMsg(r),e.error?r.status="fail":r.status="success",r=s.reverse(r),t&&(e.obj.filter=!0),e.obj=r},o.completeSysMsg=function(e){return e.from=this.account,e},o.onSysMsg=function(e,t){var n=this,r=s.reverse(e.content.sysMsg);n.markSysMsgRead(r),t&&(r.filter=!0),s.isCustom(r)?(n.logger.info("on customSysMsg",r),n.options.oncustomsysmsg(r)):n.syncing?n.unhandledSysMsgs.push(r):n.handleSysMsg(r)},o.handleSysMsg=function(e){var t=this,n=e.type,o=e.from;t.sysMsgPromise=t.sysMsgPromise.then(function(){return t.putSysMsg(e,"onSysMsg")}).then(function(t){e=t[0]}).then(function(){if(e){var i,s=r.resolve();switch(n){case"addFriend":i={type:"addFriend",account:o},s=t.onFriendRequest(i);break;case"passFriendApply":i={type:"passFriendApply",account:o},s=t.onFriendRequest(i);break;case"deleteFriend":s=t.onDeleteFriend({account:o})}return i&&i.friend&&(e.friend=i.friend),s}}).then(function(){e&&(t.logger.info("on sysMsg",n,e),setTimeout(function(){t.options.onsysmsg(e)},0))})},o.putSysMsg=function(e,t){if(i.isArray(e)||(e=[e]),e[0].filter)return r.resolve(e);var n=this,o=n.db,s=o.enable,a=r.resolve(),c=[];return a=a.then(function(){return s?o.putSysMsg(e):e}).then(function(t){var r=[];e.forEach(function(e){n.checkSysMsgUnique(e)&&r.push(e)}),e=r,c=s?t:e}),a=a.then(function(){return n.getSysMsgUnread().then(function(r){return c.length||(c=e,c.backward=!0),n.updateSysMsgUnread(c,r,1).then(function(e){"offlineSysMsgs"===t&&(n.syncResult.sysMsgUnread=e),"onSysMsg"===t&&n.onUpdateSysMsgUnread(e)})})}),a.then(function(){return e})},o.checkSysMsgUnique=i.genCheckUniqueFunc("idServer"),o.getSysMsgUnread=function(){var e=this,t=e.db;return new r(function(n){t.enable?t.getSysMsgUnread().then(function(e){n(e)},function(){n(e.sysMsgUnread)}):n(e.sysMsgUnread)})},o.updateSysMsgUnread=function(e,t,n){if(i.isArray(e)||(e=[e]),!e.length)return r.resolve(t);t=t||{};var o,a=this,c=a.db;return e.forEach(function(e){(n>0&&!e.read||n<0&&e.read)&&(o=e.type,t[o]=(t[o]||0)+n)}),t=s.completeUnread(t),a.sysMsgUnread=t,c.enable&&!e.backward?c.updateSysMsgUnread(t):r.resolve(t)},o.reduceSysMsgUnread=function(e){var t=this;return t.getSysMsgUnread().then(function(n){return t.updateSysMsgUnread(e,n,-1)}).then(function(e){t.onUpdateSysMsgUnread(e)})},o.onUpdateSysMsgUnread=function(e){var t=this;setTimeout(function(){t.logger.info("on update sysMsg unread",e),t.options.onupdatesysmsgunread(e)},0)},o.updateSysMsg=function(e){var t,n=this,o=n.db;t=o.enable?o.updateSysMsg(e):r.resolve(e),t.then(function(e){n.onUpdateSysMsg(e)})},o.onUpdateSysMsg=function(e){var t=this;setTimeout(function(){i.isArray(e)||(e=[e]),e.forEach(function(e){t.logger.info("on update sysMsg",e),t.options.onupdatesysmsg(e)})},0)},o.processUnsettledSysMsgs=function(){var e=this;e.unhandledSysMsgs.forEach(function(t){e.handleSysMsg(t)}),e.resetUnsettledSysMsgs()}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(1),s=i.objs2accounts,a=i.teams2ids,c=n(20),u=n(15);o.processTeam=function(e){var t,n,r,o=this,i=e.error;switch(e.cmd){case"createTeam":if(t=e.obj.team,i||(t=e.content.team),t=c.reverse(t),e.obj.team=t,r=u.assembleOwner(t),e.obj.owner=r,!i){var s={team:t,owner:r};o.logger.info("on create team",s),o.options.onCreateTeam(s),o.onCreateTeam(t,r)}break;case"syncCreateTeam":t=c.reverse(e.content.team),r=u.assembleOwner(t),o.logger.info("on sync createTeam",t,r),o.options.onsynccreateteam(t,r),o.onCreateTeam(t,r);break;case"sendTeamMsg":o.onSendMsg(e);break;case"teamMsg":o.onMsg(e);break;case"teamMsgs":o.onMsgs(e);break;case"addTeamMembers":case"removeTeamMembers":case"leaveTeam":case"dismissTeam":case"addTeamManagers":case"removeTeamManagers":case"transferTeam":break;case"updateInfoInTeam":n=e.obj,n.account=o.account,n.id=u.genId(n.teamId,n.account),n=u.reverse(n),e.obj=n,o.mergeMyTeamMembers(n),o.onUpdateTeamMember(n);break;case"updateNickInTeam":e.obj=u.reverse(e.obj);break;case"updateTeam":e.obj=c.reverse(e.obj);break;case"applyTeam":e.error||(e.obj=c.reverse(e.content.team));break;case"passTeamApply":o.updateTeamSysMsgState(e,"passed");break;case"rejectTeamApply":o.updateTeamSysMsgState(e,"rejected");break;case"acceptTeamInvite":o.updateTeamSysMsgState(e,"passed"),e.error||(e.obj=c.reverse(e.content.team));break;case"rejectTeamInvite":o.updateTeamSysMsgState(e,"rejected");break;case"getTeam":e.error||(e.obj=c.reverse(e.content.team));break;case"getTeams":o.onTeams(e);break;case"getTeamMembers":o.onTeamMembers(e);break;case"syncTeams":o.onTeams(e);break;case"syncTeamMembers":o.onTeamMembers(e);break;case"getTeamHistoryMsgs":case"searchTeamHistoryMsgs":o.onHistoryMsgs(e);break;case"syncSendTeamMsg":o.onMsg(e);break;case"syncUpdateTeamMember":n=u.reverse(e.content.teamMember),o.onUpdateTeamMember(n),n.account===o.account&&o.mergeMyTeamMembers(n);break;case"updateMuteStateInTeam":break;case"getMyTeamMembers":e.error||(e.obj=u.reverseMembers(e.content.teamMembers));break;case"getMutedTeamMembers":e.error||(e.obj={teamId:e.obj.teamId,members:u.reverseMembers(e.content.teamMembers)});break;case"syncMyTeamMembers":o.onSyncMyTeamMembers(e)}},o.onCreateTeam=function(e,t){var n=this.db;n.enable&&(n.putTeam(e),n.putTeamMembers(t))},o.onTeams=function(e){function t(){d&&f.forEach(function(e){e=c.reverse(e),e.validToCurrentUser?m.push(e):p.push(e)}),s.logger.warn("parse teams",a(m),m,"invalid",a(p),p),f.length?(d=!0,i=e.content.timetag):d=!1}function n(t,n){e.promise=new r(function(e,r){function a(){l?(o(),e(),t()):u.getTeams().then(function(n){m=n,o(),e(),t()}).then(void 0,function(e){e._msg="get teams error",r(e),n(e)})}d?u.mergeTeams(m,p,i).then(function(){a()}).then(void 0,function(e){e._msg="merge teams error",r(e),n(e)}):(s.logger.warn("no merge teams"),a())}).then(void 0,function(e){throw e._msg="merge teams data error",n(e),e})}function o(){s.timetags.teams=i,m.invalid=p,l?(s.syncResult.teams=m,s.syncResult.invalidTeams=p):(s.logger.warn("get teams",a(m),m),e.obj=m)}e.content=e.content||{};var i,s=this,u=s.db,l=s.packetFromSync(e),f=e.content.teams||[],d=!0,m=[],p=[];if(e.error)switch(e.error.code){case 803:e.error=null,d=!1}var h=new r(function(r,i){e.error?l&&i(e.error):(t(),u.enable?n(r,i):(o(),r()))});l&&(h.cmd="teams",s.syncPromiseArray.push(h))},o.onTeamMembers=function(e){function t(){m&&d.forEach(function(e){e=u.reverse(e),e.valid?p.push(e):h.push(e)}),c.logger.warn("parse members",a,s(p),p,"invalid",s(h),h),d.length?(m=!0,i=e.content.timetag):m=!1}function n(t,n){e.promise=new r(function(e,r){function s(){f?(o(),e(),t()):l.getTeamMembers(a).then(function(n){p=n,o(),e(),t()}).then(void 0,function(e){e._msg="get members error",r(e),n(e)})}m?l.mergeTeamMembers(a,p,h,i).then(function(){s()}).then(void 0,function(e){e._msg="merge members error "+a,r(e),n(e)}):(c.logger.warn("no merge members",a),s())}).then(void 0,function(e){throw e._msg="merge members data error",n(e),e})}function o(){p.invalid=h,f?(c.syncTeamMembersResult[a]=p,c.syncTeamMembersResult[a+"-invalid"]=h,c.timetags["team-"+a]=i):(c.logger.warn("get members",a,s(p),p),e.obj={teamId:a,members:p})}e.content=e.content||{};var i,a,c=this,l=c.db,f=c.packetFromSync(e),d=e.content.members||[],m=!0,p=[],h=[];if(e.obj&&(a=e.obj.teamId),a||(a=e.content.teamId),a=""+a,e.error)switch(e.error.code){case 406:e.error=null,m=!1}var g=new r(function(r,i){e.error?f&&i(e.error):(t(),l.enable?n(r,i):(o(),r()))});f&&(g.cmd=a,c.syncTeamMembersPromiseArray.push(g))},o.onUpdateTeamMember=function(e){var t=this;e.updateTime||(e.updateTime=+new Date),t.logger.warn("parse update member",e),t.logger.info("on update teamMember",e),t.options.onupdateteammember(i.simpleClone(e));var n={teamId:e.teamId,memberUpdateTime:e.updateTime};t.onUpdateTeam(n);var r=this.db;r.enable&&r.updateTeamMember(e)},o.onUpdateTeam=function(e){var t=this;t.logger.info("on update team",e),t.options.onUpdateTeam(i.simpleClone(e));var n=t.db;n.enable&&n.updateTeam(e)},o.onSyncMyTeamMembers=function(e){var t=this,n=t.db,r=u.reverseMembers(e.content.teamMembers);if(t.logger.warn("parse my team members",r),n.enable){var o=n.putTeamMembers(r).then(function(){return n.updateMyTeamMembersTimetag(e.content.timetag)});o.cmd="myTeamMembers",t.syncTeamMembersPromiseArray.push(o)}t.mergeMyTeamMembers(r)},o.mergeMyTeamMembers=function(e){i.isArray(e)||(e=[e]);var t=this,n=t.myTeamMembersMap=t.myTeamMembersMap||{};e.forEach(function(e){var t=e.teamId;n[t]=i.merge(n[t],e)}),t.logger.warn("cache my team members",n)},o.notifyForNewTeamMsg=function(e){i.isArray(e)||(e=[e]);var t=this,n=this.myTeamMembersMap||{},o={},s=[];e.forEach(function(e){i.exist(n[e])?o[e]=!n[e].muteTeam:s.push(e)});var a=r.resolve(o);return s.length&&(a=t.api.getMyTeamMembers({teamIds:s,promise:!0}).then(function(e){return t.mergeMyTeamMembers(e),e.forEach(function(e){o[e.teamId]=!e.muteTeam}),o})),a},o.updateTeamSysMsgState=function(e,t){var n,r=e.error;r&&(t="error",r=i.filterObj(r,"code message")),n={idServer:e.obj.idServer,state:t},r&&(n.error=r),this.updateSysMsg(n)}},function(e,t,n){"use strict";var r=n(2).Promise,o=n(4).fn,i=n(1),s=i.objs2accounts,a=n(119),c=n(28);o.processUser=function(e){var t,n=this,r=n.db,o=e.obj,i=e.error,s=e.content;switch(e.cmd){case"markInBlacklist":i||n.markInBlacklist(o);break;case"syncMarkInBlacklist":n.markInBlacklist(s,!0);break;case"markInMutelist":i||n.markInMutelist(o);break;case"syncMarkInMutelist":n.markInMutelist(s,!0);break;case"getRelations":i||n.onRelations(e);break;case"syncMyInfo":n.onMyInfo(e,!0);break;case"updateMyInfo":i||(o.updateTime=s.timetag,n.onUpdateMyInfo(e,o));break;case"syncUpdateMyInfo":n.onUpdateMyInfo(e,s.user,!0);break;case"getUsers":i||(t=s.users.map(function(e){return e=c.reverse(e),n.mergeUser(e),e}),e.obj=t,r.enable&&r.putUsers(t));break;case"updateDonnop":n.onUpdateDonnop(e);break;case"syncUpdateDonnop":n.onDonnop(e,!1)}},o.onMyInfo=function(e){function t(){i=c.reverse(l.user),s.logger.warn("parse myInfo",i)}function n(e,t){a.mergeMyInfo(i,f).then(function(){o(),e()}).then(void 0,function(e){e._msg="merge myInfo error",t(e)})}function o(){s.timetags.myInfo=i.updateTime,f&&(s.syncResult.myInfo=i)}var i,s=this,a=s.db,u=e.error,l=e.content,f=!0,d=new r(function(e,r){u?f&&r(u):(t(),a.enable?n(e,r):(o(),e()))});f&&(d.cmd="myInfo",s.syncPromiseArray.push(d))},o.onUpdateMyInfo=function(e,t,n){var r=this,o=r.db,s=c.reverse(t),a=i.merge(r.myInfo,s);r.myInfo=a,n?(r.logger.info("on update myInfo",a),r.options.onupdatemyinfo(a)):e.obj=a,o.enable&&(s.account=r.account,o.updateUser(s))},o.onRelations=function(e){function t(){d.forEach(function(e){e=a.parse(e);var t={account:e.account,createTime:e.createTime,updateTime:e.updateTime};e.isBlacked?p.push(t):h.push(t),e.isMuted?g.push(t):y.push(t)}),c.logger.warn("parse blacklist",s(p),p,"delete",s(h),h),c.logger.warn("parse mutelist",s(g),g,"delete",s(y),y),d.length?(m=!0,i=e.content.timetag):m=!1}function n(t,n){e.promise=new r(function(e,r){function s(){f?(o(),e(),t()):u.getRelations().then(function(n){p=n[0],g=n[1],o(),e(),t()}).then(void 0,function(e){e._msg="get relations error",r(e),n(e)})}m?u.mergeRelations(p,h,g,y,i).then(function(){s()}).then(void 0,function(e){e._msg="merge relations error",r(e),n(e)}):(c.logger.warn("no merge relations"),s())}).then(void 0,function(e){throw e._msg="merge relations data error",n(e),e})}function o(){c.timetags.relations=i,p.invalid=h,g.invalid=y,f?(c.syncResult.blacklist=p,c.syncResult.mutelist=g,c.syncResult.invalidBlacklist=h,c.syncResult.invalidMutelist=y):(c.logger.warn("get relations",p,g),e.obj.blacklist=p,e.obj.mutelist=g)}var i,c=this,u=c.db,l=e.error,f=c.packetFromSync(e),d=e.content.specialRelations,m=!0,p=[],h=[],g=[],y=[],v=new r(function(e,r){l?f&&r(l):(t(),u.enable?n(e,r):(o(),e()))});f&&(v.cmd="relations",c.syncPromiseArray.push(v))},o.markInBlacklist=function(e,t){var n=this,r=n.db;e.record={account:e.account,updateTime:+new Date},r.enable&&r.markInBlacklist(e),t&&(n.logger.info("on sync markInBlacklist",e),n.options.onsyncmarkinblacklist(e))},o.markInMutelist=function(e,t){var n=this,r=n.db;e.record={account:e.account,updateTime:+new Date},r.enable&&r.markInMutelist(e),t&&(n.logger.info("on sync markInMutelist",e),n.options.onsyncmarkinmutelist(e))},o.mergeUser=function(e){this.userSet[e.account]=e}},function(e,t,n){"use strict";var r=n(1),o=n(41),i=r.merge({},o.idMap,{chatroom:{id:13,login:2,kicked:3,logout:4,sendMsg:6,msg:7,getChatroomMembers:8,getHistoryMsgs:9,markChatroomMember:11,closeChatroom:12,getChatroom:13,updateChatroom:14,updateMyChatroomMemberInfo:15,getChatroomMembersInfo:16,kickChatroomMember:17,updateChatroomMemberTempMute:19}}),s=r.merge({},o.cmdConfig,{login:{sid:i.chatroom.id,cid:i.chatroom.login,params:[{type:"byte",name:"type"},{type:"Property",name:"login"},{type:"Property",name:"imLogin"}]},logout:{sid:i.chatroom.id,cid:i.chatroom.logout},sendMsg:{sid:i.chatroom.id,cid:i.chatroom.sendMsg,params:[{type:"Property",name:"msg"}]},getChatroomMembers:{sid:i.chatroom.id,cid:i.chatroom.getChatroomMembers,params:[{type:"byte",name:"type"},{type:"long",name:"time"},{type:"int",name:"limit"}]},getHistoryMsgs:{sid:i.chatroom.id,cid:i.chatroom.getHistoryMsgs,params:[{type:"long",name:"timetag"},{type:"int",name:"limit"}]},markChatroomMember:{sid:i.chatroom.id,cid:i.chatroom.markChatroomMember,params:[{type:"string",name:"account"},{type:"int",name:"type"},{type:"bool",name:"isAdd"},{type:"int",name:"level"},{type:"string",name:"custom"}]},closeChatroom:{sid:i.chatroom.id,cid:i.chatroom.closeChatroom,params:[{type:"string",name:"custom"}]},getChatroom:{sid:i.chatroom.id,cid:i.chatroom.getChatroom},updateChatroom:{sid:i.chatroom.id,cid:i.chatroom.updateChatroom,params:[{type:"Property",name:"chatroom"},{type:"boolean",name:"needNotify"},{type:"String",name:"custom"}]},updateMyChatroomMemberInfo:{sid:i.chatroom.id,cid:i.chatroom.updateMyChatroomMemberInfo,params:[{type:"Property",name:"chatroomMember"},{type:"boolean",name:"needNotify"},{type:"String",name:"custom"}]},getChatroomMembersInfo:{sid:i.chatroom.id,cid:i.chatroom.getChatroomMembersInfo,params:[{type:"StrArray",name:"accounts"}]},kickChatroomMember:{sid:i.chatroom.id,cid:i.chatroom.kickChatroomMember,params:[{type:"string",name:"account"},{type:"string",name:"custom"}]},updateChatroomMemberTempMute:{sid:i.chatroom.id,cid:i.chatroom.updateChatroomMemberTempMute,params:[{type:"String",name:"account"},{type:"long",name:"duration"},{type:"boolean",name:"needNotify"},{type:"String",name:"custom"}]}}),a="chatroom",c=r.merge({},o.packetConfig,{"4_10":{service:"notify"},"4_11":{service:"notify"},"13_2":{service:a,cmd:"login",response:[{type:"Property",name:"chatroom"},{type:"Property",name:"chatroomMember"}]},"13_3":{service:a,cmd:"kicked",response:[{type:"Number",name:"reason"},{type:"String",name:"custom"}]},"13_4":{service:a,cmd:"logout"},"13_6":{service:a,cmd:"sendMsg",response:[{type:"Property",name:"msg"}]},"13_7":{service:a,cmd:"msg",response:[{type:"Property",name:"msg"}]},"13_8":{service:a,cmd:"getChatroomMembers",response:[{type:"PropertyArray",name:"members",entity:"chatroomMember"}]},"13_9":{service:a,cmd:"getHistoryMsgs",response:[{type:"PropertyArray",name:"msgs",entity:"msg"}]},"13_11":{service:a,cmd:"markChatroomMember",response:[{type:"Property",name:"chatroomMember"}]},"13_12":{service:a,cmd:"closeChatroom"},"13_13":{service:a,cmd:"getChatroom",response:[{type:"Property",name:"chatroom"}]},"13_14":{service:a,cmd:"updateChatroom"},"13_15":{service:a,cmd:"updateMyChatroomMemberInfo"},"13_16":{service:a,cmd:"getChatroomMembersInfo",response:[{type:"PropertyArray",name:"members",entity:"chatroomMember"}]},"13_17":{service:a,cmd:"kickChatroomMember"},"13_19":{service:a,cmd:"updateChatroomMemberTempMute"}});e.exports={idMap:i,cmdConfig:s,packetConfig:c}},function(e,t){"use strict";e.exports={imLogin:{os:4,sdkVersion:6,appLogin:8,protocolVersion:9,deviceId:13,appKey:18,account:19,browser:24,session:26,token:1e3},nosToken:{objectName:1,token:2,bucket:3,expireTime:4},audioToText:{url:2},imageOp:{type:0,stripmeta:1,typeType:2,blurRadius:3,blurSigma:4,qualityQuality:5,cropX:6,cropY:7,cropWidth:8,cropHeight:9,rotateAngle:10,pixelPixel:11,thumbnailMode:12,thumbnailWidth:13,thumbnailHeight:14,thumbnailAxisX:15,thumbnailAxisY:16,thumbnailCenterX:17,thumbnailCenterY:18,thumbnailEnlarge:19,thumbnailToStatic:20,watermarkType:21,watermarkGravity:22,watermarkDissolve:23,watermarkDx:24,watermarkDy:25,watermarkImage:26,watermarkText:27,watermarkFont:28,watermarkFontSize:29,watermarkFontColor:30,interlace:31},login:{appKey:1,account:2,deviceId:3,chatroomId:5,chatroomNick:20,chatroomAvatar:21,chatroomCustom:22,chatroomEnterCustom:23,session:26},chatroom:{id:1,name:3,announcement:4,broadcastUrl:5,custom:12,createTime:14,updateTime:15,creator:100,onlineMemberNum:101,mute:102},msg:{idClient:1,type:2,attach:3,custom:4,resend:5,userUpdateTime:6,fromNick:7,fromAvatar:8,fromCustom:9,yidunEnable:10,antiSpamContent:11,time:20,from:21,chatroomId:22,fromClientType:23},chatroomMember:{chatroomId:1,account:2,type:3,level:4,nick:5,avatar:6,custom:7,online:8,guest:9,enterTime:10,blacked:12,gaged:13,valid:14,updateTime:15,tempMuted:16,tempMuteDuration:17}}},function(e,t){"use strict";e.exports={nosToken:{objectName:1,token:2,bucket:3,expireTime:4},audioToText:{url:2},imageOp:{type:0,stripmeta:1,typeType:2,blurRadius:3,blurSigma:4,qualityQuality:5,cropX:6,cropY:7,cropWidth:8,cropHeight:9,rotateAngle:10,pixelPixel:11,thumbnailMode:12,thumbnailWidth:13,thumbnailHeight:14,thumbnailAxisX:15,thumbnailAxisY:16,thumbnailCenterX:17,thumbnailCenterY:18,thumbnailEnlarge:19,thumbnailToStatic:20,watermarkType:21,watermarkGravity:22,watermarkDissolve:23,watermarkDx:24,watermarkDy:25,watermarkImage:26,watermarkText:27,watermarkFont:28,watermarkFontSize:29,watermarkFontColor:30,interlace:31},login:{os:4,sdkVersion:6,appLogin:8,protocolVersion:9,deviceId:13,appKey:18,account:19,browser:24,session:26,token:1e3},loginRes:{lastLoginDeviceId:17,connectionId:102,ip:103,port:104,country:106},loginPort:{type:3,os:4,mac:5,deviceId:13,account:19,connectionId:102,ip:103,time:109},sync:{myInfo:1,offlineMsgs:2,teams:3,roamingMsgs:7,relations:9,friends:11,sessions:12,friendUsers:13,msgReceipts:14,myTeamMembers:15,donnop:16,deleteMsg:17,sessionAck:18,filterMsgs:100},donnop:{open:1},team:{teamId:1,name:3,type:4,owner:5,level:6,selfCustom:7,valid:8,memberNum:9,memberUpdateTime:10,createTime:11,updateTime:12,validToCurrentUser:13,intro:14,announcement:15,joinMode:16,bits:17,custom:18,serverCustom:19,avatar:20,beInviteMode:21,inviteMode:22,updateTeamMode:23,updateCustomMode:24,mute:100},teamMember:{teamId:1,account:3,type:4,nickInTeam:5,bits:7,active:8,valid:9,joinTime:10,updateTime:11,custom:12,mute:13},msg:{scene:0,to:1,from:2,fromClientType:4,fromDeviceId:5,fromNick:6,time:7,type:8,body:9,attach:10,idClient:11,idServer:12,resend:13,userUpdateTime:14,custom:15,pushPayload:16,pushContent:17,apnsAccounts:18,apnsContent:19,apnsForcePush:20,yidunEnable:21,antiSpamContent:22,isHistoryable:100,isRoamingable:101,isSyncable:102,isMuted:104,cc:105,isPushable:107,isOfflinable:108,isUnreadable:109,needPushNick:110},msgReceipt:{to:1,from:2,time:7,idClient:11},sysMsg:{time:0,type:1,to:2,from:3,ps:4,attach:5,idServer:6,sendToOnlineUsersOnly:7,apnsText:8,pushPayload:9,deletedIdClient:10,deletedIdServer:11,yidunEnable:12,antiSpamContent:13,deletedMsgTime:14,deletedMsgFromNick:15,cc:105,isPushable:107,isUnreadable:109,needPushNick:110},friend:{account:4,flag:5,beflag:6,source:7,alias:8,bits:9,custom:10,createTime:11,updateTime:12},user:{account:1,nick:3,avatar:4,sign:5,gender:6,email:7,birth:8,tel:9,custom:10,createTime:12,updateTime:13},specialRelation:{account:0,isMuted:1,isBlacked:2,createTime:3,updateTime:4}}},function(e,t){"use strict";e.exports={imLogin:{4:"os",6:"sdkVersion",8:"appLogin",9:"protocolVersion",13:"deviceId",18:"appKey",19:"account",24:"browser",26:"session",1000:"token"},nosToken:{1:"objectName",2:"token",3:"bucket",4:"expireTime"},audioToText:{2:"url"},imageOp:{0:"type",1:"stripmeta",2:"typeType",3:"blurRadius",4:"blurSigma",5:"qualityQuality",6:"cropX",7:"cropY",8:"cropWidth",9:"cropHeight",10:"rotateAngle",11:"pixelPixel",12:"thumbnailMode",13:"thumbnailWidth",14:"thumbnailHeight",15:"thumbnailAxisX",16:"thumbnailAxisY",17:"thumbnailCenterX",18:"thumbnailCenterY",19:"thumbnailEnlarge",20:"thumbnailToStatic",21:"watermarkType",22:"watermarkGravity",23:"watermarkDissolve",24:"watermarkDx",25:"watermarkDy",26:"watermarkImage",27:"watermarkText",28:"watermarkFont",29:"watermarkFontSize",30:"watermarkFontColor",31:"interlace"},login:{1:"appKey",2:"account",3:"deviceId",5:"chatroomId",20:"chatroomNick",21:"chatroomAvatar",22:"chatroomCustom",23:"chatroomEnterCustom",26:"session"},chatroom:{1:"id",3:"name",4:"announcement",5:"broadcastUrl",12:"custom",14:"createTime",15:"updateTime",100:"creator",101:"onlineMemberNum",102:"mute"},msg:{1:"idClient",2:"type",3:"attach",4:"custom",5:"resend",6:"userUpdateTime",7:"fromNick",8:"fromAvatar",9:"fromCustom",10:"yidunEnable",11:"antiSpamContent",20:"time",21:"from",22:"chatroomId",23:"fromClientType"},chatroomMember:{1:"chatroomId",2:"account",3:"type",4:"level",5:"nick",6:"avatar",7:"custom",8:"online",9:"guest",10:"enterTime",12:"blacked",13:"gaged",14:"valid",15:"updateTime",16:"tempMuted",17:"tempMuteDuration"}}},function(e,t){"use strict";e.exports={nosToken:{1:"objectName",2:"token",3:"bucket",4:"expireTime"},audioToText:{2:"url"},imageOp:{0:"type",1:"stripmeta",2:"typeType",3:"blurRadius",4:"blurSigma",5:"qualityQuality",6:"cropX",7:"cropY",8:"cropWidth",9:"cropHeight",10:"rotateAngle",11:"pixelPixel",12:"thumbnailMode",13:"thumbnailWidth",14:"thumbnailHeight",15:"thumbnailAxisX",16:"thumbnailAxisY",17:"thumbnailCenterX",18:"thumbnailCenterY",19:"thumbnailEnlarge",20:"thumbnailToStatic",21:"watermarkType",22:"watermarkGravity",23:"watermarkDissolve",24:"watermarkDx",25:"watermarkDy",26:"watermarkImage",27:"watermarkText",28:"watermarkFont",29:"watermarkFontSize",30:"watermarkFontColor",31:"interlace"},login:{4:"os",6:"sdkVersion",8:"appLogin",9:"protocolVersion",13:"deviceId",18:"appKey",19:"account",24:"browser",26:"session",1000:"token"},loginRes:{17:"lastLoginDeviceId",102:"connectionId",103:"ip",104:"port",106:"country"},loginPort:{3:"type",4:"os",5:"mac",13:"deviceId",19:"account",102:"connectionId",103:"ip",109:"time"},sync:{1:"myInfo",2:"offlineMsgs",3:"teams",7:"roamingMsgs",9:"relations",11:"friends",12:"sessions",13:"friendUsers",14:"msgReceipts",15:"myTeamMembers",16:"donnop",17:"deleteMsg",18:"sessionAck",100:"filterMsgs"},donnop:{1:"open"},team:{1:"teamId",3:"name",4:"type",5:"owner",6:"level",7:"selfCustom",8:"valid",9:"memberNum",10:"memberUpdateTime",11:"createTime",12:"updateTime",13:"validToCurrentUser",14:"intro",15:"announcement",16:"joinMode",17:"bits",18:"custom",19:"serverCustom",20:"avatar",21:"beInviteMode",22:"inviteMode",23:"updateTeamMode",24:"updateCustomMode",100:"mute"},teamMember:{1:"teamId",3:"account",4:"type",5:"nickInTeam",7:"bits",8:"active",9:"valid",10:"joinTime",11:"updateTime",12:"custom",13:"mute"},msg:{0:"scene",1:"to",2:"from",4:"fromClientType",5:"fromDeviceId",6:"fromNick",7:"time",8:"type",9:"body",10:"attach",11:"idClient",12:"idServer",13:"resend",14:"userUpdateTime",15:"custom",16:"pushPayload",17:"pushContent",18:"apnsAccounts",19:"apnsContent",20:"apnsForcePush",21:"yidunEnable",22:"antiSpamContent",100:"isHistoryable",101:"isRoamingable",102:"isSyncable",104:"isMuted",105:"cc",107:"isPushable",108:"isOfflinable",109:"isUnreadable",110:"needPushNick"},msgReceipt:{1:"to",2:"from",7:"time",11:"idClient"},sysMsg:{0:"time",1:"type",2:"to",3:"from",4:"ps",5:"attach",6:"idServer",7:"sendToOnlineUsersOnly",8:"apnsText",9:"pushPayload",10:"deletedIdClient",11:"deletedIdServer",12:"yidunEnable",13:"antiSpamContent",14:"deletedMsgTime",15:"deletedMsgFromNick",105:"cc",107:"isPushable",109:"isUnreadable",110:"needPushNick"},friend:{4:"account",5:"flag",6:"beflag",7:"source",8:"alias",9:"bits",10:"custom",11:"createTime",12:"updateTime"},user:{1:"account",3:"nick",4:"avatar",5:"sign",6:"gender",7:"email",8:"birth",9:"tel",10:"custom",12:"createTime",13:"updateTime"},specialRelation:{0:"account",1:"isMuted",2:"isBlacked",3:"createTime",4:"updateTime"}}},function(e,t,n){"use strict";var r={NIM:n(100),Chatroom:n(99)},o=n(36);o(r),e.exports=r}])});