!function(e,t){e.Long=function(){"use strict";function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,o,r;return t?(e>>>=0,(r=0<=e&&e<256)&&(o=a[e])?o:(n=i(e,(0|e)<0?-1:0,!0),r&&(a[e]=n),n)):(e|=0,(r=-128<=e&&e<128)&&(o=u[e])?o:(n=i(e,e<0?-1:0,!1),r&&(u[e]=n),n))}function o(e,t){if(isNaN(e)||!isFinite(e))return t?m:d;if(t){if(e<0)return m;if(e>=p)return _}else{if(e<=-f)return y;if(e+1>=f)return M}return e<0?o(-e,t).neg():i(e%l|0,e/l|0,t)}function i(t,n,o){return new e(t,n,o)}function r(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return d;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return r(e.substring(1),t,n).neg();for(var s=o(c(n,8)),u=d,a=0;a>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36>>0,p=l.toString(e);if(s=a,s.isZero())return p+u;for(;p.length<6;)p="0"+p;u=""+p+u}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(y)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return t(e)||(e=s(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var n=this.isNegative(),o=e.isNegative();return n&&!o?-1:!n&&o?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(y)?y:this.not().add(h)},T.neg=T.negate,T.add=function(e){t(e)||(e=s(e));var n=this.high>>>16,o=65535&this.high,r=this.low>>>16,u=65535&this.low,a=e.high>>>16,c=65535&e.high,l=e.low>>>16,p=65535&e.low,f=0,g=0,d=0,m=0;return m+=u+p,d+=m>>>16,m&=65535,d+=r+l,g+=d>>>16,d&=65535,g+=o+c,f+=g>>>16,g&=65535,f+=n+a,f&=65535,i(d<<16|m,f<<16|g,this.unsigned)},T.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return d;if(t(e)||(e=s(e)),e.isZero())return d;if(this.eq(y))return e.isOdd()?y:d;if(e.eq(y))return this.isOdd()?y:d;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return o(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,u=this.low>>>16,a=65535&this.low,c=e.high>>>16,l=65535&e.high,p=e.low>>>16,f=65535&e.low,m=0,h=0,I=0,E=0;return E+=a*f,I+=E>>>16,E&=65535,I+=u*f,h+=I>>>16,I&=65535,I+=a*p,h+=I>>>16,I&=65535,h+=r*f,m+=h>>>16,h&=65535,h+=u*p,m+=h>>>16,h&=65535,h+=a*l,m+=h>>>16,h&=65535,m+=n*f+r*p+u*l+a*c,m&=65535,i(I<<16|E,m<<16|h,this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:d;var n,i,r;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return I;r=m}else{if(this.eq(y)){if(e.eq(h)||e.eq(E))return y;if(e.eq(y))return h;return n=this.shr(1).div(e).shl(1),n.eq(d)?e.isNegative()?h:E:(i=this.sub(e.mul(n)),r=n.add(i.div(e)))}if(e.eq(y))return this.unsigned?m:d;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();r=d}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var u=Math.ceil(Math.log(n)/Math.LN2),a=u<=48?1:c(2,u-48),l=o(n),p=l.mul(e);p.isNegative()||p.gt(i);)n-=a,l=o(n,this.unsigned),p=l.mul(e);l.isZero()&&(l=h),r=r.add(l),i=i.sub(p)}return r},T.div=T.divide,T.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.not=function(){return i(~this.low,~this.high,this.unsigned)},T.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<>>32-e,this.unsigned):i(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0===(e&=63))return this;var n=this.high;if(e<32){return i(this.low>>>e|n<<32-e,n>>>e,this.unsigned)}return 32===e?i(n,0,this.unsigned):i(n>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e}()}(window),"function"!=typeof Array.prototype.forEach&&(Array.prototype.forEach=function(e){for(var t=0;t")),t},this.formatHtml2Text=function(e){var t=e;return t&&(t=t.replace(/ /g," "),t=t.replace(//g,"\n")),t},this.getStrBytes=function(e){if(null==e||void 0===e)return 0;if("string"!=typeof e)return 0;var t,n,o,i=0;for(n=0,o=e.length;n]/g,">"),e=e.replace(/"/g,""")),e},this.trimStr=function(e){return e?(e=e.toString(),e.replace(/(^\s*)|(\s*$)/g,"")):""},this.validNumber=function(e){return e=e.toString(),e.match(/(^\d{1,8}$)/g)},this.getReturnError=function(e,t){return t||(t=-100),{ActionStatus:g.FAIL,ErrorCode:t,ErrorInfo:e+"["+t+"]"}},this.setCookie=function(e,t,n,o,i){var r=new Date;r.setTime(r.getTime()+1e3*n),document.cookie=e+"="+escape(t)+";expires="+r.toGMTString()},this.getCookie=function(e){var t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]*)(;|$)"));return null!=t?unescape(t[2]):null},this.delCookie=function(e){var t=new Date;t.setTime(t.getTime()-1);var n=this.getCookie(e);null!=n&&(document.cookie=e+"="+escape(n)+";expires="+t.toGMTString())},this.getQueryString=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?unescape(n[2]):null},this.isIE=function(e){var t=document.createElement("b");return t.innerHTML="\x3c!--[if IE "+e+"]>=20){var p={EvtItems:oe,MainVersion:t.VERSION,Version:"0"};vt(p,function(e){oe=[]},function(e){oe=[]})}}}}},Oe=function(e){Ft.apiCall(u.WEB_IM,"accesslayer",{},function(t){0===t.ErrorCode&&1===t.WebImAccessLayer&&(i.FORMAL.COMMON="https://events.tim.qq.com"),e()},function(){e()})},Ge=function(e,t){Ft.apiCall(u.OPEN_IM,"login",{State:"Online"},function(n){if(n.TinyId)W.tinyid=n.TinyId;else if(t)return void t(ae.getReturnError("TinyId is empty",-10));if(n.A2Key)W.a2=n.A2Key;else if(t)return void t(ae.getReturnError("A2Key is empty",-11));var o=["Tag_Profile_IM_Nick","Tag_Profile_IM_Image"],i={From_Account:W.identifier,To_Account:[W.identifier],LastStandardSequence:0,TagList:o};Et(i,function(t){var n,o;if(t.UserProfileItem&&t.UserProfileItem.length>0)for(var i in t.UserProfileItem)for(var r in t.UserProfileItem[i].ProfileItem)switch(t.UserProfileItem[i].ProfileItem[r].Tag){case"Tag_Profile_IM_Nick":n=t.UserProfileItem[i].ProfileItem[r].Value,n&&(W.identifierNick=n);break;case"Tag_Profile_IM_Image":o=t.UserProfileItem[i].ProfileItem[r].Value,o&&(W.headurl=o)}e&&e(W.identifierNick,W.headurl)},t)},t)},Fe=function(e,t,n){if(!Ie(n,!1))return Ae(),void(t&&t({ActionStatus:g.OK,ErrorCode:0,ErrorInfo:"logout success"}));"all"==e?Ft.apiCall(u.OPEN_IM,"logout",{},function(e){Ae(),t&&t(e)},n):Ft.apiCall(u.OPEN_IM,"longpollinglogout",{LongPollingId:B},function(e){Ae(),t&&t(e)},n)},Ne=function(e,t,n){if(Ie(n,!0)){var o=null;switch(e.sess.type()){case l.C2C:o={From_Account:W.identifier,To_Account:e.sess.id().toString(),MsgTimeStamp:e.time,MsgSeq:e.seq,MsgRandom:e.random,MsgBody:[],OfflinePushInfo:e.offlinePushInfo};break;case l.GROUP:var i=e.getSubType();switch(o={GroupId:e.sess.id().toString(),From_Account:W.identifier,Random:e.random,MsgBody:[]},i){case S.COMMON:o.MsgPriority="COMMON";break;case S.REDPACKET:o.MsgPriority="REDPACKET";break;case S.LOVEMSG:o.MsgPriority="LOVEMSG";break;case S.TIP:ce.error("不能主动发送群提示消息,subType="+i);break;default:return void ce.error("发送群消息时,出现未知子消息类型:subType="+i)}}for(var r in e.elems){var s=e.elems[r],a=null,c=s.type;switch(c){case d.TEXT:a={Text:s.content.text};break;case d.FACE:a={Index:s.content.index,Data:s.content.data};break;case d.IMAGE:var p=[];for(var f in s.content.ImageInfoArray)p.push({Type:s.content.ImageInfoArray[f].type,Size:s.content.ImageInfoArray[f].size,Width:s.content.ImageInfoArray[f].width,Height:s.content.ImageInfoArray[f].height,URL:s.content.ImageInfoArray[f].url});a={ImageFormat:s.content.ImageFormat,UUID:s.content.UUID,ImageInfoArray:p};break;case d.SOUND:ce.warn("web端暂不支持发送语音消息");continue;case d.LOCATION:ce.warn("web端暂不支持发送地理位置消息");continue;case d.FILE:a={UUID:s.content.uuid,FileName:s.content.name,FileSize:s.content.size,DownloadFlag:s.content.downFlag};break;case d.CUSTOM:a={Data:s.content.data,Desc:s.content.desc,Ext:s.content.ext},c=d.CUSTOM;break;default:ce.warn("web端暂不支持发送"+s.type+"消息");continue}e.PushInfoBoolean&&(o.OfflinePushInfo=e.PushInfo),o.MsgBody.push({MsgType:c,MsgContent:a})}e.sess.type()==l.C2C?Ft.apiCall(u.OPEN_IM,"sendmsg",o,t,n):e.sess.type()==l.GROUP&&Ft.apiCall(u.GROUP,"send_group_msg",o,t,n)}},Re=function(e,t,o){(n||"undefined"==typeof stopPolling||1!=stopPolling)&&Ie(o,!0)&&Ft.apiCall(u.OPEN_IM,"longpolling",e,t,o,q,!0)},Pe=function(e,t,n,o){Ft.apiCall(u.BIG_GROUP_LONG_POLLING,"get_msg",e,t,n,o)},be=function(e,t,n,o){Ie(o,!0)&&Ft.apiCall(u.OPEN_IM,"getmsg",{Cookie:e,SyncFlag:t},function(e){if(e.MsgList&&e.MsgList.length)for(var t in e.MsgList)te.push(e.MsgList[t]);1==e.SyncFlag?be(e.Cookie,e.SyncFlag,n,o):(e.MsgList=te,te=[],n&&n(e))},o)},Le=function(e,t,n,o){if(Ie(o,!0)){var i=[];for(var r in t){var s={To_Account:t[r].toAccount,LastedMsgTime:t[r].lastedMsgTime};i.push(s)}Ft.apiCall(u.OPEN_IM,"msgreaded",{C2CMsgReaded:{Cookie:e,C2CMsgReadedItem:i}},n,o)}},Ue=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.OPEN_IM,"deletemsg",e,t,n)},we=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.OPEN_IM,"getroammsg",e,function(o){var i=e.MaxCnt,r=o.Complete,s=o.MaxCnt,u=o.MsgKey,a=o.LastMsgTime;if(o.MsgList&&o.MsgList.length)for(var c in o.MsgList)ne.push(o.MsgList[c]);var l=null;0==r&&s0&&(e.ActionStatus=g.FAIL,e.GroupInfo[o].ErrorInfo="["+i+"]"+e.GroupInfo[o].ErrorInfo,e.ErrorInfo+=e.GroupInfo[o].ErrorInfo+"\n")}e.ActionStatus==g.FAIL?n&&n(e):t&&t(e)},n)},We=function(e,t,n){if(Ie(n,!0)){var o={GroupIdList:e.GroupIdList,ResponseFilter:{GroupBaseInfoFilter:e.GroupBaseInfoFilter,MemberInfoFilter:e.MemberInfoFilter}};e.AppDefinedDataFilter_Group&&(o.ResponseFilter.AppDefinedDataFilter_Group=e.AppDefinedDataFilter_Group),e.AppDefinedDataFilter_GroupMember&&(o.ResponseFilter.AppDefinedDataFilter_GroupMember=e.AppDefinedDataFilter_GroupMember),Ft.apiCall(u.GROUP,"get_group_info",o,t,n)}},Qe=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"get_group_member_info",{GroupId:e.GroupId,Offset:e.Offset,Limit:e.Limit,MemberInfoFilter:e.MemberInfoFilter,MemberRoleFilter:e.MemberRoleFilter,AppDefinedDataFilter_GroupMember:e.AppDefinedDataFilter_GroupMember},t,n)},Ze=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"add_group_member",{GroupId:e.GroupId,Silence:e.Silence,MemberList:e.MemberList},t,n)},$e=function(e,t,n){if(Ie(n,!0)){var o={};e.GroupId&&(o.GroupId=e.GroupId),e.Member_Account&&(o.Member_Account=e.Member_Account),e.Role&&(o.Role=e.Role),e.MsgFlag&&(o.MsgFlag=e.MsgFlag),e.ShutUpTime&&(o.ShutUpTime=e.ShutUpTime),e.NameCard&&(o.NameCard=e.NameCard),e.AppMemberDefinedData&&(o.AppMemberDefinedData=e.AppMemberDefinedData),Ft.apiCall(u.GROUP,"modify_group_member_info",o,t,n)}},et=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"delete_group_member",{GroupId:e.GroupId,Silence:e.Silence,MemberToDel_Account:e.MemberToDel_Account,Reason:e.Reason},t,n)},tt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"destroy_group",{GroupId:e.GroupId},t,n)},nt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"change_group_owner",e,t,n)},ot=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"get_joined_group_list",{Member_Account:e.Member_Account,Limit:e.Limit,Offset:e.Offset,GroupType:e.GroupType,ResponseFilter:{GroupBaseInfoFilter:e.GroupBaseInfoFilter,SelfInfoFilter:e.SelfInfoFilter}},t,n)},it=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"get_role_in_group",{GroupId:e.GroupId,User_Account:e.User_Account},t,n)},rt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"forbid_send_msg",{GroupId:e.GroupId,Members_Account:e.Members_Account,ShutUpTime:e.ShutUpTime},t,n)},st=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"send_group_system_notification",e,t,n)},ut=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"group_msg_get",{GroupId:e.GroupId,ReqMsgSeq:e.ReqMsgSeq,ReqMsgNumber:e.ReqMsgNumber},t,n)},at=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.GROUP,"msg_read_report",{GroupId:e.GroupId,MsgReadedSeq:e.MsgReadedSeq},t,n)},ct=function(e){var t=[];if(e.Fail_Account&&e.Fail_Account.length&&(t=e.Fail_Account),e.Invalid_Account&&e.Invalid_Account.length)for(var n in e.Invalid_Account)t.push(e.Invalid_Account[n]);if(t.length){e.ActionStatus=g.FAIL,e.ErrorCode=99999,e.ErrorInfo="";for(var o in t){var i=t[o];for(var r in e.ResultItem)if(e.ResultItem[r].To_Account==i){var s=e.ResultItem[r].ResultCode;e.ResultItem[r].ResultInfo="["+s+"]"+e.ResultItem[r].ResultInfo,e.ErrorInfo+=e.ResultItem[r].ResultInfo+"\n";break}}}return e},lt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"friend_add",{From_Account:W.identifier,AddFriendItem:e.AddFriendItem},function(e){var o=ct(e);o.ActionStatus==g.FAIL?n&&n(o):t&&t(o)},n)},pt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"friend_delete",{From_Account:W.identifier,To_Account:e.To_Account,DeleteType:e.DeleteType},function(e){var o=ct(e);o.ActionStatus==g.FAIL?n&&n(o):t&&t(o)},n)},ft=function(e,t,n){Ie(n,!0)&&(1==e.chatType?Ft.apiCall(u.DEL_CHAT,"delete",{From_Account:W.identifier,Type:e.chatType,To_Account:e.To_Account},t,n):Ft.apiCall(u.DEL_CHAT,"delete",{From_Account:W.identifier,Type:e.chatType,ToGroupid:e.To_Account },t,n))},gt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"pendency_get",{From_Account:W.identifier,PendencyType:e.PendencyType,StartTime:e.StartTime,MaxLimited:e.MaxLimited,LastSequence:e.LastSequence},t,n)},dt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"PendencyReport",{From_Account:W.identifier,LatestPendencyTimeStamp:e.LatestPendencyTimeStamp},t,n)},mt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"pendency_delete",{From_Account:W.identifier,PendencyType:e.PendencyType,To_Account:e.To_Account},function(e){var o=ct(e);o.ActionStatus==g.FAIL?n&&n(o):t&&t(o)},n)},ht=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"friend_response",{From_Account:W.identifier,ResponseFriendItem:e.ResponseFriendItem},function(e){var o=ct(e);o.ActionStatus==g.FAIL?n&&n(o):t&&t(o)},n)},It=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"friend_get_all",{From_Account:W.identifier,TimeStamp:e.TimeStamp,StartIndex:e.StartIndex,GetCount:e.GetCount,LastStandardSequence:e.LastStandardSequence,TagList:e.TagList},t,n)},Et=function(e,t,n){e.To_Account.length>100&&(e.To_Account.length=100,ce.error("获取用户资料人数不能超过100人")),Ie(n,!0)&&Ft.apiCall(u.PROFILE,"portrait_get",{From_Account:W.identifier,To_Account:e.To_Account,TagList:e.TagList},function(e){var o=[];if(e.Fail_Account&&e.Fail_Account.length&&(o=e.Fail_Account),e.Invalid_Account&&e.Invalid_Account.length)for(var i in e.Invalid_Account)o.push(e.Invalid_Account[i]);if(o.length){e.ActionStatus=g.FAIL,e.ErrorCode=99999,e.ErrorInfo="";for(var r in o){var s=o[r];for(var u in e.UserProfileItem)if(e.UserProfileItem[u].To_Account==s){var a=e.UserProfileItem[u].ResultCode;e.UserProfileItem[u].ResultInfo="["+a+"]"+e.UserProfileItem[u].ResultInfo,e.ErrorInfo+="账号:"+s+","+e.UserProfileItem[u].ResultInfo+"\n";break}}}e.ActionStatus==g.FAIL?n&&n(e):t&&t(e)},n)},Mt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.PROFILE,"portrait_set",{From_Account:W.identifier,ProfileItem:e.ProfileItem},function(n){for(var o in e.ProfileItem){var i=e.ProfileItem[o];if("Tag_Profile_IM_Nick"==i.Tag){W.identifierNick=i.Value;break}}t&&t(n)},n)},_t=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"black_list_add",{From_Account:W.identifier,To_Account:e.To_Account},function(e){var o=ct(e);o.ActionStatus==g.FAIL?n&&n(o):t&&t(o)},n)},yt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"black_list_delete",{From_Account:W.identifier,To_Account:e.To_Account},function(e){var o=ct(e);o.ActionStatus==g.FAIL?n&&n(o):t&&t(o)},n)},Tt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.FRIEND,"black_list_get",{From_Account:W.identifier,StartIndex:e.StartIndex,MaxLimited:e.MaxLimited,LastSequence:e.LastSequence},t,n)},Ct=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.RECENT_CONTACT,"get",{From_Account:W.identifier,Count:e.Count},t,n)},At=function(e,t,n){if(Ie(n,!0)){var o;o=Ee()?"pic_up":"pic_up_test",Ft.apiCall(u.PIC,o,{App_Version:y.APP_VERSION,From_Account:W.identifier,To_Account:e.To_Account,Seq:e.Seq,Timestamp:e.Timestamp,Random:e.Random,File_Str_Md5:e.File_Str_Md5,File_Size:e.File_Size,File_Type:e.File_Type,Server_Ver:y.SERVER_VERSION,Auth_Key:X,Busi_Id:e.Busi_Id,PkgFlag:e.PkgFlag,Slice_Offset:e.Slice_Offset,Slice_Size:e.Slice_Size,Slice_Data:e.Slice_Data,content_type:"application/x-www-form-urlencoded"},t,n)}},St=function(e,t){Ie(t,!0)&&Ft.apiCall(u.OPEN_IM,"authkey",{},e,t)},vt=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.IM_OPEN_STAT,"web_report",e,t,n)},Ot=function(e,t,n){Ie(n,!0)&&Ft.apiCall(u.OPEN_IM,"getlongpollingid",{},function(e){t&&t(e)},n)},Gt=function(e,t,n){Ft.apiCall(u.PIC,"apply_download",e,t,n)};!function(){r=ae.getBrowserInfo(),ce.info("BROWSER_INFO: type="+r.type+", ver="+r.ver),"ie"==r.type&&parseInt(r.ver)<10&&(s=!0)}();var Ft=0==s?new function(){var e=null;this.init=function(t,n,o){t&&(e=t)},this.callBack=function(t){e&&e(t)},this.clear=function(){e=null},this.apiCall=function(e,t,n,o,i,r,s){var u=Me(e,t,0,i);if(0!=u){var a=n.content_type?n.content_type:"application/x-www-form-urlencoded";me("POST",u,n,r,a,s,function(r){var s=null,a="";"pic_up"==t&&(n.Slice_Data="");var c="\n request url: \n"+u+"\n request body: \n"+JSON.stringify(n)+"\n response: \n"+JSON.stringify(r);r.ActionStatus==g.OK?(ce.info("["+e+"]["+t+"]success: "+c),o&&o(r),s=0,a=""):(s=r.ErrorCode,a=r.ErrorInfo,i&&(r.SrcErrorInfo=r.ErrorInfo,r.ErrorInfo="["+e+"]["+t+"]failed: "+c,"longpolling"==t&&60008==r.ErrorCode||ce.error(r.ErrorInfo),i(r))),ve(t,s,a)},function(e){i&&i(e),ve(t,e.ErrorCode,e.ErrorInfo)})}}}:new function(){var e=null;this.init=function(t,n,o){t&&(e=t)},this.callBack=function(t){e&&e(t)},this.clear=function(){e=null},this.apiCall=function(e,t,n,o,i,r,s){var u=Me(e,t,0,i);if(0!=u){var a=H++,c="jsonpRequest"+a,l=document.createElement("script"),p=0;window[c]=J,l.type="text/javascript",u=u+"&jsonpcallback="+c+"&jsonpbody="+encodeURIComponent(JSON.stringify(n)),l.src=u,l.async=!0,void 0!==l.onreadystatechange&&(l.event="onclick",l.htmlFor=l.id="_jsonpRequest_"+a),l.onload=l.onreadystatechange=function(){if(this.readyState&&"complete"!==this.readyState&&"loaded"!==this.readyState||p)return!1;l.onload=l.onreadystatechange=null,l.onclick&&l.onclick();var r=V,s="\n request url: \n"+u+"\n request body: \n"+JSON.stringify(n)+"\n response: \n"+JSON.stringify(r);r.ActionStatus==g.OK?(ce.info("["+e+"]["+t+"]success: "+s),o&&o(r)):(r.ErrorInfo="["+e+"]["+t+"]failed "+s,"longpolling"!=t||60008!=r.ErrorCode?ce.error(r.ErrorInfo):ce.warn("["+e+"]["+t+"]success: "+s),i&&i(r)),V=void 0,document.body.removeChild(l),p=1},document.body.appendChild(l)}}},Nt=function(e,t,n,o,i,r){this._impl={skey:Nt.skey(e,t),type:e,id:t,name:n,icon:o,unread:0,isAutoRead:!1,time:i>=0?i:0,curMaxMsgSeq:r>=0?r:0,msgs:[],isFinished:1}};Nt.skey=function(e,t){return e+t},Nt.prototype.type=function(){return this._impl.type},Nt.prototype.id=function(){return this._impl.id},Nt.prototype.name=function(){return this._impl.name},Nt.prototype.icon=function(){return this._impl.icon},Nt.prototype.unread=function(e){if(void 0===e)return this._impl.unread;this._impl.unread=e},Nt.prototype.isFinished=function(e){if(void 0===e)return this._impl.isFinished;this._impl.isFinished=e},Nt.prototype.time=function(){return this._impl.time},Nt.prototype.curMaxMsgSeq=function(e){if(void 0===e)return this._impl.curMaxMsgSeq;this._impl.curMaxMsgSeq=e},Nt.prototype.msgCount=function(){return this._impl.msgs.length},Nt.prototype.msg=function(e){return this._impl.msgs[e]},Nt.prototype.msgs=function(){return this._impl.msgs},Nt.prototype._impl_addMsg=function(e,t){this._impl.msgs.push(e),e.time>this._impl.time&&(this._impl.time=e.time),e.seq>this._impl.curMaxMsgSeq&&(this._impl.curMaxMsgSeq=e.seq),e.isSend||this._impl.isAutoRead||!t||this._impl.unread++};var Rt=function(e,t){this.toAccount=e,this.lastedMsgTime=t},Pt=function(e,t){for(var n=parseInt(e).toString(2)+"00000000000000000000000000000000",o=parseInt(t).toString(2),i=n.split("").reverse(),r=o.split("").reverse(),s=null,u=[],a=i.length>r.length?i.length:r.length,c=0;c=0?s:0,this.fromAccount=r,this.fromAccountNick=u||r,this.fromAccountHeadurl=a||null,this.isSend=Boolean(t),this.seq=n>=0?n:pe(),this.random=o>=0?o:fe(),this.time=i>=0?i:le(),this.elems=[],e.type()){case l.GROUP:this.uniqueId=Pt(this.seq,this.random);break;case l.C2C:default:this.uniqueId=Pt(this.time,this.random)}};bt.prototype.getSession=function(){return this.sess},bt.prototype.getType=function(){return this.subType},bt.prototype.getSubType=function(){return this.subType},bt.prototype.getFromAccount=function(){return this.fromAccount},bt.prototype.getFromAccountNick=function(){return this.fromAccountNick},bt.prototype.getIsSend=function(){return this.isSend},bt.prototype.getSeq=function(){return this.seq},bt.prototype.getTime=function(){return this.time},bt.prototype.getRandom=function(){return this.random},bt.prototype.getElems=function(){return this.elems},bt.prototype.getMsgUniqueId=function(){return this.uniqueId},bt.prototype.addText=function(t){this.addElem(new e.Msg.Elem(d.TEXT,t))},bt.prototype.addFace=function(t){this.addElem(new e.Msg.Elem(d.FACE,t))},bt.prototype.addImage=function(t){this.addElem(new e.Msg.Elem(d.IMAGE,t))},bt.prototype.addLocation=function(t){this.addElem(new e.Msg.Elem(d.LOCATION,t))},bt.prototype.addFile=function(t){this.addElem(new e.Msg.Elem(d.FILE,t))},bt.prototype.addCustom=function(t){this.addElem(new e.Msg.Elem(d.CUSTOM,t))},bt.prototype.addElem=function(e){this.elems.push(e)},bt.prototype.toHtml=function(){var e="";for(var t in this.elems){e+=this.elems[t].toHtml()}return e},bt.prototype.setOfflinePushInfo=function(e){this.offlinePushInfo=e},bt.Elem=function(e,t){this.type=e,this.content=t},bt.Elem.prototype.getType=function(){return this.type},bt.Elem.prototype.getContent=function(){return this.content},bt.Elem.prototype.toHtml=function(){return this.content.toHtml()},bt.Elem.Text=function(e){this.text=ae.xssFilter(e)},bt.Elem.Text.prototype.getText=function(){return this.text},bt.Elem.Text.prototype.toHtml=function(){return this.text},bt.Elem.Face=function(e,t){this.index=e,this.data=t},bt.Elem.Face.prototype.getIndex=function(){return this.index},bt.Elem.Face.prototype.getData=function(){return this.data},bt.Elem.Face.prototype.toHtml=function(){var e=null,t=se[this.data],n=ue[t];return n&&n[1]&&(e=n[1]),e?"":this.data},bt.Elem.Location=function(e,t,n){this.latitude=t,this.longitude=e,this.desc=n},bt.Elem.Location.prototype.getLatitude=function(){return this.latitude},bt.Elem.Location.prototype.getLongitude=function(){return this.longitude},bt.Elem.Location.prototype.getDesc=function(){return this.desc},bt.Elem.Location.prototype.toHtml=function(){return"经度="+this.longitude+",纬度="+this.latitude+",描述="+this.desc},bt.Elem.Images=function(e,t){this.UUID=e,"number"!=typeof t&&(t=parseInt(h[t]||h.UNKNOWN,10)),this.ImageFormat=t,this.ImageInfoArray=[]},bt.Elem.Images.prototype.addImage=function(e){this.ImageInfoArray.push(e)},bt.Elem.Images.prototype.toHtml=function(){var e=this.getImage(m.SMALL),t=this.getImage(m.LARGE),n=this.getImage(m.ORIGIN);return t||(t=e),n||(n=e),""},bt.Elem.Images.prototype.getImageId=function(){return this.UUID},bt.Elem.Images.prototype.getImageFormat=function(){return this.ImageFormat},bt.Elem.Images.prototype.getImage=function(e){for(var t in this.ImageInfoArray)if(this.ImageInfoArray[t].getType()==e)return this.ImageInfoArray[t];var n=null;return this.ImageInfoArray.forEach(function(t){t.getType()==e&&(n=t)}),n},bt.Elem.Images.Image=function(e,t,n,o,i){this.type=e,this.size=t,this.width=n,this.height=o,this.url=i},bt.Elem.Images.Image.prototype.getType=function(){return this.type},bt.Elem.Images.Image.prototype.getSize=function(){return this.size},bt.Elem.Images.Image.prototype.getWidth=function(){return this.width},bt.Elem.Images.Image.prototype.getHeight=function(){return this.height},bt.Elem.Images.Image.prototype.getUrl=function(){return this.url},bt.Elem.Sound=function(e,t,n,o,i,r,s){this.uuid=e,this.second=t,this.size=n,this.senderId=o,this.receiverId=i,this.downFlag=r,this.busiId=s==l.C2C?2:1,void 0!==this.downFlag&&void 0!==this.busiId?Te(e,o,0,r,i,this.busiId,_.SOUND):this.downUrl=_e(e,o)},bt.Elem.Sound.prototype.getUUID=function(){return this.uuid},bt.Elem.Sound.prototype.getSecond=function(){return this.second},bt.Elem.Sound.prototype.getSize=function(){return this.size},bt.Elem.Sound.prototype.getSenderId=function(){return this.senderId},bt.Elem.Sound.prototype.getDownUrl=function(){return this.downUrl},bt.Elem.Sound.prototype.toHtml=function(){return"ie"==r.type&&parseInt(r.ver)<=8?"[这是一条语音消息]demo暂不支持ie8(含)以下浏览器播放语音,语音URL:"+this.downUrl:''},bt.Elem.File=function(e,t,n,o,i,r,s){this.uuid=e,this.name=t,this.size=n,this.senderId=o,this.receiverId=i,this.downFlag=r,this.busiId=s==l.C2C?2:1,void 0!==r&&void 0!==busiId?Te(e,o,0,r,i,this.busiId,_.FILE):this.downUrl=ye(e,o,t)},bt.Elem.File.prototype.getUUID=function(){return this.uuid},bt.Elem.File.prototype.getName=function(){return this.name},bt.Elem.File.prototype.getSize=function(){return this.size},bt.Elem.File.prototype.getSenderId=function(){return this.senderId},bt.Elem.File.prototype.getDownUrl=function(){return this.downUrl},bt.Elem.File.prototype.getDownFlag=function(){return this.downFlag},bt.Elem.File.prototype.toHtml=function(){var e,t;return e=this.size,t="Byte",this.size>=1024&&(e=Math.round(this.size/1024),t="KB"),' '+this.name+"("+e+t+")"},bt.Elem.GroupTip=function(e,t,n,o,i,r){this.opType=e,this.opUserId=t,this.groupId=n,this.groupName=o,this.userIdList=i||[],this.groupInfoList=[],this.memberInfoList=[],this.groupMemberNum=null,this.userinfo=r||[]},bt.Elem.GroupTip.prototype.addGroupInfo=function(e){this.groupInfoList.push(e)},bt.Elem.GroupTip.prototype.addMemberInfo=function(e){this.memberInfoList.push(e)},bt.Elem.GroupTip.prototype.getOpType=function(){return this.opType},bt.Elem.GroupTip.prototype.getOpUserId=function(){return this.opUserId},bt.Elem.GroupTip.prototype.getGroupId=function(){return this.groupId},bt.Elem.GroupTip.prototype.getGroupName=function(){return this.groupName},bt.Elem.GroupTip.prototype.getUserIdList=function(){return this.userIdList},bt.Elem.GroupTip.prototype.getUserInfo=function(){return this.userinfo},bt.Elem.GroupTip.prototype.getGroupInfoList=function(){return this.groupInfoList},bt.Elem.GroupTip.prototype.getMemberInfoList=function(){return this.memberInfoList},bt.Elem.GroupTip.prototype.getGroupMemberNum=function(){return this.groupMemberNum},bt.Elem.GroupTip.prototype.setGroupMemberNum=function(e){return this.groupMemberNum=e},bt.Elem.GroupTip.prototype.toHtml=function(){var e="[群提示消息]";switch(this.opType){case O.JOIN:e+=this.opUserId+"邀请了";for(var t in this.userIdList)if(e+=this.userIdList[t]+",",this.userIdList.length>10&&9==t){e+="等"+this.userIdList.length+"人";break}e+="加入该群";break;case O.QUIT:e+=this.opUserId+"主动退出该群";break;case O.KICK:e+=this.opUserId+"将";for(var t in this.userIdList)if(e+=this.userIdList[t]+",",this.userIdList.length>10&&9==t){e+="等"+this.userIdList.length+"人";break}e+="踢出该群";break;case O.SET_ADMIN:e+=this.opUserId+"将";for(var t in this.userIdList)if(e+=this.userIdList[t]+",",this.userIdList.length>10&&9==t){e+="等"+this.userIdList.length+"人";break}e+="设为管理员";break;case O.CANCEL_ADMIN:e+=this.opUserId+"取消";for(var t in this.userIdList)if(e+=this.userIdList[t]+",",this.userIdList.length>10&&9==t){e+="等"+this.userIdList.length+"人";break}e+="的管理员资格";break;case O.MODIFY_GROUP_INFO:e+=this.opUserId+"修改了群资料:";for(var t in this.groupInfoList){var n=this.groupInfoList[t].getType(),o=this.groupInfoList[t].getValue();switch(n){case G.FACE_URL:e+="群头像为"+o+"; ";break;case G.NAME:e+="群名称为"+o+"; ";break;case G.OWNER:e+="群主为"+o+"; ";break;case G.NOTIFICATION:e+="群公告为"+o+"; ";break;case G.INTRODUCTION:e+="群简介为"+o+"; ";break;default:e+="未知信息为:type="+n+",value="+o+"; "}}break;case O.MODIFY_MEMBER_INFO:e+=this.opUserId+"修改了群成员资料:";for(var t in this.memberInfoList){var i=this.memberInfoList[t].getUserId(),r=this.memberInfoList[t].getShutupTime();if(e+=i+": ",e+=null!=r&&void 0!==r?0==r?"取消禁言; ":"禁言"+r+"秒; ":" shutupTime为空",this.memberInfoList.length>10&&9==t){e+="等"+this.memberInfoList.length+"人";break}}break;case O.READED:Log.info("消息已读同步");break;default:e+="未知群提示消息类型:type="+this.opType}return e},bt.Elem.GroupTip.GroupInfo=function(e,t){this.type=e,this.value=t},bt.Elem.GroupTip.GroupInfo.prototype.getType=function(){return this.type},bt.Elem.GroupTip.GroupInfo.prototype.getValue=function(){return this.value},bt.Elem.GroupTip.MemberInfo=function(e,t){this.userId=e,this.shutupTime=t},bt.Elem.GroupTip.MemberInfo.prototype.getUserId=function(){return this.userId},bt.Elem.GroupTip.MemberInfo.prototype.getShutupTime=function(){return this.shutupTime},bt.Elem.Custom=function(e,t,n){this.data=e,this.desc=t,this.ext=n},bt.Elem.Custom.prototype.getData=function(){return this.data},bt.Elem.Custom.prototype.getDesc=function(){return this.desc},bt.Elem.Custom.prototype.getExt=function(){return this.ext},bt.Elem.Custom.prototype.toHtml=function(){return this.data};var Lt=new function(){var e={},t=[];msgCache={},this.cookie="",this.syncFlag=0;var n=function(t){for(var n in e)t(e[n])},o=function(e){var t=!1,n=e.sess._impl.skey,o=e.isSend+e.seq+e.random;return msgCache[n]&&msgCache[n][o]&&(t=!0),msgCache[n]?msgCache[n][o]={time:e.time}:(msgCache[n]={},msgCache[n][o]={time:e.time}),t};this.sessMap=function(){return e},this.sessCount=function(){return t.length},this.sessByTypeId=function(t,n){var o=Nt.skey(t,n);return void 0===o||null==o?null:e[o]},this.delSessByTypeId=function(t,n){var o=Nt.skey(t,n);return void 0!==o&&null!=o&&(e[o]&&(delete e[o],delete msgCache[o]),!0)},this.resetCookieAndSyncFlag=function(){this.cookie="",this.syncFlag=0},this.setAutoRead=function(e,t,o){if(o&&n(function(e){e._impl.isAutoRead=!1}),e&&(e._impl.isAutoRead=t,t))if(e._impl.unread=0,e._impl.type==l.C2C){var i=[];i.push(new Rt(e._impl.id,e._impl.time)),Le(Lt.cookie,i,function(e){ce.info("[setAutoRead]: c2CMsgReaded success")},function(e){ce.error("[setAutoRead}: c2CMsgReaded failed:"+e.ErrorInfo)})}else if(e._impl.type==l.GROUP){var r={GroupId:e._impl.id,MsgReadedSeq:e._impl.curMaxMsgSeq};at(r,function(e){ce.info("groupMsgReaded success")},function(e){ce.error("groupMsgReaded failed:"+e.ErrorInfo)})}},this.c2CMsgReaded=function(e,t,n){var o=[];o.push(new Rt(e.To_Account,e.LastedMsgTime)),Le(Lt.cookie,o,function(e){t&&(ce.info("c2CMsgReaded success"),t(e))},function(e){n&&(ce.error("c2CMsgReaded failed:"+e.ErrorInfo),n(e))})},this.addSession=function(t){e[t._impl.skey]=t},this.delSession=function(t){delete e[t._impl.skey]},this.clear=function(){e={},t=[],msgCache={},this.cookie="",this.syncFlag=0},this.addMsg=function(t,n){if(o(t))return!1;var i=t.sess;return e[i._impl.skey]||this.addSession(i),i._impl_addMsg(t,n),!0},this.updateTimeline=function(){var e=new Array;n(function(t){e.push(t)}),e.sort(function(e,t){return t.time-e.time}),t=e}},Ut=new function(){var e=null,t=null,n={1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null,9:null,10:null,11:null,15:null,255:null,12:null},o={1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null},i={1:null},r=null,s=!1,u=0,a=0,c=null,p=!1,f={},m=90,h=null,I={},E={92:null,96:null},M=null,_={},y={};this.setLongPollingOn=function(e){s=e},this.getLongPollingOn=function(){return s},this.resetLongPollingInfo=function(){s=!1,u=0,a=0},this.setBigGroupLongPollingOn=function(e){p=e},this.checkBigGroupLongPollingOn=function(e){return!!h[e]},this.setBigGroupLongPollingKey=function(e,t){h[e]=t},this.resetBigGroupLongPollingInfo=function(e){p=!1,f[e]=0,h[e]=null,I[e]={}},this.setBigGroupLongPollingMsgMap=function(e,t){var n=I[e];n?(n=parseInt(n)+t,I[e]=n):I[e]=t},this.clear=function(){t=null,n={1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null,9:null,10:null,11:null,15:null,255:null,12:null},o={1:null,2:null,3:null,4:null,5:null,6:null,7:null,8:null},i={1:null},e=null,s=!1,u=0,a=0,c=null,p=!1,f={},h={},I={},y={},Y=[],X=null,j=null};var P=function(e,t){St(function(t){Y=t.IpList,X=t.AuthKey,j=t.ExpireTime,e&&e(t)},function(e){ce.error("initIpAndAuthkey failed:"+e.ErrorInfo),t&&t(e)})},L=function(e,t){var n={Member_Account:W.identifier,Limit:1e3,Offset:0,GroupBaseInfoFilter:["NextMsgSeq"]};ot(n,function(t){if(!t.GroupIdList||0==t.GroupIdList.length)return ce.info("initMyGroupMaxSeqs: 目前还没有加入任何群组"),void(e&&e(t));for(var n=0;nn&&(_[e]=t):_[e]=t},H=function(e,t){for(var n in e){var o=e[n];if(o.From_Account){var i=se(o,!1,!0);i&&t.push(i),K(o.ToGroupId,o.MsgSeq)}}return t},V=function(t,n){var o={},i=[];for(var r in n){var s=o[n[r].ToGroupId];s||(s=o[n[r].ToGroupId]={min:99999999,max:-1,msgs:[]}),n[r].NoticeSeq>a&&(ce.warn("noticeSeq="+a+",msgNoticeSeq="+n[r].NoticeSeq),a=n[r].NoticeSeq),n[r].Event=t,o[n[r].ToGroupId].msgs.push(n[r]),n[r].MsgSeqs.max&&(o[n[r].ToGroupId].max=n[r].MsgSeq)}for(var u in o)i=H(o[u].msgs,i);i.length&&Lt.updateTimeline(),e&&i.length&&e(i)},J=function(t,n){var o={},i=[];for(var r in n){var s=o[n[r].ToGroupId];s||(s=o[n[r].ToGroupId]={min:99999999,max:-1,msgs:[]}),n[r].NoticeSeq>a&&(ce.warn("noticeSeq="+a+",msgNoticeSeq="+n[r].NoticeSeq),a=n[r].NoticeSeq),n[r].Event=t,o[n[r].ToGroupId].msgs.push(n[r]),n[r].MsgSeqs.max&&(o[n[r].ToGroupId].max=n[r].MsgSeq)}for(var u in o)i=H(o[u].msgs,i);i.length&&Lt.updateTimeline(),e&&i.length&&e(i)},z=function(e,t){for(var o in e){var i=e[o],r=i.MsgBody,s=r.ReportType;0==t&&i.NoticeSeq&&i.NoticeSeq>a&&(a=i.NoticeSeq);i.GroupInfo.To_Account;if(t){var u=i.ToGroupId+"_"+s+"_"+r.Operator_Account;if(y[u]){ce.warn("收到重复的群系统消息:key="+u);continue}y[u]=!0}var c={SrcFlag:0,ReportType:s,GroupId:i.ToGroupId,GroupName:i.GroupInfo.GroupName,Operator_Account:r.Operator_Account,MsgTime:i.MsgTimeStamp,groupReportTypeMsg:r};switch(s){case F.JOIN_GROUP_REQUEST:c.RemarkInfo=r.RemarkInfo,c.MsgKey=r.MsgKey,c.Authentication=r.Authentication,c.UserDefinedField=i.UserDefinedField,c.From_Account=i.From_Account,c.MsgSeq=i.ClientSeq,c.MsgRandom=i.MsgRandom;break;case F.JOIN_GROUP_ACCEPT:case F.JOIN_GROUP_REFUSE:c.RemarkInfo=r.RemarkInfo;break;case F.KICK:case F.DESTORY:case F.CREATE:case F.INVITED_JOIN_GROUP_REQUEST:case F.INVITED_JOIN_GROUP_REQUEST_AGREE:case F.QUIT:case F.SET_ADMIN:case F.CANCEL_ADMIN:case F.REVOKE:case F.READED:break;case F.CUSTOM:c.MsgSeq=i.MsgSeq,c.UserDefinedField=r.UserDefinedField;break;default:ce.error("未知群系统消息类型:reportType="+s)}if(t)n[s]?n[s](c):ce.error("未知群系统消息类型:reportType="+s);else if(n[s])if(s==F.READED)for(var l=c.groupReportTypeMsg.GroupReadInfoArray,p=0,f=l.length;pa&&(a=n.NoticeSeq),r={Type:i},i){case N.FRIEND_ADD:r.Accounts=n.FriendAdd_Account;break;case N.FRIEND_DELETE:r.Accounts=n.FriendDel_Account;break;case N.PENDENCY_ADD:r.PendencyList=n.PendencyAdd;break;case N.PENDENCY_DELETE:r.Accounts=n.FrienPencydDel_Account;break;case N.BLACK_LIST_ADD:r.Accounts=n.BlackListAdd_Account;break;case N.BLACK_LIST_DELETE:r.Accounts=n.BlackListDel_Account;break;default:ce.error("未知好友系统通知类型:friendNotice="+JSON.stringify(n))}t?i==N.PENDENCY_ADD&&o[i]&&o[i](r):o[i]&&o[i](r)}},Z=function(e,t){var n,o,r;for(var s in e){switch(n=e[s],o=n.PushType,0==t&&n.NoticeSeq&&n.NoticeSeq>a&&(a=n.NoticeSeq),r={Type:o},o){case R.PROFILE_MODIFY:r.Profile_Account=n.Profile_Account,r.ProfileList=n.ProfileList;break;default:ce.error("未知资料系统通知类型:profileNotice="+JSON.stringify(n))}t?o==R.PROFILE_MODIFY&&i[o]&&i[o](r):i[o]&&i[o](r)}},$=function(e){var t=e.MsgBody,o=t.ReportType,i=(e.GroupInfo.To_Account,{SrcFlag:1,ReportType:o,GroupId:e.ToGroupId,GroupName:e.GroupInfo.GroupName,Operator_Account:t.Operator_Account,MsgTime:e.MsgTimeStamp});switch(o){case F.JOIN_GROUP_REQUEST:i.RemarkInfo=t.RemarkInfo,i.MsgKey=t.MsgKey,i.Authentication=t.Authentication,i.UserDefinedField=e.UserDefinedField,i.From_Account=e.From_Account,i.MsgSeq=e.ClientSeq,i.MsgRandom=e.MsgRandom;break;case F.JOIN_GROUP_ACCEPT:case F.JOIN_GROUP_REFUSE:i.RemarkInfo=t.RemarkInfo;break;case F.KICK:case F.DESTORY:case F.CREATE:case F.INVITED_JOIN_GROUP_REQUEST:case F.INVITED_JOIN_GROUP_REQUEST_AGREE:case F.QUIT:case F.SET_ADMIN:case F.CANCEL_ADMIN:case F.REVOKE:break;case F.CUSTOM:i.MsgSeq=e.MsgSeq,i.UserDefinedField=t.UserDefinedField;break;default:ce.error("未知群系统消息类型:reportType="+o)}n[o]&&n[o](i)},ee=function(e){for(var t=0,n=e.length;tON)";break;case b.ON:t="connection is on...(ON->ON)";break;case b.RECONNECT:w=b.ON,t="connection is on...(RECONNECT->ON)";break;case b.OFF:n=!0,w=b.RECONNECT,t="reconnect successfully(OFF->RECONNECT)"}var o={ActionStatus:g.OK,ErrorCode:w,ErrorInfo:t};n&&Ft.callBack(o),s&&Ut.longPolling()}else if(91101==e.ErrorCode)ce.error("多实例登录,被kick"),r&&r();else if(k++,ce.warn("longPolling接口第"+k+"次报错: "+e.ErrorInfo),k<=10)setTimeout(oe,100);else{w=b.OFF;var i={ActionStatus:g.FAIL,ErrorCode:b.OFF,ErrorInfo:"connection is off"};0==D&&Ft.callBack(i),D=!0,ce.warn("5000毫秒之后,SDK会发起新的longPolling请求..."),setTimeout(oe,5e3)}},V=function(t,n){var o=[],i=[];i=n;for(var r in i){var s,u,a=i[r],c=a.From_AccountHeadurl||"";a.From_Account==W.identifier?(s=!0,u=a.To_Account):(s=!1,u=a.From_Account);var p=Lt.sessByTypeId(l.C2C,u);p||(p=new Nt(l.C2C,u,u,c,0,0));var f=new bt(p,s,a.MsgSeq,a.MsgRandom,a.MsgTimeStamp,a.From_Account,C.COMMON,a.From_AccountNick,c),g=null,m=null,h=null;for(var I in a.MsgBody){switch(g=a.MsgBody[I],h=g.MsgType){case d.TEXT:m=new bt.Elem.Text(g.MsgContent.Text);break;case d.FACE:m=new bt.Elem.Face(g.MsgContent.Index,g.MsgContent.Data);break;case d.IMAGE:m=new bt.Elem.Images(g.MsgContent.UUID,g.MsgContent.ImageFormat||"");for(var E in g.MsgContent.ImageInfoArray){var M=g.MsgContent.ImageInfoArray[E];m.addImage(new bt.Elem.Images.Image(M.Type,M.Size,M.Width,M.Height,M.URL))}break;case d.SOUND:g.MsgContent?m=new bt.Elem.Sound(g.MsgContent.UUID,g.MsgContent.Second,g.MsgContent.Size,a.From_Account,a.To_Account,g.MsgContent.Download_Flag,l.C2C):(h=d.TEXT,m=new bt.Elem.Text("[语音消息]下载地址解析出错"));break;case d.LOCATION:m=new bt.Elem.Location(g.MsgContent.Longitude,g.MsgContent.Latitude,g.MsgContent.Desc);break;case d.FILE:case d.FILE+" ":h=d.FILE,g.MsgContent?m=new bt.Elem.File(g.MsgContent.UUID,g.MsgContent.FileName,g.MsgContent.FileSize,a.From_Account,a.To_Account,g.MsgContent.Download_Flag,l.C2C):(h=d.TEXT,m=new bt.Elem.Text("[文件消息下载地址解析出错]"));break;case d.CUSTOM:try{var _=JSON.parse(g.MsgContent.Data);if(_&&_.userAction&&_.userAction==U.ING)continue}catch(e){}h=d.CUSTOM,m=new bt.Elem.Custom(g.MsgContent.Data,g.MsgContent.Desc,g.MsgContent.Ext);break;default:h=d.TEXT,m=new bt.Elem.Text("web端暂不支持"+g.MsgType+"消息")}f.elems.push(new bt.Elem(h,m))}f.elems.length>0&&Lt.addMsg(f,!0)&&o.push(f)}o.length>0&&Lt.updateTimeline(),o.length>0&&e&&e(o)},oe=function(){s&&Ut.longPolling()},re=function(e){for(var t in e){var n=e[t];switch(z(n.GroupTips,!0),n.Event){case T.GROUP_SYSTEM:ce.warn("handlerApplyJoinGroupSystemMsgs: handler new group system msg"),z(n.GroupTips,!0);break;default:ce.error("syncMsgs收到未知的群系统消息类型: Event="+n.Event)}}};this.syncMsgs=function(t,n){var o=[],i=[];be(Lt.cookie,Lt.syncFlag,function(n){2==n.SyncFlag&&(Lt.syncFlag=0),i=n.MsgList,Lt.cookie=n.Cookie;for(var r in i){var s,u,a,c=i[r];c.From_Account==W.identifier?(s=!0,u=c.To_Account,a=""):(s=!1,u=c.From_Account,a="");var p=Lt.sessByTypeId(l.C2C,u);p||(p=new Nt(l.C2C,u,u,a,0,0));var f=new bt(p,s,c.MsgSeq,c.MsgRandom,c.MsgTimeStamp,c.From_Account,C.COMMON,c.From_AccountNick,c.From_AccountHeadurl),g=null,m=null,h=null;for(var I in c.MsgBody){switch(g=c.MsgBody[I],h=g.MsgType){case d.TEXT:m=new bt.Elem.Text(g.MsgContent.Text);break;case d.FACE:m=new bt.Elem.Face(g.MsgContent.Index,g.MsgContent.Data);break;case d.IMAGE:m=new bt.Elem.Images(g.MsgContent.UUID,g.MsgContent.ImageFormat);for(var E in g.MsgContent.ImageInfoArray){var M=g.MsgContent.ImageInfoArray[E];m.addImage(new bt.Elem.Images.Image(M.Type,M.Size,M.Width,M.Height,M.URL))}break;case d.SOUND:g.MsgContent?m=new bt.Elem.Sound(g.MsgContent.UUID,g.MsgContent.Second,g.MsgContent.Size,c.From_Account,c.To_Account,g.MsgContent.Download_Flag,l.C2C):(h=d.TEXT,m=new bt.Elem.Text("[语音消息]下载地址解析出错"));break;case d.LOCATION:m=new bt.Elem.Location(g.MsgContent.Longitude,g.MsgContent.Latitude,g.MsgContent.Desc);break;case d.FILE:case d.FILE+" ":h=d.FILE, g.MsgContent?m=new bt.Elem.File(g.MsgContent.UUID,g.MsgContent.FileName,g.MsgContent.FileSize,c.From_Account,c.To_Account,g.MsgContent.Download_Flag,l.C2C):(h=d.TEXT,m=new bt.Elem.Text("[文件消息下载地址解析出错]"));break;case d.CUSTOM:try{var _=JSON.parse(g.MsgContent.Data);if(_&&_.userAction&&_.userAction==U.ING)continue}catch(e){}h=d.CUSTOM,m=new bt.Elem.Custom(g.MsgContent.Data,g.MsgContent.Desc,g.MsgContent.Ext);break;default:h=d.TEXT,m=new bt.Elem.Text("web端暂不支持"+g.MsgType+"消息")}f.elems.push(new bt.Elem(h,m))}f.elems.length>0&&Lt.addMsg(f,!0)&&o.push(f)}re(n.EventArray),o.length>0&&Lt.updateTimeline(),t?t(o):o.length>0&&e&&e(o)},function(e){ce.error("getMsgs failed:"+e.ErrorInfo),n&&n(e)})},this.getC2CHistoryMsgs=function(e,t,n){if(!e.Peer_Account&&n)return void n(ae.getReturnError("Peer_Account is empty",-13));if(e.MaxCnt||(e.MaxCnt=15),e.MaxCnt<=0&&n)return void n(ae.getReturnError("MaxCnt should be greater than 0",-14));if(e.MaxCnt>15){if(n)return void n(ae.getReturnError("MaxCnt can not be greater than 15",-15))}else{null!=e.MsgKey&&void 0!==e.MsgKey||(e.MsgKey="");var o={Peer_Account:e.Peer_Account,MaxCnt:e.MaxCnt,LastMsgTime:e.LastMsgTime,MsgKey:e.MsgKey};we(o,function(n){var o=[],i=[];i=n.MsgList;var r=Lt.sessByTypeId(l.C2C,e.Peer_Account);r||(r=new Nt(l.C2C,e.Peer_Account,e.Peer_Account,"",0,0));for(var s in i){var u,a=i[s],c=a.From_AccountHeadurl||"";a.From_Account==W.identifier?(u=!0,a.To_Account):(u=!1,a.From_Account);var p=new bt(r,u,a.MsgSeq,a.MsgRandom,a.MsgTimeStamp,a.From_Account,C.COMMON,a.From_AccountNick,c),f=null,g=null,m=null;for(var h in a.MsgBody){switch(f=a.MsgBody[h],m=f.MsgType){case d.TEXT:g=new bt.Elem.Text(f.MsgContent.Text);break;case d.FACE:g=new bt.Elem.Face(f.MsgContent.Index,f.MsgContent.Data);break;case d.IMAGE:g=new bt.Elem.Images(f.MsgContent.UUID,f.MsgContent.ImageFormat);for(var I in f.MsgContent.ImageInfoArray){var E=f.MsgContent.ImageInfoArray[I];g.addImage(new bt.Elem.Images.Image(E.Type,E.Size,E.Width,E.Height,E.URL))}break;case d.SOUND:f.MsgContent?g=new bt.Elem.Sound(f.MsgContent.UUID,f.MsgContent.Second,f.MsgContent.Size,a.From_Account,a.To_Account,f.MsgContent.Download_Flag,l.C2C):(m=d.TEXT,g=new bt.Elem.Text("[语音消息]下载地址解析出错"));break;case d.LOCATION:g=new bt.Elem.Location(f.MsgContent.Longitude,f.MsgContent.Latitude,f.MsgContent.Desc);break;case d.FILE:case d.FILE+" ":m=d.FILE,f.MsgContent?g=new bt.Elem.File(f.MsgContent.UUID,f.MsgContent.FileName,f.MsgContent.FileSize,a.From_Account,a.To_Account,f.MsgContent.Download_Flag,l.C2C):(m=d.TEXT,g=new bt.Elem.Text("[文件消息下载地址解析出错]"));break;case d.CUSTOM:m=d.CUSTOM,g=new bt.Elem.Custom(f.MsgContent.Data,f.MsgContent.Desc,f.MsgContent.Ext);break;default:m=d.TEXT,g=new bt.Elem.Text("web端暂不支持"+f.MsgType+"消息")}p.elems.push(new bt.Elem(m,g))}Lt.addMsg(p),o.push(p)}if(Lt.updateTimeline(),t){var M={Complete:n.Complete,MsgCount:o.length,LastMsgTime:n.LastMsgTime,MsgKey:n.MsgKey,MsgList:o};r.isFinished(n.Complete),t(M)}},function(e){ce.error("getC2CHistoryMsgs failed:"+e.ErrorInfo),n&&n(e)})}},this.syncGroupMsgs=function(t,n,o){if(t.ReqMsgSeq<=0){if(o){var i=ae.getReturnError("ReqMsgSeq must be greater than 0",-16);o(i)}}else{var r={GroupId:t.GroupId,ReqMsgSeq:t.ReqMsgSeq,ReqMsgNumber:t.ReqMsgNumber};ut(r,function(t){var o=[],i=(t.GroupId,t.RspMsgList),r=t.IsFinished;if(null==i||void 0===i)return void(n&&n([]));for(var s=i.length-1;s>=0;s--){var u=i[s];if(!u.IsPlaceMsg&&u.From_Account&&u.MsgBody&&0!=u.MsgBody.length){var a=se(u,!0,!0,r);a&&o.push(a)}}o.length>0&&Lt.updateTimeline(),n?n(o):o.length>0&&e&&e(o)},function(e){ce.error("getGroupMsgs failed:"+e.ErrorInfo),o&&o(e)})}};var se=function(e,n,o,i){if(e.IsPlaceMsg||!e.From_Account||!e.MsgBody||0==e.MsgBody.length)return null;var r,s,u,a,c=e.ToGroupId,p=c;e.GroupInfo&&e.GroupInfo.GroupName&&(p=e.GroupInfo.GroupName),u=e.From_Account,e.GroupInfo&&(e.GroupInfo.From_AccountNick&&(u=e.GroupInfo.From_AccountNick),a=e.GroupInfo.From_AccountHeadurl?e.GroupInfo.From_AccountHeadurl:null),e.From_Account==W.identifier?(r=!0,e.From_Account,s=""):(r=!1,e.From_Account,s="");var f=Lt.sessByTypeId(l.GROUP,c);f||(f=new Nt(l.GROUP,c,p,s,0,0)),void 0!==i&&f.isFinished(i||0);var g=S.COMMON;if(T.GROUP_TIP==e.Event||T.GROUP_TIP2==e.Event){g=S.TIP;var m=e.MsgBody;e.MsgBody=[],e.MsgBody.push({MsgType:d.GROUP_TIP,MsgContent:m})}else e.MsgPriority&&(e.MsgPriority==v.REDPACKET?g=S.REDPACKET:e.MsgPriority==v.LOVEMSG&&(g=S.LOVEMSG));var h=new bt(f,r,e.MsgSeq,e.MsgRandom,e.MsgTimeStamp,e.From_Account,g,u,a),I=null,E=null,M=null;for(var _ in e.MsgBody){switch(I=e.MsgBody[_],M=I.MsgType){case d.TEXT:E=new bt.Elem.Text(I.MsgContent.Text);break;case d.FACE:E=new bt.Elem.Face(I.MsgContent.Index,I.MsgContent.Data);break;case d.IMAGE:E=new bt.Elem.Images(I.MsgContent.UUID,I.MsgContent.ImageFormat||"");for(var y in I.MsgContent.ImageInfoArray)E.addImage(new bt.Elem.Images.Image(I.MsgContent.ImageInfoArray[y].Type,I.MsgContent.ImageInfoArray[y].Size,I.MsgContent.ImageInfoArray[y].Width,I.MsgContent.ImageInfoArray[y].Height,I.MsgContent.ImageInfoArray[y].URL));break;case d.SOUND:I.MsgContent?E=new bt.Elem.Sound(I.MsgContent.UUID,I.MsgContent.Second,I.MsgContent.Size,e.From_Account,e.To_Account,I.MsgContent.Download_Flag,l.GROUP):(M=d.TEXT,E=new bt.Elem.Text("[语音消息]下载地址解析出错"));break;case d.LOCATION:E=new bt.Elem.Location(I.MsgContent.Longitude,I.MsgContent.Latitude,I.MsgContent.Desc);break;case d.FILE:case d.FILE+" ":M=d.FILE;ye(I.MsgContent.UUID,e.From_Account,I.MsgContent.FileName);I.MsgContent?E=new bt.Elem.File(I.MsgContent.UUID,I.MsgContent.FileName,I.MsgContent.FileSize,e.From_Account,e.To_Account,I.MsgContent.Download_Flag,l.GROUP):(M=d.TEXT,E=new bt.Elem.Text("[文件消息]地址解析出错"));break;case d.GROUP_TIP:var C=I.MsgContent.OpType;if(E=new bt.Elem.GroupTip(C,I.MsgContent.Operator_Account,c,e.GroupInfo.GroupName,I.MsgContent.List_Account,I.MsgContent.MsgMemberExtraInfo),O.JOIN==C||O.QUIT==C)E.setGroupMemberNum(I.MsgContent.MemberNum);else if(O.MODIFY_GROUP_INFO==C){var A=!1,F={GroupId:c,GroupFaceUrl:null,GroupName:null,OwnerAccount:null,GroupNotification:null,GroupIntroduction:null},N=I.MsgContent.MsgGroupNewInfo;if(N.GroupFaceUrl){var R=new bt.Elem.GroupTip.GroupInfo(G.FACE_URL,N.GroupFaceUrl);E.addGroupInfo(R),A=!0,F.GroupFaceUrl=N.GroupFaceUrl}if(N.GroupName){var P=new bt.Elem.GroupTip.GroupInfo(G.NAME,N.GroupName);E.addGroupInfo(P),A=!0,F.GroupName=N.GroupName}if(N.Owner_Account){var b=new bt.Elem.GroupTip.GroupInfo(G.OWNER,N.Owner_Account);E.addGroupInfo(b),A=!0,F.OwnerAccount=N.Owner_Account}if(N.GroupNotification){var L=new bt.Elem.GroupTip.GroupInfo(G.NOTIFICATION,N.GroupNotification);E.addGroupInfo(L),A=!0,F.GroupNotification=N.GroupNotification}if(N.GroupIntroduction){var U=new bt.Elem.GroupTip.GroupInfo(G.INTRODUCTION,N.GroupIntroduction);E.addGroupInfo(U),A=!0,F.GroupIntroduction=N.GroupIntroduction}0==n&&A&&t&&t(F)}else if(O.MODIFY_MEMBER_INFO==C){var w=I.MsgContent.MsgMemberInfo;for(var D in w){var k=w[D];E.addMemberInfo(new bt.Elem.GroupTip.MemberInfo(k.User_Account,k.ShutupTime))}}break;case d.CUSTOM:M=d.CUSTOM,E=new bt.Elem.Custom(I.MsgContent.Data,I.MsgContent.Desc,I.MsgContent.Ext);break;default:M=d.TEXT,E=new bt.Elem.Text("web端暂不支持"+I.MsgType+"消息")}h.elems.push(new bt.Elem(M,E))}return 0==o?h:Lt.addMsg(h,!0)?(h.extraInfo=e.GroupInfo.MsgFrom_AccountExtraInfo,h):null};this.init=function(u,a,l){if(u.onMsgNotify||ce.warn("listeners.onMsgNotify is empty"),e=u.onMsgNotify,u.onBigGroupMsgNotify?c=u.onBigGroupMsgNotify:ce.warn("listeners.onBigGroupMsgNotify is empty"),u.onC2cEventNotifys?E=u.onC2cEventNotifys:ce.warn("listeners.onC2cEventNotifys is empty"),u.onGroupSystemNotifys?n=u.onGroupSystemNotifys:ce.warn("listeners.onGroupSystemNotifys is empty"),u.onGroupInfoChangeNotify?t=u.onGroupInfoChangeNotify:ce.warn("listeners.onGroupInfoChangeNotify is empty"),u.onFriendSystemNotifys?o=u.onFriendSystemNotifys:ce.warn("listeners.onFriendSystemNotifys is empty"),u.onProfileSystemNotifys?i=u.onProfileSystemNotifys:ce.warn("listeners.onProfileSystemNotifys is empty"),u.onKickedEventCall?r=u.onKickedEventCall:ce.warn("listeners.onKickedEventCall is empty"),u.onLongPullingNotify?ie=u.onLongPullingNotify:ce.warn("listeners.onKickedEventCall is empty"),u.onAppliedDownloadUrl?M=u.onAppliedDownloadUrl:ce.warn("listeners.onAppliedDownloadUrl is empty"),W.identifier&&W.userSig)L(function(e){ce.info("initMyGroupMaxSeqs success"),P(function(e){if(ce.info("initIpAndAuthkey success"),a){ce.info("login success(have login state))");var t={ActionStatus:g.OK,ErrorCode:0,ErrorInfo:"login success"};a(t)}Ut.setLongPollingOn(!0),s&&Ut.longPolling(a)},l)},l);else if(a){var p={ActionStatus:g.OK,ErrorCode:0,ErrorInfo:"login success(no login state)"};a(p)}},this.sendMsg=function(e,t,n){Ne(e,function(o){if(e.sess.type()==l.C2C){if(!Lt.addMsg(e)){var i="sendMsg: addMsg failed!",r=ae.getReturnError(i,-17);return ce.error(i),void(n&&n(r))}Lt.updateTimeline()}t&&t(o)},function(e){n&&n(e)})}},wt=new function(){this.fileMd5=null;var e=function(e,t,n){function o(){var t=a*s,n=t+s>=e.size?e.size:t+s,o=r.call(e,t,n);i.readAsArrayBuffer(o)}var i=null;try{i=new FileReader}catch(e){if(n)return void n(ae.getReturnError("当前浏览器不支持FileReader",-18))}var r=File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice;if(!r&&n)return void n(ae.getReturnError("当前浏览器不支持FileAPI",-19));var s=2097152,u=Math.ceil(e.size/s),a=0,c=new SparkMD5;i.onload=function(e){for(var n="",i=new Uint8Array(e.target.result),r=i.byteLength,s=0;sn.total?(r=n.total,n.sliceSize=r-e):n.sliceSize=n.step,n.sliceOffset=e,t=n.blobSlice.call(o,e,r),n.reader.readAsDataURL(t)},abortHandler:function(){var e=i;e.reader&&e.reader.abort()}};e(t.file,function(e){ce.info("fileMd5: "+e),t.fileMd5=e,i.init(t,n,o),i.upload()},o)}};e.SESSION_TYPE=l,e.MSG_MAX_LENGTH=f,e.C2C_MSG_SUB_TYPE=C,e.GROUP_MSG_SUB_TYPE=S,e.MSG_ELEMENT_TYPE=d,e.GROUP_TIP_TYPE=O,e.IMAGE_TYPE=m,e.GROUP_SYSTEM_TYPE=F,e.FRIEND_NOTICE_TYPE=N,e.GROUP_TIP_MODIFY_GROUP_INFO_TYPE=G,e.BROWSER_INFO=r,e.Emotions=e.EmotionPicData=ue,e.EmotionDataIndexs=e.EmotionPicDataIndex=se,e.TLS_ERROR_CODE=P,e.CONNECTION_STATUS=b,e.UPLOAD_PIC_BUSSINESS_TYPE=L,e.RECENT_CONTACT_TYPE=p,e.UPLOAD_RES_TYPE=_,e.Tool=ae,e.Log=ce,e.Msg=bt,e.Session=Nt,e.MsgStore={sessMap:function(){return Lt.sessMap()},sessCount:function(){return Lt.sessCount()},sessByTypeId:function(e,t){return Lt.sessByTypeId(e,t)},delSessByTypeId:function(e,t){return Lt.delSessByTypeId(e,t)},resetCookieAndSyncFlag:function(){return Lt.resetCookieAndSyncFlag()}},e.Resources=re,e.login=e.init=function(e,t,n,o,i){Ft.init(t.onConnNotify,o,i),t.jsonpCallback&&(J=t.jsonpCallback),Se(e,t,n,o,i)},e.logout=e.offline=function(e,t){return Fe("instance",e,t)},e.logoutAll=function(e,t){return Fe("all",e,t)},e.sendMsg=function(e,t,n){return Ut.sendMsg(e,t,n)},e.syncMsgs=function(e,t){return Ut.syncMsgs(e,t)},e.getC2CHistoryMsgs=function(e,t,n){return Ut.getC2CHistoryMsgs(e,t,n)},e.syncGroupMsgs=function(e,t,n){return Ut.syncGroupMsgs(e,t,n)},e.c2CMsgReaded=function(e,t,n){return Lt.c2CMsgReaded(e,t,n)},e.groupMsgReaded=function(e,t,n){return at(e,t,n)},e.setAutoRead=function(e,t,n){return Lt.setAutoRead(e,t,n)},e.createGroup=function(e,t,n){return De(e,t,n)},e.createGroupHigh=function(e,t,n){return ke(e,t,n)},e.applyJoinGroup=function(e,t,n){return Be(e,t,n)},e.handleApplyJoinGroupPendency=function(e,t,n){return Ke(e,t,n)},e.getPendencyGroup=function(e,t,n){return He(e,t,n)},e.getPendencyGroupRead=function(e,t,n){return Ve(e,t,n)},e.handleInviteJoinGroupRequest=function(e,t,n){return Je(e,t,n)},e.deleteApplyJoinGroupPendency=function(e,t,n){return Ue(e,t,n)},e.quitGroup=function(e,t,n){return ze(e,t,n)},e.searchGroupByName=function(e,t,n){return Xe(e,t,n)},e.getGroupPublicInfo=function(e,t,n){return je(e,t,n)},e.getGroupInfo=function(e,t,n){return We(e,t,n)},e.modifyGroupBaseInfo=function(e,t,n){return qe(e,t,n)},e.getGroupMemberInfo=function(e,t,n){return Qe(e,t,n)},e.addGroupMember=function(e,t,n){return Ze(e,t,n)},e.modifyGroupMember=function(e,t,n){return $e(e,t,n)},e.deleteGroupMember=function(e,t,n){return et(e,t,n)},e.destroyGroup=function(e,t,n){return tt(e,t,n)},e.changeGroupOwner=function(e,t,n){return nt(e,t,n)},e.getJoinedGroupListHigh=function(e,t,n){return ot(e,t,n)},e.getRoleInGroup=function(e,t,n){return it(e,t,n)},e.forbidSendMsg=function(e,t,n){return rt(e,t,n)},e.sendCustomGroupNotify=function(e,t,n){return st(e,t,n)},e.applyJoinBigGroup=function(e,t,n){return xe(e,t,n)},e.quitBigGroup=function(e,t,n){return Ye(e,t,n)},e.getProfilePortrait=function(e,t,n){return Et(e,t,n)},e.setProfilePortrait=function(e,t,n){return Mt(e,t,n)},e.applyAddFriend=function(e,t,n){return lt(e,t,n)},e.getPendency=function(e,t,n){return gt(e,t,n)},e.getPendencyReport=function(e,t,n){return dt(e,t,n)},e.deletePendency=function(e,t,n){return mt(e,t,n)},e.responseFriend=function(e,t,n){return ht(e,t,n)},e.getAllFriend=function(e,t,n){return It(e,t,n)},e.deleteChat=function(e,t,n){return ft(e,t,n)},e.deleteFriend=function(e,t,n){return pt(e,t,n)},e.addBlackList=function(e,t,n){return _t(e,t,n)},e.deleteBlackList=function(e,t,n){return yt(e,t,n)},e.getBlackList=function(e,t,n){return Tt(e,t,n)},e.getRecentContactList=function(e,t,n){return Ct(e,t,n)},e.uploadFile=e.uploadPic=function(e,t,n){return wt.uploadFile(e,t,n)},e.submitUploadFileForm=function(e,t,n){return wt.submitUploadFileForm(e,t,n)},e.uploadFileByBase64=e.uploadPicByBase64=function(e,t,n){var o={To_Account:e.toAccount,Busi_Id:e.businessType,File_Type:e.File_Type,File_Str_Md5:e.fileMd5,PkgFlag:I.BASE64_DATA,File_Size:e.totalSize,Slice_Offset:0,Slice_Size:e.totalSize,Slice_Data:e.base64Str,Seq:pe(),Timestamp:le(),Random:fe()};return At(o,t,n)},e.setJsonpLastRspData=function(e){V="string"==typeof e?JSON.parse(e):e},e.getLongPollingId=function(e,t,n){return Ot(0,t,n)},e.applyDownload=function(e,t,n){return Gt(e,t,n)},e.onDownFile=function(e){window.open(re.downloadMap["uuid_"+e])},e.checkLogin=function(e,t){return Ie(e,t)}}(webim);