Files
tk-mini-program/unpackage/dist/build/mp-weixin/common/vendor.js
pengxiaolong c5042d08c3 优化页面
2025-06-09 19:18:38 +08:00

37 lines
1.3 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";
/**
* @vue/shared v3.4.21
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
function e(e,t){const n=new Set(e.split(","));return t?e=>n.has(e.toLowerCase()):e=>n.has(e)}const t={},n=[],o=()=>{},i=()=>!1,s=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),r=e=>e.startsWith("onUpdate:"),a=Object.assign,c=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},u=Object.prototype.hasOwnProperty,l=(e,t)=>u.call(e,t),p=Array.isArray,d=e=>"[object Map]"===I(e),h=e=>"[object Set]"===I(e),g=e=>"function"==typeof e,f=e=>"string"==typeof e,m=e=>"symbol"==typeof e,_=e=>null!==e&&"object"==typeof e,v=e=>(_(e)||g(e))&&g(e.then)&&g(e.catch),y=Object.prototype.toString,I=e=>y.call(e),M=e=>"[object Object]"===I(e),C=e=>f(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,T=e(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),S=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},E=/-(\w)/g,k=S((e=>e.replace(E,((e,t)=>t?t.toUpperCase():"")))),D=/\B([A-Z])/g,L=S((e=>e.replace(D,"-$1").toLowerCase())),R=S((e=>e.charAt(0).toUpperCase()+e.slice(1))),O=S((e=>e?`on${R(e)}`:"")),A=(e,t)=>!Object.is(e,t),b=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},P=e=>{const t=parseFloat(e);return isNaN(t)?e:t},N=e=>{const t=f(e)?Number(e):NaN;return isNaN(t)?e:t};function x(e){if(p(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],i=f(o)?F(o):x(o);if(i)for(const e in i)t[e]=i[e]}return t}if(f(e)||_(e))return e}const w=/;(?![^(]*\))/g,U=/:([^]+)/,G=/\/\*[^]*?\*\//g;function F(e){const t={};return e.replace(G,"").split(w).forEach((e=>{if(e){const n=e.split(U);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function B(e){let t="";if(f(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){const o=B(e[n]);o&&(t+=o+" ")}else if(_(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function q(e){if(!e)return null;let{class:t,style:n}=e;return t&&!f(t)&&(e.class=B(t)),n&&(e.style=x(n)),e}const V=e=>f(e)?e:null==e?"":p(e)||_(e)&&(e.toString===y||!g(e.toString))?JSON.stringify(e,j,2):String(e),j=(e,t)=>t&&t.__v_isRef?j(e,t.value):d(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[H(t,o)+" =>"]=n,e)),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>H(e)))}:m(t)?H(t):!_(t)||p(t)||M(t)?t:String(t),H=(e,t="")=>{var n;return m(e)?`Symbol(${null!=(n=e.description)?n:t})`:e},K="onShow",$="onHide",z="onLaunch",Y="onError",W="onThemeChange",J="onPageNotFound",X="onUnhandledRejection",Z="onLoad",Q="onReady",ee="onUnload",te="onInit",ne="onSaveExitState",oe="onResize",ie="onBackPress",se="onPageScroll",re="onTabItemTap",ae="onReachBottom",ce="onPullDownRefresh",ue="onShareTimeline",le="onShareChat",pe="onAddToFavorites",de="onShareAppMessage",he="onNavigationBarButtonTap",ge="onNavigationBarSearchInputClicked",fe="onNavigationBarSearchInputChanged",me="onNavigationBarSearchInputConfirmed",_e="onNavigationBarSearchInputFocusChanged",ve="virtualHostId";function ye(e,t=null){let n;return(...o)=>(e&&(n=e.apply(t,o),e=null),n)}function Ie(e,t){if(!f(t))return;const n=(t=t.replace(/\[(\d+)\]/g,".$1")).split(".");let o=n[0];return e||(e={}),1===n.length?e[o]:Ie(e[o],n.slice(1).join("."))}function Me(e){let t={};return M(e)&&Object.keys(e).sort().forEach((n=>{const o=n;t[o]=e[o]})),Object.keys(t)?t:e}function Ce(e){return"default"===e?"d":e}const Te=/:/g;const Se=encodeURIComponent;function Ee(e,t=Se){const n=e?Object.keys(e).map((n=>{let o=e[n];return void 0===typeof o||null===o?o="":M(o)&&(o=JSON.stringify(o)),t(n)+"="+t(o)})).filter((e=>e.length>0)).join("&"):null;return n?`?${n}`:""}const ke=[te,Z,K,$,ee,ie,se,re,ae,ce,ue,de,le,pe,ne,he,ge,fe,me,_e];const De=[K,$,z,Y,W,J,X,"onExit",te,Z,Q,ee,oe,ie,se,re,ae,ce,ue,pe,de,le,ne,he,ge,fe,me,_e],Le=(()=>({onPageScroll:1,onShareAppMessage:2,onShareTimeline:4}))();function Re(e,t,n=!0){return!(n&&!g(t))&&(De.indexOf(e)>-1||0===e.indexOf("on"))}let Oe;const Ae=[];const be=ye(((e,t)=>t(e))),Pe=function(){};Pe.prototype={_id:1,on:function(e,t,n){var o=this.e||(this.e={});return(o[e]||(o[e]=[])).push({fn:t,ctx:n,_id:this._id}),this._id++},once:function(e,t,n){var o=this;function i(){o.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),o=0,i=n.length;o<i;o++)n[o].fn.apply(n[o].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),o=n[e],i=[];if(o&&t){for(var s=o.length-1;s>=0;s--)if(o[s].fn===t||o[s].fn._===t||o[s]._id===t){o.splice(s,1);break}i=o}return i.length?n[e]=i:delete n[e],this}};var Ne=Pe;const xe=["{","}"];const we=/^(?:\d)+/,Ue=/^(?:\w)+/;const Ge="zh-Hans",Fe="zh-Hant",Be="en",qe=Object.prototype.hasOwnProperty,Ve=(e,t)=>qe.call(e,t),je=new class{constructor(){this._caches=Object.create(null)}interpolate(e,t,n=xe){if(!t)return[e];let o=this._caches[e];return o||(o=function(e,[t,n]){const o=[];let i=0,s="";for(;i<e.length;){let r=e[i++];if(r===t){s&&o.push({type:"text",value:s}),s="";let t="";for(r=e[i++];void 0!==r&&r!==n;)t+=r,r=e[i++];const a=r===n,c=we.test(t)?"list":a&&Ue.test(t)?"named":"unknown";o.push({value:t,type:c})}else s+=r}return s&&o.push({type:"text",value:s}),o}(e,n),this._caches[e]=o),function(e,t){const n=[];let o=0;const i=Array.isArray(t)?"list":(s=t,null!==s&&"object"==typeof s?"named":"unknown");var s;if("unknown"===i)return n;for(;o<e.length;){const s=e[o];switch(s.type){case"text":n.push(s.value);break;case"list":n.push(t[parseInt(s.value,10)]);break;case"named":"named"===i&&n.push(t[s.value])}o++}return n}(o,t)}};function He(e,t){if(!e)return;if(e=e.trim().replace(/_/g,"-"),t&&t[e])return e;if("chinese"===(e=e.toLowerCase()))return Ge;if(0===e.indexOf("zh"))return e.indexOf("-hans")>-1?Ge:e.indexOf("-hant")>-1?Fe:(n=e,["-tw","-hk","-mo","-cht"].find((e=>-1!==n.indexOf(e)))?Fe:Ge);var n;let o=[Be,"fr","es"];t&&Object.keys(t).length>0&&(o=Object.keys(t));const i=function(e,t){return t.find((t=>0===e.indexOf(t)))}(e,o);return i||void 0}class Ke{constructor({locale:e,fallbackLocale:t,messages:n,watcher:o,formater:i}){this.locale=Be,this.fallbackLocale=Be,this.message={},this.messages={},this.watchers=[],t&&(this.fallbackLocale=t),this.formater=i||je,this.messages=n||{},this.setLocale(e||Be),o&&this.watchLocale(o)}setLocale(e){const t=this.locale;this.locale=He(e,this.messages)||this.fallbackLocale,this.messages[this.locale]||(this.messages[this.locale]={}),this.message=this.messages[this.locale],t!==this.locale&&this.watchers.forEach((e=>{e(this.locale,t)}))}getLocale(){return this.locale}watchLocale(e){const t=this.watchers.push(e)-1;return()=>{this.watchers.splice(t,1)}}add(e,t,n=!0){const o=this.messages[e];o?n?Object.assign(o,t):Object.keys(t).forEach((e=>{Ve(o,e)||(o[e]=t[e])})):this.messages[e]=t}f(e,t,n){return this.formater.interpolate(e,t,n).join("")}t(e,t,n){let o=this.message;return"string"==typeof t?(t=He(t,this.messages))&&(o=this.messages[t]):n=t,Ve(o,e)?this.formater.interpolate(o[e],n).join(""):(console.warn(`Cannot translate the value of keypath ${e}. Use the value of keypath as default.`),e)}}function $e(e){return function(){try{return e.apply(e,arguments)}catch(yl){console.error(yl)}}}let ze=1;const Ye={};function We(e,t,n){if("number"==typeof e){const o=Ye[e];if(o)return o.keepAlive||delete Ye[e],o.callback(t,n)}return t}const Je="success",Xe="fail",Ze="complete";function Qe(e,t={},{beforeAll:n,beforeSuccess:o}={}){M(t)||(t={});const{success:i,fail:s,complete:r}=function(e){const t={};for(const n in e){const o=e[n];g(o)&&(t[n]=$e(o),delete e[n])}return t}(t),a=g(i),c=g(s),u=g(r),l=ze++;return function(e,t,n,o=!1){Ye[e]={name:t,keepAlive:o,callback:n}}(l,e,(l=>{(l=l||{}).errMsg=function(e,t){return e&&-1!==e.indexOf(":fail")?t+e.substring(e.indexOf(":fail")):t+":ok"}(l.errMsg,e),g(n)&&n(l),l.errMsg===e+":ok"?(g(o)&&o(l,t),a&&i(l)):c&&s(l),u&&r(l)})),l}const et="success",nt="fail",ot="complete",it={},st={};function rt(e,t){return function(n){return e(n,t)||n}}function at(e,t,n){let o=!1;for(let i=0;i<e.length;i++){const s=e[i];if(o)o=Promise.resolve(rt(s,n));else{const e=s(t,n);if(v(e)&&(o=Promise.resolve(e)),!1===e)return{then(){},catch(){}}}}return o||{then:e=>e(t),catch(){}}}function ct(e,t={}){return[et,nt,ot].forEach((n=>{const o=e[n];if(!p(o))return;const i=t[n];t[n]=function(e){at(o,e,t).then((e=>g(i)&&i(e)||e))}})),t}function ut(e,t){const n=[];p(it.returnValue)&&n.push(...it.returnValue);const o=st[e];return o&&p(o.returnValue)&&n.push(...o.returnValue),n.forEach((e=>{t=e(t)||t})),t}function lt(e){const t=Object.create(null);Object.keys(it).forEach((e=>{"returnValue"!==e&&(t[e]=it[e].slice())}));const n=st[e];return n&&Object.keys(n).forEach((e=>{"returnValue"!==e&&(t[e]=(t[e]||[]).concat(n[e]))})),t}function pt(e,t,n,o){const i=lt(e);if(i&&Object.keys(i).length){if(p(i.invoke)){return at(i.invoke,n).then((n=>t(ct(lt(e),n),...o)))}return t(ct(i,n),...o)}return t(n,...o)}function dt(e,t){return(n={},...o)=>function(e){return!(!M(e)||![Je,Xe,Ze].find((t=>g(e[t]))))}(n)?ut(e,pt(e,t,n,o)):ut(e,new Promise(((i,s)=>{pt(e,t,a(n,{success:i,fail:s}),o)})))}function ht(e,t,n,o={}){const i=t+":fail";let s="";return s=n?0===n.indexOf(i)?n:i+" "+n:i,delete o.errCode,We(e,a({errMsg:s},o))}function gt(e,t,n,o){const i=function(e){e[0]}(t);if(i)return i}function ft(e,t,n,o){return n=>{const i=Qe(e,n,o),s=gt(0,[n]);return s?ht(i,e,s):t(n,{resolve:t=>function(e,t,n){return We(e,a(n||{},{errMsg:t+":ok"}))}(i,e,t),reject:(t,n)=>ht(i,e,function(e){return!e||f(e)?e:e.stack?("undefined"!=typeof globalThis&&globalThis.harmonyChannel||console.error(e.message+"\n"+e.stack),e.message):e}(t),n)})}}function mt(e,t,n,o){return function(e,t){return(...e)=>{const n=gt(0,e);if(n)throw new Error(n);return t.apply(null,e)}}(0,t)}let _t=!1,vt=0,yt=0;const It=mt(0,((e,t)=>{if(0===vt&&function(){var e,t;let n,o,i;{const s=(null===(e=wx.getWindowInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync(),r=(null===(t=wx.getDeviceInfo)||void 0===t?void 0:t.call(wx))||wx.getSystemInfoSync();n=s.windowWidth,o=s.pixelRatio,i=r.platform}vt=n,yt=o,_t="ios"===i}(),0===(e=Number(e)))return 0;let n=e/750*(t||vt);return n<0&&(n=-n),n=Math.floor(n+1e-4),0===n&&(n=1!==yt&&_t?.5:1),e<0?-n:n}));function Mt(e,t){Object.keys(t).forEach((n=>{g(t[n])&&(e[n]=function(e,t){const n=t?e?e.concat(t):p(t)?t:[t]:e;return n?function(e){const t=[];for(let n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}(e[n],t[n]))}))}function Ct(e,t){e&&t&&Object.keys(t).forEach((n=>{const o=e[n],i=t[n];p(o)&&g(i)&&c(o,i)}))}const Tt=mt(0,((e,t)=>{f(e)&&M(t)?Mt(st[e]||(st[e]={}),t):M(e)&&Mt(it,e)})),St=mt(0,((e,t)=>{f(e)?M(t)?Ct(st[e],t):delete st[e]:M(e)&&Ct(it,e)}));const Et=new class{constructor(){this.$emitter=new Ne}on(e,t){return this.$emitter.on(e,t)}once(e,t){return this.$emitter.once(e,t)}off(e,t){e?this.$emitter.off(e,t):this.$emitter.e={}}emit(e,...t){this.$emitter.emit(e,...t)}},kt=mt(0,((e,t)=>(Et.on(e,t),()=>Et.off(e,t)))),Dt=mt(0,((e,t)=>(Et.once(e,t),()=>Et.off(e,t)))),Lt=mt(0,((e,t)=>{p(e)||(e=e?[e]:[]),e.forEach((e=>{Et.off(e,t)}))})),Rt=mt(0,((e,...t)=>{Et.emit(e,...t)}));let Ot,At,bt;function Pt(e){try{return JSON.parse(e)}catch(yl){}return e}const Nt=[];function xt(e,t){Nt.forEach((n=>{n(e,t)})),Nt.length=0}const wt=dt(Ut="getPushClientId",function(e,t,n,o){return ft(e,t,0,o)}(Ut,((e,{resolve:t,reject:n})=>{Promise.resolve().then((()=>{void 0===bt&&(bt=!1,Ot="",At="uniPush is not enabled"),Nt.push(((e,o)=>{e?t({cid:e}):n(o)})),void 0!==Ot&&xt(Ot,At)}))}),0,Gt));var Ut,Gt;const Ft=[],Bt=/^\$|__f__|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|rpx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/,qt=/^create|Manager$/,Vt=["createBLEConnection"],jt=["request","downloadFile","uploadFile","connectSocket"],Ht=["createBLEConnection"],Kt=/^on|^off/;function $t(e){return qt.test(e)&&-1===Vt.indexOf(e)}function zt(e){return Bt.test(e)&&-1===Ht.indexOf(e)}function Yt(e){return-1!==jt.indexOf(e)}function Wt(e){return!($t(e)||zt(e)||function(e){return Kt.test(e)&&"onPush"!==e}(e))}function Jt(e,t){return Wt(e)&&g(t)?function(n={},...o){return g(n.success)||g(n.fail)||g(n.complete)?ut(e,pt(e,t,n,o)):ut(e,new Promise(((i,s)=>{pt(e,t,a({},n,{success:i,fail:s}),o)})))}:t}Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((n=>t.resolve(e&&e()).then((()=>n))),(n=>t.resolve(e&&e()).then((()=>{throw n}))))});const Xt=["success","fail","cancel","complete"];const Zt=()=>{const e=g(getApp)&&getApp({allowDefault:!0});return e&&e.$vm?e.$vm.$locale:function(){var e;let t="";{const n=(null===(e=wx.getAppBaseInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync();t=He(n&&n.language?n.language:Be)||Be}return t}()},Qt=[];"undefined"!=typeof global&&(global.getLocale=Zt);const en="__DC_STAT_UUID";let tn;function nn(e=wx){return function(t,n){tn=tn||e.getStorageSync(en),tn||(tn=Date.now()+""+Math.floor(1e7*Math.random()),wx.setStorage({key:en,data:tn})),n.deviceId=tn}}function on(e,t){if(e.safeArea){const n=e.safeArea;t.safeAreaInsets={top:n.top,left:n.left,right:e.windowWidth-n.right,bottom:e.screenHeight-n.bottom}}}function sn(e,t){let n="",o="";switch(n=e.split(" ")[0]||t,o=e.split(" ")[1]||"",n=n.toLocaleLowerCase(),n){case"harmony":case"ohos":case"openharmony":n="harmonyos";break;case"iphone os":n="ios";break;case"mac":case"darwin":n="macos";break;case"windows_nt":n="windows"}return{osName:n,osVersion:o}}function rn(e,t){let n=e.deviceType||"phone";{const e={ipad:"pad",windows:"pc",mac:"pc"},o=Object.keys(e),i=t.toLocaleLowerCase();for(let t=0;t<o.length;t++){const s=o[t];if(-1!==i.indexOf(s)){n=e[s];break}}}return n}function an(e){let t=e;return t&&(t=t.toLocaleLowerCase()),t}function cn(e){return Zt?Zt():e}function un(e){let t=e.hostName||"WeChat";return e.environment?t=e.environment:e.host&&e.host.env&&(t=e.host.env),t}const ln={returnValue:(e,t)=>{on(e,t),nn()(e,t),function(e,t){const{brand:n="",model:o="",system:i="",language:s="",theme:r,version:c,platform:u,fontSizeSetting:l,SDKVersion:p,pixelRatio:d,deviceOrientation:h}=e,{osName:g,osVersion:f}=sn(i,u);let m=c,_=rn(e,o),v=an(n),y=un(e),I=h,M=d,C=p;const T=(s||"").replace(/_/g,"-"),S={appId:"__UNI__A6CDB98",appName:"tk-mini-program",appVersion:"1.0.0",appVersionCode:"100",appLanguage:cn(T),uniCompileVersion:"4.66",uniCompilerVersion:"4.66",uniRuntimeVersion:"4.66",uniPlatform:"mp-weixin",deviceBrand:v,deviceModel:o,deviceType:_,devicePixelRatio:M,deviceOrientation:I,osName:g,osVersion:f,hostTheme:r,hostVersion:m,hostLanguage:T,hostName:y,hostSDKVersion:C,hostFontSizeSetting:l,windowTop:0,windowBottom:0,osLanguage:void 0,osTheme:void 0,ua:void 0,hostPackageName:void 0,browserName:void 0,browserVersion:void 0,isUniAppX:!1};a(t,S)}(e,t)}},pn=ln,dn={args(e,t){let n=parseInt(e.current);if(isNaN(n))return;const o=e.urls;if(!p(o))return;const i=o.length;return i?(n<0?n=0:n>=i&&(n=i-1),n>0?(t.current=o[n],t.urls=o.filter(((e,t)=>!(t<n)||e!==o[n]))):t.current=o[0],{indicator:!1,loop:!1}):void 0}},hn={args(e,t){t.alertText=e.title}},gn={returnValue:(e,t)=>{const{brand:n,model:o,system:i="",platform:s=""}=e;let r=rn(e,o),c=an(n);nn()(e,t);const{osName:u,osVersion:l}=sn(i,s);t=Me(a(t,{deviceType:r,deviceBrand:c,deviceModel:o,osName:u,osVersion:l}))}},fn={returnValue:(e,t)=>{const{version:n,language:o,SDKVersion:i,theme:s}=e;let r=un(e),c=(o||"").replace(/_/g,"-");const u={hostVersion:n,hostLanguage:c,hostName:r,hostSDKVersion:i,hostTheme:s,appId:"__UNI__A6CDB98",appName:"tk-mini-program",appVersion:"1.0.0",appVersionCode:"100",appLanguage:cn(c),isUniAppX:!1,uniPlatform:"mp-weixin",uniCompileVersion:"4.66",uniCompilerVersion:"4.66",uniRuntimeVersion:"4.66"};a(t,u)}},mn={returnValue:(e,t)=>{on(e,t),t=Me(a(t,{windowTop:0,windowBottom:0}))}},_n={args(e){const t=getApp({allowDefault:!0})||{};t.$vm?qs(Y,e,t.$vm.$):(wx.$onErrorHandlers||(wx.$onErrorHandlers=[]),wx.$onErrorHandlers.push(e))}},vn={args(e){const t=getApp({allowDefault:!0})||{};if(t.$vm){if(e.__weh){const n=t.$vm.$[Y];if(n){const t=n.indexOf(e.__weh);t>-1&&n.splice(t,1)}}}else{if(!wx.$onErrorHandlers)return;const t=wx.$onErrorHandlers.findIndex((t=>t===e));-1!==t&&wx.$onErrorHandlers.splice(t,1)}}},yn={args(){if(wx.__uni_console__){if(wx.__uni_console_warned__)return;wx.__uni_console_warned__=!0,console.warn("开发模式下小程序日志回显会使用 socket 连接,为了避免冲突,建议使用 SocketTask 的方式去管理 WebSocket 或手动关闭日志回显功能。[详情](https://uniapp.dcloud.net.cn/tutorial/run/mp-log.html)")}}},In=yn,Mn={$on:kt,$off:Lt,$once:Dt,$emit:Rt,upx2px:It,rpx2px:It,interceptors:{},addInterceptor:Tt,removeInterceptor:St,onCreateVueApp:function(e){if(Oe)return e(Oe);Ae.push(e)},invokeCreateVueAppHook:function(e){Oe=e,Ae.forEach((t=>t(e)))},getLocale:Zt,setLocale:e=>{const t=g(getApp)&&getApp();if(!t)return!1;return t.$vm.$locale!==e&&(t.$vm.$locale=e,Qt.forEach((t=>t({locale:e}))),!0)},onLocaleChange:e=>{-1===Qt.indexOf(e)&&Qt.push(e)},getPushClientId:wt,onPushMessage:e=>{-1===Ft.indexOf(e)&&Ft.push(e)},offPushMessage:e=>{if(e){const t=Ft.indexOf(e);t>-1&&Ft.splice(t,1)}else Ft.length=0},invokePushCallback:function(e){if("enabled"===e.type)bt=!0;else if("clientId"===e.type)Ot=e.cid,At=e.errMsg,xt(Ot,e.errMsg);else if("pushMsg"===e.type){const t={type:"receive",data:Pt(e.message)};for(let e=0;e<Ft.length;e++){if((0,Ft[e])(t),t.stopped)break}}else"click"===e.type&&Ft.forEach((t=>{t({type:"click",data:Pt(e.message)})}))},__f__:function(e,t,...n){t&&n.push(t),console[e].apply(console,n)}};const Cn=["qy","env","error","version","lanDebug","cloud","serviceMarket","router","worklet","__webpack_require_UNI_MP_PLUGIN__"],Tn=["lanDebug","router","worklet"],Sn=wx.getLaunchOptionsSync?wx.getLaunchOptionsSync():null;function En(e){return(!Sn||1154!==Sn.scene||!Tn.includes(e))&&(Cn.indexOf(e)>-1||"function"==typeof wx[e])}function kn(){const e={};for(const t in wx)En(t)&&(e[t]=wx[t]);return"undefined"!=typeof globalThis&&"undefined"==typeof requireMiniProgram&&(globalThis.wx=e),e}const Dn=["__route__","__wxExparserNodeId__","__wxWebviewId__"],Ln=(Rn={oauth:["weixin"],share:["weixin"],payment:["wxpay"],push:["weixin"]},function({service:e,success:t,fail:n,complete:o}){let i;Rn[e]?(i={errMsg:"getProvider:ok",service:e,provider:Rn[e]},g(t)&&t(i)):(i={errMsg:"getProvider:fail:服务["+e+"]不存在"},g(n)&&n(i)),g(o)&&o(i)});var Rn;const On=kn();On.canIUse("getAppBaseInfo")||(On.getAppBaseInfo=On.getSystemInfoSync),On.canIUse("getWindowInfo")||(On.getWindowInfo=On.getSystemInfoSync),On.canIUse("getDeviceInfo")||(On.getDeviceInfo=On.getSystemInfoSync);let An=On.getAppBaseInfo&&On.getAppBaseInfo();An||(An=On.getSystemInfoSync());const bn=An?An.host:null,Pn=bn&&"SAAASDK"===bn.env?On.miniapp.shareVideoMessage:On.shareVideoMessage;var Nn=Object.freeze({__proto__:null,createSelectorQuery:function(){const e=On.createSelectorQuery(),t=e.in;return e.in=function(e){return e.$scope?t.call(this,e.$scope):t.call(this,function(e){const t=Object.create(null);return Dn.forEach((n=>{t[n]=e[n]})),t}(e))},e},getProvider:Ln,shareVideoMessage:Pn});const xn={args(e,t){e.compressedHeight&&!t.compressHeight&&(t.compressHeight=e.compressedHeight),e.compressedWidth&&!t.compressWidth&&(t.compressWidth=e.compressedWidth)}};var wn=Object.freeze({__proto__:null,compressImage:xn,getAppAuthorizeSetting:{returnValue:function(e,t){const{locationReducedAccuracy:n}=e;t.locationAccuracy="unsupported",!0===n?t.locationAccuracy="reduced":!1===n&&(t.locationAccuracy="full")}},getAppBaseInfo:fn,getDeviceInfo:gn,getSystemInfo:ln,getSystemInfoSync:pn,getWindowInfo:mn,offError:vn,onError:_n,onSocketMessage:In,onSocketOpen:yn,previewImage:dn,redirectTo:{},showActionSheet:hn});const Un=kn();var Gn=function(e,t,n=wx){const o=function(e){function t(e,t,n){return function(i){return t(o(e,i,n))}}function n(e,n,o={},i={},s=!1){if(M(n)){const r=!0===s?n:{};g(o)&&(o=o(n,r)||{});for(const a in n)if(l(o,a)){let t=o[a];g(t)&&(t=t(n[a],n,r)),t?f(t)?r[t]=n[a]:M(t)&&(r[t.name?t.name:a]=t.value):console.warn(`微信小程序 ${e} 暂不支持 ${a}`)}else if(-1!==Xt.indexOf(a)){const o=n[a];g(o)&&(r[a]=t(e,o,i))}else s||l(r,a)||(r[a]=n[a]);return r}return g(n)&&(g(o)&&o(n,{}),n=t(e,n,i)),n}function o(t,o,i,s=!1){return g(e.returnValue)&&(o=e.returnValue(t,o)),n(t,o,i,{},s||!1)}return function(t,i){const s=l(e,t);if(!s&&"function"!=typeof wx[t])return i;const r=s||g(e.returnValue)||$t(t)||Yt(t),a=s||g(i);if(!s&&!i)return function(){console.error(`微信小程序 暂不支持${t}`)};if(!r||!a)return i;const c=e[t];return function(e,i){let s=c||{};g(c)&&(s=c(e));const r=[e=n(t,e,s.args,s.returnValue)];void 0!==i&&r.push(i);const a=wx[s.name||t].apply(wx,r);return($t(t)||Yt(t))&&a&&!a.__v_skip&&(a.__v_skip=!0),zt(t)?o(t,a,s.returnValue,$t(t)):a}}}(t);return new Proxy({},{get:(t,i)=>l(t,i)?t[i]:l(e,i)?Jt(i,e[i]):l(Mn,i)?Jt(i,Mn[i]):Jt(i,o(i,n[i]))})}(Nn,wn,Un);let Fn,Bn,qn=class{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Fn,!e&&Fn&&(this.index=(Fn.scopes||(Fn.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=Fn;try{return Fn=this,e()}finally{Fn=t}}}on(){Fn=this}off(){Fn=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0,this._active=!1}}};function Vn(e){return new qn(e)}function jn(e,t=Fn){t&&t.active&&t.effects.push(e)}function Hn(){return Fn}function Kn(e){Fn&&Fn.cleanups.push(e)}class $n{constructor(e,t,n,o){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,jn(this,o)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,to();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(t.computed.value,this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),no()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Zn,t=Bn;try{return Zn=!0,Bn=this,this._runnings++,zn(this),this.fn()}finally{Yn(this),this._runnings--,Bn=t,Zn=e}}stop(){var e;this.active&&(zn(this),Yn(this),null==(e=this.onStop)||e.call(this),this.active=!1)}}function zn(e){e._trackId++,e._depsLength=0}function Yn(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)Wn(e.deps[t],e);e.deps.length=e._depsLength}}function Wn(e,t){const n=e.get(t);void 0!==n&&t._trackId!==n&&(e.delete(t),0===e.size&&e.cleanup())}function Jn(e,t){e.effect instanceof $n&&(e=e.effect.fn);const n=new $n(e,o,(()=>{n.dirty&&n.run()}));t&&(a(n,t),t.scope&&jn(n,t.scope)),t&&t.lazy||n.run();const i=n.run.bind(n);return i.effect=n,i}function Xn(e){e.effect.stop()}let Zn=!0,Qn=0;const eo=[];function to(){eo.push(Zn),Zn=!1}function no(){const e=eo.pop();Zn=void 0===e||e}function oo(){Qn++}function io(){for(Qn--;!Qn&&ro.length;)ro.shift()()}function so(e,t,n){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&Wn(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const ro=[];function ao(e,t,n){oo();for(const o of e.keys()){let n;o._dirtyLevel<t&&(null!=n?n:n=e.get(o)===o._trackId)&&(o._shouldSchedule||(o._shouldSchedule=0===o._dirtyLevel),o._dirtyLevel=t),o._shouldSchedule&&(null!=n?n:n=e.get(o)===o._trackId)&&(o.trigger(),o._runnings&&!o.allowRecurse||2===o._dirtyLevel||(o._shouldSchedule=!1,o.scheduler&&ro.push(o.scheduler)))}io()}const co=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},uo=new WeakMap,lo=Symbol(""),po=Symbol("");function ho(e,t,n){if(Zn&&Bn){let t=uo.get(e);t||uo.set(e,t=new Map);let o=t.get(n);o||t.set(n,o=co((()=>t.delete(n)))),so(Bn,o)}}function go(e,t,n,o,i,s){const r=uo.get(e);if(!r)return;let a=[];if("clear"===t)a=[...r.values()];else if("length"===n&&p(e)){const e=Number(o);r.forEach(((t,n)=>{("length"===n||!m(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(r.get(n)),t){case"add":p(e)?C(n)&&a.push(r.get("length")):(a.push(r.get(lo)),d(e)&&a.push(r.get(po)));break;case"delete":p(e)||(a.push(r.get(lo)),d(e)&&a.push(r.get(po)));break;case"set":d(e)&&a.push(r.get(lo))}oo();for(const c of a)c&&ao(c,4);io()}const fo=e("__proto__,__v_isRef,__isVue"),mo=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(m)),_o=vo();function vo(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=ui(this);for(let t=0,i=this.length;t<i;t++)ho(n,0,t+"");const o=n[t](...e);return-1===o||!1===o?n[t](...e.map(ui)):o}})),["push","pop","shift","unshift","splice"].forEach((t=>{e[t]=function(...e){to(),oo();const n=ui(this)[t].apply(this,e);return io(),no(),n}})),e}function yo(e){const t=ui(this);return ho(t,0,e),t.hasOwnProperty(e)}class Io{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const o=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(o?i?Zo:Xo:i?Jo:Wo).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const s=p(e);if(!o){if(s&&l(_o,t))return Reflect.get(_o,t,n);if("hasOwnProperty"===t)return yo}const r=Reflect.get(e,t,n);return(m(t)?mo.has(t):fo(t))?r:(o||ho(e,0,t),i?r:mi(r)?s&&C(t)?r:r.value:_(r)?o?ni(r):ei(r):r)}}class Mo extends Io{constructor(e=!1){super(!1,e)}set(e,t,n,o){let i=e[t];if(!this._isShallow){const t=ri(i);if(ai(n)||ri(n)||(i=ui(i),n=ui(n)),!p(e)&&mi(i)&&!mi(n))return!t&&(i.value=n,!0)}const s=p(e)&&C(t)?Number(t)<e.length:l(e,t),r=Reflect.set(e,t,n,o);return e===ui(o)&&(s?A(n,i)&&go(e,"set",t,n):go(e,"add",t,n)),r}deleteProperty(e,t){const n=l(e,t);e[t];const o=Reflect.deleteProperty(e,t);return o&&n&&go(e,"delete",t,void 0),o}has(e,t){const n=Reflect.has(e,t);return m(t)&&mo.has(t)||ho(e,0,t),n}ownKeys(e){return ho(e,0,p(e)?"length":lo),Reflect.ownKeys(e)}}class Co extends Io{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const To=new Mo,So=new Co,Eo=new Mo(!0),ko=new Co(!0),Do=e=>e,Lo=e=>Reflect.getPrototypeOf(e);function Ro(e,t,n=!1,o=!1){const i=ui(e=e.__v_raw),s=ui(t);n||(A(t,s)&&ho(i,0,t),ho(i,0,s));const{has:r}=Lo(i),a=o?Do:n?di:pi;return r.call(i,t)?a(e.get(t)):r.call(i,s)?a(e.get(s)):void(e!==i&&e.get(t))}function Oo(e,t=!1){const n=this.__v_raw,o=ui(n),i=ui(e);return t||(A(e,i)&&ho(o,0,e),ho(o,0,i)),e===i?n.has(e):n.has(e)||n.has(i)}function Ao(e,t=!1){return e=e.__v_raw,!t&&ho(ui(e),0,lo),Reflect.get(e,"size",e)}function bo(e){e=ui(e);const t=ui(this);return Lo(t).has.call(t,e)||(t.add(e),go(t,"add",e,e)),this}function Po(e,t){t=ui(t);const n=ui(this),{has:o,get:i}=Lo(n);let s=o.call(n,e);s||(e=ui(e),s=o.call(n,e));const r=i.call(n,e);return n.set(e,t),s?A(t,r)&&go(n,"set",e,t):go(n,"add",e,t),this}function No(e){const t=ui(this),{has:n,get:o}=Lo(t);let i=n.call(t,e);i||(e=ui(e),i=n.call(t,e)),o&&o.call(t,e);const s=t.delete(e);return i&&go(t,"delete",e,void 0),s}function xo(){const e=ui(this),t=0!==e.size,n=e.clear();return t&&go(e,"clear",void 0,void 0),n}function wo(e,t){return function(n,o){const i=this,s=i.__v_raw,r=ui(s),a=t?Do:e?di:pi;return!e&&ho(r,0,lo),s.forEach(((e,t)=>n.call(o,a(e),a(t),i)))}}function Uo(e,t,n){return function(...o){const i=this.__v_raw,s=ui(i),r=d(s),a="entries"===e||e===Symbol.iterator&&r,c="keys"===e&&r,u=i[e](...o),l=n?Do:t?di:pi;return!t&&ho(s,0,c?po:lo),{next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:a?[l(e[0]),l(e[1])]:l(e),done:t}},[Symbol.iterator](){return this}}}}function Go(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Fo(){const e={get(e){return Ro(this,e)},get size(){return Ao(this)},has:Oo,add:bo,set:Po,delete:No,clear:xo,forEach:wo(!1,!1)},t={get(e){return Ro(this,e,!1,!0)},get size(){return Ao(this)},has:Oo,add:bo,set:Po,delete:No,clear:xo,forEach:wo(!1,!0)},n={get(e){return Ro(this,e,!0)},get size(){return Ao(this,!0)},has(e){return Oo.call(this,e,!0)},add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear"),forEach:wo(!0,!1)},o={get(e){return Ro(this,e,!0,!0)},get size(){return Ao(this,!0)},has(e){return Oo.call(this,e,!0)},add:Go("add"),set:Go("set"),delete:Go("delete"),clear:Go("clear"),forEach:wo(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((i=>{e[i]=Uo(i,!1,!1),n[i]=Uo(i,!0,!1),t[i]=Uo(i,!1,!0),o[i]=Uo(i,!0,!0)})),[e,n,t,o]}const[Bo,qo,Vo,jo]=Fo();function Ho(e,t){const n=t?e?jo:Vo:e?qo:Bo;return(t,o,i)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(l(n,o)&&o in t?n:t,o,i)}const Ko={get:Ho(!1,!1)},$o={get:Ho(!1,!0)},zo={get:Ho(!0,!1)},Yo={get:Ho(!0,!0)},Wo=new WeakMap,Jo=new WeakMap,Xo=new WeakMap,Zo=new WeakMap;function Qo(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>I(e).slice(8,-1))(e))}function ei(e){return ri(e)?e:ii(e,!1,To,Ko,Wo)}function ti(e){return ii(e,!1,Eo,$o,Jo)}function ni(e){return ii(e,!0,So,zo,Xo)}function oi(e){return ii(e,!0,ko,Yo,Zo)}function ii(e,t,n,o,i){if(!_(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const s=i.get(e);if(s)return s;const r=Qo(e);if(0===r)return e;const a=new Proxy(e,2===r?o:n);return i.set(e,a),a}function si(e){return ri(e)?si(e.__v_raw):!(!e||!e.__v_isReactive)}function ri(e){return!(!e||!e.__v_isReadonly)}function ai(e){return!(!e||!e.__v_isShallow)}function ci(e){return si(e)||ri(e)}function ui(e){const t=e&&e.__v_raw;return t?ui(t):e}function li(e){return Object.isExtensible(e)&&((e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})})(e,"__v_skip",!0),e}const pi=e=>_(e)?ei(e):e,di=e=>_(e)?ni(e):e;class hi{constructor(e,t,n,o){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new $n((()=>e(this._value)),(()=>fi(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=ui(this);return e._cacheable&&!e.effect.dirty||!A(e._value,e._value=e.effect.run())||fi(e,4),gi(e),e.effect._dirtyLevel>=2&&fi(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function gi(e){var t;Zn&&Bn&&(e=ui(e),so(Bn,null!=(t=e.dep)?t:e.dep=co((()=>e.dep=void 0),e instanceof hi?e:void 0)))}function fi(e,t=4,n){const o=(e=ui(e)).dep;o&&ao(o,t)}function mi(e){return!(!e||!0!==e.__v_isRef)}function _i(e){return yi(e,!1)}function vi(e){return yi(e,!0)}function yi(e,t){return mi(e)?e:new Ii(e,t)}let Ii=class{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:ui(e),this._value=t?e:pi(e)}get value(){return gi(this),this._value}set value(e){const t=this.__v_isShallow||ai(e)||ri(e);e=t?e:ui(e),A(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:pi(e),fi(this,4))}};function Mi(e){fi(e,4)}function Ci(e){return mi(e)?e.value:e}function Ti(e){return g(e)?e():Ci(e)}const Si={get:(e,t,n)=>Ci(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const i=e[t];return mi(i)&&!mi(n)?(i.value=n,!0):Reflect.set(e,t,n,o)}};function Ei(e){return si(e)?e:new Proxy(e,Si)}class ki{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:t,set:n}=e((()=>gi(this)),(()=>fi(this)));this._get=t,this._set=n}get value(){return this._get()}set value(e){this._set(e)}}function Di(e){return new ki(e)}function Li(e){const t=p(e)?new Array(e.length):{};for(const n in e)t[n]=bi(e,n);return t}class Ri{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=ui(this._object),t=this._key,null==(n=uo.get(e))?void 0:n.get(t);var e,t,n}}class Oi{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Ai(e,t,n){return mi(e)?e:g(e)?new Oi(e):_(e)&&arguments.length>1?bi(e,t,n):_i(e)}function bi(e,t,n){const o=e[t];return mi(o)?o:new Ri(e,t,n)}function Pi(e,t,n,o){try{return o?e(...o):e()}catch(i){xi(i,t,n)}}function Ni(e,t,n,o){if(g(e)){const i=Pi(e,t,n,o);return i&&v(i)&&i.catch((e=>{xi(e,t,n)})),i}const i=[];for(let s=0;s<e.length;s++)i.push(Ni(e[s],t,n,o));return i}function xi(e,t,n,o=!0){const i=t?t.vnode:null;if(t){let o=t.parent;const i=t.proxy,s=`https://vuejs.org/error-reference/#runtime-${n}`;for(;o;){const t=o.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,i,s))return;o=o.parent}const r=t.appContext.config.errorHandler;if(r)return void Pi(r,null,10,[e,i,s])}wi(e,n,i,o)}function wi(e,t,n,o=!0){console.error(e)}let Ui=!1,Gi=!1;const Fi=[];let Bi=0;const qi=[];let Vi=null,ji=0;const Hi=Promise.resolve();let Ki=null;function $i(e){const t=Ki||Hi;return e?t.then(this?e.bind(this):e):t}function zi(e){Fi.length&&Fi.includes(e,Ui&&e.allowRecurse?Bi+1:Bi)||(null==e.id?Fi.push(e):Fi.splice(function(e){let t=Bi+1,n=Fi.length;for(;t<n;){const o=t+n>>>1,i=Fi[o],s=Qi(i);s<e||s===e&&i.pre?t=o+1:n=o}return t}(e.id),0,e),Yi())}function Yi(){Ui||Gi||(Gi=!0,Ki=Hi.then(ts))}function Wi(e){return Fi.indexOf(e)>-1}function Ji(e){const t=Fi.indexOf(e);t>Bi&&Fi.splice(t,1)}function Xi(e){p(e)?qi.push(...e):Vi&&Vi.includes(e,e.allowRecurse?ji+1:ji)||qi.push(e),Yi()}function Zi(e,t,n=(Ui?Bi+1:0)){for(;n<Fi.length;n++){const e=Fi[n];e&&e.pre&&(Fi.splice(n,1),n--,e())}}const Qi=e=>null==e.id?1/0:e.id,es=(e,t)=>{const n=Qi(e)-Qi(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function ts(e){Gi=!1,Ui=!0,Fi.sort(es);try{for(Bi=0;Bi<Fi.length;Bi++){const e=Fi[Bi];e&&!1!==e.active&&Pi(e,null,14)}}finally{Bi=0,Fi.length=0,function(){if(qi.length){const e=[...new Set(qi)].sort(((e,t)=>Qi(e)-Qi(t)));if(qi.length=0,Vi)return void Vi.push(...e);for(Vi=e,ji=0;ji<Vi.length;ji++)Vi[ji]();Vi=null,ji=0}}(),Ui=!1,Ki=null,(Fi.length||qi.length)&&ts()}}const ns=ss("component:added"),os=ss("component:updated"),is=e=>{};
/*! #__NO_SIDE_EFFECTS__ */
function ss(e){return e=>{e.appContext.app,e.uid,0===e.uid||e.parent&&e.parent.uid}}function rs(e,n,...o){if(e.isUnmounted)return;const i=e.vnode.props||t;let s=o;const r=n.startsWith("update:"),a=r&&n.slice(7);if(a&&a in i){const e=`${"modelValue"===a?"model":a}Modifiers`,{number:n,trim:r}=i[e]||t;r&&(s=o.map((e=>f(e)?e.trim():e))),n&&(s=o.map(P))}let c,u=i[c=O(n)]||i[c=O(k(n))];!u&&r&&(u=i[c=O(L(n))]),u&&Ni(u,e,6,s);const l=i[c+"Once"];if(l){if(e.emitted){if(e.emitted[c])return}else e.emitted={};e.emitted[c]=!0,Ni(l,e,6,s)}}function as(e,t,n=!1){const o=t.emitsCache,i=o.get(e);if(void 0!==i)return i;const s=e.emits;let r={},c=!1;if(!g(e)){const o=e=>{const n=as(e,t,!0);n&&(c=!0,a(r,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return s||c?(p(s)?s.forEach((e=>r[e]=null)):a(r,s),_(e)&&o.set(e,r),r):(_(e)&&o.set(e,null),null)}function cs(e,t){return!(!e||!s(t))&&(t=t.slice(2).replace(/Once$/,""),l(e,t[0].toLowerCase()+t.slice(1))||l(e,L(t))||l(e,t))}let us=null;function ls(e){const t=us;return us=e,e&&e.type.__scopeId,t}const ps=e=>ds;function ds(e,t=us,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d;const i=ls(t);let s;try{s=e(...n)}finally{ls(i),o._d}return s};return o._n=!0,o._c=!0,o._d=!0,o}const hs="components";function gs(e,t){return ms(hs,e,!0,t)||e}function fs(e){return ms("directives",e)}function ms(e,t,n=!0,o=!1){const i=us||Hr;if(i){const n=i.type;if(e===hs){const e=function(e,t=!0){return g(e)?e.displayName||e.name:e.name||t&&e.__name}(n,!1);if(e&&(e===t||e===k(t)||e===R(k(t))))return n}const s=_s(i[e]||n[e],t)||_s(i.appContext[e],t);return!s&&o?n:s}}function _s(e,t){return e&&(e[t]||e[k(t)]||e[R(k(t))])}const vs=Symbol.for("v-scx"),ys=()=>Ns(vs);function Is(e,t){return Es(e,null,t)}function Ms(e,t){return Es(e,null,{flush:"post"})}function Cs(e,t){return Es(e,null,{flush:"sync"})}const Ts={};function Ss(e,t,n){return Es(e,t,n)}function Es(e,n,{immediate:i,deep:s,flush:r,once:a,onTrack:u,onTrigger:l}=t){if(n&&a){const e=n;n=(...t)=>{e(...t),E()}}const d=Hr,h=e=>!0===s?e:Ls(e,!1===s?1:void 0);let f,m,_=!1,v=!1;if(mi(e)?(f=()=>e.value,_=ai(e)):si(e)?(f=()=>h(e),_=!0):p(e)?(v=!0,_=e.some((e=>si(e)||ai(e))),f=()=>e.map((e=>mi(e)?e.value:si(e)?h(e):g(e)?Pi(e,d,2):void 0))):f=g(e)?n?()=>Pi(e,d,2):()=>(m&&m(),Ni(e,d,3,[y])):o,n&&s){const e=f;f=()=>Ls(e())}let y=e=>{m=T.onStop=()=>{Pi(e,d,4),m=T.onStop=void 0}},I=v?new Array(e.length).fill(Ts):Ts;const M=()=>{if(T.active&&T.dirty)if(n){const e=T.run();(s||_||(v?e.some(((e,t)=>A(e,I[t]))):A(e,I)))&&(m&&m(),Ni(n,d,3,[e,I===Ts?void 0:v&&I[0]===Ts?[]:I,y]),I=e)}else T.run()};let C;M.allowRecurse=!!n,"sync"===r?C=M:"post"===r?C=()=>wr(M,d&&d.suspense):(M.pre=!0,d&&(M.id=d.uid),C=()=>zi(M));const T=new $n(f,o,C),S=Hn(),E=()=>{T.stop(),S&&c(S.effects,T)};return n?i?M():I=T.run():"post"===r?wr(T.run.bind(T),d&&d.suspense):T.run(),E}function ks(e,t,n){const o=this.proxy,i=f(e)?e.includes(".")?Ds(o,e):()=>o[e]:e.bind(o,o);let s;g(t)?s=t:(s=t.handler,n=t);const r=Yr(this),a=Es(i,s.bind(o),n);return r(),a}function Ds(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function Ls(e,t,n=0,o){if(!_(e)||e.__v_skip)return e;if(t&&t>0){if(n>=t)return e;n++}if((o=o||new Set).has(e))return e;if(o.add(e),mi(e))Ls(e.value,t,n,o);else if(p(e))for(let i=0;i<e.length;i++)Ls(e[i],t,n,o);else if(h(e)||d(e))e.forEach((e=>{Ls(e,t,n,o)}));else if(M(e))for(const i in e)Ls(e[i],t,n,o);return e}function Rs(e,n){if(null===us)return e;const o=ea(us)||us.proxy,i=e.dirs||(e.dirs=[]);for(let s=0;s<n.length;s++){let[e,r,a,c=t]=n[s];e&&(g(e)&&(e={mounted:e,updated:e}),e.deep&&Ls(r),i.push({dir:e,instance:o,value:r,oldValue:void 0,arg:a,modifiers:c}))}return e}function Os(){return{app:null,config:{isNativeTag:i,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let As=0;let bs=null;function Ps(e,t){if(Hr){let n=Hr.provides;const o=Hr.parent&&Hr.parent.provides;o===n&&(n=Hr.provides=Object.create(o)),n[e]=t,"app"===Hr.type.mpType&&Hr.appContext.app.provide(e,t)}else;}function Ns(e,t,n=!1){const o=Hr||us;if(o||bs){const i=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:bs._context.provides;if(i&&e in i)return i[e];if(arguments.length>1)return n&&g(t)?t.call(o&&o.proxy):t}}function xs(){return!!(Hr||us||bs)}
/*! #__NO_SIDE_EFFECTS__ */function ws(e,t){return g(e)?(()=>a({name:e.name},t,{setup:e}))():e}function Us(e,t){Fs(e,"a",t)}function Gs(e,t){Fs(e,"da",t)}function Fs(e,t,n=Hr){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(qs(t,o,n),n){let e=n.parent;for(;e&&e.parent;)e.parent.vnode.type.__isKeepAlive&&Bs(o,t,n,e),e=e.parent}}function Bs(e,t,n,o){const i=qs(t,e,o,!0);Ys((()=>{c(o[t],i)}),n)}function qs(e,t,n=Hr,o=!1){if(n){(function(e){return ke.indexOf(e)>-1})(e)&&(n=n.root);const i=n[e]||(n[e]=[]),s=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;to();const i=Yr(n),s=Ni(t,n,e,o);return i(),no(),s});return o?i.unshift(s):i.push(s),s}}const Vs=e=>(t,n=Hr)=>(!exports.isInSSRComponentSetup||"sp"===e)&&qs(e,((...e)=>t(...e)),n),js=Vs("bm"),Hs=Vs("m"),Ks=Vs("bu"),$s=Vs("u"),zs=Vs("bum"),Ys=Vs("um"),Ws=Vs("sp"),Js=Vs("rtg"),Xs=Vs("rtc");function Zs(e,t=Hr){qs("ec",e,t)}function Qs(e,t){const n={};for(const o in e)n[t&&/[A-Z]/.test(o)?`on:${o}`:O(o)]=e[o];return n}const er=e=>e?Jr(e)?ea(e)||e.proxy:er(e.parent):null,tr=a(Object.create(null),{$:e=>e,$el:e=>e.__$el||(e.__$el={}),$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>er(e.parent),$root:e=>er(e.root),$emit:e=>e.emit,$options:e=>Ir(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,zi(e.update)}),$watch:e=>ks.bind(e)}),nr=(e,n)=>e!==t&&!e.__isScriptSetup&&l(e,n),or={get({_:e},n){const{ctx:o,setupState:i,data:s,props:r,accessCache:a,type:c,appContext:u}=e;let p;if("$"!==n[0]){const c=a[n];if(void 0!==c)switch(c){case 1:return i[n];case 2:return s[n];case 4:return o[n];case 3:return r[n]}else{if(nr(i,n))return a[n]=1,i[n];if(s!==t&&l(s,n))return a[n]=2,s[n];if((p=e.propsOptions[0])&&l(p,n))return a[n]=3,r[n];if(o!==t&&l(o,n))return a[n]=4,o[n];mr&&(a[n]=0)}}const d=tr[n];let h,g;return d?("$attrs"===n&&ho(e,0,n),d(e)):(h=c.__cssModules)&&(h=h[n])?h:o!==t&&l(o,n)?(a[n]=4,o[n]):(g=u.config.globalProperties,l(g,n)?g[n]:void 0)},set({_:e},n,o){const{data:i,setupState:s,ctx:r}=e;return nr(s,n)?(s[n]=o,!0):i!==t&&l(i,n)?(i[n]=o,!0):!l(e.props,n)&&(("$"!==n[0]||!(n.slice(1)in e))&&(r[n]=o,!0))},has({_:{data:e,setupState:n,accessCache:o,ctx:i,appContext:s,propsOptions:r}},a){let c;return!!o[a]||e!==t&&l(e,a)||nr(n,a)||(c=r[0])&&l(c,a)||l(i,a)||l(tr,a)||l(s.config.globalProperties,a)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:l(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ir(){return null}function sr(){return null}function rr(e){}function ar(e,t){return null}function cr(){return lr().slots}function ur(){return lr().attrs}function lr(){const e=Kr();return e.setupContext||(e.setupContext=Qr(e))}function pr(e){return p(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}function dr(e,t){const n=pr(e);for(const o in t){if(o.startsWith("__skip"))continue;let e=n[o];e?p(e)||g(e)?e=n[o]={type:e,default:t[o]}:e.default=t[o]:null===e&&(e=n[o]={default:t[o]}),e&&t[`__skip_${o}`]&&(e.skipFactory=!0)}return n}function hr(e,t){return e&&t?p(e)&&p(t)?e.concat(t):a({},pr(e),pr(t)):e||t}function gr(e,t){const n={};for(const o in e)t.includes(o)||Object.defineProperty(n,o,{enumerable:!0,get:()=>e[o]});return n}function fr(e){const t=Kr();let n=e();return Wr(),v(n)&&(n=n.catch((e=>{throw Yr(t),e}))),[n,()=>Yr(t)]}let mr=!0;function _r(e){const t=Ir(e),n=e.proxy,i=e.ctx;mr=!1,t.beforeCreate&&vr(t.beforeCreate,e,"bc");const{data:s,computed:r,methods:a,watch:c,provide:u,inject:l,created:d,beforeMount:h,mounted:f,beforeUpdate:m,updated:v,activated:y,deactivated:I,beforeDestroy:M,beforeUnmount:C,destroyed:T,unmounted:S,render:E,renderTracked:k,renderTriggered:D,errorCaptured:L,serverPrefetch:R,expose:O,inheritAttrs:A,components:b,directives:P,filters:N}=t;if(l&&function(e,t){p(e)&&(e=Sr(e));for(const n in e){const o=e[n];let i;i=_(o)?"default"in o?Ns(o.from||n,o.default,!0):Ns(o.from||n):Ns(o),mi(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}(l,i),a)for(const o in a){const e=a[o];g(e)&&(i[o]=e.bind(n))}if(s){const t=s.call(n,n);_(t)&&(e.data=ei(t))}if(mr=!0,r)for(const p in r){const e=r[p],t=g(e)?e.bind(n,n):g(e.get)?e.get.bind(n,n):o,s=!g(e)&&g(e.set)?e.set.bind(n):o,a=ta({get:t,set:s});Object.defineProperty(i,p,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(const o in c)yr(c[o],i,n,o);function x(e,t){p(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(function(){if(u){const e=g(u)?u.call(n):u;Reflect.ownKeys(e).forEach((t=>{Ps(t,e[t])}))}}(),d&&vr(d,e,"c"),x(js,h),x(Hs,f),x(Ks,m),x($s,v),x(Us,y),x(Gs,I),x(Zs,L),x(Xs,k),x(Js,D),x(zs,C),x(Ys,S),x(Ws,R),p(O))if(O.length){const t=e.exposed||(e.exposed={});O.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});E&&e.render===o&&(e.render=E),null!=A&&(e.inheritAttrs=A),b&&(e.components=b),P&&(e.directives=P),e.ctx.$onApplyOptions&&e.ctx.$onApplyOptions(t,e,n)}function vr(e,t,n){Ni(p(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function yr(e,t,n,o){const i=o.includes(".")?Ds(n,o):()=>n[o];if(f(e)){const n=t[e];g(n)&&Ss(i,n)}else if(g(e))Ss(i,e.bind(n));else if(_(e))if(p(e))e.forEach((e=>yr(e,t,n,o)));else{const o=g(e.handler)?e.handler.bind(n):t[e.handler];g(o)&&Ss(i,o,e)}}function Ir(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:i,optionsCache:s,config:{optionMergeStrategies:r}}=e.appContext,a=s.get(t);let c;return a?c=a:i.length||n||o?(c={},i.length&&i.forEach((e=>Mr(c,e,r,!0))),Mr(c,t,r)):c=t,_(t)&&s.set(t,c),c}function Mr(e,t,n,o=!1){const{mixins:i,extends:s}=t;s&&Mr(e,s,n,!0),i&&i.forEach((t=>Mr(e,t,n,!0)));for(const r in t)if(o&&"expose"===r);else{const o=Cr[r]||n&&n[r];e[r]=o?o(e[r],t[r]):t[r]}return e}const Cr={data:Tr,props:Dr,emits:Dr,methods:kr,computed:kr,beforeCreate:Er,created:Er,beforeMount:Er,mounted:Er,beforeUpdate:Er,updated:Er,beforeDestroy:Er,beforeUnmount:Er,destroyed:Er,unmounted:Er,activated:Er,deactivated:Er,errorCaptured:Er,serverPrefetch:Er,components:kr,directives:kr,watch:function(e,t){if(!e)return t;if(!t)return e;const n=a(Object.create(null),e);for(const o in t)n[o]=Er(e[o],t[o]);return n},provide:Tr,inject:function(e,t){return kr(Sr(e),Sr(t))}};function Tr(e,t){return t?e?function(){return a(g(e)?e.call(this,this):e,g(t)?t.call(this,this):t)}:t:e}function Sr(e){if(p(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Er(e,t){return e?[...new Set([].concat(e,t))]:t}function kr(e,t){return e?a(Object.create(null),e,t):t}function Dr(e,t){return e?p(e)&&p(t)?[...new Set([...e,...t])]:a(Object.create(null),pr(e),pr(null!=t?t:{})):t}function Lr(e,t,n,o){const{props:i,attrs:s,vnode:{patchFlag:r}}=e,a=ui(i),[c]=e.propsOptions;let u=!1;if(!(o||r>0)||16&r){let o;Rr(e,t,i,s)&&(u=!0);for(const s in a)t&&(l(t,s)||(o=L(s))!==s&&l(t,o))||(c?!n||void 0===n[s]&&void 0===n[o]||(i[s]=Or(c,a,s,void 0,e,!0)):delete i[s]);if(s!==a)for(const e in s)t&&l(t,e)||(delete s[e],u=!0)}else if(8&r){const n=e.vnode.dynamicProps;for(let o=0;o<n.length;o++){let r=n[o];if(cs(e.emitsOptions,r))continue;const p=t[r];if(c)if(l(s,r))p!==s[r]&&(s[r]=p,u=!0);else{const t=k(r);i[t]=Or(c,a,t,p,e,!1)}else p!==s[r]&&(s[r]=p,u=!0)}}u&&go(e,"set","$attrs")}function Rr(e,n,o,i){const[s,r]=e.propsOptions;let a,c=!1;if(n)for(let t in n){if(T(t))continue;const u=n[t];let p;s&&l(s,p=k(t))?r&&r.includes(p)?(a||(a={}))[p]=u:o[p]=u:cs(e.emitsOptions,t)||t in i&&u===i[t]||(i[t]=u,c=!0)}if(r){const n=ui(o),i=a||t;for(let t=0;t<r.length;t++){const a=r[t];o[a]=Or(s,n,a,i[a],e,!l(i,a))}}return c}function Or(e,t,n,o,i,s){const r=e[n];if(null!=r){const e=l(r,"default");if(e&&void 0===o){const e=r.default;if(r.type!==Function&&!r.skipFactory&&g(e)){const{propsDefaults:s}=i;if(n in s)o=s[n];else{const r=Yr(i);o=s[n]=e.call(null,t),r()}}else o=e}r[0]&&(s&&!e?o=!1:!r[1]||""!==o&&o!==L(n)||(o=!0))}return o}function Ar(e,o,i=!1){const s=o.propsCache,r=s.get(e);if(r)return r;const c=e.props,u={},d=[];let h=!1;if(!g(e)){const t=e=>{h=!0;const[t,n]=Ar(e,o,!0);a(u,t),n&&d.push(...n)};!i&&o.mixins.length&&o.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!h)return _(e)&&s.set(e,n),n;if(p(c))for(let n=0;n<c.length;n++){const e=k(c[n]);br(e)&&(u[e]=t)}else if(c)for(const t in c){const e=k(t);if(br(e)){const n=c[t],o=u[e]=p(n)||g(n)?{type:n}:a({},n);if(o){const t=xr(Boolean,o.type),n=xr(String,o.type);o[0]=t>-1,o[1]=n<0||t<n,(t>-1||l(o,"default"))&&d.push(e)}}}const f=[u,d];return _(e)&&s.set(e,f),f}function br(e){return"$"!==e[0]&&!T(e)}function Pr(e){if(null===e)return"null";if("function"==typeof e)return e.name||"";if("object"==typeof e){return e.constructor&&e.constructor.name||""}return""}function Nr(e,t){return Pr(e)===Pr(t)}function xr(e,t){return p(t)?t.findIndex((t=>Nr(t,e))):g(t)&&Nr(t,e)?0:-1}const wr=Xi,Ur=Symbol.for("v-fgt"),Gr=Symbol.for("v-txt");function Fr(e){return e?ci(e)||"__vInternal"in e?a({},e):e:null}function Br(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const e in o)if("class"===e)t.class!==o.class&&(t.class=B([t.class,o.class]));else if("style"===e)t.style=x([t.style,o.style]);else if(s(e)){const n=t[e],i=o[e];!i||n===i||p(n)&&n.includes(i)||(t[e]=n?[].concat(n,i):i)}else""!==e&&(t[e]=o[e])}return t}const qr=Os();let Vr=0;function jr(e,n,o){const i=e.type,s=(n?n.appContext:e.appContext)||qr,r={uid:Vr++,vnode:e,type:i,parent:n,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,scope:new qn(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(s.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ar(i,s),emitsOptions:as(i,s),emit:null,emitted:null,propsDefaults:t,inheritAttrs:i.inheritAttrs,ctx:t,data:t,props:t,attrs:t,slots:t,refs:t,setupState:t,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:o,suspenseId:o?o.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null,$uniElements:new Map,$templateUniElementRefs:[],$templateUniElementStyles:{},$eS:{},$eA:{}};return r.ctx={_:r},r.root=n?n.root:r,r.emit=rs.bind(null,r),e.ce&&e.ce(r),r}let Hr=null;const Kr=()=>Hr||us;let $r,zr;$r=e=>{Hr=e},zr=e=>{exports.isInSSRComponentSetup=e};const Yr=e=>{const t=Hr;return $r(e),e.scope.on(),()=>{e.scope.off(),$r(t)}},Wr=()=>{Hr&&Hr.scope.off(),$r(null)};function Jr(e){return 4&e.vnode.shapeFlag}function Xr(e,t=!1){t&&zr(t);const{props:n}=e.vnode,o=Jr(e);!function(e,t,n,o=!1){const i={},s={};e.propsDefaults=Object.create(null),Rr(e,t,i,s);for(const r in e.propsOptions[0])r in i||(i[r]=void 0);n?e.props=o?i:ti(i):e.type.props?e.props=i:e.props=s,e.attrs=s}(e,n,o,t);const i=o?function(e){const t=e.type;e.accessCache=Object.create(null),e.proxy=li(new Proxy(e.ctx,or));const{setup:n}=t;if(n){const t=e.setupContext=n.length>1?Qr(e):null,o=Yr(e);to();const i=Pi(n,e,0,[e.props,t]);no(),o(),v(i)?i.then(Wr,Wr):function(e,t){g(t)?e.render=t:_(t)&&(e.setupState=Ei(t));Zr(e)}(e,i)}else Zr(e)}(e):void 0;return t&&zr(!1),i}function Zr(e,t,n){const i=e.type;e.render||(e.render=i.render||o);{const t=Yr(e);to();try{_r(e)}finally{no(),t()}}}function Qr(e){const t=t=>{e.exposed=t||{}};return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(ho(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t}}function ea(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Ei(li(e.exposed)),{get:(t,n)=>n in t?t[n]:e.proxy[n],has:(e,t)=>t in e||t in tr}))}exports.isInSSRComponentSetup=!1;const ta=(e,t)=>{const n=function(e,t,n=!1){let i,s;const r=g(e);return r?(i=e,s=o):(i=e.get,s=e.set),new hi(i,s,r||!s,n)}(e,0,exports.isInSSRComponentSetup);return n};function na(e,n,o=t){const i=Kr(),s=k(n),r=L(n),a=Di(((t,a)=>{let c;return Cs((()=>{const t=e[n];A(c,t)&&(c=t,a())})),{get:()=>(t(),o.get?o.get(c):c),set(e){const t=i.vnode.props;t&&(n in t||s in t||r in t)&&(`onUpdate:${n}`in t||`onUpdate:${s}`in t||`onUpdate:${r}`in t)||!A(e,c)||(c=e,a()),i.emit(`update:${n}`,o.set?o.set(e):e)}}})),c="modelValue"===n?"modelModifiers":`${n}Modifiers`;return a[Symbol.iterator]=()=>{let t=0;return{next:()=>t<2?{value:t++?e[c]||{}:a,done:!1}:{done:!0}}},a}const oa="3.4.21",ia=o;function sa(e){return Ci(e)}function ra(e){console.error("defineAsyncComponent is unsupported")}const aa="[object Array]",ca="[object Object]";function ua(e,t){const n={};return la(e,t),pa(e,t,"",n),n}function la(e,t){if((e=sa(e))===t)return;const n=I(e),o=I(t);if(n==ca&&o==ca)for(let i in t){const n=e[i];void 0===n?e[i]=null:la(n,t[i])}else n==aa&&o==aa&&e.length>=t.length&&t.forEach(((t,n)=>{la(e[n],t)}))}function pa(e,t,n,o){if((e=sa(e))===t)return;const i=I(e),s=I(t);if(i==ca)if(s!=ca||Object.keys(e).length<Object.keys(t).length)da(o,n,e);else for(let r in e){const i=sa(e[r]),s=t[r],a=I(i),c=I(s);if(a!=aa&&a!=ca)i!=s&&da(o,(""==n?"":n+".")+r,i);else if(a==aa)c!=aa||i.length<s.length?da(o,(""==n?"":n+".")+r,i):i.forEach(((e,t)=>{pa(e,s[t],(""==n?"":n+".")+r+"["+t+"]",o)}));else if(a==ca)if(c!=ca||Object.keys(i).length<Object.keys(s).length)da(o,(""==n?"":n+".")+r,i);else for(let e in i)pa(i[e],s[e],(""==n?"":n+".")+r+"."+e,o)}else i==aa?s!=aa||e.length<t.length?da(o,n,e):e.forEach(((e,i)=>{pa(e,t[i],n+"["+i+"]",o)})):da(o,n,e)}function da(e,t,n){e[t]=n}function ha(e){const t=e.ctx.__next_tick_callbacks;if(t&&t.length){const e=t.slice(0);t.length=0;for(let t=0;t<e.length;t++)e[t]()}}function ga(e,t){const n=e.ctx;if(!n.__next_tick_pending&&!function(e){return Fi.includes(e.update)}(e))return $i(t&&t.bind(e.proxy));let o;return n.__next_tick_callbacks||(n.__next_tick_callbacks=[]),n.__next_tick_callbacks.push((()=>{t?Pi(t.bind(e.proxy),e,14):o&&o(e.proxy)})),new Promise((e=>{o=e}))}function fa(e,t){const n=typeof(e=sa(e));if("object"===n&&null!==e){let n=t.get(e);if(void 0!==n)return n;if(p(e)){const o=e.length;n=new Array(o),t.set(e,n);for(let i=0;i<o;i++)n[i]=fa(e[i],t)}else{n={},t.set(e,n);for(const o in e)l(e,o)&&(n[o]=fa(e[o],t))}return n}if("symbol"!==n)return e}function ma(e){return fa(e,"undefined"!=typeof WeakMap?new WeakMap:new Map)}function _a(e,t,n){if(!t)return;(t=ma(t)).$eS=e.$eS||{},t.$eA=e.$eA||{};const o=e.ctx,i=o.mpType;if("page"===i||"component"===i){t.r0=1;const i=o.$scope,s=Object.keys(t),r=ua(t,n||function(e,t){const n=e.data,o=Object.create(null);return t.forEach((e=>{o[e]=n[e]})),o}(i,s));Object.keys(r).length?(o.__next_tick_pending=!0,i.setData(r,(()=>{o.__next_tick_pending=!1,ha(e)})),Zi()):ha(e)}}function va(e,t,n){t.appContext.config.globalProperties.$applyOptions(e,t,n);const o=e.computed;if(o){const e=Object.keys(o);if(e.length){const n=t.ctx;n.$computedKeys||(n.$computedKeys=[]),n.$computedKeys.push(...e)}}delete t.ctx.$onApplyOptions}function ya(e,t=!1){const{setupState:n,$templateRefs:o,$templateUniElementRefs:i,ctx:{$scope:s,$mpPlatform:r}}=e;if("mp-alipay"===r)return;if(!s||!o&&!i)return;if(t)return o&&o.forEach((e=>Ia(e,null,n))),void(i&&i.forEach((e=>Ia(e,null,n))));const a="mp-baidu"===r||"mp-toutiao"===r,c=e=>{if(0===e.length)return[];const t=(s.selectAllComponents(".r")||[]).concat(s.selectAllComponents(".r-i-f")||[]);return e.filter((e=>{const o=function(e,t){const n=e.find((e=>e&&(e.properties||e.props).uI===t));if(n){const e=n.$vm;return e?ea(e.$)||e:function(e){_(e)&&li(e);return e}(n)}return null}(t,e.i);return!(!a||null!==o)||(Ia(e,o,n),!1)}))},u=()=>{if(o){const t=c(o);t.length&&e.proxy&&e.proxy.$scope&&e.proxy.$scope.setData({r1:1},(()=>{c(t)}))}};i&&i.length&&ga(e,(()=>{i.forEach((e=>{p(e.v)?e.v.forEach((t=>{Ia(e,t,n)})):Ia(e,e.v,n)}))})),s._$setRef?s._$setRef(u):ga(e,u)}function Ia({r:e,f:t},n,o){if(g(e))e(n,{});else{const i=f(e),s=mi(e);if(i||s)if(t){if(!s)return;p(e.value)||(e.value=[]);const t=e.value;if(-1===t.indexOf(n)){if(t.push(n),!n)return;n.$&&zs((()=>c(t,n)),n.$)}}else i?l(o,e)&&(o[e]=n):mi(e)&&(e.value=n)}}const Ma=Xi;function Ca(e,t){const n=e.component=jr(e,t.parentComponent,null);return n.ctx.$onApplyOptions=va,n.ctx.$children=[],"app"===t.mpType&&(n.render=o),t.onBeforeSetup&&t.onBeforeSetup(n,t),Xr(n),t.parentComponent&&n.proxy&&t.parentComponent.ctx.$children.push(ea(n)||n.proxy),function(e){const t=Da.bind(e);e.$updateScopedSlots=()=>$i((()=>zi(t)));const n=()=>{if(e.isMounted){const{next:t,bu:n,u:o}=e;La(e,!1),ka(),n&&b(n),La(e,!0),_a(e,Sa(e)),o&&Ma(o)}else zs((()=>{ya(e,!0)}),e),_a(e,Sa(e))},i=e.effect=new $n(n,o,(()=>zi(s)),e.scope),s=e.update=()=>{i.dirty&&i.run()};s.id=e.uid,La(e,!0),s()}(n),n.proxy}const Ta=e=>{let t;for(const n in e)("class"===n||"style"===n||s(n))&&((t||(t={}))[n]=e[n]);return t};function Sa(e){const{type:t,vnode:n,proxy:o,withProxy:i,props:s,propsOptions:[r],slots:a,attrs:c,emit:u,render:l,renderCache:p,data:d,setupState:h,ctx:g,uid:f,appContext:{app:{config:{globalProperties:{pruneComponentPropsCache:m}}}},inheritAttrs:_}=e;let v;e.$uniElementIds=new Map,e.$templateRefs=[],e.$templateUniElementRefs=[],e.$templateUniElementStyles={},e.$ei=0,m(f),e.__counter=0===e.__counter?1:0;const y=ls(e);try{if(4&n.shapeFlag){Ea(_,s,r,c);const e=i||o;v=l.call(e,e,p,s,h,d,g)}else{Ea(_,s,r,t.props?c:Ta(c));const e=t;v=e.length>1?e(s,{attrs:c,slots:a,emit:u}):e(s,null)}}catch(I){xi(I,e,1),v=!1}return ya(e),ls(y),v}function Ea(e,t,n,o){if(t&&o&&!1!==e){const e=Object.keys(o).filter((e=>"class"!==e&&"style"!==e));if(!e.length)return;n&&e.some(r)?e.forEach((e=>{r(e)&&e.slice(9)in n||(t[e]=o[e])})):e.forEach((e=>t[e]=o[e]))}}const ka=e=>{to(),Zi(),no()};function Da(){const e=this.$scopedSlotsData;if(!e||0===e.length)return;const t=this.ctx.$scope,n=t.data,o=Object.create(null);e.forEach((({path:e,index:t,data:i})=>{const s=Ie(n,e),r=f(t)?`${e}.${t}`:`${e}[${t}]`;if(void 0===s||void 0===s[t])o[r]=i;else{const e=ua(i,s[t]);Object.keys(e).forEach((t=>{o[r+"."+t]=e[t]}))}})),e.length=0,Object.keys(o).length&&t.setData(o)}function La({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}const Ra=function(e,t=null){g(e)||(e=a({},e)),null==t||_(t)||(t=null);const n=Os(),o=new WeakSet,i=n.app={_uid:As++,_component:e,_props:t,_container:null,_context:n,_instance:null,version:oa,get config(){return n.config},set config(e){},use:(e,...t)=>(o.has(e)||(e&&g(e.install)?(o.add(e),e.install(i,...t)):g(e)&&(o.add(e),e(i,...t))),i),mixin:e=>(n.mixins.includes(e)||n.mixins.push(e),i),component:(e,t)=>t?(n.components[e]=t,i):n.components[e],directive:(e,t)=>t?(n.directives[e]=t,i):n.directives[e],mount(){},unmount(){},provide:(e,t)=>(n.provides[e]=t,i),runWithContext(e){const t=bs;bs=i;try{return e()}finally{bs=t}}};return i};function Oa(e,t=null){("undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof my?my:void 0).__VUE__=!0;const n=Ra(e,t),i=n._context;i.config.globalProperties.$nextTick=function(e){return ga(this.$,e)};const s=e=>(e.appContext=i,e.shapeFlag=6,e),r=function(e,t){return Ca(s(e),t)},a=function(e){return e&&function(e){const{bum:t,scope:n,update:o,um:i}=e;t&&b(t);{const t=e.parent;if(t){const n=t.ctx.$children,o=ea(e)||e.proxy,i=n.indexOf(o);i>-1&&n.splice(i,1)}}n.stop(),o&&(o.active=!1),i&&Ma(i),Ma((()=>{e.isUnmounted=!0}))}(e.$)};return n.mount=function(){e.render=o;const t=Ca(s({type:e}),{mpType:"app",mpInstance:null,parentComponent:null,slots:[],props:null});return n._instance=t.$,t.$app=n,t.$createComponent=r,t.$destroyComponent=a,i.$appInstance=t,t},n.unmount=function(){},n}function Aa(e="$style"){{const n=Kr();if(!n)return t;const o=n.type.__cssModules;if(!o)return t;const i=o[e];return i||t}}function ba(e){const t=Kr();t&&function(e,t){e.ctx.__cssVars=()=>{const n=t(e.proxy),o={};for(const e in n)o[`--${e}`]=n[e];return o}}(t,e)}function Pa(){}function Na(){}function xa(e,t,n,o){g(t)&&qs(e,t.bind(n),o)}function wa(e,t,n){!function(e,t,n){const o=e.mpType||n.$mpType;o&&"component"!==o&&Object.keys(e).forEach((o=>{if(Re(o,e[o],!1)){const i=e[o];p(i)?i.forEach((e=>xa(o,e,n,t))):xa(o,i,n,t)}}))}(e,t,n)}function Ua(e,t,n){return e[t]=n}function Ga(e,...t){const n=this[e];return n?n(...t):(console.error(`method ${e} not found`),null)}function Fa(e){const t=e.config.errorHandler;return function(n,o,i){t&&t(n,o,i);const s=e._instance;if(!s||!s.proxy)throw n;s[Y]?s.proxy.$callHook(Y,n):wi(n,0,o&&o.$.vnode,!1)}}function Ba(e,t){return e?[...new Set([].concat(e,t))]:t}let qa;const Va="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ja=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function Ha(){const e=Gn.getStorageSync("uni_id_token")||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let n;try{n=JSON.parse((o=t[1],decodeURIComponent(qa(o).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(i){throw new Error("获取当前用户信息出错,详细错误信息为:"+i.message)}var o;return n.tokenExpired=1e3*n.exp,delete n.exp,delete n.iat,n}function Ka(e){const t=e.config;var n;t.errorHandler=be(e,Fa),n=t.optionMergeStrategies,De.forEach((e=>{n[e]=Ba}));const o=t.globalProperties;!function(e){e.uniIDHasRole=function(e){const{role:t}=Ha();return t.indexOf(e)>-1},e.uniIDHasPermission=function(e){const{permission:t}=Ha();return this.uniIDHasRole("admin")||t.indexOf(e)>-1},e.uniIDTokenValid=function(){const{tokenExpired:e}=Ha();return e>Date.now()}}(o),o.$set=Ua,o.$applyOptions=wa,o.$callMethod=Ga,Gn.invokeCreateVueAppHook(e)}qa="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!ja.test(e))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,o,i="",s=0;s<e.length;)t=Va.indexOf(e.charAt(s++))<<18|Va.indexOf(e.charAt(s++))<<12|(n=Va.indexOf(e.charAt(s++)))<<6|(o=Va.indexOf(e.charAt(s++))),i+=64===n?String.fromCharCode(t>>16&255):64===o?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}:atob;const $a=Object.create(null);function za(e){delete $a[e]}function Ya(e){if(!e)return;const[t,n]=e.split(",");return $a[t]?$a[t][parseInt(n)]:void 0}var Wa={install(e){Ka(e),e.config.globalProperties.pruneComponentPropsCache=za;const t=e.mount;e.mount=function(n){const o=t.call(e,n),i=function(){const e="createApp";if("undefined"!=typeof global&&void 0!==global[e])return global[e];if("undefined"!=typeof my)return my[e]}();return i?i(o):"undefined"!=typeof createMiniProgramApp&&createMiniProgramApp(o),o}}};function Ja(e){return f(e)?e:function(e){let t="";if(!e||f(e))return t;for(const n in e)t+=`${n.startsWith("--")?n:L(n)}:${e[n]};`;return t}(x(e))}function Xa(e,t){const n=Kr(),i=n.ctx,s=void 0===t||"mp-weixin"!==i.$mpPlatform&&"mp-qq"!==i.$mpPlatform&&"mp-xhs"!==i.$mpPlatform||!f(t)&&"number"!=typeof t?"":"_"+t,r="e"+n.$ei+++s,c=i.$scope;if(!e)return delete c[r],r;const u=c[r];return u?u.value=e:c[r]=function(e,t){const n=e=>{var i;(i=e).type&&i.target&&(i.preventDefault=o,i.stopPropagation=o,i.stopImmediatePropagation=o,l(i,"detail")||(i.detail={}),l(i,"markerId")&&(i.detail="object"==typeof i.detail?i.detail:{},i.detail.markerId=i.markerId),M(i.detail)&&l(i.detail,"checked")&&!l(i.detail,"value")&&(i.detail.value=i.detail.checked),M(i.detail)&&(i.target=a({},i.target,i.detail)));let s=[e];t&&t.ctx.$getTriggerEventDetail&&"number"==typeof e.detail&&(e.detail=t.ctx.$getTriggerEventDetail(e.detail)),e.detail&&e.detail.__args__&&(s=e.detail.__args__);const r=n.value,c=()=>Ni(function(e,t){if(p(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n&&n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e(t)))}return t}(e,r),t,5,s),u=e.target,d=!!u&&(!!u.dataset&&"true"===String(u.dataset.eventsync));if(!Za.includes(e.type)||d){const t=c();if("input"===e.type&&(p(t)||v(t)))return;return t}setTimeout(c)};return n.value=e,n}(e,n),r}const Za=["tap","longpress","longtap","transitionend","animationstart","animationiteration","animationend","touchforcechange"];function Qa(e,t={},n){const o=Kr(),{parent:i,isMounted:s,ctx:{$scope:r}}=o,a=(r.properties||r.props).uI;if(!a)return;if(!i&&!s)return void Hs((()=>{Qa(e,t,n)}),o);const c=function(e,t){let n=t.parent;for(;n;){const t=n.$ssi;if(t&&t[e])return t[e];n=n.parent}}(a,o);c&&c(e,t,n)}function ec(e,{name:t,path:n,vueId:o}){const i=Kr();e.path=n;const s=i.$ssi||(i.$ssi={}),r=s[o]||(s[o]=function(e){const t=(n,o,i)=>{const s=t.slots[n];if(!s)return;const r=void 0!==i;i=i||0;const a=ls(e),c=s.fn(o,n+(r?"-"+i:""),i),u=s.fn.path;ls(a),(e.$scopedSlotsData||(e.$scopedSlotsData=[])).push({path:u,index:i,data:c}),e.$updateScopedSlots()};return t.slots={},t}(i));return r.slots[t]?r.slots[t].fn=e:r.slots[t]={fn:e},Ie(i.ctx.$scope.data,n)}function tc(e){return e.$scope.virtualHostId}function nc(e,t){return!function(e){return!!tc(e)}(e)||function(e){return e.$.propsOptions&&e.$.propsOptions[0]&&"id"in e.$.propsOptions[0]}(e)?t:tc(e)}function oc(){}const ic=(e,t)=>Xa(e,t),sc=(e,t)=>function(e,t){let n;if(p(e)||f(e)){n=new Array(e.length);for(let o=0,i=e.length;o<i;o++)n[o]=t(e[o],o,o)}else if("number"==typeof e){n=new Array(e);for(let o=0;o<e;o++)n[o]=t(o+1,o,o)}else if(_(e))if(e[Symbol.iterator])n=Array.from(e,((e,n)=>t(e,n,n)));else{const o=Object.keys(e);n=new Array(o.length);for(let i=0,s=o.length;i<s;i++){const s=o[i];n[i]=t(e[s],s,i)}}else n=[];return n}(e,t),rc=e=>function(e){return f(e)?Ce(e):e.map((e=>Ce(e)))}(e),ac=(e,t,n)=>Qa(e,t,n),cc=(e,t)=>ec(e,t),uc=e=>Ja(e),lc=e=>k(e),pc=(e,...t)=>a(e,...t),dc=e=>L(e),hc=e=>B(e),gc=e=>V(e),fc=e=>function(e){const{uid:t,__counter:n}=Kr();return t+","+(($a[t]||($a[t]=[])).push(Fr(e))-1)+","+n}(e),mc=(e,t,n)=>function(e,t,n={}){const{$templateRefs:o}=Kr();o.push({i:t,r:e,k:n.k,f:n.f})}(e,t,n),_c=(e,t,n=!1)=>function(e,{number:t,trim:n},o=!1){return o?(...o)=>(n?o=o.map((e=>e.trim())):t&&(o=o.map(N)),e(...o)):o=>{const i=o.detail.value;return n?o.detail.value=i.trim():t&&(o.detail.value=N(i)),e(o)}}(e,t,n),vc=e=>JSON.stringify(e),yc=function(e,t,n){return nc(e,t)||n||""};function Ic(e,t=null){return e&&(e.mpType="app"),Oa(e,t).use(Wa)}const Mc=Ic,Cc=Object.freeze(Object.defineProperty({__proto__:null,EMPTY_OBJ:t,EffectScope:qn,Fragment:Ur,ReactiveEffect:$n,Text:Gr,c:lc,callWithAsyncErrorHandling:Ni,callWithErrorHandling:Pi,camelize:k,computed:ta,createApp:Ic,createPropsRestProxy:gr,createSSRApp:Mc,createVNode:Na,createVueApp:Oa,customRef:Di,d:rc,defineAsyncComponent:ra,defineComponent:ws,defineEmits:sr,defineExpose:rr,defineProps:ir,devtoolsComponentAdded:ns,devtoolsComponentRemoved:is,devtoolsComponentUpdated:os,diff:ua,e:pc,effect:Jn,effectScope:Vn,f:sc,findComponentPropsData:Ya,gei:yc,getCurrentInstance:Kr,getCurrentScope:Hn,getExposeProxy:ea,guardReactiveProps:Fr,h:dc,hasInjectionContext:xs,hasQueueJob:Wi,inject:Ns,injectHook:qs,invalidateJob:Ji,get isInSSRComponentSetup(){return exports.isInSSRComponentSetup},isProxy:ci,isReactive:si,isReadonly:ri,isRef:mi,isShallow:ai,j:vc,logError:wi,m:_c,markRaw:li,mergeDefaults:dr,mergeModels:hr,mergeProps:Br,n:hc,nextTick:$i,normalizeClass:B,normalizeProps:q,normalizeStyle:x,o:ic,onActivated:Us,onBeforeMount:js,onBeforeUnmount:zs,onBeforeUpdate:Ks,onDeactivated:Gs,onErrorCaptured:Zs,onMounted:Hs,onRenderTracked:Xs,onRenderTriggered:Js,onScopeDispose:Kn,onServerPrefetch:Ws,onUnmounted:Ys,onUpdated:$s,p:fc,patch:_a,provide:Ps,proxyRefs:Ei,pruneComponentPropsCache:za,queuePostFlushCb:Xi,r:ac,reactive:ei,readonly:ni,ref:_i,resolveComponent:gs,resolveDirective:fs,resolveFilter:null,s:uc,setCurrentRenderingInstance:ls,setTemplateRef:Ia,setupDevtoolsPlugin:oc,shallowReactive:ti,shallowReadonly:oi,shallowRef:vi,sr:mc,stop:Xn,t:gc,toDisplayString:V,toHandlerKey:O,toHandlers:Qs,toRaw:ui,toRef:Ai,toRefs:Li,toValue:Ti,triggerRef:Mi,unref:Ci,updateProps:Lr,useAttrs:ur,useCssModule:Aa,useCssVars:ba,useModel:na,useSSRContext:ys,useSlots:cr,version:oa,w:cc,warn:ia,watch:Ss,watchEffect:Is,watchPostEffect:Ms,watchSyncEffect:Cs,withAsyncContext:fr,withCtx:ds,withDefaults:ar,withDirectives:Rs,withModifiers:Pa,withScopeId:ps},Symbol.toStringTag,{value:"Module"}));const Tc=["externalClasses"];const Sc=/_(.*)_worklet_factory_/;function Ec(e,t){const n=e.$children;for(let i=n.length-1;i>=0;i--){const e=n[i];if(e.$scope._$vueId===t)return e}let o;for(let i=n.length-1;i>=0;i--)if(o=Ec(n[i],t),o)return o}const kc=["createSelectorQuery","createIntersectionObserver","selectAllComponents","selectComponent"];function Dc(e,t){const n=e.ctx;n.mpType=t.mpType,n.$mpType=t.mpType,n.$mpPlatform="mp-weixin",n.$scope=t.mpInstance,Object.defineProperties(n,{[ve]:{get(){const e=this.$scope.data[ve];return void 0===e?"":e}}}),n.$mp={},n._self={},e.slots={},p(t.slots)&&t.slots.length&&(t.slots.forEach((t=>{e.slots[t]=!0})),e.slots.d&&(e.slots.default=!0)),n.getOpenerEventChannel=function(){return t.mpInstance.getOpenerEventChannel()},n.$hasHook=Lc,n.$callHook=Rc,e.emit=function(e,t){return function(n,...o){const i=t.$scope;if(i&&n){const e={__args__:o};i.triggerEvent(n,e)}return e.apply(this,[n,...o])}}(e.emit,n)}function Lc(e){const t=this.$[e];return!(!t||!t.length)}function Rc(e,t){"mounted"===e&&(Rc.call(this,"bm"),this.$.isMounted=!0,e="m");const n=this.$[e];return n&&((e,t)=>{let n;for(let o=0;o<e.length;o++)n=e[o](t);return n})(n,t)}const Oc=[Z,K,$,ee,oe,re,ae,ce,pe];function Ac(e,t=new Set){if(e){Object.keys(e).forEach((n=>{Re(n,e[n])&&t.add(n)}));{const{extends:n,mixins:o}=e;o&&o.forEach((e=>Ac(e,t))),n&&Ac(n,t)}}return t}function bc(e,t,n){-1!==n.indexOf(t)||l(e,t)||(e[t]=function(e){return this.$vm&&this.$vm.$callHook(t,e)})}const Pc=[Q];function Nc(e,t,n=Pc){t.forEach((t=>bc(e,t,n)))}function xc(e,t,n=Pc){Ac(t).forEach((t=>bc(e,t,n)))}const wc=ye((()=>{const e=[],t=g(getApp)&&getApp({allowDefault:!0});if(t&&t.$vm&&t.$vm.$){const n=t.$vm.$.appContext.mixins;if(p(n)){const t=Object.keys(Le);n.forEach((n=>{t.forEach((t=>{l(n,t)&&!e.includes(t)&&e.push(t)}))}))}}return e}));const Uc=[K,$,Y,W,J,X];function Gc(e,t){const n=e.$,o={globalData:e.$options&&e.$options.globalData||{},$vm:e,onLaunch(t){this.$vm=e;const o=n.ctx;this.$vm&&o.$scope&&o.$callHook||(Dc(n,{mpType:"app",mpInstance:this,slots:[]}),o.globalData=this.globalData,e.$callHook(z,t))}},i=wx.$onErrorHandlers;i&&(i.forEach((e=>{qs(Y,e,n)})),i.length=0),function(e){const t=_i(function(){var e;let t="";{const n=(null===(e=wx.getAppBaseInfo)||void 0===e?void 0:e.call(wx))||wx.getSystemInfoSync();t=He(n&&n.language?n.language:Be)||Be}return t}());Object.defineProperty(e,"$locale",{get:()=>t.value,set(e){t.value=e}})}(e);const s=e.$.type;Nc(o,Uc),xc(o,s);{const e=s.methods;e&&a(o,e)}return o}function Fc(e,t){if(g(e.onLaunch)){const t=wx.getLaunchOptionsSync&&wx.getLaunchOptionsSync();e.onLaunch(t)}g(e.onShow)&&wx.onAppShow&&wx.onAppShow((e=>{t.$callHook("onShow",e)})),g(e.onHide)&&wx.onAppHide&&wx.onAppHide((e=>{t.$callHook("onHide",e)}))}const Bc=["eO","uR","uRIF","uI","uT","uP","uS"];function qc(e){e.properties||(e.properties={}),a(e.properties,function(e,t=!1){const n={};if(!t){let e=function(e){const t=Object.create(null);e&&e.forEach((e=>{t[e]=!0})),this.setData({$slots:t})};Bc.forEach((e=>{n[e]={type:null,value:""}})),n.uS={type:null,value:[]},n.uS.observer=e}return e.behaviors&&e.behaviors.includes("wx://form-field")&&(e.properties&&e.properties.name||(n.name={type:null,value:""}),e.properties&&e.properties.value||(n.value={type:null,value:""})),n}(e),function(e){const t={};return e&&e.virtualHost&&(t.virtualHostStyle={type:null,value:""},t.virtualHostClass={type:null,value:""},t.virtualHostHidden={type:null,value:""},t[ve]={type:null,value:""}),t}(e.options))}const Vc=[String,Number,Boolean,Object,Array,null];function jc(e,t){const n=function(e){return p(e)&&1===e.length?e[0]:e}(e);return-1!==Vc.indexOf(n)?n:null}function Hc(e,t){return(t?function(e){const t={};M(e)&&Object.keys(e).forEach((n=>{-1===Bc.indexOf(n)&&(t[n]=e[n])}));return t}(e):Ya(e.uP))||{}}function Kc(e){const t=function(){const e=this.properties.uP;e&&(this.$vm?function(e,t){const n=ui(t.props),o=Ya(e)||{};$c(n,o)&&(Lr(t,o,n,!1),Wi(t.update)&&Ji(t.update),t.update())}(e,this.$vm.$):"m"===this.properties.uT&&function(e,t){const n=t.properties,o=Ya(e)||{};$c(n,o,!1)&&t.setData(o)}(e,this))};e.observers||(e.observers={}),e.observers.uP=t}function $c(e,t,n=!0){const o=Object.keys(t);if(n&&o.length!==Object.keys(e).length)return!0;for(let i=0;i<o.length;i++){const n=o[i];if(t[n]!==e[n])return!0}return!1}function zc(e,t){e.data={},e.behaviors=function(e){const t=e.behaviors;let n=e.props;n||(e.props=n=[]);const o=[];return p(t)&&t.forEach((e=>{o.push(e.replace("uni://","wx://")),"uni://form-field"===e&&(p(n)?(n.push("name"),n.push("modelValue")):(n.name={type:String,default:""},n.modelValue={type:[String,Number,Boolean,Array,Object,Date],default:""}))})),o}(t)}function Yc(e,{parse:t,mocks:n,isPage:o,isPageInProject:i,initRelation:s,handleLink:r,initLifetimes:c}){e=e.default||e;const u={multipleSlots:!0,addGlobalClass:!0,pureDataPattern:/^uP$/};p(e.mixins)&&e.mixins.forEach((e=>{_(e.options)&&a(u,e.options)})),e.options&&a(u,e.options);const d={options:u,lifetimes:c({mocks:n,isPage:o,initRelation:s,vueOptions:e}),pageLifetimes:{show(){this.$vm&&this.$vm.$callHook("onPageShow")},hide(){this.$vm&&this.$vm.$callHook("onPageHide")},resize(e){this.$vm&&this.$vm.$callHook("onPageResize",e)}},methods:{__l:r}};var h,g,f,m;return zc(d,e),qc(d),Kc(d),function(e,t){Tc.forEach((n=>{l(t,n)&&(e[n]=t[n])}))}(d,e),h=d.methods,g=e.wxsCallMethods,p(g)&&g.forEach((e=>{h[e]=function(t){return this.$vm[e](t)}})),f=d.methods,(m=e.methods)&&Object.keys(m).forEach((e=>{const t=e.match(Sc);if(t){const n=t[1];f[e]=m[e],f[n]=m[n]}})),t&&t(d,{handleLink:r}),d}let Wc,Jc;function Xc(){return getApp().$vm}function Zc(e,t){const{parse:n,mocks:o,isPage:i,initRelation:s,handleLink:r,initLifetimes:a}=t,c=Yc(e,{mocks:o,isPage:i,isPageInProject:!0,initRelation:s,handleLink:r,initLifetimes:a});!function({properties:e},t){p(t)?t.forEach((t=>{e[t]={type:String,value:""}})):M(t)&&Object.keys(t).forEach((n=>{const o=t[n];if(M(o)){let t=o.default;g(t)&&(t=t());const i=o.type;o.type=jc(i),e[n]={type:o.type,value:t}}else e[n]={type:jc(o)}}))}(c,(e.default||e).props);const u=c.methods;return u.onLoad=function(e){var t;return this.options=e,this.$page={fullPath:(t=this.route+Ee(e),function(e){return 0===e.indexOf("/")}(t)?t:"/"+t)},this.$vm&&this.$vm.$callHook(Z,e)},Nc(u,Oc),xc(u,e),function(e,t){if(!t)return;Object.keys(Le).forEach((n=>{t&Le[n]&&bc(e,n,[])}))}(u,e.__runtimeHooks),Nc(u,wc()),n&&n(c,{handleLink:r}),c}const Qc=Page,eu=Component;function tu(e){const t=e.triggerEvent,n=function(n,...o){return t.apply(e,[(i=n,k(i.replace(Te,"-"))),...o]);var i};try{e.triggerEvent=n}catch(o){e._triggerEvent=n}}function nu(e,t,n){const o=t[e];t[e]=o?function(...e){return tu(this),o.apply(this,e)}:function(){tu(this)}}Page=function(e){return nu(Z,e),Qc(e)},Component=function(e){nu("created",e);return e.properties&&e.properties.uP||(qc(e),Kc(e)),eu(e)};var ou=Object.freeze({__proto__:null,handleLink:function(e){const t=e.detail||e.value,n=t.vuePid;let o;n&&(o=Ec(this.$vm,n)),o||(o=this.$vm),t.parent=o},initLifetimes:function({mocks:e,isPage:t,initRelation:n,vueOptions:o}){return{attached(){let i=this.properties;!function(e,t){if(!e)return;const n=e.split(","),o=n.length;1===o?t._$vueId=n[0]:2===o&&(t._$vueId=n[0],t._$vuePid=n[1])}(i.uI,this);const s={vuePid:this._$vuePid};n(this,s);const r=this,a=t(r);let c=i;this.$vm=function(e,t){Wc||(Wc=Xc().$createComponent);const n=Wc(e,t);return ea(n.$)||n}({type:o,props:Hc(c,a)},{mpType:a?"page":"component",mpInstance:r,slots:i.uS||{},parentComponent:s.parent&&s.parent.$,onBeforeSetup(t,n){!function(e,t){Object.defineProperty(e,"refs",{get(){const e={};return function(e,t,n){e.selectAllComponents(t).forEach((e=>{const t=e.properties.uR;n[t]=e.$vm||e}))}(t,".r",e),t.selectAllComponents(".r-i-f").forEach((t=>{const n=t.properties.uR;n&&(e[n]||(e[n]=[]),e[n].push(t.$vm||t))})),e}})}(t,r),function(e,t,n){const o=e.ctx;n.forEach((n=>{l(t,n)&&(e[n]=o[n]=t[n])}))}(t,r,e),function(e,t){Dc(e,t);const n=e.ctx;kc.forEach((e=>{n[e]=function(...t){const o=n.$scope;if(o&&o[e])return o[e].apply(o,t)}}))}(t,n)}}),a||function(e){const t=e.$options;p(t.behaviors)&&t.behaviors.includes("uni://form-field")&&e.$watch("modelValue",(()=>{e.$scope&&e.$scope.setData({name:e.name,value:e.modelValue})}),{immediate:!0})}(this.$vm)},ready(){this.$vm&&(this.$vm.$callHook("mounted"),this.$vm.$callHook(Q))},detached(){var e;this.$vm&&(za(this.$vm.$.uid),e=this.$vm,Jc||(Jc=Xc().$destroyComponent),Jc(e))}}},initRelation:function(e,t){e.triggerEvent("__l",t)},isPage:function(e){return!!e.route},mocks:["__route__","__wxExparserNodeId__","__wxWebviewId__"]});const iu=function(e){return App(Gc(e))},su=(ru=ou,function(e){return Component(Zc(e,ru))});var ru;const au=function(e){return function(t){return Component(Yc(t,e))}}(ou),cu=function(e){Fc(Gc(e),e)},uu=function(e){const t=Gc(e),n=g(getApp)&&getApp({allowDefault:!0});if(!n)return;e.$.ctx.$scope=n;const o=n.globalData;o&&Object.keys(t.globalData).forEach((e=>{l(o,e)||(o[e]=t.globalData[e])})),Object.keys(t).forEach((e=>{l(n,e)||(n[e]=t[e])})),Fc(t,e)};wx.createApp=global.createApp=iu,wx.createPage=su,wx.createComponent=au,wx.createPluginApp=global.createPluginApp=cu,wx.createSubpackageApp=global.createSubpackageApp=uu;
/*!
* pinia v2.1.7
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/
let lu;const pu=e=>lu=e,du=Symbol();function hu(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var gu,fu;(fu=gu||(gu={})).direct="direct",fu.patchObject="patch object",fu.patchFunction="patch function";const mu="undefined"!=typeof window;function _u(){const e=Vn(!0),t=e.run((()=>_i({})));let n=[],o=[];const i=li({install(e){pu(i),i._a=e,e.provide(du,i),e.config.globalProperties.$pinia=i,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const vu=()=>{};function yu(e,t,n,o=vu){e.push(t);const i=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),o())};return!n&&Hn()&&Kn(i),i}function Iu(e,...t){e.slice().forEach((e=>{e(...t)}))}const Mu=e=>e();function Cu(e,t){e instanceof Map&&t instanceof Map&&t.forEach(((t,n)=>e.set(n,t))),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],i=e[n];hu(i)&&hu(o)&&e.hasOwnProperty(n)&&!mi(o)&&!si(o)?e[n]=Cu(i,o):e[n]=o}return e}const Tu=Symbol();const{assign:Su}=Object;function Eu(e,t,n={},o,i,s){let r;const a=Su({actions:{}},n),c={deep:!0};let u,l,p,d=[],h=[];const g=o.state.value[e];let f;function m(t){let n;u=l=!1,"function"==typeof t?(t(o.state.value[e]),n={type:gu.patchFunction,storeId:e,events:p}):(Cu(o.state.value[e],t),n={type:gu.patchObject,payload:t,storeId:e,events:p});const i=f=Symbol();$i().then((()=>{f===i&&(u=!0)})),l=!0,Iu(d,n,o.state.value[e])}s||g||(o.state.value[e]={}),_i({});const _=s?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{Su(e,t)}))}:vu;function v(t,n){return function(){pu(o);const i=Array.from(arguments),s=[],r=[];let a;Iu(h,{args:i,name:t,store:y,after:function(e){s.push(e)},onError:function(e){r.push(e)}});try{a=n.apply(this&&this.$id===e?this:y,i)}catch(c){throw Iu(r,c),c}return a instanceof Promise?a.then((e=>(Iu(s,e),e))).catch((e=>(Iu(r,e),Promise.reject(e)))):(Iu(s,a),a)}}const y=ei({_p:o,$id:e,$onAction:yu.bind(null,h),$patch:m,$reset:_,$subscribe(t,n={}){const i=yu(d,t,n.detached,(()=>s())),s=r.run((()=>Ss((()=>o.state.value[e]),(o=>{("sync"===n.flush?l:u)&&t({storeId:e,type:gu.direct,events:p},o)}),Su({},c,n))));return i},$dispose:function(){r.stop(),d=[],h=[],o._s.delete(e)}});o._s.set(e,y);const I=(o._a&&o._a.runWithContext||Mu)((()=>o._e.run((()=>(r=Vn()).run(t)))));for(const T in I){const t=I[T];if(mi(t)&&(!mi(C=t)||!C.effect)||si(t))s||(!g||hu(M=t)&&M.hasOwnProperty(Tu)||(mi(t)?t.value=g[T]:Cu(t,g[T])),o.state.value[e][T]=t);else if("function"==typeof t){const e=v(T,t);I[T]=e,a.actions[T]=t}}var M,C;return Su(y,I),Su(ui(y),I),Object.defineProperty(y,"$state",{get:()=>o.state.value[e],set:e=>{m((t=>{Su(t,e)}))}}),o._p.forEach((e=>{Su(y,r.run((()=>e({store:y,app:o._a,pinia:o,options:a}))))})),g&&s&&n.hydrate&&n.hydrate(y.$state,g),u=!0,l=!0,y}function ku(e,t,n){let o,i;const s="function"==typeof t;function r(e,n){const r=xs();(e=e||(r?Ns(du,null):null))&&pu(e),(e=lu)._s.has(o)||(s?Eu(o,t,i,e):function(e,t,n){const{state:o,actions:i,getters:s}=t,r=n.state.value[e];let a;a=Eu(e,(function(){r||(n.state.value[e]=o?o():{});const t=Li(n.state.value[e]);return Su(t,i,Object.keys(s||{}).reduce(((t,o)=>(t[o]=li(ta((()=>{pu(n);const t=n._s.get(e);return s[o].call(t,t)}))),t)),{}))}),t,n,0,!0)}(o,i,e));return e._s.get(o)}return"string"==typeof e?(o=e,i=s?n:t):(i=e,o=e.id),r.$id=o,r}let Du="Store";function Lu(e,t){return Array.isArray(t)?t.reduce(((t,n)=>(t[n]=function(){return e(this.$pinia)[n]},t)),{}):Object.keys(t).reduce(((n,o)=>(n[o]=function(){const n=e(this.$pinia),i=t[o];return"function"==typeof i?i.call(this,n):n[i]},n)),{})}const Ru=Lu;const Ou=Object.freeze(Object.defineProperty({__proto__:null,get MutationType(){return gu},PiniaVuePlugin:function(e){e.mixin({beforeCreate(){const e=this.$options;if(e.pinia){const t=e.pinia;if(!this._provided){const e={};Object.defineProperty(this,"_provided",{get:()=>e,set:t=>Object.assign(e,t)})}this._provided[du]=t,this.$pinia||(this.$pinia=t),t._a=this,mu&&pu(t)}else!this.$pinia&&e.parent&&e.parent.$pinia&&(this.$pinia=e.parent.$pinia)},destroyed(){delete this._pStores}})},acceptHMRUpdate:function(e,t){return()=>{}},createPinia:_u,defineStore:ku,getActivePinia:()=>xs()&&Ns(du)||lu,mapActions:function(e,t){return Array.isArray(t)?t.reduce(((t,n)=>(t[n]=function(...t){return e(this.$pinia)[n](...t)},t)),{}):Object.keys(t).reduce(((n,o)=>(n[o]=function(...n){return e(this.$pinia)[t[o]](...n)},n)),{})},mapGetters:Ru,mapState:Lu,mapStores:function(...e){return e.reduce(((e,t)=>(e[t.$id+Du]=function(){return t(this.$pinia)},e)),{})},mapWritableState:function(e,t){return Array.isArray(t)?t.reduce(((t,n)=>(t[n]={get(){return e(this.$pinia)[n]},set(t){return e(this.$pinia)[n]=t}},t)),{}):Object.keys(t).reduce(((n,o)=>(n[o]={get(){return e(this.$pinia)[t[o]]},set(n){return e(this.$pinia)[t[o]]=n}},n)),{})},setActivePinia:pu,setMapStoreSuffix:function(e){Du=e},skipHydrate:function(e){return Object.defineProperty(e,Tu,{})},storeToRefs:function(e){{e=ui(e);const t={};for(const n in e){const o=e[n];(mi(o)||si(o))&&(t[n]=Ai(e,n))}return t}}},Symbol.toStringTag,{value:"Module"}));var Au="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function bu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pu={exports:{}};Pu.exports=function(){function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function t(e){if(Array.isArray(e))return e}function n(e,t,n){t=c(t);var o=e;if(!(t=l()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))||"object"!=typeof t&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=o))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,y(o.key),o)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t){var n,o,i,s,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return i=!(o=!0),{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,n=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(r=M(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),s=0,{s:t=function(){},n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(l=function(){return!!e})()}function p(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)),o}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t){if(null==e)return{};var n,o=function(e,t){if(null==e)return{};var n,o={};for(n in e)if({}.hasOwnProperty.call(e,n)){if(0<=t.indexOf(n))continue;o[n]=e[n]}return o}(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),s=0;s<i.length;s++)n=i[s],0<=t.indexOf(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _(e,n){return t(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,s,r,a=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=s.call(n)).done)&&(a.push(o.value),a.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(u)throw i}}return a}}(e,n)||M(e,n)||d()}function v(t){return function(t){if(Array.isArray(t))return e(t)}(t)||p(t)||M(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return"symbol"==typeof(e=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);if("object"!=typeof(t=t.call(e,"string")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e))?e:e+""}function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(t,n){var o;if(t)return"string"==typeof t?e(t,n):"Map"===(o="Object"===(o={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?e(t,n):void 0}function C(e){var t="function"==typeof Map?new Map:void 0;return function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){var o;return l()?Reflect.construct.apply(null,arguments):((o=[null]).push.apply(o,t),t=new(e.bind.apply(e,o)),n&&m(t,n.prototype),t)}(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),m(n,e)}(e)}var T={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",ROOM_CUSTOM_DATA_RECEIVED:"onRoomCustomDataReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",MESSAGE_REACTIONS_UPDATED:"onMessageReactionsUpdated",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",MY_FOLLOWERS_LIST_UPDATED:"onMyFollowersListUpdated",MY_FOLLOWING_LIST_UPDATED:"onMyFollowingListUpdated",MUTUAL_FOLLOWERS_LIST_UPDATED:"onMutualFollowersListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",ALL_RECEIVE_MESSAGE_OPT_UPDATED:"onAllReceiveMessageOptUpdated",SERVER_CONFIG_UPDATED:"onServerConfigUpdated"},S={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_ROOM:"Room",GRP_LIVE:"Live",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_MSG_EXCEPT_AT:"NotReceiveMsgExceptAt",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3,IOS_OFFLINE_PUSH_NO_SOUND:"push.no_sound",IOS_OFFLINE_PUSH_DEFAULT_SOUND:"default"},E={NEW_INVITATION_RECEIVED:"newInvitationReceived",INVITEE_ACCEPTED:"ts_invitee_accepted",INVITEE_REJECTED:"ts_invitee_rejected",INVITATION_CANCELLED:"ts_invitation_cancelled",INVITATION_TIMEOUT:"ts_invitation_timeout",INVITATION_MODIFIED:"ts_invitation_modified",ACTION_TYPE_UNKNOWN:0,ACTION_TYPE_INVITE:1,ACTION_TYPE_CANCEL_INVITE:2,ACTION_TYPE_ACCEPT_INVITE:3,ACTION_TYPE_REJECT_INVITE:4,ACTION_TYPE_INVITE_TIMEOUT:5},k=s((function e(){o(this,e),this.cache=[],this.options=null}),[{key:"use",value:function(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}},{key:"next",value:function(e){if(this.middlewares&&0<this.middlewares.length)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}]),D=s((function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.high=t,this.low=n}),[{key:"equal",value:function(e){return null!==e&&this.low===e.low&&this.high===e.high}},{key:"toString",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t="0"+t,n--;return e+t}}]),L={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"},INDONESIA:{DEFAULT:"wss://wssidn-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT0:"wss://*w4s.my-imcloud.com",DEFAULT:"wss://wsssgp.im.qcloud.com",IPV6:"wss://wsssgpv6.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",BACKUP_WEB:"wss://*w4s.my-cpaas.com",STAT:"https://apisgp.my-imcloud.com",ANYCAST:"wss://162.14.19.159"},KOREA:{DEFAULT0:"wss://*w4k.my-imcloud.com",DEFAULT:"wss://wsskr.im.qcloud.com",IPV6:"wss://wsskrv6.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",BACKUP_WEB:"wss://*w4k.my-cpaas.com",STAT:"https://apikr.my-imcloud.com",ANYCAST:"wss://162.14.13.104"},GERMANY:{DEFAULT0:"wss://*w4g.my-imcloud.com",DEFAULT:"wss://wssger.im.qcloud.com",IPV6:"wss://wssgerv6.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",BACKUP_WEB:"wss://*w4g.my-cpaas.com",STAT:"https://apiger.my-imcloud.com",ANYCAST:"wss://162.14.3.17"},IND:{DEFAULT0:"wss://*w4i.my-imcloud.com",DEFAULT:"wss://wssind.my-imcloud.com",IPV6:"wss://wssindv6.im.qcloud.com",BACKUP:"wss://wssind.im.qcloud.com",BACKUP_WEB:"wss://*w4i.my-cpaas.com",STAT:"https://apiind.my-imcloud.com",ANYCAST:"wss://162.14.19.46"},JPN:{DEFAULT0:"wss://*w4j.my-imcloud.com",DEFAULT:"wss://wssjpn.im.qcloud.com",IPV6:"wss://wssjpnv6.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",BACKUP_WEB:"wss://*w4j.my-cpaas.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT0:"wss://*w4u.my-imcloud.com",DEFAULT:"wss://wssusa.im.qcloud.com",IPV6:"wss://wssusav6.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",BACKUP_WEB:"wss://*w4u.my-cpaas.com",STAT:"https://apiusa.my-imcloud.com",ANYCAST:"wss://162.14.10.42"},INDONESIA:{DEFAULT0:"wss://*w4y.my-imcloud.com",DEFAULT:"wss://wssidn.im.qcloud.com",IPV6:"wss://wssidnv6.im.qcloud.com",BACKUP:"wss://wssidn.my-imcloud.com",BACKUP_WEB:"wss://*w4y.my-cpaas.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},R={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15,DONUT_NATIVE_APP:19,NS_NATIVE_APP:20,RN_NATIVE_APP:21},O="1.7.3",A=537048168,b="CHINA",P={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){this.CURRENT=L.PRODUCTION[0<arguments.length&&void 0!==arguments[0]?arguments[0]:b]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GRP:"group_open_http_svc",GRP_AV:"group_open_avchatroom_http_svc",GRP_COMMUNITY:"million_group_open_http_svc",GRP_ATTR:"group_open_attr_http_svc",FD:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GRP_NO_AUTH:"group_open_http_noauth_svc",BIG_GRP_POLLING:"group_open_long_polling_http_svc",BIG_GRP_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MSG:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate",IM_OPEN_SPEECH:"im_open_speech",MSG_SEARCH:"message_search",GRP_SEARCH:"group_search",GRP_MEMBER_SEARCH:"group_member_search",USER_SEARCH:"user_search",FOLLOW:"follow",OFFLINE_PUSH_REPORT:"offline_push_report",IM_MSG_LOGIC:"im_msg_db_logic"}},N={SEARCH_GRP_SNS:new D(0,Math.pow(2,1)).toString(),AV_HISTORY_MSG:new D(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new D(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new D(0,Math.pow(2,4)).toString(),AV_MBR_LIST:new D(0,Math.pow(2,6)).toString(),USER_STATUS:new D(0,Math.pow(2,7)).toString(),CONV_MARK:new D(0,Math.pow(2,9)).toString(),CONV_GROUP:new D(0,Math.pow(2,10)).toString(),AV_BAN_MBR:new D(0,Math.pow(2,11)).toString(),MSG_EXT:new D(0,Math.pow(2,13)).toString(),GRP_COUNTER:new D(0,Math.pow(2,15)).toString(),PLUGIN_TRANSLATE:new D(Math.pow(2,6)).toString(),PLUGIN_VOICE_TO_TEXT:new D(Math.pow(2,7)).toString(),PLUGIN_CS:new D(Math.pow(2,8)).toString(),PLUGIN_PUSH:new D(Math.pow(2,9)).toString(),PLUGIN_BOT:new D(Math.pow(2,10)).toString(),MSG_REACTION:new D(Math.pow(2,16)).toString(),FOLLOW:new D(Math.pow(2,20)).toString()},x="group_profile",w=["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember","InviteJoinOption"],U=["Role","JoinTime","MsgSeq","MsgFlag"],G="web.sdk.qcloud.com",F="web.sdk.cloud.tencent.cn",B="web.sdk.tencent.cn";P.HOST.setCurrent(b);for(var q,V=void 0!==Un&&"function"==typeof Un.getSystemInfoSync&&Boolean(Un.getSystemInfoSync().fontSizeSetting),j=V&&"function"==typeof Un.createGamePortal,H="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),K="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),$="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),z="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),Y="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,W=void 0!==Gn&&"undefined"==typeof window&&"function"==typeof Gn.requireNativePlugin,J=V&&"object"===I(Un.miniapp),X=void 0!==Gn,Z=V||H||K||$||z||W||Y,Q="undefined"==typeof window&&!Z&&void 0!==Au&&void 0!==Au.NativeScriptGlobals,ee=void 0!==Au&&(void 0!==Au.nativeModuleProxy||void 0!==Au.ReactNative),te=void 0!==Gn?!Z:"undefined"!=typeof window&&!Z&&!ee,ne=H?qq:K?tt:$?swan:z?my:V?Un:W?Gn:Y?jd:{},oe=te&&window&&window.navigator&&window.navigator.userAgent||"",ie=(Y="WEB",/(micromessenger|webbrowser)/i.test(oe)?Y="WEB":H?Y="QQ_MP":K?Y="TT_MP":$?Y="BAIDU_MP":z?Y="ALI_MP":V?Y=J?"DONUT_NATIVE_APP":"WX_MP":W?Y="UNI_NATIVE_APP":Q?Y="NS_NATIVE_APP":ee&&(Y="RN_NATIVE_APP"),R[Y]),se=(J=/iPad/i.test(oe),Q=/iPhone/i.test(oe)&&!J,Y=/iPod/i.test(oe),Q||J||Y),re=(Q=oe.match(/OS (\d+)_/i))&&Q[1]?Q[1]:null,ae=/Android/i.test(oe),ce=(J=oe.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i))?(Y=J[1]&&parseFloat(J[1]),Q=J[2]&&parseFloat(J[2]),Y&&Q?parseFloat(J[1]+"."+J[2]):Y||null):null,ue=(J=!(Q=/Edge/i.test(oe))&&/Chrome/i.test(oe),/MSIE/.test(oe)||-1<oe.indexOf("Trident")&&-1<oe.indexOf("rv:11.0")),le=Y=!(Y=(Y=/MSIE\s(\d+)\.\d/.exec(oe))&&parseFloat(Y[1]))&&/Trident\/7.0/i.test(oe)&&/rv:11.0/.test(oe)?11:Y,pe=(Y=/Safari/i.test(oe)&&!J&&!ae&&!Q,/Windows/i.test(oe)),de=/MAC OS X/i.test(oe),he=te&&"undefined"!=typeof Worker&&!ue,ge=ae||se,fe=te&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy,me="undefined"!=typeof window&&void 0!==window.navigator&&(J=window.navigator.standalone,!(!se||J||Y)),_e="undefined"!=typeof console?console:void 0!==Au&&Au.console?Au.console:"undefined"!=typeof window&&window.console?window.console:{},ve=function(){},ye=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Ie=ye.length;Ie--;)q=ye[Ie],console[q]||(_e[q]=ve);function Me(){var e=new Date;return e.setTime(ke()),e}function Ce(){Ee=0}function Te(){return Math.floor(ke()/1e3)}var Se=_e,Ee=0,ke=function(){return(new Date).getTime()+Ee},De=0;function Le(){return Vt()?"%c Chat %c":"Chat"}function Re(){var e=Me();return e.toLocaleTimeString("en-US",{hour12:!1})+"."+function(e){var t;switch(e.toString().length){case 1:t="00"+e;break;case 2:t="0"+e;break;default:t=e}return t}(e.getMilliseconds())}var Oe={arguments2String:function(e){var t="";if(1===e.length)t=e[0];else for(var n=0,o=e.length;n<o;n++){if(pt(e[n]))try{t+=dt(e[n])?JSON.stringify(e[n],["message","code"]):JSON.stringify(e[n])}catch(i){t+=i?i.message:"";break}else t+=e[n];t+=" "}return t},_exec:function(e,t){Vt()?Se[e](Le(),"background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent",Re(),t):Se[e]("".concat(Le()," ").concat(Re()," ").concat(t))},d:function(){var e;De<=-1&&(e=this.arguments2String(arguments),this._exec("debug",e))},l:function(){var e;De<=0&&(e=this.arguments2String(arguments),this._exec("log",e))},log:function(){var e;De<=0&&(e=this.arguments2String(arguments),this._exec("log",e))},i:function(){var e;De<=1&&(e=this.arguments2String(arguments),this._exec("info",e))},w:function(){var e;De<=2&&(e=this.arguments2String(arguments),this._exec("warn",e))},e:function(){var e;De<=3&&(e=this.arguments2String(arguments),this._exec("error",e))},setLevel:function(e){e<4&&this._exec("log","set level from "+De+" to "+e),De=e},getLevel:function(){return De}},Ae={JPG:1,JPEG:1,GIF:2,PNG:3,BMP:4,UNKNOWN:255},be={NICK:"".concat(Q="Tag_Profile_IM_","Nick"),GENDER:"".concat(Q,"Gender"),BIRTHDAY:"".concat(Q,"BirthDay"),LOCATION:"".concat(Q,"Location"),SELFSIGNATURE:"".concat(Q,"SelfSignature"),ALLOWTYPE:"".concat(Q,"AllowType"),LANGUAGE:"".concat(Q,"Language"),AVATAR:"".concat(Q,"Image"),MESSAGESETTINGS:"".concat(Q,"MsgSettings"),ADMINFORBIDTYPE:"".concat(Q,"AdminForbidType"),LEVEL:"".concat(Q,"Level"),ROLE:"".concat(Q,"Role")},Pe={GROUP:"".concat("Tag_SNS_IM_","Group"),REMARK:"".concat("Tag_SNS_IM_","Remark"),ADDSOURCE:"".concat("Tag_SNS_IM_","AddSource"),ADDWORDING:"".concat("Tag_SNS_IM_","Wording"),ADDTIME:"".concat("Tag_SNS_IM_","AddTime")},Ne={UNKNOWN:"".concat(J="Gender_Type_","Unknown"),FEMALE:"".concat(J,"Female"),MALE:"".concat(J,"Male")},xe={NONE:"".concat("AdminForbid_Type_","None"),SEND_OUT:"".concat("AdminForbid_Type_","SendOut")},we={NEED_CONFIRM:"".concat("AllowType_Type_","NeedConfirm"),ALLOW_ANY:"".concat("AllowType_Type_","AllowAny"),DENY_ANY:"".concat("AllowType_Type_","DenyAny")},Ue="JoinedSuccess",Ge="WaitAdminApproval",Fe="@TOPIC#_",Be=Object.prototype.hasOwnProperty;function qe(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(ze(e)){for(var t in e)if(Be.call(e,t))return!1;return!0}return!!(Ve(e)||je(e)||He(e))&&0===e.size}function Ve(e){return"map"===ht(e)}function je(e){return"set"===ht(e)}function He(e){return"file"===ht(e)}function Ke(e){return null!==e&&("number"==typeof e&&!isNaN(+e)||"object"===I(e)&&e.constructor===Number)}function $e(e){return null!==e&&"object"===I(e)}function ze(e){if("object"===I(e)&&null!==e){if(null===(e=Object.getPrototypeOf(e)))return 1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return e===t}}function Ye(e){return"function"==typeof Array.isArray?Array.isArray(e):"array"===ht(e)}function We(e){return Ye(e)&&0<e.length}function Je(e){return"function"==typeof e}function Xe(e){return"filelist"===ht(e)}function Ze(e){return"string"==typeof e&&(e=e[0],!/[^a-zA-Z0-9]/.test(e))}function Qe(e,t,n,o){if(!pt(e)||!pt(t))return 0;for(var i,s=0,r=Object.keys(t),a=0,c=r.length;a<c;a++)if(i=r[a],!(lt(t[i])||n&&n.includes(i)))if(pt(e[i])&&pt(t[i]))s+=Qe(e[i],t[i],n,o);else{if(o&&o.includes(t[i]))continue;e[i]!==t[i]&&(e[i]=t[i],s+=1)}return s}function et(e,t){var n,o=new Map,i=r(e.entries());try{for(i.s();!(n=i.n()).done;){var s=_(n.value,2),a=s[0],c=s[1];c&&o.set(a,t?JSON.stringify(c):JSON.parse(JSON.stringify(c)))}}catch(u){i.e(u)}finally{i.f()}return o}function nt(e){if(0===e.length)return 0;for(var t=0,n=0,o="undefined"!=typeof document&&void 0!==document.characterSet?document.characterSet:"UTF-8";void 0!==e[t];)n+=e[t++].charCodeAt[t]<=255?1:!1===o?3:2;return n}function ot(e){return e=e||99999999,Math.round(Math.random()*e)}function it(){for(var e="",t=32;0<t;--t)e+=gt[Math.floor(Math.random()*ft)];return e}function st(e,t){for(var n in e)if(e[n]===t)return 1}function rt(e){return-1===e.indexOf("http://")||-1===e.indexOf("https://")?"https://"+e:e.replace(/https|http/,"https")}function at(e){if(0===Object.getOwnPropertyNames(e).length)return Object.create(null);var t,n,o=Array.isArray(e)?[]:Object.create(null);for(n in e)null!==e[n]?void 0!==e[n]?(t=I(e[n]),0<=["string","number","function","boolean"].indexOf(t)?o[n]=e[n]:o[n]=at(e[n])):o[n]=void 0:o[n]=null;return o}var ct=["url"],ut=function(e){return"string"==typeof e},lt=function(e){return void 0===e},pt=function(e){return Ye(e)||$e(e)},dt=function(e){return e instanceof Error},ht=function(e){return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()},gt=(Date.now||(Date.now=function(){return(new Date).getTime()}),"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"),ft=gt.length,mt={};function _t(e,t){var n;return!(!Ye(e)||!Ye(t))&&(n=!1,t.forEach((function(t){var o=t.key,i=(t=t.value,e.find((function(e){return e.key===o})));i?i.value!==t&&(i.value=t,n=!0):(e.push({key:o,value:t}),n=!0)})),n)}function vt(e){return qe(e)?[]:e.filter((function(e){return!0===e.isModified}))}function yt(e){if(ze(e)&&ze(e.webhookInfo)){var t=[];if(e.webhookInfo.disableCloudMessagePreHook&&t.push("ForbidBeforeSendMsgCallback"),e.webhookInfo.disableCloudMessagePostHook&&t.push("ForbidAfterSendMsgCallback"),0!==t.length)return t}}function It(e){return qe(e)?[]:e.filter((function(e){return!1===e.isModified}))}function Mt(e){return e===S.GRP_AVCHATROOM}function Ct(e){var t=e.type;return e=e.groupID,t===S.GRP_COMMUNITY||"".concat(e).startsWith("@TGS#_")&&!"".concat(e).includes(Fe)}function Tt(e){return"".concat(e).startsWith("@TGS#_")&&"".concat(e).includes(Fe)}function St(e){return ut(e)&&e.slice(0,3)===S.CONV_C2C}function Et(e){return ut(e)&&e.slice(0,5)===S.CONV_GROUP}function kt(e){return ut(e)&&e===S.CONV_SYSTEM}function Dt(e,t){var n={};return Object.keys(e).forEach((function(o){n[o]=t(e[o],o)})),n}function Lt(e){return ee?Promise.resolve({width:0,height:0}):Z?new Promise((function(t,n){ne.getImageInfo({src:e,success:function(e){t({width:e.width,height:e.height})},fail:function(){t({width:0,height:0})}})})):ue&&9===le?Promise.resolve({width:0,height:0}):new Promise((function(t,n){var o=new Image;o.onload=function(){t({width:this.width,height:this.height}),o=null},o.onerror=function(){t({width:0,height:0}),o=null},o.src=e}))}function Rt(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return"".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function Ot(){var e=ae?"android":se?"ios":pe?"windows":de?"mac":"unknown";if(Z)try{var t=ne.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(n){}return e}function At(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.length<n;)e.push("0");for(;t.length<n;)t.push("0");for(var o=0;o<n;o++){var i=parseInt(e[o]),s=parseInt(t[o]);if(s<i)return 1;if(i<s)return-1}return 0}function bt(e){var t=void 0===(t=e.originUrl)?void 0:t,n=e.originWidth,o=e.originHeight,i=(e=void 0===(e=e.min)?198:e,{url:void 0,width:0,height:0});return((n=parseInt(n))<=(o=parseInt(o))?n:o)<=e?(i.url=t,i.width=n,i.height=o):(o<=n?(i.width=Math.ceil(n*e/o),i.height=e):(i.width=e,i.height=Math.ceil(o*e/n)),o=t&&-1<t.indexOf("?")?"".concat(t,"&"):"".concat(t,"?"),i.url="".concat(o,198===e?"imageView2/3/w/198/h/198":"imageView2/3/w/720/h/720")),lt(t)?f(i,ct):i}function Pt(e){var t=e[2];e[2]=e[1],e[1]=t;for(var n=0;n<e.length;n++)e[n].setType(n)}function Nt(e){return(e=e.servcmd).slice(e.indexOf(".")+1)}function xt(e,t){return Math.round(Number(e)*Math.pow(10,t))/Math.pow(10,t)}function wt(e,t){return e.includes(t)}function Ut(e,t){return e.includes(t)}function Gt(e){return e.split(Fe)[0]}function Ft(e,t,n){if(lt(t))return"";switch(e){case S.MSG_TEXT:return t.text;case S.MSG_IMAGE:return n?"[Image]":"[图片]";case S.MSG_LOCATION:return n?"[Location]":"[位置]";case S.MSG_AUDIO:return n?"[Voice]":"[语音]";case S.MSG_VIDEO:return n?"[Video]":"[视频]";case S.MSG_FILE:return n?"[File]":"[文件]";case S.MSG_CUSTOM:return n?"[Custom Messages]":"[自定义消息]";case S.MSG_GRP_TIP:return n?"[Group Notification]":"[群提示消息]";case S.MSG_GRP_SYS_NOTICE:return n?"[Group System Message]":"[群系统通知]";case S.MSG_FACE:return n?"[Animated Sticker]":"[动画表情]";case S.MSG_MERGER:return n?"[Chat Record]":"[聊天记录]";default:return""}}function Bt(e){return e===S.MSG_TEXT||e===S.MSG_CUSTOM||e===S.MSG_LOCATION||e===S.MSG_FACE}function qt(e){var t=[];if(ut(e)){var n=e.length;if(0!==n)for(var o=n-1;0<=o;o--)"1"===e[o]&&t.push(Math.pow(2,n-o-1))}return t}function Vt(){return!ue&&!Z}function jt(e){return"the length of userIDList cannot exceed ".concat(e)}function Ht(e){var t;if(Ye(e)&&0!==e.length)return t=0,e.forEach((function(e){t+=e})),t.toFixed(0)}function Kt(e){var t;if(Ye(e)&&0!==e.length)return t=0,e.forEach((function(e){t+=e})),(t/e.length).toFixed(0)}function $t(e,t,n){t=!(1<arguments.length&&void 0!==t)||t,n=!(2<arguments.length&&void 0!==n)||n;var o=Date.now();return t?n?"".concat(o-e," ms"):"".concat(Math.round((o-e)/1e3)," s"):n?o-e:Math.round((o-e)/1e3)}function zt(e){return!!(e&&1<e)}function Yt(e,t,n,o){var i,s,r;return void 0===t||(i=!0,t.required&&qe(e)&&(Oe.e("[".concat(n,'] Missing required params: "').concat(o,'".')),i=!1),qe(e)||(s=ht(e))===(r=t.type.toLowerCase())||"asyncfunction"===s&&"function"===r||(Oe.e("[".concat(n,'] Invalid params: type check failed for "').concat(o,'". Expected ').concat(t.type,".")),i=!1),t.validator&&!t.validator(e,n,o)&&(Oe.e("[".concat(n,'] Invalid params: custom validator check failed for "').concat(o,'".')),i=!1),i)}function Wt(e){return!(!e||!(St(e)||Et(e)||kt(e))&&((e=xn("InvalidConversationID",e))&&Oe.w(e),1))}function Jt(e){""!==e.desc&&""!==xn("API_REFER")&&Oe.w("[".concat(e.api,"] | ").concat(e.paramName," | ").concat(e.desc,", ").concat(xn("API_REFER")).concat(e.api))}function Xt(){return xn("StringRequiredLog")}function Zt(e){return xn("NonEmptyStringRequiredLog",e)}function Qt(){return xn("NumberRequiredLog")}function en(){return xn("UndefinedNotAllowedLog")}function tn(){return xn("FileRequiredLog")}function nn(){return xn("FunctionRequiredLog")}function on(){return xn("ArrayRequiredLog")}function sn(){return xn("NonEmptyArrayLog")}function rn(){return xn("CallbackMissingLog")}function an(){return xn("PositiveIntegerRequiredLog")}function cn(e,t){return xn("StringNotLongerThanLog",e,t)}function un(e,t){return xn("NumberGreaterThanLog",e,t)}function ln(e,t){return xn("NumberGreaterOrEqualLog",e,t)}function pn(e){return xn("KeyValueStringRequiredLog",e)}function dn(){return xn("PlainObjectRequiredLog")}function hn(){return xn("NonEmptyContentRequiredLog")}function gn(){return xn("FileNotSelectedLog")}function fn(){return xn("MessageInstanceRequiredLog")}function mn(){return xn("NonAnonymousFunctionLog")}function _n(){return xn("MessageExtensionNotAvailableLog")}function vn(){return xn("MessageReactionRequiredLog")}function yn(e,t){return xn("ContainsUnsupportedTypeLog",e,t)}function In(e,t,n,o){var i=o.allowUndefined,s=o.allowEmpty;return o=o.maxLength,lt(e)?!!i||(Jt({api:t,paramName:n,desc:en()}),!1):Ye(e)?!(0===e.length&&(Jt({api:t,paramName:n,desc:sn()}),!s)||o&&e.length>o&&(Jt({api:t,paramName:n,desc:xn("MaximumArrayLengthLog",n,o)}),1)):(Jt({api:t,paramName:n,desc:on()}),!1)}function Mn(e,t,n,o){var i=o.allowUndefined,s=o.min;return o=o.max,lt(e)?!!i||(Jt({api:t,paramName:n,desc:en()}),!1):Ke(e)?Ke(s)&&e<s?(Jt({api:t,paramName:n,desc:0===s?ln(n,s):un(n,s-1)}),!1):!(Ke(o)&&o<e&&(Jt({api:t,paramName:n,desc:xn("MaximumNumberLog",n,o)}),1)):(Jt({api:t,paramName:n,desc:Qt()}),!1)}function Cn(e){return{code:0,data:e||{}}}function Tn(e){return Promise.resolve(Cn(e))}function Sn(e){var t,n=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return e instanceof Bn?(n&&null!==Vn&&Vn.emit(T.ERROR,e),Promise.reject(e)):e instanceof Error?(t=new Bn({code:qn.UNCAUGHT_ERROR}),n&&null!==Vn&&Vn.emit(T.ERROR,t),Promise.reject(t)):lt(e)||lt(e.code)?Promise.reject(new Bn({code:qn.UNCAUGHT_ERROR})):(t=new Bn(e),n&&null!==Vn&&Vn.emit(T.ERROR,t),Promise.reject(t))}var En="unSend",kn="success",Dn="fail",Ln="notStart",Rn="pending",On="resolved",An="rejected",bn={type:"Boolean",required:!0},Pn={type:"number",required:!0},Nn={keywordListForMsg:{type:"Array",required:!1,validator:function(e,t,n){return In(e,t,n,{allowUndefined:!0,allowEmpty:!0,maxLength:5})}},keywordListExceptMsg:{type:"Array",required:!0,validator:function(e,t,n){return In(e,t,n,{allowUndefined:!1,allowEmpty:!1,maxLength:5})}},keywordListMatchType:{type:"String",required:!1,validator:function(e,t,n){return!e||"or"===e||"and"===e||Jt({api:t,paramName:n,desc:"".concat(e," is invalid match type")})}},cursor:{type:"String",required:!1},count:{type:"Number",required:!1,validator:function(e,t,n){return Mn(e,t,n,{allowUndefined:!0,min:1,max:100})}},groupTypeList:{type:"Array",required:!1,validator:function(e,t,n){var o;return!e||!(!In(e,t,n,{allowUndefined:!0,allowEmpty:!0})||(o=[S.GRP_PUBLIC,S.GRP_COMMUNITY,S.GRP_WORK,S.GRP_MEETING],0<e.filter((function(e){return-1===o.indexOf(e)})).length&&(Jt({api:t,paramName:n,desc:yn(n,"group")}),1)))}}},xn=null,wn={hookGetAPITips:function(e){xn=e},login:{userID:Y={type:"String",required:!0},userSig:Y},addToBlacklist:{userIDList:Q={type:"Array",required:!0}},removeFromBlacklist:{userIDList:Q},on:[{name:"eventName",type:"String",validator:function(e,t,n){return"string"==typeof e&&0!==e.length||(Jt({api:t,paramName:n,desc:Zt(n)}),!1)}},{name:"handler",type:"Function",validator:function(e,t,n){return"function"!=typeof e?(Jt({api:t,paramName:n,desc:nn()}),!1):(""===e.name&&Jt({api:t,paramName:n,desc:mn()}),!0)}}],once:[{name:"eventName",type:"String",validator:function(e,t,n){return"string"==typeof e&&0!==e.length||(Jt({api:t,paramName:n,desc:Zt(n)}),!1)}},{name:"handler",type:"Function",validator:function(e,t,n){return"function"!=typeof e?(Jt({api:t,paramName:n,desc:nn()}),!1):(""===e.name&&Jt({api:t,paramName:n,desc:mn()}),!0)}}],off:[{name:"eventName",type:"String",validator:function(e,t,n){return"string"==typeof e&&0!==e.length||(Jt({api:t,paramName:n,desc:Zt(n)}),!1)}},{name:"handler",type:"Function",validator:function(e,t,n){return"function"!=typeof e?(Jt({api:t,paramName:n,desc:nn()}),!1):(""===e.name&&Jt({api:t,paramName:n,desc:mn()}),!0)}}],sendMessage:[g({name:"message"},J={type:"Object",required:!0})],setMessageExtensions:[g(g({name:"message"},J),{},{validator:function(e,t,n){return e.status===kn&&!0===e.isSupportExtension||(Jt({api:t,paramName:n,desc:_n()}),!1)}}),g({name:"extensions"},Q)],getMessageExtensions:[g(g({name:"message"},J),{},{validator:function(e,t,n){return e.status===kn&&!0===e.isSupportExtension||(Jt({api:t,paramName:n,desc:_n()}),!1)}})],deleteMessageExtensions:[g(g({name:"message"},J),{},{validator:function(e,t,n){return e.status===kn&&!0===e.isSupportExtension||(Jt({api:t,paramName:n,desc:_n()}),!1)}})],addMessageReaction:[g(g({name:"message"},J),{},{validator:function(e,t,n){return e.status===kn||(Jt({api:t,paramName:n,desc:vn()}),!1)}}),g({name:"reactionID"},Y)],removeMessageReaction:[g(g({name:"message"},J),{},{validator:function(e,t,n){return e.status===kn||(Jt({api:t,paramName:n,desc:vn()}),!1)}}),g({name:"reactionID"},Y)],getMessageReactions:{messageList:g({},Q)},getAllUserListOfMessageReaction:{message:g(g({},J),{},{validator:function(e,t,n){return e.status===kn||(Jt({api:t,paramName:n,desc:vn()}),!1)}}),reactionID:g({},Y),nextSeq:{type:"Number"},count:{type:"Number"}},getMessageList:{conversationID:g(g({},Y),{},{validator:Wt}),nextReqMessageID:{type:"String"},count:{type:"Number",validator:function(e,t,n){return!(!lt(e)&&!/^[1-9][0-9]*$/.test(e)&&(Jt({api:t,paramName:n,desc:an()}),1))}}},getMessageListHopping:{conversationID:g(g({},Y),{},{validator:Wt}),sequence:{type:"Number"},time:{type:"Number"},direction:{type:"Number",validator:function(e,t,n){return!(!lt(e)&&0!==e&&1!==e&&(Jt({api:t,paramName:n,desc:xn("0Or1RequiredLog")}),1))}},count:{type:"Number",validator:function(e,t,n){return!(!lt(e)&&!/^[1-9][0-9]*$/.test(e)&&(Jt({api:t,paramName:n,desc:an}),1))}}},setMessageRead:{conversationID:g(g({},Y),{},{validator:Wt})},setAllMessageRead:{scope:{type:"String",required:!1,validator:function(e,t,n){return!e||-1!==[S.READ_ALL_C2C_MSG,S.READ_ALL_GROUP_MSG,S.READ_ALL_MSG].indexOf(e)||(Jt({api:t,paramName:n,desc:xn("ValidScopeRequired")}),!1)}}},getConversationProfile:[g(g({name:"conversationID"},Y),{},{validator:Wt})],clearHistoryMessage:[g(g({name:"conversationID"},Y),{},{validator:Wt})],pinConversation:{conversationID:g(g({},Y),{},{validator:Wt}),isPinned:g({},bn)},setConversationDraft:{conversationID:g(g({},Y),{},{validator:Wt}),draftText:{type:"String",validator:function(e,t,n){return!!ut(e)||(Jt({api:t,paramName:n,desc:Xt()}),!1)}}},setConversationCustomData:{conversationIDList:g({},Q),customData:{type:"String",validator:function(e,t,n){return ut(e)?!(256<e.length&&(Jt({api:t,paramName:n,desc:cn(n,256)}),1)):(Jt({api:t,paramName:n,desc:Xt()}),!1)}}},markConversation:{conversationIDList:g({},Q),markType:{type:"number",validator:function(e,t,n){return Ke(e)?e<=0?(Jt({api:t,paramName:n,desc:un(n,0)}),!1):!(e>=Math.pow(2,64)&&(Jt({api:t,paramName:n,desc:xn("NumberLessThanLog",n,"Math.pow(2,64)")}),1)):(Jt({api:t,paramName:n,desc:Qt()}),!1)}},enableMark:g({},bn)},createConversationGroup:{conversationIDList:g({},Q),groupName:g(g({},Y),{},{validator:function(e,t,n){return!(!e||32<e.length&&(Jt({api:t,paramName:n,desc:cn(n,32)}),1))}})},deleteConversationGroup:[g({name:"groupName"},Y)],renameConversationGroup:{oldName:g({},Y),newName:g(g({},Y),{},{validator:function(e,t,n){return!(!e||32<e.length&&(Jt({api:t,paramName:n,desc:cn(n,32)}),1))}})},addConversationsToGroup:{conversationIDList:g({},Q),groupName:g({},Y)},deleteConversationsFromGroup:{conversationIDList:g({},Q),groupName:g({},Y)},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:Y,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:Q},createGroup:{name:Y},joinGroup:{groupID:Y,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[g({name:"groupID"},Y)],handleApplication:{message:J,handleAction:Y,handleMessage:{type:"String"}},changeGroupOwner:{groupID:Y,newOwnerID:Y},updateGroupProfile:{groupID:Y,muteAllMembers:{type:"Boolean"}},dismissGroup:[g({name:"groupID"},Y)],searchGroupByID:[g({name:"groupID"},Y)],getGroupOnlineMemberCount:[g({name:"groupID"},Y)],initGroupAttributes:{groupID:Y,groupAttributes:g(g({},J),{},{validator:function(e,t,n){var o=!0;return Object.keys(e).forEach((function(i){if(!ut(e[i]))return Jt({api:t,paramName:n,desc:pn("value")}),o=!1})),o}})},setGroupAttributes:{groupID:Y,groupAttributes:g(g({},J),{},{validator:function(e,t,n){var o=!0;return Object.keys(e).forEach((function(i){if(!ut(e[i]))return Jt({api:t,paramName:n,desc:pn("value")}),o=!1})),o}})},deleteGroupAttributes:{groupID:Y,keyList:{type:"Array",validator:function(e,t,n){var o;return lt(e)||!Ye(e)?(Jt({api:t,paramName:n,desc:on()}),!1):!!qe(e)||(o=!0,e.forEach((function(e){if(!ut(e))return Jt({api:t,paramName:n,desc:xn("StringArrayRequiredLog")}),o=!1})),o)}}},getGroupAttributes:{groupID:Y,keyList:{type:"Array",validator:function(e,t,n){var o;return lt(e)||!Ye(e)?(Jt({api:t,paramName:n,desc:on()}),!1):!!qe(e)||(o=!0,e.forEach((function(e){if(!ut(e))return Jt({api:t,paramName:n,desc:pn("key")}),o=!1})),o)}}},setGroupCounters:{groupID:Y,counters:J},increaseGroupCounter:{groupID:Y,key:Y,value:Pn},decreaseGroupCounter:{groupID:Y,key:Y,value:Pn},getGroupCounters:{groupID:Y},getGroupMemberList:{groupID:Y,count:{type:"Number"}},getGroupMemberProfile:{groupID:Y,userIDList:Q,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:Y,userIDList:Q},setGroupMemberRole:{groupID:Y,userID:Y,role:Y},setGroupMemberMuteTime:{groupID:Y,userID:Y,muteTime:{type:"Number",validator:function(e){return 0<=e}}},setGroupMemberNameCard:{groupID:Y,userID:{type:"String"},nameCard:{type:"String",validator:function(e,t,n){return ut(e)?(e.length,!0):(Jt({api:t,paramName:n,desc:Xt()}),!1)}}},setGroupMemberCustomField:{groupID:Y,userID:{type:"String"},memberCustomField:Q},deleteGroupMember:{groupID:Y},markGroupMemberList:{groupID:Y,markType:{type:"number",validator:function(e,t,n){return Ke(e)?!(e<1e3&&(Jt({api:t,paramName:n,desc:ln(n,1e3)}),1)):(Jt({api:t,paramName:n,desc:Qt()}),!1)}},userIDList:g({},Q),enableMark:g({},bn)},createTextMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){return ze(e)?ut(e.text)?0!==e.text.length||(Jt({api:t,paramName:"payload.text",desc:hn()}),!1):(Jt({api:t,paramName:"payload.text",desc:Xt()}),!1):(Jt({api:t,paramName:n,desc:dn()}),!1)}})},createTextAtMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){return ze(e)?ut(e.text)?0===e.text.length?(Jt({api:t,paramName:"payload.text",desc:hn()}),!1):!(e.atUserList&&!Ye(e.atUserList)&&(Jt({api:t,paramName:"payload.atUserList",desc:on()}),1)):(Jt({api:t,paramName:"payload.text",desc:Xt()}),!1):(Jt({api:t,paramName:n,desc:dn()}),!1)}})},createCustomMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){return ze(e)?e.data&&!ut(e.data)?(Jt({api:t,paramName:"payload.data",desc:Xt()}),!1):e.description&&!ut(e.description)?(Jt({api:t,paramName:"payload.description",desc:Xt()}),!1):!(e.extension&&!ut(e.extension)&&(Jt({api:t,paramName:"payload.extension",desc:Xt()}),1)):(Jt({api:t,paramName:"payload",desc:dn()}),!1)}})},createImageMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){if(!ze(e))return Jt({api:t,paramName:n,desc:dn()}),!1;if(lt(e.file))return Jt({api:t,paramName:"payload.file",desc:en()}),!1;if(te){if(!(e.file instanceof HTMLInputElement||He(e.file)))return ze(e.file)&&void 0!==Gn?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Jt({api:t,paramName:"payload.file",desc:gn()}),!1):(Jt({api:t,paramName:"payload.file",desc:tn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Jt({api:t,paramName:"payload.file",desc:gn()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:function(e,t,n){return lt(e)&&Jt({api:t,paramName:n,desc:rn()}),!0}}})},createAudioMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){return!!ze(e)||(Jt({api:t,paramName:n,desc:dn()}),!1)}}),onProgress:{type:"Function",required:!1,validator:function(e,t,n){return lt(e)&&Jt({api:t,paramName:n,desc:rn()}),!0}}},createVideoMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){if(!ze(e))return Jt({api:t,paramName:n,desc:dn()}),!1;if(lt(e.file))return Jt({api:t,paramName:"payload.file",desc:en()}),!1;if(te){if(!(e.file instanceof HTMLInputElement||He(e.file)))return ze(e.file)&&void 0!==Gn?!!He(e.file.tempFile)||(Jt({api:t,paramName:"payload.file",desc:gn()}),!1):(Jt({api:t,paramName:"payload.file",desc:tn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Jt({api:t,paramName:"payload.file",desc:gn()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e,t,n){return lt(e)&&Jt({api:t,paramName:n,desc:rn()}),!0}}},createFaceMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){return ze(e)?Ke(e.index)?!!ut(e.data)||(Jt({api:t,paramName:"payload.data",desc:Xt()}),!1):(Jt({api:t,paramName:"payload.index",desc:Qt()}),!1):(Jt({api:t,paramName:n,desc:dn()}),!1)}})},createFileMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){if(!ze(e))return Jt({api:t,paramName:n,desc:dn()}),!1;if(lt(e.file))return Jt({api:t,paramName:"payload.file",desc:en()}),!1;if(te){if(!(e.file instanceof HTMLInputElement||He(e.file)))return ze(e.file)&&void 0!==Gn?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Jt({api:t,paramName:"payload.file",desc:gn()}),!1):(Jt({api:t,paramName:"payload.file",desc:tn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Jt({api:t,paramName:"payload.file",desc:gn()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e,t,n){return lt(e)&&Jt({api:t,paramName:n,desc:rn()}),!0}}},createLocationMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){return ze(e)?ut(e.description)?Ke(e.longitude)?!!Ke(e.latitude)||(Jt({api:t,paramName:"payload.latitude",desc:Qt()}),!1):(Jt({api:t,paramName:"payload.longitude",desc:Qt()}),!1):(Jt({api:t,paramName:"payload.description",desc:Xt()}),!1):(Jt({api:t,paramName:n,desc:dn()}),!1)}})},createMergerMessage:{to:Y,conversationType:Y,payload:g(g({},J),{},{validator:function(e,t,n){var o;return qe(e.messageList)?(Jt({api:t,paramName:"payload.messageList",desc:sn()}),!1):qe(e.compatibleText)?(Jt({api:t,paramName:"payload.compatibleText",desc:Zt("compatibleText")}),!1):(o=!1,e.messageList.forEach((function(e){e.status===Dn&&(o=!0)})),!o||(Jt({api:t,paramName:"payload.messageList",desc:xn("MergeFailedMessageLog")}),!1))}})},revokeMessage:[g(g({name:"message"},J),{},{validator:function(e,t,n){return qe(e)?(Jt({api:t,paramName:n,desc:fn()}),!1):e.conversationType===S.CONV_SYSTEM?(Jt({api:t,paramName:n,desc:xn("MessageCanBeRevokedDesc")}),!1):!0!==e.isRevoked||(Jt({api:t,paramName:n,desc:xn("MessageRevokedLog")}),!1)}})],deleteMessage:[g(g({name:"messageList"},Q),{},{validator:function(e,t,n){return!qe(e)||(Jt({api:t,paramName:n,desc:sn()}),!1)}})],translateText:{sourceTextList:Q,sourceLanguage:Y,targetLanguage:Y},convertVoiceToText:{message:g(g({},J),{},{validator:function(e,t,n){return qe(e)?(Jt({api:t,paramName:n,desc:fn()}),!1):e.type===S.MSG_AUDIO&&e.status===kn||(Jt({api:t,paramName:n,desc:xn("AudioMessageRequiredLog")}),!1)}})},modifyMessage:[g(g({name:"message"},J),{},{validator:function(e,t,n){return qe(e)?(Jt({api:t,paramName:n,desc:fn()}),!1):e.conversationType===S.CONV_SYSTEM?(Jt({api:t,paramName:n,desc:xn("MessageCanBeModifiedLog")}),!1):!0!==e._onlineOnlyFlag||(Jt({api:t,paramName:n,desc:xn("OnlineMessageNotSupportLog")}),!1)}})],searchCloudMessages:{keywordList:Nn.keywordListForMsg,keywordListMatchType:Nn.keywordListMatchType,cursor:Nn.cursor,senderUserIDList:{type:"Array",required:!1,validator:function(e,t,n){return In(e,t,n,{allowUndefined:!0,allowEmpty:!0,maxLength:5})}},messageTypeList:{type:"Array",required:!1,validator:function(e,t,n){var o;return!e||!(!In(e,t,n,{allowUndefined:!0,allowEmpty:!0})||(o=[S.MSG_TEXT,S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_FILE,S.MSG_VIDEO,S.MSG_LOCATION,S.MSG_CUSTOM,S.MSG_MERGER],0<e.filter((function(e){return-1===o.indexOf(e)})).length&&(Jt({api:t,paramName:n,desc:yn(n,"message")}),1)))}},conversationID:{type:"String",required:!1,validator:function(e){return!e||Wt(e)}},timePosition:{type:"number",required:!1,validator:function(e,t,n){return Mn(e,t,n,{allowUndefined:!0,min:0})}},timePeriod:{type:"number",required:!1,validator:function(e,t,n){return Mn(e,t,n,{allowUndefined:!0,min:0})}}},searchCloudUsers:{keywordList:Nn.keywordListExceptMsg,keywordListMatchType:Nn.keywordListMatchType,cursor:Nn.cursor,count:Nn.count,miniBirthday:{type:"Number",required:!1,validator:function(e,t,n){return Mn(e,t,n,{allowUndefined:!0,min:0})}},maxBirthday:{type:"Number",required:!1,validator:function(e,t,n){return Mn(e,t,n,{allowUndefined:!0,min:0})}},gender:{type:"String",required:!1,validator:function(e,t,n){return!e||e===S.GENDER_FEMALE||e===S.GENDER_MALE||Jt({api:t,paramName:n,desc:"".concat(e," is invalid match type")})}}},searchCloudGroups:{keywordList:Nn.keywordListExceptMsg,keywordListMatchType:Nn.keywordListMatchType,cursor:Nn.cursor,count:Nn.count,groupTypeList:Nn.groupTypeList},searchCloudGroupMembers:{keywordList:Nn.keywordListExceptMsg,keywordListMatchType:Nn.keywordListMatchType,cursor:Nn.cursor,count:Nn.count,groupTypeList:Nn.groupTypeList,groupIDList:{type:"Array",required:!1,validator:function(e,t,n){return In(e,t,n,{allowUndefined:!0,allowEmpty:!0})}}},getUserProfile:{userIDList:{type:"Array",validator:function(e,t,n){return Ye(e)?(0===e.length&&Jt({api:t,paramName:n,desc:sn()}),!0):(Jt({api:t,paramName:n,desc:on()}),!1)}}},updateMyProfile:{profileCustomField:{type:"Array",validator:function(e,t,n){return!!lt(e)||!!Ye(e)||(Jt({api:t,paramName:n,desc:on()}),!1)}}},setSelfStatus:{customStatus:{type:"String",validator:function(e,t,n){return!!ut(e)||(Jt({api:t,paramName:n,desc:Xt()}),!1)}}},getUserStatus:{userIDList:{type:"Array",validator:function(e,t,n){return Ye(e)?0!==e.length||(Jt({api:t,paramName:n,desc:sn()}),!1):(Jt({api:t,paramName:n,desc:on()}),!1)}}},subscribeUserStatus:{userIDList:{type:"Array",validator:function(e,t,n){return Ye(e)?0!==e.length||(Jt({api:t,paramName:n,desc:sn()}),!1):(Jt({api:t,paramName:n,desc:on()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:function(e,t,n){return!e||!!Ye(e)||(Jt({api:t,paramName:n,desc:on()}),!1)}}},addFriend:{to:Y,source:{type:"String",required:!0,validator:function(e,t,n){return!(!e||(e.startsWith("AddSource_Type_")?8<e.replace("AddSource_Type_","").length&&(Jt({api:t,paramName:n,desc:cn("keyword",8)}),1):(Jt({api:t,paramName:n,desc:xn("SourcePrefixLog")}),1)))}},remark:{type:"String",required:!1,validator:function(e,t,n){return!(ut(e)&&96<e.length&&(Jt({api:t,paramName:n,desc:cn(n,96)}),1))}}},deleteFriend:{userIDList:Q},checkFriend:{userIDList:Q},getFriendProfile:{userIDList:Q},updateFriend:{userID:Y,remark:{type:"String",required:!1,validator:function(e,t,n){return!(ut(e)&&96<e.length&&(Jt({api:t,paramName:n,desc:cn(n,96)}),1))}},friendCustomField:{type:"Array",required:!1,validator:function(e,t,n){var o;return!e||(Ye(e)?(o=!0,e.forEach((function(e){return ut(e.key)&&-1!==e.key.indexOf("Tag_SNS_Custom")?ut(e.value)?8<e.key.replace("Tag_SNS_Custom_","").length?(Jt({api:t,paramName:n,desc:cn("keyword",8)}),o=!1):void 0:(Jt({api:t,paramName:n,desc:pn("value")}),o=!1):(Jt({api:t,paramName:n,desc:xn("FriendCustomFieldPrefixLog")}),o=!1)})),o):(Jt({api:t,paramName:n,desc:on()}),!1))}}},acceptFriendApplication:{userID:Y},refuseFriendApplication:{userID:Y},deleteFriendApplication:{userID:Y},createFriendGroup:{name:Y},deleteFriendGroup:{name:Y},addToFriendGroup:{name:Y,userIDList:Q},removeFromFriendGroup:{name:Y,userIDList:Q},renameFriendGroup:{oldName:Y,newName:Y},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:function(e,t,n){return Ye(e)?0!==e.length||(Jt({api:t,paramName:n,desc:sn()}),!1):(Jt({api:t,paramName:n,desc:on()}),!1)}}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:function(e,t,n){return Ye(e)?0!==e.length||(Jt({api:t,paramName:n,desc:sn()}),!1):(Jt({api:t,paramName:n,desc:on()}),!1)}}],createTopicInCommunity:{groupID:Y,topicName:Y},deleteTopicFromCommunity:{groupID:Y,topicIDList:{type:"Array",validator:function(e,t,n){return!e||!!Ye(e)||(Jt({api:t,paramName:n,desc:on()}),!1)}}},updateTopicProfile:{groupID:Y,topicID:Y},getTopicList:{groupID:Y,topicIDList:{type:"Array",validator:function(e,t,n){return!e||!!Ye(e)||(Jt({api:t,paramName:n,desc:on()}),!1)}}},followUser:[g({name:"userIDList"},Q)],unfollowUser:[g({name:"userIDList"},Q)],getMyFollowingList:[g(g({name:"startIndex"},Y),{},{required:!1})],getMyFollowersList:[g(g({name:"startIndex"},Y),{},{required:!1})],getMutualFollowersList:[g(g({name:"startIndex"},Y),{},{required:!1})],getUserFollowInfo:[g(g({name:"userIDList"},Q),{},{required:!1})],checkFollowType:[g({name:"userIDList"},Q)],addSignalingListener:[{name:"eventName",type:"String",validator:function(e,t,n){return"string"==typeof e&&0!==e.length||(Jt({api:t,paramName:n,desc:Zt(n)}),!1)}},{name:"handler",type:"Function",validator:function(e,t,n){return"function"!=typeof e?(Jt({api:t,paramName:n,desc:nn()}),!1):(""===e.name&&Jt({api:t,paramName:n,desc:mn()}),!0)}}],removeSignalingListener:[{name:"eventName",type:"String",validator:function(e,t,n){return"string"==typeof e&&0!==e.length||(Jt({api:t,paramName:n,desc:Zt(n)}),!1)}},{name:"handler",type:"Function",validator:function(e,t,n){return"function"!=typeof e?(Jt({api:t,paramName:n,desc:nn()}),!1):(""===e.name&&Jt({api:t,paramName:n,desc:mn()}),!0)}}],invite:{userID:Y},inviteSync:[g(g({},J),{},{validator:function(e,t,n){return ze(e)?!!ut(e.userID)||(Jt({api:t,paramName:"options.userID",desc:Xt()}),!1):(Jt({api:t,paramName:"options",desc:dn()}),!1)}}),{name:"successCb",type:"Function",required:!1,validator:function(e,t,n){return lt(e)&&Jt({api:t,paramName:n,desc:nn()}),!0}},{name:"errorCb",type:"Function",required:!1,validator:function(e,t,n){return lt(e)&&Jt({api:t,paramName:n,desc:nn()}),!0}}],inviteInGroup:{groupID:Y,inviteeList:Q},inviteInGroupSync:[g(g({},J),{},{validator:function(e,t,n){return ze(e)?ut(e.groupID)?!!Ye(e.inviteeList)||(Jt({api:t,paramName:"options.inviteeList",desc:on()}),!1):(Jt({api:t,paramName:"options.groupID",desc:Xt()}),!1):(Jt({api:t,paramName:"options",desc:dn()}),!1)}}),{name:"successCb",type:"Function",required:!1,validator:function(e,t,n){return lt(e)&&Jt({api:t,paramName:n,desc:nn()}),!0}},{name:"errorCb",type:"Function",required:!1,validator:function(e,t,n){return lt(e)&&Jt({api:t,paramName:n,desc:nn()}),!0}}],accept:{inviteID:Y},reject:{inviteID:Y},getSignalingInfo:[g(g({name:"message"},J),{},{validator:function(e,t,n){return!qe(e)||(Jt({api:t,paramName:n,desc:fn()}),!1)}})],modifyInvitation:{inviteID:Y,data:Y}},Fn={login:1,logout:1,getLoginUser:1,getServerTime:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,isReady:1,createTextMessage:1,createTextAtMessage:1,createImageMessage:1,createAudioMessage:1,createVideoMessage:1,createCustomMessage:1,createFaceMessage:1,createFileMessage:1,createLocationMessage:1,createMergerMessage:1,downloadMergerMessage:1,createForwardMessage:1,sendMessage:1,resendMessage:1,revokeMessage:1,deleteMessage:1,translateText:1,convertVoiceToText:1,modifyMessage:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,addMessageReaction:1,removeMessageReaction:1,getMessageReactions:1,getAllUserListOfMessageReaction:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,setConversationDraft:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,setMessageRemindType:1,setAllReceiveMessageOpt:1,getAllReceiveMessageOpt:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,searchCloudMessages:1,searchCloudUsers:1,searchCloudGroups:1,searchCloudGroupMembers:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,followUser:1,unfollowUser:1,getMyFollowingList:1,getMyFollowersList:1,getMutualFollowersList:1,getUserFollowInfo:1,checkFollowType:1,callExperimentalAPI:1,addSignalingListener:1,removeSignalingListener:1,invite:1,inviteSync:1,inviteInGroup:1,inviteInGroupSync:1,cancel:1,accept:1,reject:1,getSignalingInfo:1,modifyInvitation:1},Bn=(u(ao,C(Error)),s(ao)),qn={NO_SDKAPPID:2e3,NO_ACCOUNT_TYPE:2001,NO_IDENTIFIER:2002,NO_USERSIG:2003,NO_TINYID:2022,NO_A2KEY:2023,USER_NOT_LOGGED_IN:2024,REPEAT_LOGIN:2025,COS_UNDETECTED:2040,COS_GET_SIG_FAIL:2041,MSG_SEND_FAIL:2100,MSG_SEND_FAIL_NOT_IN_AV:2101,MSG_INSTANCE_REQUIRED:2105,MSG_INVALID_CONV_TYPE:2106,MSG_F_IS_EMPTY:2108,MSG_ONPROGRESS_ERR:2109,MSG_REVOKE_FAIL:2110,MSG_DELETE_FAIL:2111,MSG_UNREAD_ALL_FAIL:2112,READ_RECEIPT_MSG_LIST_EMPTY:2114,MSG_SEND_GRP_WITH_TOPIC_FAIL:2115,CANNOT_DELETE_GRP_SYSTEM_NOTICE:2116,TRANSLATE_TEXT_FAIL:2117,VOICE_TO_TEXT_FAIL:2118,UNSUPPORTED_VOICE_FORMAT:2119,MSG_I_SELECT_F_FIRST:2251,MSG_I_TYPES_LIMIT:2252,MSG_I_SIZE_LIMIT:2253,MSG_A_UPLOAD_FAIL:2300,MSG_A_SIZE_LIMIT:2301,MSG_V_UPLOAD_FAIL:2350,MSG_V_SIZE_LIMIT:2351,MSG_V_TYPES_LIMIT:2352,MSG_F_UPLOAD_FAIL:2400,MSG_F_SELECT_F_FIRST:2401,MSG_F_SIZE_LIMIT:2402,MSG_F_URL_IS_EMPTY:2403,MSG_MERGER_TYPE_INVALID:2450,MSG_MERGER_KEY_INVALID:2451,MSG_MERGER_DOWNLOAD_FAIL:2452,MSG_FORWARD_TYPE_INVALID:2453,MSG_FORWARD_INVALID_ELEMENTS:2454,MSG_MODIFY_CONFLICT:2480,MSG_MODIFY_DISABLED_IN_AV:2481,CONV_NOT_FOUND:2500,USER_OR_GRP_NOT_FOUND:2501,CONV_UN_RECORDED_TYPE:2502,INVALID_CONV_ID:2503,ILLEGAL_GRP_TYPE:2600,ILLEGAL_GRP_ID:2602,CANNOT_FIND_GRP:2603,CANNOT_CHANGE_OWNER_IN_AV:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,MEMBER_NOT_IN_GRP:2623,JOIN_GRP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AV:2661,CANNOT_JOIN_NON_AV_WITHOUT_LOGIN:2662,NOT_OWNER:2681,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,OPERATION_NOT_SUPPORTED_IN_AV:2687,NOT_MY_FRIEND:2700,ALREADY_MY_FRIEND:2701,FRIEND_GRP_EXISTED:2710,FRIEND_GRP_NOT_EXIST:2711,FRIEND_APPLICATION_NOT_EXIST:2716,UPDATE_PROFILE_INVALID_PARAM:2721,UPDATE_PROFILE_NO_KEY:2722,CANNOT_ADD_SELF_TO_BLACKLIST:2742,NETWORK_ERROR:2800,NETWORK_TIMEOUT:2801,NO_NETWORK:2805,UNCAUGHT_ERROR:2903,INVALID_OPERATION:2905,INVALID_TRTC_CMD:2995,OVER_FREQUENCY_LIMIT:2996,NO_PROTOCOL:2997,NO_MODULE:2998,SDK_IS_NOT_READY:2999,LOGGING_IN:3e3,LOGIN_FAILED:3001,KICKED_OUT_MULT_DEVICE:3002,KICKED_OUT_MULT_ACCOUNT:3003,KICKED_OUT_USERSIG_EXPIRED:3004,LOGGED_OUT:3005,KICKED_OUT_REST_API:3006,ILLEGAL_TOPIC_ID:3021,NO_USE:3122,PROFANITY_FOUND:3123,OPTIONS_IS_EMPTY:3153,MSG_A2KEY_EXPIRED:20002,ACCOUNT_A2KEY_EXPIRED:70001,HELLO_ANSWER_KICKED_OUT:1002,OPEN_SERVICE_OVERLOAD_ERROR:60022,SIGNALING_INVALID_INVITE_ID:8010,SIGNALING_NO_PERMISSION:8011,SIGNALING_ALREADY_EXISTS:8012,INVALID_CANCEL_MESSAGE:8020},Vn=null,jn=(Pn=s((function e(t){o(this,e),this._m=t,this._n=""}),[{key:"isLoggedIn",value:function(){return this._m.get(12).isLoggedIn()}},{key:"isOversea",value:function(){return this._m.get(12).isOversea()}},{key:"isPrivateNetWork",value:function(){var e=this._m.get(12);return e.isPrivateNetWork()&&!e.getFileDownloadProxy()}},{key:"getFileDownloadProxy",value:function(){return this._m.get(12).getFileDownloadProxy()}},{key:"getDownloadFileAuthKey",value:function(){return this._m.get(12).getDownloadFileAuthKey()}},{key:"getMyUserID",value:function(){return this._m.get(12).getUserID()}},{key:"getMyTinyID",value:function(){return this._m.get(12).getTinyID()}},{key:"getSDKAppID",value:function(){return this._m.get(12).getSDKAppID()}},{key:"isIntl",value:function(){return this._m.get(12).isIntl()}},{key:"isUsingChatCore",value:function(){return this._m.get(12).isUsingChatCore()}},{key:"isDevMode",value:function(){return this._m.get(12).isDevMode()}},{key:"get",value:function(e){return this._m.get(e)}},{key:"getPlatform",value:function(){return ie}},{key:"getCloudConfig",value:function(e){return this._m.get(23).getCloudConfig(e)}},{key:"emitOEvt",value:function(e,t){this._m.getOEmitInst().emit(e,t)}},{key:"emitIEvt",value:function(e,t){this._m.getIEmitInst().emit(e,t)}},{key:"getIEmitInst",value:function(){return this._m.getIEmitInst()}},{key:"req",value:function(e){return this._m.get(20).req(e)}},{key:"canIUse",value:function(e){return this._m.get(27).canIUse(e)}},{key:"getErrMsg",value:function(e,t,n){return this._m.getErrMsg(e,t,n)}},{key:"warn",value:function(e,t,n){(e=this.getErrMsg(e,t,n))&&Oe.w(e)}},{key:"noUse",value:function(e){var t=qn.NO_USE;return Sn({code:t,message:this.getErrMsg(t,e)})}}]),{LOGIN:"wslogin",LOGOUT:"wslogout",HELLO:"wshello",KICK_OTHER:"KickOther",SYNC_UNREAD_MSG:"getmsg",SEND_C2C_MSG:"sendmsg",SEND_GRP_MSG:"send_group_msg",GET_USER_PROFILE:"portrait_get_all",UPDATE_MY_PROFILE:"portrait_set",GET_BL:"black_list_get",ADD_TO_BL:"black_list_add",RM_FROM_BL:"black_list_delete",GET_FD_LIST:"friend_get",GET_FD_PROFILE:"friend_get_specified",CHECK_FD:"friend_check",DEL_FD:"friend_delete",ADD_FD:"friend_add",UPDATE_FD:"friend_update",RESPOND_FD_APPLICATION:"friend_response",GET_FD_APPLICATION_LIST:"pendency_get",DEL_FD_APPLICATION:"pendency_delete",REFUSE_FD_APPLICATION:"pendency_refuse",REPORT_FD_APPLICATION:"pendency_report",GET_FD_GRP_LIST:"group_get",CREATE_FD_GRP:"group_add",DEL_FD_GRP:"group_delete",UPDATE_FD_GRP:"group_update",REVOKE_C2C_MSG:"msgwithdraw",SET_C2C_MSG_READ:"msgreaded",SET_C2C_PEER_MUTE_NOTIFICATIONS:"set_c2c_peer_mute_notifications",GET_C2C_PEER_MUTE_NOTIFICATIONS:"get_c2c_peer_mute_notifications",GET_C2C_ROAMING_MSG:"getroammsg",GET_C2C_PEER_READ_TIME:"get_peer_read_time",DEL_C2C_MSG:"delete_c2c_msg_ramble",MODIFY_C2C_MSG:"modify_c2c_msg",MODIFY_C2C_MSG_EXT:"set_key_values",GET_C2C_MSG_EXT:"get_key_values",ADD_C2C_MSG_REACTION:"reaction_add",RM_C2C_MSG_REACTION:"reaction_del",GET_C2C_MSG_REACTIONS:"reaction_multi_stat",GET_C2C_MSG_REACTION_USER_LIST:"reaction_iterate",PAGING_GET_CONV_LIST:"page_get",DEL_CONV:"batch_delete",CLEAR_HISTORY_MSG:"clear_msg",PIN_CONV:"top",DEL_GROUP_AT_TIPS:"deletemsg",SET_CONV_CUSTOM_DATA:"set_conv_custom_data",MARK_CONV:"mark_contact",CREATE_CONV_GRP:"create_contact_group",DEL_CONV_GRP:"del_contact_group",RENAME_CONV_GRP:"update_contact_group",ADD_CONV_TO_GRP:"add_conv_to_group",DEL_CONV_FROM_GRP:"del_conv_from_group",GET_CONV_GRP_LIST:"get_contact_group",SEARCH_CONV_GRP_MARK:"search_contact_group",GET_GRP_LIST:"get_joined_group_list",GET_GRP_PROFILE:"get_group_self_member_info",CREATE_GRP:"create_group",DISMISS_GRP:"destroy_group",UPDATE_GRP_PROFILE:"modify_group_base_info",APPLY_JOIN_GRP:"apply_join_group",APPLY_JOIN_GRP_NOAUTH:"apply_join_group_noauth",QUIT_GRP:"quit_group",SEARCH_GRP:"get_group_public_info",CHANGE_GRP_OWNER:"change_group_owner",HANDLE_GRP_APPLICATION:"handle_apply_join_group",HANDLE_INVITE_JOIN_GRP:"handle_invite_join_permission_group",HANDLE_GRP_INVITATION:"handle_invite_join_group",REVOKE_GRP_MSG:"group_msg_recall",SET_GRP_MSG_READ:"msg_read_report",SET_ALL_MSG_READ:"read_all_unread_msg",GET_GRP_ROAMING_MSG:"group_msg_get",GET_READ_RECEIPT:"get_group_msg_receipt",SEND_READ_RECEIPT:"group_msg_receipt",SEND_C2C_READ_RECEIPT:"c2c_msg_read_receipt",GET_READ_RECEIPT_DETAIL:"get_group_msg_receipt_detail",GET_GRP_RECEIPTS_BY_USERS:"get_group_msg_receipts_by_users",GET_GRP_PENDENCY:"get_pendency",DEL_GRP_SYSTEM_NOTICE:"deletemsg",AV_POLLING:"get_msg",AV_NOAUTH_POLLING:"get_msg_noauth",GET_ONLINE_MBR_NUM:"get_online_member_num",DEL_GRP_MSG:"delete_group_ramble_msg_by_seq",MODIFY_GRP_MSG:"modify_group_msg",SET_GRP_ATTR:"set_group_attr",MODIFY_GRP_ATTR:"modify_group_attr",DEL_GRP_ATTR:"delete_group_attr",CLEAR_GRP_ATTR:"clear_group_attr",GET_GRP_ATTR:"get_group_attr",MODIFY_GRP_MSG_EXT:"group_set_key_values",GET_GRP_MSG_EXT:"group_get_key_values",GET_GRP_NOTIFY:"batch_get_group_notify",UPDATE_GRP_COUNTER:"update_group_counter",GET_GRP_COUNTER:"get_group_counter",ADD_GRP_MSG_REACTION:"group_reaction_add",RM_GRP_MSG_REACTION:"group_reaction_del",GET_GRP_MSG_REACTIONS:"group_reaction_multi_stat",GET_GRP_MSG_REACTION_USER_LIST:"group_reaction_iterate",GET_GRP_MBR_LIST:"get_group_member_info",GET_AV_MBR_LIST:"get_members",GET_GRP_MBR_PROFILE:"get_specified_group_member_info",ADD_GRP_MBR:"add_group_member",DEL_GRP_MBR:"delete_group_member",BAN_AV_MBR:"ban_group_member",MODIFY_GRP_MBR_INFO:"modify_group_member_info",MARK_AV_MBR_INFO:"modify_user_info",COS_SIGN:"cos",COS_PRE_SIG:"pre_sig",SIMPLE_COS_PRE_SIG:"simple_sig",GET_IMAGE_INFO:"get_imageinfo",GET_IP:"get_final_ip",VIDEO_COVER:"video_cover",SSO_STAT:"tim_web_report_v2",PING:"alive",MSG_PUSH:"msg_push",CS:"query",GRP_CS:"query_grp",MBR_CS:"query_grp_member",USER_CS:"query_user",MULTI_MSG_PUSH:"multi_msg_push_ws",MSG_PUSH_ACK:"ws_msg_push_ack",STATUS_FORCE_OFFLINE:"stat_forceoffline",UPLOAD_MERGER_MSG:"save_relay_json_msg",DOWNLOAD_MERGER_MSG:"get_relay_json_msg",FETCH_CLOUD_CTRL_CONFIG:"fetch_config",PUSHED_CLOUD_CTRL_CONFIG:"push_configv2",FETCH_COMMERCIAL_CONFIG:"fetch_imsdk_purchase_bitsv2",PUSHED_COMMERCIAL_CONFIG:"push_imsdk_purchase_bitsv2",OVERLOAD_NOTIFY:"notify2",CREATE_TOPIC:"create_topic",DEL_TOPIC:"destroy_topic",UPDATE_TOPIC_PROFILE:"modify_topic",GET_TOPIC_LIST:"get_topic",SET_SELF_STATUS:"ws_set_custom_status",GET_USER_STATUS:"ws_get_user_status",SUB_USER_STATUS:"ws_status_subscribe",UNSUB_USER_STATUS:"ws_status_unsubscribe",STAT_BACKGROUND:"ws_stat_background",STAT_FOREGROUND:"ws_stat_foreground",SET_TOKEN:"ws_stat_settoken",PUSH_REPORT:"uniapp_sdk_report",GET_PROFANITY_LIST:"get_local_words",TRANSLATE_TEXT:"ws_batch_trans_text",VOICE_TO_TEXT:"ws_sentence_recognition",FOLLOW:"follow_add",UNFOLLOW:"follow_delete",GET_FOLLOW:"follow_get",GET_FOLLOW_INFO:"follow_get_info",CHECK_FOLLOW_TYPE:"follow_check",SET_ALL_RECEIVE_MSG_OPT:"ws_set_do_not_disturb",GET_ALL_RECEIVE_MSG_OPT:"ws_get_do_not_disturb"}),Hn="networkRTT",Kn="messageE2EDelay",$n="sendMessageC2C",zn="sendMessageGroup",Yn="sendMessageGroupAV",Wn="sendMessageRichMedia",Jn="cosUpload",Xn="messageReceivedGroup",Zn="messageReceivedGroupAVPush",Qn="messageReceivedGroupAVPull",eo=a(a(a(a(a(a(a(a(a(a({},Hn,2),Kn,3),$n,4),zn,5),Yn,6),Wn,7),Xn,8),Zn,9),Qn,10),Jn,11),to={info:4,warning:5,error:6},no={wifi:1,"2g":2,"3g":3,"4g":4,"5g":5,unknown:6,none:7,online:8},oo={login:4,plugin_search:16,plugin_translate:16,plugin_voice_to_text:16,plugin_cs:16,plugin_push:16,plugin_bot:16,plugin_emoji_reaction:16,tui_key_features:16},io=s(ro,[{key:"updateTimeStamp",value:function(){this.timestamp=ke()}},{key:"start",value:function(e){return this._startts=e,this}},{key:"end",value:function(){var e,t=this,n=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this._sentFlag||(this._netMonitorModule&&(e=this._netMonitorModule.getNetworkType(),this.setNetworkType(e)),e=ke(),0===this.costTime&&(this.costTime=e-this._startts),this.setMoreMessage("startts:".concat(this._startts," endts:").concat(e)),n?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout((function(){t._sentFlag=!0,t._eventStatModule&&t._eventStatModule.pushIn(t)}),0))}},{key:"setError",value:function(e){var t;return e instanceof Error?this._sentFlag||(t=!0,(t=this._netMonitorModule?this._netMonitorModule.isOnline():t)?(e.code&&this.setCode(e.code),e.message&&this.setMoreMessage(e.message)):this.setCode(qn.NO_NETWORK),this.setLevel("error")):Oe.w("".concat(this._n,".setError value not instanceof Error, please check!")),this}},{key:"setCode",value:function(e){return lt(e)||this._sentFlag||("ECONNABORTED"===e&&(this.code=103),Ke(e)?this.code=e:Oe.w("".concat(this._n,".setCode value not a number, please check!"),e,I(e))),this}},{key:"setMessage",value:function(e){return lt(e)||this._sentFlag||(Ke(e)&&(this.message=e.toString()),ut(e)&&(this.message=e)),this}},{key:"setCostTime",value:function(e){return this.costTime=e,this}},{key:"setLevel",value:function(e){return lt(e)||this._sentFlag||(this.level=to[e]),this}},{key:"setMoreMessage",value:function(e){return qe(this.moreMessage)?this.moreMessage="".concat(e):this.moreMessage+=" ".concat(e),this}},{key:"setNetworkType",value:function(e){return lt(e)?Oe.w("".concat(this._n,".setNetworkType value is undefined, please check!")):(e=no[e.toLowerCase()],lt(e)||(this.networkType=e)),this}},{key:"getStartTs",value:function(){return this._startts}},{key:"setUIPlatform",value:function(e){return this.uiPlatform=e,this}},{key:"setExtension",value:function(e){return this.extension=e,this}},{key:"setEventType",value:function(e){return this.eventType=e,this}}],[{key:"bindEventStatModule",value:function(e){ro.prototype._eventStatModule=e}},{key:"bindNetMonitorModule",value:function(e){ro.prototype._netMonitorModule=e}}]),so=s((function e(t){o(this,e),this.type=S.MSG_TEXT,this.content={text:t.text||""}}),[{key:"setText",value:function(e){this.content.text=e}},{key:"sendable",value:function(){return 0!==this.content.text.length}}]);function ro(e){o(this,ro),this._n="SSOLogData",this.eventType=oo[e]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message="",this.moreMessage="",this.extension=e,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=ke()}function ao(e){o(this,ao),t=n(this,ao);var t,i=e.code,s=e.message;return e=e.data,t.code=i,s?t.message=s:t._getErrMsg&&(t.message=t._getErrMsg(t.code)),t.data=e||{},t}function co(e,t,n,o){var i;return o=3<arguments.length&&void 0!==o?o:[],e&&(i=e,t&&(e.startsWith("http://")?i=e.replace(/^http:\/\/[^/]+/,t):e.startsWith("https://")&&(i=e.replace(/^https:\/\/[^/]+/,t))),n&&-1===i.indexOf("authKey=")&&po(i,o)?(-1<i.indexOf("?")?"".concat(i,"&authKey="):"".concat(i,"?authKey=")).concat(n):i)}function uo(e,t,n){var o=2<arguments.length&&void 0!==n?n:[];return n=t[0].content||t[0].payload,e===S.MSG_IMAGE?n.imageInfoArray.forEach((function(e){po(e.imageUrl,o)&&(e.imageUrl=lo(e.imageUrl))})):e===S.MSG_VIDEO?(po(n.snapshotUrl,o)&&(n.snapshotUrl=lo(n.snapshotUrl),n.thumbUrl=lo(n.thumbUrl)),po(n.remoteVideoUrl,o)&&(n.remoteVideoUrl=lo(n.remoteVideoUrl))):e===S.MSG_AUDIO?po(n.remoteAudioUrl,o)&&(n.remoteAudioUrl=lo(n.remoteAudioUrl)):e===S.MSG_FILE?po(n.fileUrl,o)&&(n.fileUrl=lo(n.fileUrl)):e===S.MSG_MERGER&&(e=(n=t[0].content||t[0].payload).downloadKey,n=void 0===(n=n.messageList)?[]:n,qe(void 0===e?"":e))&&n.forEach((function(e){uo(e.messageBody[0].type,e.messageBody,o)})),t}function lo(e){if(!e)return e;if(-1===e.indexOf("authKey="))return e;for(var t=(e=e.split("?"))[1].split("&"),n=0,o=0;o<t.length;o++)if(-1<t[o].indexOf("authKey=")){n=o;break}return t.splice(n,1),0<t.length?"".concat(e[0],"?").concat(t.join("&")):e[0]}function po(e,t){var n=!1;if(e){var o=(e=e.match(/:\/\/([0-9]?\.)?(.[^/:]+)/))&&e[2]||"";if(o.includes("rich-dev"))return 1;for(var i=0;i<t.length;i++)if(o.endsWith(t[i])){n=!0;break}}return n}var ho=s((function e(t,n,i,s){o(this,e),this._imageMemoryURL="",this._fileDownloadProxy=n,this._authKey=i,this._fileDNList=s,Z||ee?this.createImageDataASURL(t.file):this.createImageDataASURLInWeb(t.file),this._initImageInfoModel(),this.type=S.MSG_IMAGE,this._percent=0,this.content={imageFormat:t.imageFormat||Ae.UNKNOWN,uuid:t.uuid,imageInfoArray:[]},this.initImageInfoArray(t.imageInfoArray),this._autoFixUrl()}),[{key:"_initImageInfoModel",value:function(){var e=this;this._ImageInfoModel=function(t){this.instanceID=ot(9999999),this.sizeType=t.type||0,this.type=0,this.size=t.size||0,this.width=t.width||0,this.height=t.height||0,this.imageUrl=t.imageUrl||t.url||"",this.url=co(t.url||e._imageMemoryURL,e._fileDownloadProxy,e._authKey,e._fileDNList)},this._ImageInfoModel.prototype={setSizeType:function(e){this.sizeType=e},setType:function(e){this.type=e},setImageUrl:function(t){t&&(this.imageUrl=co(t,e._fileDownloadProxy,e._authKey,e._fileDNList))},getImageUrl:function(){return this.imageUrl}}}},{key:"initImageInfoArray",value:function(e){for(var t,n=0,o=null;n<=2;)t=lt(e)||lt(e[n])?{type:0,size:0,width:0,height:0,url:""}:e[n],(o=new this._ImageInfoModel(t)).setSizeType(n+1),o.setType(n),this.addImageInfo(o),n++;this.updateAccessSideImageInfoArray()}},{key:"updateImageInfoArray",value:function(e){for(var t,n=this.content.imageInfoArray.length,o=0;o<n;o++)t=this.content.imageInfoArray[o],e[o].size&&(t.size=e[o].size),e[o].url&&t.setImageUrl(e[o].url),e[o].width&&(t.width=e[o].width),e[o].height&&(t.height=e[o].height)}},{key:"_autoFixUrl",value:function(){for(var e=this.content.imageInfoArray.length,t="",n="",o=["http","https"],i=null,s=0;s<e;s++)this.content.imageInfoArray[s].url&&""!==(i=this.content.imageInfoArray[s]).imageUrl&&(n=i.imageUrl.slice(0,i.imageUrl.indexOf("://")+1),t=i.imageUrl.slice(i.imageUrl.indexOf("://")+1),o.indexOf(n)<0&&(n="https:"),this.content.imageInfoArray[s].setImageUrl([n,t].join("")))}},{key:"updatePercent",value:function(e){this._percent=e,1<this._percent&&(this._percent=1)}},{key:"updateImageFormat",value:function(e){this.content.imageFormat=Ae[e.toUpperCase()]||Ae.UNKNOWN}},{key:"createImageDataASURLInWeb",value:function(e){void 0!==e&&0<e.files.length&&(this._imageMemoryURL=window.URL.createObjectURL(e.files[0]))}},{key:"createImageDataASURL",value:function(e){e&&e.url&&(this._imageMemoryURL=e.url)}},{key:"replaceImageInfo",value:function(e,t){this.content.imageInfoArray[t]instanceof this._ImageInfoModel||(this.content.imageInfoArray[t]=e)}},{key:"addImageInfo",value:function(e){3<=this.content.imageInfoArray.length||this.content.imageInfoArray.push(e)}},{key:"updateAccessSideImageInfoArray",value:function(){var e=this.content.imageInfoArray,t=void 0===(t=(n=e[0]).width)?0:t,n=void 0===(n=n.height)?0:n;0!==t&&0!==n&&(Pt(e),Object.assign(e[2],bt({originWidth:t,originHeight:n,min:720})))}},{key:"sendable",value:function(){return 0!==this.content.imageInfoArray.length&&""!==this.content.imageInfoArray[0].imageUrl&&0!==this.content.imageInfoArray[0].size}}]),go=s((function e(t){o(this,e),this.type=S.MSG_FACE,this.content=t||null}),[{key:"sendable",value:function(){return null!==this.content}}]),fo=s((function e(t,n,i,s){o(this,e),this.type=S.MSG_AUDIO,this._percent=0,this._fileDownloadProxy=n,this._authKey=i,this._fileDNList=s,this.content={downloadFlag:2,second:t.second,size:t.size,url:co(t.url,this._fileDownloadProxy,this._authKey,this._fileDNList),remoteAudioUrl:co(t.url||"",this._fileDownloadProxy,this._authKey,this._fileDNList),uuid:t.uuid}}),[{key:"updatePercent",value:function(e){this._percent=e,1<this._percent&&(this._percent=1)}},{key:"updateAudioUrl",value:function(e){this.content.remoteAudioUrl=co(e,this._fileDownloadProxy,this._authKey,this._fileDNList)}},{key:"sendable",value:function(){return""!==this.content.remoteAudioUrl}}]),mo={from:!0,groupID:!0,groupName:!0,to:!0},_o=s((function e(t){o(this,e),this.type=S.MSG_GRP_TIP,this.content={},this._initContent(t)}),[{key:"_initContent",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"remarkInfo":case"memberExtraInfo":case"onlineMemberInfo":break;case"groupProfile":t.content.groupProfile={},t._initGroupProfile(e[n]);break;case"operatorInfo":t.content.operatorInfo={},t._initOperatorInfo(e[n]);break;case"memberInfoList":case"msgMemberInfo":t._updateMemberList(e[n]);break;case"memberNum":t.content[n]=e[n],t.content.memberCount=e[n];break;case"newGroupProfile":t.content.newGroupProfile={},t._initNewGroupProfile(e[n]);break;default:t.content[n]=e[n]}})),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:"_initGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];mo[o]&&(this.content.groupProfile[o]=e[o])}}},{key:"_initOperatorInfo",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];this.content.operatorInfo[o]=e[o]}}},{key:"_updateMemberList",value:function(e){qe(this.content.memberList)?this.content.memberList=e:this.content.memberList.forEach((function(t){e.forEach((function(e){t.userID===e.userID&&Object.assign(t,e)}))}))}},{key:"_initNewGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];this.content.newGroupProfile[o]="muteAllMembers"!==o?e[o]:1===e[o]}}}]),vo={from:!0,groupID:!0,groupName:!0,to:!0,groupType:!0},yo=s((function e(t){o(this,e),this.type=S.MSG_GRP_SYS_NOTICE,this.content={},this._initContent(t)}),[{key:"_initContent",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"memberInfoList":break;case"remarkInfo":t.content.handleMessage=e[n];break;case"groupProfile":t.content.groupProfile={},t._initGroupProfile(e[n]);break;default:t.content[n]=e[n]}}))}},{key:"_initGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];vo[o]&&("groupName"===o?this.content.groupProfile.name=e[o]:this.content.groupProfile[o]=e[o])}}}]),Io=s((function e(t,n,i,s){o(this,e),this.type=S.MSG_FILE,this._percent=0;var r=this._getFileInfo(t);this.content={downloadFlag:2,fileUrl:co(t.url||t.fileUrl,n,i,s)||"",uuid:t.uuid,fileName:r.name||"",fileSize:r.size||0}}),[{key:"_getFileInfo",value:function(e){var t,n;return lt(e.fileName)||lt(e.fileSize)?(t=e.file.files[0],W&&(t.path&&-1!==t.path.indexOf(".")&&(n=t.path.slice(t.path.lastIndexOf(".")+1).toLowerCase(),t.type=n,t.name||(t.name="".concat(ot(999999),".").concat(n))),t.name||(t.type="",t.name=t.path.slice(t.path.lastIndexOf("/")+1).toLowerCase()),t.suffix&&(t.type=t.suffix),t.url||(t.url=t.path)),{size:t.size,name:t.name}):{size:e.fileSize,name:e.fileName}}},{key:"updatePercent",value:function(e){this._percent=e,1<this._percent&&(this._percent=1)}},{key:"updateFileUrl",value:function(e){this.content.fileUrl=e}},{key:"sendable",value:function(){return""!==this.content.fileUrl&&""!==this.content.fileName&&0!==this.content.fileSize}}]),Mo=s((function e(t){o(this,e),this.type=S.MSG_CUSTOM,this.content={data:t.data||"",description:t.description||"",extension:t.extension||""}}),[{key:"setData",value:function(e){return this.content.data=e,this}},{key:"setDescription",value:function(e){return this.content.description=e,this}},{key:"setExtension",value:function(e){return this.content.extension=e,this}},{key:"sendable",value:function(){return 0!==this.content.data.length||0!==this.content.description.length||0!==this.content.extension.length}}]),Co=s((function e(t,n,i,s){o(this,e),this.type=S.MSG_VIDEO,this._percent=0,this._fileDownloadProxy=n,this._authKey=i,this._fileDNList=s,this.content={remoteVideoUrl:co(t.remoteVideoUrl||t.videoUrl||"",this._fileDownloadProxy,this._authKey,this._fileDNList),videoFormat:t.videoFormat,videoSecond:parseInt(t.videoSecond,10),videoSize:t.videoSize,videoUrl:co(t.videoUrl,this._fileDownloadProxy,this._authKey,this._fileDNList),videoDownloadFlag:2,videoUUID:t.videoUUID,thumbUUID:t.thumbUUID,thumbFormat:t.thumbFormat,thumbWidth:t.thumbWidth,snapshotWidth:t.thumbWidth,thumbHeight:t.thumbHeight,snapshotHeight:t.thumbHeight,thumbSize:t.thumbSize,snapshotSize:t.thumbSize,thumbDownloadFlag:2,thumbUrl:co(t.thumbUrl,this._fileDownloadProxy,this._authKey,this._fileDNList),snapshotUrl:co(t.thumbUrl,this._fileDownloadProxy,this._authKey,this._fileDNList)}}),[{key:"updatePercent",value:function(e){this._percent=e,1<this._percent&&(this._percent=1)}},{key:"updateVideoUrl",value:function(e){e&&(this.content.remoteVideoUrl=co(e,this._fileDownloadProxy,this._authKey,this._fileDNList))}},{key:"updateSnapshotInfo",value:function(e){var t=e.snapshotUrl,n=e.snapshotWidth;e=e.snapshotHeight,qe(t)||(this.content.thumbUrl=this.content.snapshotUrl=t),qe(n)||(this.content.thumbWidth=this.content.snapshotWidth=Number(n)),qe(e)||(this.content.thumbHeight=this.content.snapshotHeight=Number(e))}},{key:"sendable",value:function(){return""!==this.content.remoteVideoUrl}}]),To=s((function e(t){o(this,e),this.type=S.MSG_LOCATION;var n=t.description,i=t.longitude;t=t.latitude,this.content={description:n,longitude:i,latitude:t}}),[{key:"sendable",value:function(){return!0}}]),So=s((function e(t,n,i,s){var r,a;o(this,e),this.from=t.from,this.messageSender=t.from,this.time=t.time,this.messageSequence=t.sequence,this.clientSequence=t.clientSequence||t.sequence,this.messageRandom=t.random,this.cloudCustomData=t.cloudCustomData||"",this.clientTime=t.clientTime||void 0,t.ID?(this.ID=t.ID||"",this.nick=t.nick||"",this.avatar=t.avatar||"",t.messageBody?this.messageBody=JSON.parse(JSON.stringify(t.messageBody)):this.messageBody=[{type:t.type,payload:t.payload}],t.conversationType?t.conversationType.startsWith(S.CONV_C2C)?this.receiverUserID=t.to:t.conversationType.startsWith(S.CONV_GROUP)&&(this.receiverGroupID=t.to):t.receiverGroupID?this.receiverGroupID=t.receiverGroupID:t.receiverUserID&&(this.receiverUserID=t.receiverUserID),this.messageReceiver=t.to||t.messageReceiver):(this.nick=t.nick||"",this.avatar=t.avatar||"",this.messageBody=[],r=t.elements[0].type,a=t.elements[0].content,this._patchRichMediaPayload(r,a),this._updateRichMediaDownloadUrl(r,a,n,i,s),r===S.MSG_MERGER?this.messageBody.push({type:r,payload:new Eo(a,n,i,s).content}):this.messageBody.push({type:r,payload:a}),t.groupID&&(this.receiverGroupID=t.groupID,this.messageReceiver=t.groupID),t.to&&(this.receiverUserID=t.to,this.messageReceiver=t.to),this.ID="".concat(t.tinyID,"-").concat(t.clientTime,"-").concat(t.random))}),[{key:"_patchRichMediaPayload",value:function(e,t){e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(e){!e.imageUrl&&e.url&&(e.imageUrl=e.url,e.sizeType=e.type,1===e.type?e.type=0:3===e.type&&(e.type=1))})):e===S.MSG_VIDEO?!t.remoteVideoUrl&&t.videoUrl&&(t.remoteVideoUrl=t.videoUrl):e===S.MSG_AUDIO?!t.remoteAudioUrl&&t.url&&(t.remoteAudioUrl=t.url):e===S.MSG_FILE&&!t.fileUrl&&t.url&&(t.fileUrl=t.url,t.url=void 0)}},{key:"_updateRichMediaDownloadUrl",value:function(e,t,n,o,i){(n||o)&&(e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(e){e.imageUrl=co(e.imageUrl,n,o,i),e.url=co(e.url,n,o,i)})):e===S.MSG_VIDEO?(t.remoteVideoUrl=co(t.remoteVideoUrl,n,o,i),t.videoUrl=co(t.videoUrl,n,o,i),t.thumbUrl=co(t.thumbUrl,n,o,i),t.snapshotUrl=co(t.thumbUrl,n,o,i),t.snapshotHeight=t.thumbHeight,t.snapshotWidth=t.thumbWidth):e===S.MSG_AUDIO?(t.remoteAudioUrl=co(t.remoteAudioUrl,n,o,i),t.url=co(t.url,n,o,i)):e===S.MSG_FILE&&(t.fileUrl=co(t.fileUrl,n,o,i)))}}]),Eo=s((function e(t,n,i,s){var r,a,c,u,l,p,d;o(this,e),this.type=S.MSG_MERGER,this.content={downloadKey:"",pbDownloadKey:"",messageList:[],title:"",abstractList:[],compatibleText:"",version:0,layersOverLimit:!1},t.downloadKey?(a=t.downloadKey,c=t.pbDownloadKey,u=t.title,l=t.abstractList,p=t.compatibleText,r=t.version,this.content.downloadKey=a,this.content.pbDownloadKey=c,this.content.title=u,this.content.abstractList=l,this.content.compatibleText=p,this.content.version=r||0):qe(t.messageList)?1===t.layersOverLimit&&(this.content.layersOverLimit=!0):(a=t.messageList,c=t.title,u=t.abstractList,l=t.compatibleText,p=t.version,d=[],a.forEach((function(e){qe(e)||(e=new So(e,n,i,s),d.push(e))})),this.content.messageList=d,this.content.title=c,this.content.abstractList=u,this.content.compatibleText=l,this.content.version=p||0)}),[{key:"sendable",value:function(){return!qe(this.content.messageList)||!qe(this.content.downloadKey)}}]),ko={1:S.MSG_PRIORITY_HIGH,2:S.MSG_PRIORITY_NORMAL,3:S.MSG_PRIORITY_LOW,4:S.MSG_PRIORITY_LOWEST},Do=s((function e(t){o(this,e),this.ID="",this.conversationID=t.conversationID||null,this.conversationType=t.conversationType||S.CONV_C2C,this.conversationSubType=t.conversationSubType,this.time=t.time||Math.ceil(Date.now()/1e3),this.sequence=t.sequence||0,this.clientSequence=t.clientSequence||t.sequence||0,this.random=t.random||0===t.random?t.random:ot(),this.priority=this._computePriority(t.priority),this.nick=t.nick||"",this.avatar=t.avatar||"",this.isPeerRead=!1,this.nameCard="",this.hasRiskContent=zt(t.checkResult),this._elements=[],this.isPlaceMessage=t.isPlaceMessage||0,this.isRevoked=2===t.isPlaceMessage||8===t.msgFlagBits,this.from=t.from||null,this.to=t.to||null,this.flow="",this.isSystemMessage=t.isSystemMessage||!1,this.protocol=t.protocol||"JSON",this.isResend=!1,this.isRead=!1,this.status=t.status||kn,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=t.cloudCustomData||"",this.isDeleted=!1,this.isModified=!!t.messageVersion,this._isExcludedFromUnreadCount=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromUnreadCount),this._isExcludedFromLastMessage=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromLastMessage),this.clientTime=t.clientTime||Te()||0,this.senderTinyID=t.senderTinyID||t.tinyID||"",this.readReceiptInfo=t.readReceiptInfo||{readCount:void 0,unreadCount:void 0,isPeerRead:void 0,timestamp:0},this.needReadReceipt=!0===t.needReadReceipt||1===t.needReadReceipt,this.version=t.messageVersion||0,this.isBroadcastMessage=t.isBroadcastMessage||!1,this._receiverList=t.receiverList||void 0,this.isSupportExtension=!0===t.isSupportExtension||1===t.isSupportExtension,this._cmConfigID=t.customModerationConfigurationID,this.revoker=t.revokerInfo&&t.revokerInfo.revoker||"",this.revokerInfo=t.revokerInfo||{userID:"",nick:"",avatar:""},this.revokeReason=t.revokeReason||"",this.reInitialize(t.currentUser),this.extractGroupInfo(t.groupProfile||null),this.handleGroupAtInfo(t),this.initC2CReadReceiptInfo(t)}),[{key:"elements",get:function(){return this._elements}},{key:"getElements",value:function(){return this._elements}},{key:"extractGroupInfo",value:function(e){null!==e&&(ut(e.nick)&&(this.nick=e.nick),ut(e.avatar)&&(this.avatar=e.avatar),ze(e=e.messageFromAccountExtraInformation))&&ut(e.nameCard)&&(this.nameCard=e.nameCard)}},{key:"handleGroupAtInfo",value:function(e){var t=this;e.payload&&e.payload.atUserList&&e.payload.atUserList.forEach((function(e){e!==S.MSG_AT_ALL?(t._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:e}),t.atUserList.push(e)):(t._groupAtInfoList.push({groupAtAllFlag:1}),t.atUserList.push(S.MSG_AT_ALL))})),Ye(e.groupAtInfo)&&e.groupAtInfo.forEach((function(e){0===e.groupAtAllFlag?t.atUserList.push(e.groupAtUserID):1===e.groupAtAllFlag&&t.atUserList.push(S.MSG_AT_ALL)}))}},{key:"getGroupAtInfoList",value:function(){return this._groupAtInfoList}},{key:"_initProxy",value:function(){this._elements[0]&&(this.payload=this._elements[0].content,this.type=this._elements[0].type)}},{key:"reInitialize",value:function(e){e&&(this.status=this.from?kn:En,!this.from)&&(this.from=e),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}},{key:"isSendable",value:function(){return 0!==this._elements.length&&(!0===this._relayFlag||"function"==typeof this._elements[0].sendable&&this._elements[0].sendable())}},{key:"_initTo",value:function(e){this.conversationType===S.CONV_GROUP&&(this.to=e.groupID)}},{key:"_initSequence",value:function(e){var t,n,o;0===this.clientSequence&&e&&(this.clientSequence=!!e&&(void 0===mt[e]&&(t="3".concat((o=new Date).getHours()).slice(-2),n="0".concat(o.getMinutes()).slice(-2),o="0".concat(o.getSeconds()).slice(-2),mt[e]=parseInt([t,n,o,"0001"].join("")),o=n=t=null,Oe.l("autoIncrementIndex start index:".concat(mt[e]))),mt[e]++)),0===this.sequence&&this.conversationType===S.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:"generateMessageID",value:function(){this.from===S.CONV_SYSTEM&&(this.senderTinyID="144115198244471703"),this.ID="".concat(this.senderTinyID,"-").concat(this.clientTime,"-").concat(this.random)}},{key:"_initFlow",value:function(e){""!==e&&(e===this.from?(this.flow="out",this.isRead=!0):this.flow="in")}},{key:"_concatConversationID",value:function(e){var t=this.to,n=this.conversationType;n!==S.CONV_SYSTEM?(e=n===S.CONV_C2C?e===this.from?t:this.from:this.to,this.conversationID=e?"".concat(n).concat(e):null):this.conversationID=S.CONV_SYSTEM}},{key:"isElement",value:function(e){return e instanceof so||e instanceof ho||e instanceof go||e instanceof fo||e instanceof Io||e instanceof Co||e instanceof _o||e instanceof yo||e instanceof Mo||e instanceof To||e instanceof Eo}},{key:"setElement",value:function(e,t,n,o){var i=this;if(this.isElement(e))this._elements=[e];else{var s=function(e){if(e.type&&e.content)switch(e.type){case S.MSG_TEXT:i.setTextElement(e.content);break;case S.MSG_IMAGE:i.setImageElement(e.content,t,n,o);break;case S.MSG_AUDIO:i.setAudioElement(e.content,t,n,o);break;case S.MSG_FILE:i.setFileElement(e.content,t,n,o);break;case S.MSG_VIDEO:i.setVideoElement(e.content,t,n,o);break;case S.MSG_CUSTOM:i.setCustomElement(e.content);break;case S.MSG_LOCATION:i.setLocationElement(e.content);break;case S.MSG_GRP_TIP:i.setGroupTipElement(e.content);break;case S.MSG_GRP_SYS_NOTICE:i.setGroupSystemNoticeElement(e.content);break;case S.MSG_FACE:i.setFaceElement(e.content);break;case S.MSG_MERGER:i.setMergerElement(e.content,t,n,o)}};if(Ye(e))for(var r=0;r<e.length;r++)s(e[r]);else s(e)}this._initProxy()}},{key:"clearElement",value:function(){this._elements.length=0}},{key:"setTextElement",value:function(e){e="string"==typeof e?e:e.text,e=new so({text:e}),this._elements.push(e)}},{key:"setImageElement",value:function(e,t,n,o){e=new ho(e,t,n,o),this._elements.push(e)}},{key:"setAudioElement",value:function(e,t,n,o){e=new fo(e,t,n,o),this._elements.push(e)}},{key:"setFileElement",value:function(e,t,n,o){e=new Io(e,t,n,o),this._elements.push(e)}},{key:"setVideoElement",value:function(e,t,n,o){e=new Co(e,t,n,o),this._elements.push(e)}},{key:"setLocationElement",value:function(e){e=new To(e),this._elements.push(e)}},{key:"setCustomElement",value:function(e){e=new Mo(e),this._elements.push(e)}},{key:"setGroupTipElement",value:function(e){var t,n={},o=e.operationType;qe(e.memberInfoList)?e.operatorInfo&&(n=e.operatorInfo):o!==S.GRP_TIP_MBR_JOIN&&o!==S.GRP_TIP_MBR_KICKED_OUT&&o!==S.GRP_TIP_MBR_SET_ADMIN&&o!==S.GRP_TIP_MBR_CANCELED_ADMIN||(n=e.memberInfoList[0]),qe(e.memberExtraInfo)||(t=e.memberExtraInfo.reason,e.msgMemberInfo.forEach((function(e){e.reason=t}))),o=n.nick,n=n.avatar,ut(o)&&(this.nick=o),ut(n)&&(this.avatar=n),o=new _o(e),this._elements.push(o)}},{key:"setGroupSystemNoticeElement",value:function(e){e=new yo(e),this._elements.push(e)}},{key:"setFaceElement",value:function(e){e=new go(e),this._elements.push(e)}},{key:"setMergerElement",value:function(e,t,n,o){e=new Eo(e,t,n,o),this._elements.push(e)}},{key:"setIsRead",value:function(e){this.isRead=e}},{key:"setRelayFlag",value:function(e){this._relayFlag=e}},{key:"_computePriority",value:function(e){if(!lt(e)){if(ut(e)&&-1!==Object.values(ko).indexOf(e))return e;if(Ke(e)&&(e=""+e,-1!==Object.keys(ko).indexOf(e)))return ko[e]}return S.MSG_PRIORITY_NORMAL}},{key:"setNickAndAvatar",value:function(e){var t=e.nick;e=e.avatar,ut(t)&&(this.nick=t),ut(e)&&(this.avatar=e)}},{key:"setNameCard",value:function(e){ut(e)&&(this.nameCard=e)}},{key:"initC2CReadReceiptInfo",value:function(e){var t=e.readReceiptSentByPeer;e=void 0===(e=e.timestamp)?0:e,this.conversationType===S.CONV_C2C&&!0===this.needReadReceipt&&(this.readReceiptInfo.isPeerRead=1===(void 0===t?void 0:t),this.readReceiptInfo.timestamp=e)}}]),Lo=["sound","FCMChannelID"],Ro=["ignoreIOSBadge","disableVoipPush","enableIOSBackgroundNotification"],Oo={HonorImportance:{range:["LOW","NORMAL"],defaultValue:void 0},MeizuNotifyType:{range:[0,1],defaultValue:void 0}},Ao={enableIOSBackgroundNotification:{range:[!0,!1],defaultValue:!1},interruptionLevel:{range:["passive","active","time-sensitive","critical"],defaultValue:"active"}};function bo(e,t){for(var n in t){var o,i;Object.prototype.hasOwnProperty.call(t,n)&&(o=(i=t[n]).range,i=i.defaultValue,e[n]=o.includes(e[n])?e[n]:i)}return e}function Po(e){if(ze(e))return{pushFlag:!0===e.disablePush?1:0,title:e.title||"",desc:e.description||"",ext:e.extension||"",apnsInfo:(n=(t=e).apnsInfo,o=void 0!==(o=t.ignoreIOSBadge)&&o,t=t.disableVoipPush,i=(n=bo(void 0===n?{}:n,Ao)).ignoreIOSBadge,s=n.disableVoipPush,r=n.enableIOSBackgroundNotification,n=f(n,Ro),i=!0===i||!0===o?1:0,o=void 0,lt(t)||(o=!1===t?1:0),lt(s)||(o=!1===s?1:0),g(g({},n),{},{badgeMode:i,isVoipPush:o,contentAvailable:r?1:0})),androidInfo:(s=void 0===(s=(t=e).androidInfo)?{}:s,t=t.androidOPPOChannelID,t=s.OPPOChannelID||(void 0===t?"":t),s=bo(s,Oo),n=void 0===(n=s.sound)?"":n,i=void 0===(i=s.FCMChannelID)?"":i,g(g({},f(s,Lo)),{},{Sound:-1===(n=(s=n).lastIndexOf("."))?s:s.slice(0,n),OPPOChannelID:t,GoogleChannelID:i}))};var t,n,o,i,s,r}u(Uo,Pn);var No=s(Uo,[{key:"onNewMessage",value:function(e){var t=e.dataList,n=e.isInstantMessage,o=e.C2CRemainingUnreadList,i=e.C2CPairUnreadList,s=(e=e.isSyncingEnded,o=(n||Oe.l("".concat(this._n,".onNewMessage C2CPairUnreadList:"),i,"C2CRemainingUnreadList:",o),t=this._assembly({dataList:t,C2CRemainingUnreadList:o,C2CPairUnreadList:i,isInstantMessage:n})).conversationOptionsList,i=t.messageList,t=t.isUnreadC2CMessage,0<(s=vt(i)).length&&this.emitOEvt(T.MESSAGE_MODIFIED,s),this.get(11).onNewMessage({conversationOptionsList:o,isInstantMessage:n,isUnreadC2CMessage:t,isSyncingEnded:e}),It(i));n&&0<s.length&&this.emitOEvt(T.MESSAGE_RECEIVED,s),i.length=0}},{key:"_assembly",value:function(e){for(var t=e.dataList,n=e.C2CRemainingUnreadList,o=e.C2CPairUnreadList,i=e.isInstantMessage,s=null,r=[],a=[],c={},u=this.get(26),l=!1,p=this.get(11),d=this.get(4),h=(e=this.get(17),this.getFileDownloadProxy()),g=this.getDownloadFileAuthKey(),f=e.getFileDNList(),m=0,_=t.length;m<_;m++)if(this._isC2CNotice(t[m]))this._noticeFromUnreadDBList.push(t[m].eventArray[0].c2CNotifyMsgArray[0]);else{var v=t[m],y=(v.currentUser=this.getMyUserID(),v.conversationType=S.CONV_C2C,v.isSystemMessage=!!v.isSystemMessage,(lt(v.nick)||lt(v.avatar))&&(l=!0),(s=new Do(v)).setElement(v.elements,h,g,f),s.setNickAndAvatar({nick:v.nick,avatar:v.avatar}),s.conversationID);if(i){if(this._msgFromUnreadDBMap.get(s.ID))continue;var I,M,C=!1,T=(s.from!==this.getMyUserID()?(M=p.getLatestMessageSentByPeer(y))&&(I=M.nick,M=M.avatar,l?s.setNickAndAvatar({nick:I,avatar:M}):I===s.nick&&M===s.avatar||(C=!0)):(I=p.getLatestMessageSentByMe(y))&&(M=I.nick,T=I.avatar,M===s.nick&&T===s.avatar||(p.modifyMessageSentByMe({conversationID:y,latestNick:s.nick,latestAvatar:s.avatar}),d.mockOnNickAvatarModified(s.nick,s.avatar))),1===t[m].isModified);if(p.isMessageSentByCurrentInstance(s)?s.isModified=T:T=!1,0===v.msgLifeTime)s._onlineOnlyFlag=!0,p.isMessageSentByCurrentInstance(s)||a.push(s);else{if(!p.pushIntoMessageList(a,s,T))continue;C&&(p.modifyMessageSentByPeer({conversationID:y,latestNick:s.nick,latestAvatar:s.avatar}),p.updateUserProfileSpecifiedKey({conversationID:y,nick:s.nick,avatar:s.avatar}))}i&&0<s.clientTime&&u.addMessageDelay(s.clientTime)}else this._msgFromUnreadDBMap.set(s.ID,s);if(0!==v.msgLifeTime){if(!1===s._onlineOnlyFlag){if(Ke(C=p.getLastMessageTime(y))&&s.time<C)continue;i&&(lt(c[y])?(v=0,"in"!==s.flow||s._isExcludedFromUnreadCount||(v=1),c[y]=r.push({conversationID:y,unreadCount:v,type:s.conversationType,subType:s.conversationSubType,lastMessage:s._isExcludedFromLastMessage?"":s})-1):(v=c[y],r[v].type=s.conversationType,r[v].subType=s.conversationSubType,r[v].lastMessage=s._isExcludedFromLastMessage?"":s,"in"!==s.flow||s._isExcludedFromUnreadCount||r[v].unreadCount++))}}else s._onlineOnlyFlag=!0}this._handleNoticeFromUnreadDB();var E=!1;if(Ye(o)&&0<o.length)for(var k=0,D=o.length;k<D;k++)!function(e){if(o[e].from!==S.CONV_SYSTEM){E=!0;var t=r.find((function(t){return t.conversationID==="".concat(S.CONV_C2C).concat(o[e].from)}));t?t.unreadCount=o[e].unreadCount:r.push({conversationID:"".concat(S.CONV_C2C).concat(o[e].from),unreadCount:o[e].unreadCount,type:S.CONV_C2C})}}(k);if(Ye(n))for(var L=0,R=n.length;L<R;L++)!function(e){r.find((function(t){return t.conversationID==="".concat(S.CONV_C2C).concat(n[e].from)}))||r.push({conversationID:"".concat(S.CONV_C2C).concat(n[e].from),type:S.CONV_C2C,lastMsgTime:n[e].lastMsgTime})}(L);return{conversationOptionsList:r,messageList:a,isUnreadC2CMessage:E}}},{key:"getMessageListFromUnreadDB",value:function(){return v(this._msgFromUnreadDBMap.values())}},{key:"_isC2CNotice",value:function(e){return!(!Ye(e=e.eventArray)||10!==e[0].event)}},{key:"_handleNoticeFromUnreadDB",value:function(){var e,t=this._noticeFromUnreadDBList.length;0!==t&&(Oe.l("".concat(this._n,"._handleNoticeFromUnreadDB count:").concat(t)),e=[],this._noticeFromUnreadDBList.forEach((function(t){t.hasOwnProperty("c2cMessageRevokedNotify")&&e.push(t)})),this.onMsgRevoked({dataList:e}),this._noticeFromUnreadDBList.length=0,e.length=0)}},{key:"onMsgRevoked",value:function(e,t){var n,o=this,i=this.get(11),s=[];e.dataList.forEach((function(e){e.c2cMessageRevokedNotify&&(e=e.c2cMessageRevokedNotify.revokedInfos,lt(e)||e.forEach((function(e){var t=o.getMyUserID()===e.from?"".concat(S.CONV_C2C).concat(e.to):"".concat(S.CONV_C2C).concat(e.from);n=i.revoke(t,e.sequence,e.random);var r,a=e.revokerInfo&&e.revokerInfo.revoker,c=e.revokerInfo&&e.revokerInfo.reason||"";n?r=n:(r={conversationID:t,sequence:e.sequence},e.tinyID&&e.clientTime&&e.random&&(r.ID="".concat(e.tinyID,"-").concat(e.clientTime,"-").concat(e.random)),e.time&&(r.time=e.time)),r&&(r.revoker=a,r.revokeReason=c,r.revokerInfo={userID:a,nick:"",avatar:""},s.push(r))})))})),0!==s.length&&(Oe.l("".concat(this._n,".onMsgRevoked count:").concat(s.length," updateUnreadCount:").concat(t)),i.onMessageRevoked(s,t),i.updateRevokerInfo(s).then((function(e){o.emitOEvt(T.MESSAGE_REVOKED,e)})))}},{key:"onMsgReadReceipt",value:function(e){var t=this;e.dataList.forEach((function(e){var n;qe(e.c2cMessageReadReceipt)||(n=e.c2cMessageReadReceipt.to,e.c2cMessageReadReceipt.uinPairReadArray.forEach((function(e){e=e.peerReadTime;var o=(Oe.l("".concat(t._n,".onMsgReadReceipt to:").concat(n," peerReadTime:").concat(e)),"".concat(S.CONV_C2C).concat(n)),i=t.get(11);i.recordPeerReadTime(o,e),i.updateMsgIsPeerReadProp(o,e)})))}))}},{key:"onMsgReadNotice",value:function(e){var t=this;e.dataList.forEach((function(e){var n;qe(e.c2cMessageReadNotice)||(n=t.get(11),e.c2cMessageReadNotice.uinPairReadArray.forEach((function(e){var o=e.from;e=e.peerReadTime,Oe.l("".concat(t._n,".onMsgReadNotice from:").concat(o," lastReadTime:").concat(e)),o="".concat(S.CONV_C2C).concat(o),n.updateIsReadAfterReadReport({conversationID:o,lastMessageTime:e}),n.updateUnreadCount(o)})))}))}},{key:"onMsgModified",value:function(e){Oe.l("".concat(this._n,".onMsgModified options:"),e);var t=this.get(11);e.dataList.forEach((function(e){t.onMessageModified(g(g({},e),{},{conversationType:S.CONV_C2C}))}))}},{key:"onReadReceiptList",value:function(e){Oe.l("".concat(this._n,".onReadReceiptList options:"),e),this.get(11).updateReadReceiptInfo(e.dataList)}},{key:"sendMessage",value:function(e,t){return e=this._createC2CMessagePack(e,t),this.req(e)}},{key:"_createC2CMessagePack",value:function(e,t){var n=null,o=(t&&(t.offlinePushInfo&&(n=t.offlinePushInfo),!0===t.onlineUserOnly)&&(n?n.disablePush=!0:n={disablePush:!0}),""),i=(ut(e.cloudCustomData)&&0<e.cloudCustomData.length&&(o=e.cloudCustomData),[]),s=(ze(t)&&ze(t.messageControlInfo)&&(s=(a=t.messageControlInfo).excludedFromUnreadCount,r=a.excludedFromLastMessage,a=a.excludedFromContentModeration,!0===s&&i.push("NoUnread"),!0===r&&i.push("NoLastMsg"),!0===a)&&i.push("NoMsgCheck"),this.isOnlineMessage(e,t)?0:void 0),r=JSON.parse(JSON.stringify(e.getElements())),a=this.get(17).getFileDNList();return{P:jn.SEND_C2C_MSG,data:{fromAccount:this.getMyUserID(),toAccount:e.to,msgBody:uo(e.type,r,a),cloudCustomData:o,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:s,nick:e.nick,avatar:e.avatar,offlinePushInfo:Po(n),messageControlInfo:0!==s?i:void 0,clientTime:e.clientTime,needReadReceipt:!0===e.needReadReceipt?1:0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0,cmConfigID:e._cmConfigID,forbidCallbackControl:yt(t)}}}},{key:"isOnlineMessage",value:function(e,t){return!(!t||!0!==t.onlineUserOnly)}},{key:"revokeMessage",value:function(e){return this.req({P:jn.REVOKE_C2C_MSG,data:{msgInfo:{fromAccount:e.from,toAccount:e.to,msgSeq:e.sequence,msgRandom:e.random,msgTimeStamp:e.time}}})}},{key:"deleteMessage",value:function(e){var t=e.to;return e=e.keyList,Oe.l("".concat(this._n,".deleteMessage toAccount:").concat(t," count:").concat(e.length)),this.req({P:jn.DEL_C2C_MSG,data:{fromAccount:this.getMyUserID(),to:t,keyList:e}})}},{key:"modifyRemoteMessage",value:function(e){var t=e.from,n=e.to,o=void 0===(o=e.version)?0:o,i=e.sequence,s=e.random,r=e.time,a=e.payload,c=e.type,u=e.cloudCustomData,l=void(e=e._elements);return Bt(c)&&(1<e.length&&e.splice(0,1,{type:c,content:a}),l=e),this.req({P:jn.MODIFY_C2C_MSG,data:{from:t,to:n,version:o,sequence:i,random:s,time:r,elements:l,cloudCustomData:u}})}},{key:"setMessageRead",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageTime,i="".concat(this._n,".").concat("setMessageRead"),s=(e="convID:".concat(n," lastMessageTime:").concat(o),Oe.l("".concat(i," ").concat(e)),Ke(o)||this.warn("DoNotModifyLastTime"),new io("setMessageRead"));return s.setMessage(e),this.req({P:jn.SET_C2C_MSG_READ,data:{C2CMsgReaded:{cookie:"",C2CMsgReadedItem:[{toAccount:n.replace("C2C",""),lastMessageTime:o,receipt:1}]}}}).then((function(){s.end(),Oe.l("".concat(i," ok"));var e=t.get(11);return e.updateIsReadAfterReadReport({conversationID:n,lastMessageTime:o}),e.updateUnreadCount(n),Cn()})).catch((function(e){return s.setError(e).end(),Oe.l("".concat(i," failed. error:"),e),Sn(e)}))}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._n,".").concat("getRoamingMessage"),o=e.peerAccount,i=e.conversationID,s=e.count,r=e.lastMessageTime,a=(e=e.messageKey,"peerAccount:".concat(o," count:").concat(s||15," lastMessageTime:").concat(r||0," messageKey:").concat(e)),c=(Oe.l("".concat(n," ").concat(a)),new io("getRoamingMessage"));return this.req({P:jn.GET_C2C_ROAMING_MSG,data:{peerAccount:o,count:s||15,lastMessageTime:r||0,messageKey:e}}).then((function(e){var o=(e=e.data).complete,s=e.messageList,r=e.messageKey,u=(e=e.lastMessageTime,lt(s)?Oe.l("".concat(n," ok. complete:").concat(o," but messageList is undefined!")):Oe.l("".concat(n," ok. complete:").concat(o," count:").concat(s.length)),c.setMessage("".concat(a," complete:").concat(o," length:").concat(s.length)).end(),t.get(11)),l=((o=1===o)&&u.setCompleted(i),[]);return s=u.onRoamingMessage(s,i,!0,l),u.modifyMessageList(i),u.updateIsRead(i),u.updateRoamingMsgKeyAndTime(i,r,e),r=u.getPeerReadTime(i),Oe.l("".concat(n," update isPeerRead property. convID:").concat(i," peerReadTime:").concat(r)),r?u.updateMsgIsPeerReadProp(i,r):(e=i.replace(S.CONV_C2C,""),t.getRemotePeerReadTime([e]).then((function(){u.updateMsgIsPeerReadProp(i,u.getPeerReadTime(i))}))),r="",0<s.length?r=s[0].ID:(e=u.getLocalOldestMessage(i))&&(r=e.ID),Oe.l("".concat(n," nextReqID:").concat(r," storedMsgCount:").concat(s.length)),{nextReqID:r,storedMessageList:s,assembledMessageList:l,isPullingCompleted:o}})).catch((function(e){return c.setMessage(a).setError(e).end(),Oe.w("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._n,".").concat("getRoamingMessagesHopping"),o=e.peerAccount,i=void 0===(i=e.time)?0:i,s=e.count,r=e.direction,a="".concat(S.CONV_C2C).concat(o),c="peerAccount:".concat(o," count:").concat(s," time:").concat(i," direction:").concat(r),u=(Oe.l("".concat(n," ").concat(c)),new io("getRoamingMessagesHopping"));return this.req({P:jn.GET_C2C_ROAMING_MSG,data:{peerAccount:o,count:s+1,lastMessageTime:i,direction:r}}).then((function(e){var o=(e=e.data).complete,i=void 0===(i=e.messageList)?[]:i,s=(e=e.lastMessageTime,"complete:".concat(o," count:").concat(i.length)),l=(Oe.l("".concat(n," ok. ").concat(s)),u.setMessage("".concat(c," ").concat(s)).end(),1!==o&&(1===r?i.pop():i.shift()),t.get(11));return s=l.onRoamingMessage(i,a,!1),t._modifyMessageList(a,s),i=t._computeResult({complete:o,lastMessageTime:e,resultList:s}),l.storeHoppingMessageList(i.messageList),o=l.getPeerReadTime(a),Oe.l("".concat(n," update isPeerRead property. convID:").concat(a," peerReadTime:").concat(o)),o?l.updateMsgIsPeerReadProp(a,o):(e=a.replace(S.CONV_C2C,""),t.getRemotePeerReadTime([e]).then((function(){l.updateMsgIsPeerReadProp(a,l.getPeerReadTime(a))}))),Cn(i)})).catch((function(e){return u.setMessage(c).setError(e).end(),Oe.w("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"_computeResult",value:function(e){var t=void 0===(t=e.complete)?0:t,n=e.lastMessageTime;return e={messageList:v(void 0===(e=e.resultList)?[]:e),isCompleted:!1,nextMessageTime:""},1===t?e.isCompleted=!0:e.nextMessageTime=n,e}},{key:"_modifyMessageList",value:function(e,t){if(e=this.get(11).getLocalConversation(e))for(var n=e.userProfile.nick,o=e.userProfile.avatar,i=(e=this.get(4).getNickAndAvatarByUserID(this.getMyUserID())).nick,s=e.avatar,r=t.length-1;0<=r;r--){var a=t[r];"in"===a.flow&&(a.nick!==n&&a.setNickAndAvatar({nick:n}),a.avatar!==o)&&a.setNickAndAvatar({avatar:o}),"out"===a.flow&&(a.nick!==i&&a.setNickAndAvatar({nick:i}),a.avatar!==s)&&a.setNickAndAvatar({avatar:s})}}},{key:"getRemotePeerReadTime",value:function(e){var t,n=this,o="".concat(this._n,".").concat("getRemotePeerReadTime");return qe(e)?Promise.resolve():(t=new io("getRemotePeerReadTime"),Oe.l("".concat(o," userIDList:").concat(e)),this.req({P:jn.GET_C2C_PEER_READ_TIME,data:{userIDList:e}}).then((function(i){var s=i.data.peerReadTimeList;Oe.l("".concat(o," ok. peerReadTimeList:").concat(s));for(var r="",a=n.get(11),c=0;c<e.length;c++)r+="".concat(e[c],"-").concat(s[c]," "),0<s[c]&&a.recordPeerReadTime("".concat(S.CONV_C2C).concat(e[c]),s[c]);t.setMessage(r).end()})).catch((function(e){t.setError(e).end(),Oe.w("".concat(o," failed. error:"),e)})))}},{key:"sendReadReceipt",value:function(e){var t,n=e[0].conversationID.replace(S.CONV_C2C,""),o=new io("sendReadReceipt"),i=(o.setMessage("peerAccount:".concat(n)),this.getMyUserID());return 0===(e=e.filter((function(e){return e.from!==i&&!0===e.needReadReceipt})).map((function(e){return{fromAccount:e.from,toAccount:e.to,sequence:e.sequence,random:e.random,time:e.time,clientTime:e.clientTime}}))).length?Sn({code:qn.READ_RECEIPT_MSG_LIST_EMPTY}):(t="".concat(this._n,".").concat("sendReadReceipt"),Oe.l("".concat(t,". peerAccount:").concat(n," length:").concat(e.length)),this.req({P:jn.SEND_C2C_READ_RECEIPT,data:{peerAccount:n,messageInfoList:e}}).then((function(e){return o.end(),Oe.l("".concat(t," ok")),Cn()})).catch((function(e){return o.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)})))}},{key:"getReadReceiptList",value:function(e){var t=e[0].conversationID.replace(S.CONV_C2C,"");return Oe.l("".concat(this._n,".getReadReceiptList peerAccount:").concat(t," msgCount:").concat(e.length)),Tn({messageList:e})}},{key:"getMessageExtensions",value:function(e,t){return Oe.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t)),this.req({P:jn.GET_C2C_MSG_EXT,data:{from:e.from,to:e.to,messageKey:this.getMessageKey(e),startSequence:t}})}},{key:"modifyMsgExts",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1;return Oe.l("".concat(this._n,".modifyMsgExts operateType:").concat(n)),this.req({P:jn.MODIFY_C2C_MSG_EXT,data:{from:e.from,to:e.to,messageKey:this.getMessageKey(e),extensionList:t,operateType:n}})}},{key:"getMessageKey",value:function(e){var t=e.clientSequence,n=e.random;return e=e.time,"".concat(t,"_").concat(n,"_").concat(e)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._msgFromUnreadDBMap.clear(),this._noticeFromUnreadDBList.length=0}}]),xo={A2KEY_AND_TINYID_UPDATED:"_inner".concat(1),CLOUD_CONFIG:"_inner".concat(2),PROFILE_UPDATED:"_inner".concat(3),CONV_SYNC_COMPLETED:"_inner".concat(4),C2C_UNREAD_HANDLE_COMPLETED:"_inner".concat(5)},wo=s((function e(t){o(this,e),this._convM=t,this._map=new Map,this._n="MsgListHandler",this._latestMsgSentByPeerMap=new Map,this._latestMsgSentByMeMap=new Map,this._hoppingMsgMap=new Map,this.TOPIC_MSG_LIMIT=1e3,this._convM.getIEmitInst().on(xo.CLOUD_CONFIG,this._onCloudConfig,this)}),[{key:"_onCloudConfig",value:function(){var e=this._convM.getCloudConfig("topic_msg_limit");lt(e)||(this.TOPIC_MSG_LIMIT=Number(e)),Oe.l("".concat(this._n,"._onCloudConfig topicMsgLimit:").concat(this.TOPIC_MSG_LIMIT))}},{key:"onCheckTimer",value:function(e){if(e%20==0&&0<this._map.size){var t,n=r(this._map);try{for(n.s();!(t=n.n()).done;){var o=_(t.value,2),i=o[0],s=o[1];i.includes(Fe)&&s.size>=this.TOPIC_MSG_LIMIT&&this._convM.clearMemMsg(i,!0)}}catch(a){n.e(a)}finally{n.f()}}}},{key:"pushIn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=e.conversationID,o=!0,i=(this._map.has(n)||this._map.set(n,new Map),this._getUniqueIDOfMsg(e));if(this._map.get(n).has(i)){var s=this._map.get(n).get(i);if(!t||!0===s.isModified)return!1}return this._map.get(n).set(i,e),this._setLatestMsgSentByPeer(n,e),this._setLatestMsgSentByMe(n,e),o}},{key:"unshift",value:function(e,t){var n;if(Ye(e)?0<e.length&&(n=e[0].conversationID,this._unshiftMultipleMsgs(e,t)):(n=e.conversationID,this._unshiftSingleMsg(e,t)),n){var o=Array.from(this._map.get(n).values());if(0!==(e=o.length)){for(var i=e-1;0<=i;i--)if("out"===o[i].flow){this._setLatestMsgSentByMe(n,o[i]);break}if(n.startsWith(S.CONV_C2C))for(var s=e-1;0<=s;s--)if("in"===o[s].flow){this._setLatestMsgSentByPeer(n,o[s]);break}}}}},{key:"_unshiftSingleMsg",value:function(e,t){var n,o,i=e.conversationID,s=this._getUniqueIDOfMsg(e);this._map.has(i)?(n=this._map.get(i),o=Array.from(n),n.has(s)||(o.unshift([s,e]),this._map.set(i,new Map(o)),t.push(e))):(this._map.set(i,new Map),this._map.get(i).set(s,e),t.push(e))}},{key:"_unshiftMultipleMsgs",value:function(e,t){for(var n=e.length,o=[],i=e[0].conversationID,s=this._map.get(i),r=this._map.has(i)?Array.from(s):[],a=0;a<n;a++){var c=this._getUniqueIDOfMsg(e[a]);s&&s.has(c)||(o.push([c,e[a]]),t.push(e[a]))}this._map.set(i,new Map(o.concat(r)))}},{key:"remove",value:function(e){var t=e.conversationID;e=this._getUniqueIDOfMsg(e),this._map.has(t)&&this._map.get(t).delete(e)}},{key:"revoke",value:function(e,t,n){var o;return this._map.has(e)?(o=this._map.get(e),this._updateMsgIsRevoked(o,t,n)):this._hoppingMsgMap.has(e)?(o=this._hoppingMsgMap.get(e),this._updateMsgIsRevoked(o,t,n)):null}},{key:"_updateMsgIsRevoked",value:function(e,t,n){var o,i=r(e);try{for(i.s();!(o=i.n()).done;){var s=_(o.value,2)[1];if(s.sequence===t&&(lt(n)||s.random===n))return s.isRevoked||(s.isRevoked=!0),s}}catch(a){i.e(a)}finally{i.f()}}},{key:"removeByConvID",value:function(e){var t=this._map.has(e);Oe.l("".concat(this._n,".removeByConvID convID:").concat(e," has:").concat(t)),t&&(this._map.delete(e),this._latestMsgSentByPeerMap.delete(e),this._latestMsgSentByMeMap.delete(e))}},{key:"findMessage",value:function(e){return this._findMsg(e,this._map)||this._findMsg(e,this._hoppingMsgMap)}},{key:"_findMsg",value:function(e,t){var n,o=null,i=r(t);try{for(i.s();!(n=i.n()).done;)for(var s=v(_(n.value,2)[1].values()),a=s.length,c=0;c<a;c++)if(s[c].ID===e){o=s[c];break}}catch(u){i.e(u)}finally{i.f()}return o}},{key:"updateMsgIsPeerReadProp",value:function(e,t){var n,o=[];return this._map.has(e)?(n=this._map.get(e),o=this._updateMsgIsPeerReadProp(n,t)):this._hoppingMsgMap.has(e)&&(n=this._hoppingMsgMap.get(e),o=this._updateMsgIsPeerReadProp(n,t)),Oe.l("".concat(this._n,".updateMsgIsPeerReadProp convID:").concat(e," peerReadTime:").concat(t," count:").concat(o.length)),o}},{key:"_updateMsgIsPeerReadProp",value:function(e,t){var n,o=[],i=r(e);try{for(i.s();!(n=i.n()).done;){var s=_(n.value,2)[1];s.time<=t&&!s.isPeerRead&&"out"===s.flow&&(s.isPeerRead=!0,o.push(s))}}catch(a){i.e(a)}finally{i.f()}return o}},{key:"updateMsgIsModifiedProp",value:function(e){var t=e.conversationID;this._map.has(t)&&(e=this._getUniqueIDOfMsg(e),t=this._map.get(t).get(e))&&(t.isModified=!0)}},{key:"hasLocalMsgList",value:function(e){return this._map.has(e)}},{key:"getLocalMsgList",value:function(e){return this.hasLocalMsgList(e)?v(this._map.get(e).values()):[]}},{key:"getLocalMaxSeq",value:function(e){return this.hasLocalMsgList(e)?(e=v(this._map.get(e).values()).map((function(e){return e.sequence})),Math.max.apply(Math,v(e))):0}},{key:"getLocalMaxTime",value:function(e){return this.hasLocalMsgList(e)?(e=v(this._map.get(e).values()).map((function(e){return e.time})),Math.max.apply(Math,v(e))):0}},{key:"hasLocalMsg",value:function(e,t){for(var n=!1,o=this.getLocalMsgList(e),i=o.length,s=0;s<i;s++)o[s].ID===t&&(n=!0);return n}},{key:"getLocalMsg",value:function(e,t){for(var n=null,o=this.getLocalMsgList(e),i=o.length,s=0;s<i;s++)if(o[s].ID===t){n=o[s];break}return n}},{key:"getLocalLastMsg",value:function(e){for(var t=this.getLocalMsgList(e),n=void 0,o=t.length-1;0<=o;o--)if(t[o].status===kn){n=t[o];break}return n}},{key:"getLocalSecondLastMsg",value:function(e){return(e=this.getLocalMsgList(e))[e.length-2]}},{key:"getLocalOldestMsg",value:function(e){return this.getLocalMsgList(e)[0]}},{key:"_setLatestMsgSentByPeer",value:function(e,t){e.startsWith(S.CONV_C2C)&&"in"===t.flow&&this._latestMsgSentByPeerMap.set(e,t)}},{key:"_setLatestMsgSentByMe",value:function(e,t){"out"===t.flow&&this._latestMsgSentByMeMap.set(e,t)}},{key:"getLatestMsgSentByPeer",value:function(e){return this._latestMsgSentByPeerMap.get(e)}},{key:"getLatestMsgSentByMe",value:function(e){return this._latestMsgSentByMeMap.get(e)}},{key:"modifyMsgSentByPeer",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar;if(!qe(e=this._map.get(t))){var i=Array.from(e.values());if(0!==(e=i.length)){for(var s=null,r=0,a=!1,c=e-1;0<=c;c--)"in"===i[c].flow&&((s=i[c]).nick!==n&&(s.setNickAndAvatar({nick:n}),a=!0),s.avatar!==o&&(s.setNickAndAvatar({avatar:o}),a=!0),a)&&(r+=1);Oe.l("".concat(this._n,".modifyMsgSentByPeer convID:").concat(t," count:").concat(r))}}}},{key:"modifyMsgSentByMe",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar;if(!qe(e=this._map.get(t))){var i=Array.from(e.values());if(0!==(e=i.length)){for(var s=null,r=0,a=!1,c=e-1;0<=c;c--)"out"===i[c].flow&&((s=i[c]).nick!==n&&(s.setNickAndAvatar({nick:n}),a=!0),s.avatar!==o&&(s.setNickAndAvatar({avatar:o}),a=!0),a)&&(r+=1);Oe.l("".concat(this._n,".modifyMsgSentByMe convID:").concat(t," count:").concat(r))}}}},{key:"getTopicConvIDList",value:function(e){return v(this._map.keys()).filter((function(t){return t.startsWith("".concat(S.CONV_GROUP).concat(e))}))}},{key:"onMsgModified",value:function(e,t){var n,o,i,s;return(this._map.has(e)||this._hoppingMsgMap.has(e))&&(n="".concat(this._n,".onMsgModified"),i=this._getUniqueIDOfMsg(t),s=!!(o=this._getTargetMsg(e,i)),Oe.l("".concat(n," convID:").concat(e," uniqueID:").concat(i," has:").concat(s)),s)?(e=t.messageVersion,i=t.elements,s=t.cloudCustomData,t=t.checkResult,Oe.l("".concat(n," localVersion:").concat(o.version," remoteVersion:").concat(e)),o.version<e?(o.version=e,o._elements=JSON.parse(JSON.stringify(i)),o.payload=o._elements[0].content,o.type=o._elements[0].type,o.cloudCustomData=s,o.isModified=!0,o.hasRiskContent=zt(t),{isUpdated:!0,message:o}):{isUpdated:!1,message:o}):{isUpdated:!1,message:null}}},{key:"_getUniqueIDOfMsg",value:function(e){var t=e.from,n=e.to,o=e.random,i=e.sequence;return e=e.time,"".concat(t,"-").concat(n,"-").concat(o,"-").concat(i,"-").concat(e)}},{key:"_getTargetMsg",value:function(e,t){if(this._map.has(e))return this._map.get(e).get(t);var n=void 0;if(this._hoppingMsgMap.has(e))for(var o=v(this._hoppingMsgMap.get(e).values()),i=0;i<o.length;i++)if(this._getUniqueIDOfMsg(o[i])===t){n=o[i];break}return n}},{key:"storeHoppingMsgList",value:function(e){if(0!==e.length){var t=e[0].conversationID,n=e.length;this._hoppingMsgMap.has(t)||this._hoppingMsgMap.set(t,new Map);for(var o=this._hoppingMsgMap.get(t),i=0;i<n;i++){var s=e[i];o.has(s.ID)||o.set(s.ID,s)}}}},{key:"getHoppingMsg",value:function(e,t){if(this._hoppingMsgMap.has(e))return this._hoppingMsgMap.get(e).get(t)}},{key:"reset",value:function(){this._map.clear(),this._latestMsgSentByPeerMap.clear(),this._latestMsgSentByMeMap.clear(),this._hoppingMsgMap.clear()}}]);function Uo(e){return o(this,Uo),(e=n(this,Uo,[e]))._n="C2CModule",e._msgFromUnreadDBMap=new Map,e._noticeFromUnreadDBList=[],e}function Go(e){this.mixin(e)}function Fo(e,t,n){return lt(e)?{lastTime:0,lastSequence:0,fromAccount:"",messageForShow:"",payload:null,type:"",isRevoked:!1,cloudCustomData:"",onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:!1,revoker:null}:n&&e.ID||e instanceof Do?{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",messageForShow:Ft(e.type,e.payload,t),payload:e.payload||null,type:e.type||null,isRevoked:e.isRevoked||!1,cloudCustomData:e.cloudCustomData||"",onlineOnlyFlag:e._onlineOnlyFlag||!1,nick:e.nick||"",nameCard:e.nameCard||"",version:e.version||0,isPeerRead:e.isPeerRead||!1,revoker:e.revoker||null}:g(g({},e),{},{messageForShow:Ft(e.type,e.payload,t)})}function Bo(e,t){return qe(e)?{lastTime:0,lastSequence:0,fromAccount:"",payload:null,type:"",messageForShow:"",nick:"",avatar:"",version:0,cloudCustomData:"",isRevoked:!1,revoker:null}:{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",payload:e.payload||null,type:e.type||"",messageForShow:Ft(e.type,e.payload,t),nick:e.nick||"",avatar:e.avatar||"",version:e.version||0,cloudCustomData:e.cloudCustomData||"",isRevoked:e.isRevoked||!1,revoker:e.revoker||null}}function qo(e){var t=String(e).replace(/[=]+$/,""),n="";if(t.length%4==1)return"";for(var o,i,s=0,r=0;i=t.charAt(r++);~i&&(o=s%4?64*o+i:i,s++%4)&&(n+=String.fromCharCode(255&o>>(-2*s&6))))i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);try{return decodeURIComponent(escape(n))}catch(a){return""}}Go.mixin=function(e){(e=e.prototype||e)._isReady=!1,e.ready=function(e){if(e)return this._isReady?void(1<arguments.length&&void 0!==arguments[1]&&arguments[1]?e.call(this):setTimeout(e,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(e))},e.triggerReady=function(){var e=this;this._isReady=!0,setTimeout((function(){var t=e._readyQueue;e._readyQueue=[],t&&0<t.length&&t.forEach((function(e){e.call(this)}),e)}),1)},e.resetReady=function(){this._isReady=!1,this._readyQueue=[]},e.isReady=function(){return this._isReady}};var Vo=["jpg","jpeg","gif","png","bmp","image","webp"],jo=["mp4","quicktime","mov"],Ho=s((function e(t){var n=this;o(this,e),qe(t)||(this.userID=t.userID||"",this.nick=t.nick||"",this.gender=t.gender||"",this.birthday=t.birthday||0,this.location=t.location||"",this.selfSignature=t.selfSignature||"",this.allowType=t.allowType||S.ALLOW_TYPE_ALLOW_ANY,this.language=t.language||0,this.avatar=t.avatar||"",this.messageSettings=t.messageSettings||0,this.adminForbidType=t.adminForbidType||S.FORBID_TYPE_NONE,this.level=t.level||0,this.role=t.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],qe(t.profileCustomField))||t.profileCustomField.forEach((function(e){n.profileCustomField.push({key:e.key,value:e.value})}))}),[{key:"validate",value:function(e){var t,n=!0,o="";if(qe(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var i=e.profileCustomField.length,s=null,r=0;r<i;r++){if(s=e.profileCustomField[r],!ut(s.key)||-1===s.key.indexOf("Tag_Profile_Custom"))return{valid:!1,tips:"The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom"};if(!ut(s.value))return{valid:!1,tips:"The type of values of the custom profile key-value pairs (which is profileCustomField) must be String"}}for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if("profileCustomField"===t)continue;if(qe(e[t])&&!ut(e[t])&&!Ke(e[t])){o="key:"+t+", invalid value:"+e[t],n=!1;continue}switch(t){case"nick":ut(e[t])||(n=!(o="nick must be a string")),500<nt(e[t])&&(o="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(nt(e[t])," bytes"),n=!1);break;case"gender":st(Ne,e.gender)||(o="key:gender, invalid value:"+e.gender,n=!1);break;case"birthday":Ke(e.birthday)||(n=!(o="birthday must be a number"));break;case"location":ut(e.location)||(n=!(o="location must be a string"));break;case"selfSignature":ut(e.selfSignature)||(n=!(o="selfSignature must be a string"));break;case"allowType":st(we,e.allowType)||(o="key:allowType, invalid value:"+e.allowType,n=!1);break;case"language":Ke(e.language)||(n=!(o="language must be a number"));break;case"avatar":ut(e.avatar)||(n=!(o="avatar must be a string"));break;case"messageSettings":0!==e.messageSettings&&1!==e.messageSettings&&(n=!(o="messageSettings must be 0 or 1"));break;case"adminForbidType":st(xe,e.adminForbidType)||(o="key:adminForbidType, invalid value:"+e.adminForbidType,n=!1);break;case"level":Ke(e.level)||(n=!(o="level must be a number"));break;case"role":Ke(e.role)||(n=!(o="role must be a number"));break;default:o="unknown key:"+t+" "+e[t],n=!1}}return{valid:n,tips:o}}}]),Ko=s((function e(t){o(this,e),this.MAX_LENGTH=t,this.map=new Map}),[{key:"set",value:function(e){var t;this.map.size>=this.MAX_LENGTH&&(t=this.map.entries().next().value[0],this.map.delete(t)),this.map.set(e,1)}},{key:"has",value:function(e){return this.map.has(e)}},{key:"delete",value:function(e){this.has(e)&&this.map.delete(e)}},{key:"reset",value:function(){this.map.clear()}}]),$o=["groupID","name","avatar","type","introduction","notification","ownerID","selfInfo","createTime","infoSequence","lastInfoTime","lastMessage","nextMessageSeq","memberNum","maxMemberNum","memberList","joinOption","groupCustomField","muteAllMembers","isSupportTopic","inviteOption","_lastRevokedTime"],zo=s((function e(t){o(this,e),this.groupID="",this.name="",this.avatar="",this.type="",this.introduction="",this.notification="",this.ownerID="",this.createTime="",this.infoSequence="",this.lastInfoTime="",this.selfInfo={messageRemindType:"",joinTime:"",nameCard:"",role:"",userID:"",memberCustomField:void 0,readedSequence:0,excludedUnreadSequenceList:void 0},this.lastMessage={lastTime:"",lastSequence:"",fromAccount:"",messageForShow:""},this.nextMessageSeq="",this.memberNum="",this.memberCount="",this.maxMemberNum="",this.maxMemberCount="",this.joinOption="",this.inviteOption="",this.groupCustomField=[],this.muteAllMembers=!1,this.isSupportTopic=!1,this._lastRevokedTime=0,this._initGroup(t)}),[{key:"memberNum",get:function(){return this.memberCount},set:function(e){}},{key:"maxMemberNum",get:function(){return this.maxMemberCount},set:function(e){}},{key:"_initGroup",value:function(e){for(var t in e)$o.indexOf(t)<0||("selfInfo"!==t?("memberNum"===t&&(this.memberCount=e[t]),"maxMemberNum"===t&&(this.maxMemberCount=e[t]),"isSupportTopic"!==t?this[t]=e[t]:this.isSupportTopic=1===e[t]):this.updateSelfInfo(e[t]))}},{key:"updateGroup",value:function(e){var t=this;(e.appid=void 0,e.grossTopicNextMsgSeq=void 0,e.selfInfo&&(e.selfInfo.grossTopicReadSeq=void 0),e=JSON.parse(JSON.stringify(e))).lastMsgTime&&(this.lastMessage.lastTime=e.lastMsgTime),lt(e.muteAllMembers)||("On"===e.muteAllMembers?e.muteAllMembers=!0:e.muteAllMembers=!1),e.groupCustomField&&_t(this.groupCustomField,e.groupCustomField),lt(e.memberNum)||(this.memberCount=e.memberNum),lt(e.maxMemberNum)||(this.maxMemberCount=e.maxMemberNum),lt(e.isSupportTopic)||(this.isSupportTopic=Ke(e.isSupportTopic)?1===e.isSupportTopic:e.isSupportTopic),Qe(this,e,["members","errorCode","lastMsgTime","groupCustomField","memberNum","maxMemberNum","isSupportTopic"]),Ye(e.members)&&0<e.members.length&&e.members.forEach((function(e){e.userID===t.selfInfo.userID&&Qe(t.selfInfo,e,["sequence"])}))}},{key:"updateSelfInfo",value:function(e){e={nameCard:e.nameCard,joinTime:e.joinTime,role:e.role,messageRemindType:e.messageRemindType,readedSequence:e.readedSequence,excludedUnreadSequenceList:e.excludedUnreadSequenceList},Qe(this.selfInfo,g({},e),[],["",null,void 0,0,NaN])}},{key:"setSelfNameCard",value:function(e){this.selfInfo.nameCard=e}}]),Yo=s((function e(t,n){var i=2<arguments.length&&void 0!==arguments[2]&&arguments[2];o(this,e),this.conversationID=t.conversationID||"",this.unreadCount=t.unreadCount||0,this.type=t.type||"",this.lastMessage=Fo(t.lastMessage,n,i),t.lastMsgTime&&(this.lastMessage.lastTime=t.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=t.peerReadTime||0,this.groupAtInfoList=[],this.remark=t.remark||"",this.isPinned=t.isPinned||!1,this.messageRemindType=t.messageRemindType,this.markList=t.markList||[],this.customData=t.customData||"",this.conversationGroupList=t.conversationGroupList||[],this.draftText=t.draftText||"",this._initProfile(t),this.subType=this.groupProfile?this.groupProfile.type:""}),[{key:"toAccount",get:function(){return this.conversationID.startsWith(S.CONV_C2C)?this.conversationID.replace(S.CONV_C2C,""):this.conversationID.startsWith(S.CONV_GROUP)?this.conversationID.replace(S.CONV_GROUP,""):""}},{key:"_initProfile",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"userProfile":t.userProfile=e.userProfile;break;case"groupProfile":t.groupProfile=e.groupProfile}})),lt(this.userProfile)&&this.type===S.CONV_C2C?this.userProfile=new Ho({userID:e.conversationID.replace("C2C","")}):lt(this.groupProfile)&&this.type===S.CONV_GROUP&&(this.groupProfile=new zo({groupID:e.conversationID.replace("GROUP","")}))}},{key:"updateUnreadCount",value:function(e){var t=e.nextUnreadCount,n=e.isFromGetConversations;e=e.isUnreadC2CMessage,lt(t)||(Mt(this.subType)?this.unreadCount=0:n&&this.type===S.CONV_GROUP||n&&this.type===S.CONV_TOPIC||e&&this.type===S.CONV_C2C?this.unreadCount=t:this.unreadCount=this.unreadCount+t)}},{key:"updateLastMessage",value:function(e){this.lastMessage=Fo(e)}},{key:"updateGroupAtInfoList",value:function(e){var n;this._isNeedMergeGroupAtInfo(e)||(-1!==(n=(t(n=e.groupAtType)||p(n)||M(n)||d()).slice(0)).indexOf(S.CONV_AT_ME)&&-1!==n.indexOf(S.CONV_AT_ALL)&&(n=[S.CONV_AT_ALL_AT_ME]),n={from:e.from,groupID:e.groupID,topicID:e.topicID,messageSequence:e.sequence,atTypeArray:n,__random:e.__random,__sequence:e.__sequence},this.groupAtInfoList.push(n))}},{key:"_isNeedMergeGroupAtInfo",value:function(e){var t,n=e.groupID,o=e.sequence;return!!Ct({groupID:n})&&(t=!1,this.groupAtInfoList.forEach((function(n){n.messageSequence===o&&(-1<n.atTypeArray.indexOf(S.CONV_AT_ME)&&-1<e.groupAtType.indexOf(S.CONV_AT_ALL)&&(n.atTypeArray=[S.CONV_AT_ALL_AT_ME]),-1<n.atTypeArray.indexOf(S.CONV_AT_ALL)&&-1<e.groupAtType.indexOf(S.CONV_AT_ME)&&(n.atTypeArray=[S.CONV_AT_ALL_AT_ME],n.__random=e.__random,n.__sequence=e.__sequence),t=!0)})),t)}},{key:"clearGroupAtInfoList",value:function(){this.groupAtInfoList.length=0}},{key:"reduceUnreadCount",value:function(){return 1<=this.unreadCount&&(--this.unreadCount,!0)}},{key:"isLastMessageRevoked",value:function(e){var t=e.sequence;return e=e.time,this.type===S.CONV_C2C&&t===this.lastMessage.lastSequence&&e===this.lastMessage.lastTime||this.type===S.CONV_GROUP&&t===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}},{key:"setDraftText",value:function(e){this.draftText=e}}]),Wo=a(a(a({},S.MSG_REMIND_ACPT_AND_NOTE,0),S.MSG_REMIND_DISCARD,1),S.MSG_REMIND_ACPT_NOT_NOTE,2),Jo=s((function e(t){o(this,e),this._convM=t,this._n="MsgRemindHandler"}),[{key:"onAllRcvMsgOptNotify",value:function(e){e=this._handleResult(e),this._convM.emitOEvt(T.ALL_RECEIVE_MESSAGE_OPT_UPDATED,e)}},{key:"getC2CMsgRemindType",value:function(e){var t=this,n="".concat(this._n,".getC2CMsgRemindType");return this._convM.req({P:jn.GET_C2C_PEER_MUTE_NOTIFICATIONS,data:{toAccount:this._convM.getMyUserID(),userIDList:e}}).then((function(o){Oe.l("".concat(n," ok. userIDList:").concat(e)),o=o.data.muteFlagList,t._convM.onC2CMsgRemindTypeFetched(o)})).catch((function(e){Oe.e("".concat(n," failed. error:"),e)}))}},{key:"set",value:function(e){return e.groupID?this._setGroupMsgRemindType(e):Ye(e.userIDList)?this._setC2CMsgRemindType(e):void 0}},{key:"_setGroupMsgRemindType",value:function(e){var t=this,n="".concat(this._n,".").concat("_setGroupMsgRemindType"),o=e.groupID,i=e.messageRemindType,s="groupID:".concat(o," messageRemindType:").concat(i),r=new io("_setGroupMsgRemindType"),a=(r.setMessage(s),this._get(7));return a?a.modifyGroupMemberInfo({groupID:o,messageRemindType:i,userID:this._convM.getMyUserID()}).then((function(){r.end(),Oe.l("".concat(n," ok. ").concat(s));var o=t.onGroupMsgRemindTypeUpdated(e);return t._convM.onTotalUnreadCountUpdate(),Cn(o)})).catch((function(e){return r.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)})):Sn({code:qn.NO_MODULE})}},{key:"onGroupMsgRemindTypeUpdated",value:function(e){var t,n,o=e.groupID,i=(e=e.messageRemindType,Oe.l("".concat(this._n,".onGroupMsgRemindTypeUpdated groupID:").concat(o," messageRemindType:").concat(e)),this._get(7).getLocalGroupProfile(o));return i&&(i.selfInfo.messageRemindType=e),Tt(o)?(t=Gt(n=o),(n=this._get(10).getLocalTopic(t,n))&&n.updateSelfInfo({messageRemindType:e})&&this._convM.emitOEvt(T.TOPIC_UPDATED,{groupID:t,topic:n}),{topic:n}):(this._convM.patchMsgRemindType({ID:o,isC2CConversation:!1,messageRemindType:e})&&this._emitConvUpdate(),{group:i})}},{key:"_setC2CMsgRemindType",value:function(e){var t=this,n="".concat(this._n,".").concat("_setC2CMsgRemindType"),o=e.userIDList,i=e.messageRemindType,s=o.slice(0,30),r=(e=Wo[i]||0,"userIDList:".concat(s," messageRemindType:").concat(i)),a=new io("_setC2CMsgRemindType");return a.setMessage(r),this._convM.req({P:jn.SET_C2C_PEER_MUTE_NOTIFICATIONS,data:{userIDList:s,muteFlag:e}}).then((function(e){a.end(),e=e.data.errorList;var o=[],c=[],u=(Ye(e)&&e.forEach((function(e){o.push(e.userID),c.push({userID:e.userID,code:e.errorCode})})),e=s.filter((function(e){return-1===o.indexOf(e)})),Oe.l("".concat(n," ok. ").concat(r," successUserIDList:").concat(e," failureUserIDList:").concat(JSON.stringify(c))),0);return e.forEach((function(e){t._convM.patchMsgRemindType({ID:e,isC2CConversation:!0,messageRemindType:i})&&(u+=1)})),1<=u&&t._emitConvUpdate(),s.length=o.length=0,t._convM.onTotalUnreadCountUpdate(),Tn({successUserIDList:e.map((function(e){return{userID:e}})),failureUserIDList:c})})).catch((function(e){return a.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"_get",value:function(e){return this._convM.get(e)}},{key:"_emitConvUpdate",value:function(){this._convM.emitConvUpdate(!0,!1)}},{key:"setAllRcvMsgOpt",value:function(e){var t="".concat(this._n,".").concat("setAllRcvMsgOpt"),n=void 0===(n=e.messageRemindType)?S.MSG_REMIND_ACPT_NOT_NOTE:n,o=void 0===(o=e.isRepeated)||o,i=void 0===(i=(s=this._calcStartAndEndTime(e)).startTime)?0:i,s=void 0===(s=s.endTime)?0:s,r=(e=JSON.stringify(e),new io("setAllRcvMsgOpt"));return r.setMessage(e),Oe.l("".concat(t," options:").concat(e)),this._convM.req({P:jn.SET_ALL_RECEIVE_MSG_OPT,data:{messageRemindType:Wo[n],startTime:i,endTime:s,isRepeated:o?1:0}}).then((function(e){return r.end(),Oe.l("".concat(t," ok.")),Cn(e)})).catch((function(e){return r.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"_calcStartAndEndTime",value:function(e){var t=void 0===(t=e.startHour)?0:t,n=void 0===(n=e.startMinute)?0:n,o=void 0===(o=e.startSecond)?0:o,i=void 0===(i=e.duration)?0:i,s=(e=void 0===(e=e.isRepeated)||e,(a=new Date).getFullYear()),r=a.getMonth(),a=a.getDate();return{startTime:s=Math.round(new Date(s,r,a,t,n,o).getTime()/1e3),endTime:e&&86400<=i?s+86400:s+i}}},{key:"getAllRcvMsgOpt",value:function(){var e=this,t="".concat(this._n,".").concat("getAllRcvMsgOpt"),n=new io("getAllRcvMsgOpt");return this._convM.req({P:jn.GET_ALL_RECEIVE_MSG_OPT,data:{toAccount:this._convM.getMyUserID()}}).then((function(o){return o=o.data,n.setMessage(JSON.stringify(o)).end(),Oe.l("".concat(t," ok. data:").concat(JSON.stringify(o))),Cn(o=e._handleResult(o))})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"_handleResult",value:function(e){var t=e.messageRemindType,n=e.startTime,o=e.endTime,i=(e=e.isRepeated,S.MSG_REMIND_ACPT_AND_NOTE);return 1===t&&(i=S.MSG_REMIND_DISCARD),{messageRemindType:i=2===t?S.MSG_REMIND_ACPT_NOT_NOTE:i,startTime:n,endTime:o,isRepeated:1===e}}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset"))}}]),Xo=s((function e(t){o(this,e),this._convM=t,this._n="ConvGroupHandler",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=Ln}),[{key:"setConvCustomData",value:function(e){var t=this,n="".concat(this._n,".").concat("setConvCustomData"),o=e.conversationIDList,i=e.customData,s=(Oe.l("".concat(n," options:"),e),new io("setConvCustomData")),r=(s.setMessage(JSON.stringify(e)),{fromAccount:this._getMyUserID(),itemList:[]}),a=[],c=[];return o.forEach((function(e){var n;return t._hasLocalConv(e)?St(e)||Et(e)?(n={operationType:2,contactItem:void 0,customMark:i},St(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,"")}:Et(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,"")}),void r.itemList.push(n)):(t._onConvIDInvalid(c,e),!0):(t._onConvNotFound(c,e),!0)})),c.length===o.length?Tn({successConversationIDList:a,failureConversationIDList:c}):this._convM.req({P:jn.SET_CONV_CUSTOM_DATA,data:r}).then((function(e){var o,r,u;return s.end(),Oe.l("".concat(n," ok")),Ye(e=e.data.resultItem)&&(u=!1,e.forEach((function(e){o=t._concatConvID(e.contactItem),0===e.resultCode?(a.push(o),(r=t._getLocalConv(o))&&r.customData!==i&&(r.customData=i,u=!0)):c.push({conversationID:o,code:e.resultCode,message:e.resultInfo})})),!0===u)&&t._emitConvUpdate(),Cn({successConversationIDList:a,failureConversationIDList:c})})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"markConv",value:function(e){var t,n,o,i,s,r,a,c,u,l,p=this;return this._convM.canIUse(N.CONV_MARK)?(t="".concat(this._n,".").concat("markConv"),n=e.conversationIDList,o=e.markType,i=e.enableMark,Oe.l("".concat(t," options:"),e),s=new io("markConv"),r=void s.setMessage(JSON.stringify(e)),a=void 0,e=this._getFlagBit(o),!0===i?a=[e]:r=[e],c={fromAccount:this._getMyUserID(),itemList:[]},u=[],l=[],n.forEach((function(e){var t;return p._hasLocalConv(e)?St(e)||Et(e)?(t={operationType:1,contactItem:void 0,clearMark:r,setMark:a},St(e)?t.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,"")}:Et(e)&&(t.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,"")}),void c.itemList.push(t)):(p._onConvIDInvalid(l,e),!0):(p._onConvNotFound(l,e),!0)})),l.length===n.length?Tn({successConversationIDList:u,failureConversationIDList:l}):this._convM.req({P:jn.MARK_CONV,data:c}).then((function(e){var n,r,a;return s.end(),Oe.l("".concat(t," ok")),Ye(e=e.data.resultItem)&&(a=!1,e.forEach((function(e){var t;n=p._concatConvID(e.contactItem),0===e.resultCode?(u.push(n),(r=p._getLocalConv(n))&&(t=r.markList.indexOf(o),!0===i?-1===t&&(r.markList.push(o),a=!0):-1!==t&&(r.markList.splice(t,1),a=!0))):l.push({conversationID:n,code:e.resultCode,message:e.resultInfo})})),!0===a)&&p._emitConvUpdate(),Cn({successConversationIDList:u,failureConversationIDList:l})})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._convM.noUse("markConv")}},{key:"getLocalConvGroupList",value:function(){var e=this;return Oe.l("".concat(this._n,".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===An?this.getRemoteConvGroupList().then((function(){return Cn(v(e._convGroupMap.values()))})):Tn(v(this._convGroupMap.values()))}},{key:"searchConvGroupAndMark",value:function(e,t){var n=this,o="".concat(this._n,".searchConvGroupAndMark"),i=[];return e.forEach((function(e){1===t?i.push({type:1,toAccount:e}):2===t&&i.push({type:2,groupID:e})})),Oe.l("".concat(o," type:").concat(t," list:"),e),this._convM.req({P:jn.SEARCH_CONV_GRP_MARK,data:{fromAccount:this._getMyUserID(),contactItem:i}}).then((function(e){var t=(e=e.data).contactItem;e=e.groupItem,Oe.l("".concat(o," ok. contactItem:"),t,"groupItem:",e),n._fillConvGroupMap(e),n._handleContactItem(t),n._emitConvUpdate()})).catch((function(e){Oe.w("".concat(o," failed. error:"),e)}))}},{key:"_fillConvGroupMap",value:function(e){var t=this;Ye(e)&&e.forEach((function(e){var n=e.convGroupID;e=e.groupName,t._convGroupMap.set(n,e)}))}},{key:"_handleContactItem",value:function(e){var t,n=this;Ye(e)&&e.forEach((function(e){var o=[],i=e.standardMark,s=e.customData,r=e.convGroupIDList;Ye(r)&&r.forEach((function(e){n._convGroupMap.has(e)&&o.push(n._convGroupMap.get(e))})),t=n._concatConvID(e),(t=n._getLocalConv(t))&&(t.markList=qt(i),t.customData=s||"",t.conversationGroupList=[].concat(o))}))}},{key:"getRemoteConvGroupList",value:function(){var e=this,t="".concat(this._n,".getRemoteConvGroupList");return this._pagingStatus=Rn,this._convM.req({P:jn.GET_CONV_GRP_LIST,data:{fromAccount:this._getMyUserID(),startIndex:this._startIndex}}).then((function(n){var o=(n=n.data).completeFlag,i=n.contactItem,s=void 0===(s=n.nextStartIndex)?0:s;if(n=n.groupItem,e._startIndex=s,Oe.l("".concat(t," completeFlag:").concat(o," nextStartIndex:").concat(s,", groupItem:"),n,"contactItem:",i),e._fillConvGroupMap(n),e._handleContactItem(i),0===o)return e.getRemoteConvGroupList();1===o&&(e._pagingStatus=On,e._emitConvUpdate(),e._emitConvGroupListUpdate())})).catch((function(n){e._pagingStatus=An,Oe.w("".concat(t," failed. error:"),n)}))}},{key:"createConvGroup",value:function(e){var t,n,o,i,s,r,a=this;return this._convM.canIUse(N.CONV_GROUP)?(t="".concat(this._n,".").concat("createConvGroup"),Oe.l("".concat(t," options:"),e),(n=new io("createConvGroup")).setMessage(JSON.stringify(e)),o=e.groupName,e=e.conversationIDList,i={fromAccount:this._getMyUserID(),itemList:[{groupName:o,contactItem:[]}]},s=[],r=[],e.forEach((function(e){return a._hasLocalConv(e)?St(e)||Et(e)?void(St(e)?i.itemList[0].contactItem.push({type:1,toAccount:e.replace(S.CONV_C2C,"")}):Et(e)&&i.itemList[0].contactItem.push({type:2,groupID:e.replace(S.CONV_GROUP,"")})):(a._onConvIDInvalid(r,e),!0):(a._onConvNotFound(r,e),!0)})),r.length===e.length?Tn({successConversationIDList:s,failureConversationIDList:r}):this._convM.req({P:jn.CREATE_CONV_GRP,data:i}).then((function(e){n.end(),Oe.l("".concat(t," ok"));var i,c,u,l=(e=e.data.groupResultItem[0]).groupItem;return e=e.resultItem,ze(l)&&(a._convGroupMap.set(l.convGroupID,l.groupName),a._emitConvGroupListUpdate()),Ye(e)&&(u=!1,e.forEach((function(e){i=a._concatConvID(e.contactItem),0===e.resultCode?(s.push(i),(c=a._getLocalConv(i))&&-1===c.conversationGroupList.indexOf(o)&&(c.conversationGroupList.push(o),u=!0)):r.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===u)&&(a._emitConvUpdate(),a._emitConvGroupListUpdate()),Cn({successConversationIDList:s,failureConversationIDList:r})})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._convM.noUse("createConvGroup")}},{key:"deleteConvGroup",value:function(e){var t,n,o=this;return this._convM.canIUse(N.CONV_GROUP)?(t="".concat(this._n,".").concat("deleteConvGroup"),Oe.l("".concat(t," groupName:").concat(e)),(n=new io("deleteConvGroup")).setMessage(e),this._convM.req({P:jn.DEL_CONV_GRP,data:{fromAccount:this._getMyUserID(),groupName:[e]}}).then((function(i){var s;n.end(),Oe.l("".concat(t," ok")),Ye(i=i.data.groupItem)&&(s=!1,i.forEach((function(e){o._convGroupMap.has(e.convGroupID)&&(o._convGroupMap.delete(e.convGroupID),s=!0)})),!0===s)&&o._emitConvGroupListUpdate(),o._eraseFromConversationGroupList([e])})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._convM.noUse("deleteConvGroup")}},{key:"renameConvGroup",value:function(e){var t,n,o,i,s=this;return this._convM.canIUse(N.CONV_GROUP)?(t="".concat(this._n,".").concat("renameConvGroup"),Oe.l("".concat(t," options:"),e),(n=new io("renameConvGroup")).setMessage(JSON.stringify(e)),o=e.oldName,i=e.newName,this._convM.req({P:jn.RENAME_CONV_GRP,data:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:o,newName:i}}}).then((function(e){n.end(),Oe.l("".concat(t," ok")),e=e.data.updateGroupResult.convGroupID,s._convGroupMap.set(e,i),s._emitConvGroupListUpdate(),e=s._convM.getLocalConvList();var r,a,c=!1;e.forEach((function(e){r=e.conversationGroupList,-1!==(a=r.indexOf(o))&&(r.splice(a,1,i),c=!0)})),!0===c&&s._emitConvUpdate()})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._convM.noUse("renameConvGroup")}},{key:"addConvsToGroup",value:function(e){var t,n,o,i,s,r,a,c=this;return this._convM.canIUse(N.CONV_GROUP)?(t="".concat(this._n,".").concat("addConvsToGroup"),Oe.l("".concat(t," options:"),e),(n=new io("addConvsToGroup")).setMessage(JSON.stringify(e)),o=e.conversationIDList,i=e.groupName,s={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:i,updateItem:[]}},r=[],a=[],o.forEach((function(e){return c._hasLocalConv(e)?St(e)||Et(e)?void(St(e)?s.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,"")}}):Et(e)&&s.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,"")}})):(c._onConvIDInvalid(a,e),!0):(c._onConvNotFound(a,e),!0)})),a.length===o.length?Tn({successConversationIDList:r,failureConversationIDList:a}):this._convM.req({P:jn.ADD_CONV_TO_GRP,data:s}).then((function(e){var o,s,u;return n.end(),Oe.l("".concat(t," ok")),Ye(e=e.data.updateGroupResult.contactResultItem)&&(u=!1,e.forEach((function(e){o=c._concatConvID(e.contactItem),0===e.resultCode?(s=c._getLocalConv(o))&&-1===s.conversationGroupList.indexOf(i)&&(s.conversationGroupList.push(i),r.push(o),u=!0):a.push({conversationID:o,code:e.resultCode,message:e.resultInfo})})),!0===u)&&(c._emitConvUpdate(),c._emitConvInGroupUpdate(i)),Cn({successConversationIDList:r,failureConversationIDList:a})})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._convM.noUse("addConvsToGroup")}},{key:"deleteConvsFromGroup",value:function(e){var t,n,o,i,s,r,a,c=this,u="deleteConvsFromGroup";return this._convM.canIUse(N.CONV_GROUP)?(t="".concat(this._n,".").concat(u),Oe.l("".concat(t," options:"),e),(n=new io(u)).setMessage(JSON.stringify(e)),o=e.conversationIDList,i=e.groupName,s={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:i,updateItem:[]}},r=[],a=[],o.forEach((function(e){return c._hasLocalConv(e)?St(e)||Et(e)?void(St(e)?s.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,"")}}):Et(e)&&s.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,"")}})):(c._onConvIDInvalid(a,e),!0):(c._onConvNotFound(a,e),!0)})),a.length===o.length?Tn({successConversationIDList:r,failureConversationIDList:a}):this._convM.req({P:jn.DEL_CONV_FROM_GRP,data:s}).then((function(e){var o,s,u;return n.end(),Oe.l("".concat(t," ok")),Ye(e=e.data.updateGroupResult.contactResultItem)&&(u=!1,e.forEach((function(e){var t;o=c._concatConvID(e.contactItem),0===e.resultCode?(s=c._getLocalConv(o))&&-1!==(t=s.conversationGroupList.indexOf(i))&&(s.conversationGroupList.splice(t,1),r.push(o),u=!0):a.push({conversationID:o,code:e.resultCode,message:e.resultInfo})})),!0===u)&&(c._emitConvUpdate(),c._emitConvInGroupUpdate(i)),Cn({successConversationIDList:r,failureConversationIDList:a})})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._convM.noUse(u)}},{key:"onConvMarkUpdated",value:function(e){var t,n,o=this;qe(e)||(Oe.l("".concat(this._n,".onConvMarkUpdated markItemList:"),e),n=!1,e.forEach((function(e){var i=e.recentContactItem,s=e.optType,r=e.standardMark;e=e.customMark,t=o._concatConvID(i),(t=o._getLocalConv(t))&&(1===s?n=o._diffStandardMark(t,r):2===s?n=o._diffCustomMark(t,e):3===s&&(i=o._diffStandardMark(t,r),s=o._diffCustomMark(t,e),n=i||s))})),!0===n&&this._emitConvUpdate())}},{key:"_diffStandardMark",value:function(e,t){t=qt(t);var n=!1;return!0!==function(e,t){if(e!==t){if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1}return!0}(e.markList,t)&&(e.markList=t,n=!0),n}},{key:"_diffCustomMark",value:function(e,t){var n=!1;return e.customData!==t&&void 0!==t&&(e.customData=t,n=!0),n}},{key:"onConvGroupCreated",value:function(e){var t=this,n=(Oe.l("".concat(this._n,".onConvGroupCreated resultList:"),e),!1),o=!1;Ye(e)&&(e.forEach((function(e){var i,s,r=(s=e.msgGroupItem).groupID,a=s.groupName;t._convGroupMap.get(r)!==a&&(t._convGroupMap.set(r,a),o=!0),Ye(s=e.msgRecentContactItem)&&s.forEach((function(e){i=t._concatConvID(e),(i=t._getLocalConv(i))&&-1===i.conversationGroupList.indexOf(a)&&(i.conversationGroupList.push(a),n=!0)}))})),!0===n&&this._emitConvUpdate(),!0===o)&&this._emitConvGroupListUpdate()}},{key:"onConvGroupDeleted",value:function(e){var t,n=this,o=(Oe.l("".concat(this._n,".onConvGroupDeleted groupItemList:"),e),[]);Ye(e)&&(t=!1,e.forEach((function(e){var i=e.groupID;e=e.groupName,n._convGroupMap.has(i)&&(n._convGroupMap.delete(i),t=!0,o.push(e))})),!0===t)&&this._emitConvGroupListUpdate(),this._eraseFromConversationGroupList(o)}},{key:"_eraseFromConversationGroupList",value:function(e){qe(e)||(this._convM.getLocalConvList().forEach((function(t){t.conversationGroupList=t.conversationGroupList.filter((function(t){return!e.includes(t)}))})),this._emitConvUpdate())}},{key:"onConvGroupNameUpdated",value:function(e){Oe.l("".concat(this._n,".onConvGroupNameUpdated options:"),e);var t,n,o,i=e.groupID,s=e.groupName,r=e.oldGroupName;this._convGroupMap.get(i)!==s&&(this._convGroupMap.set(i,s),this._emitConvGroupListUpdate(),e=this._convM.getLocalConvList(),o=!1,e.forEach((function(e){t=e.conversationGroupList,-1!==(n=t.indexOf(r))&&(t.splice(n,1,s),o=!0)})),!0===o)&&this._emitConvUpdate()}},{key:"onConvInGroupUpdated",value:function(e){var t,n,o,i=this,s=(Oe.l("".concat(this._n,".onConvInGroupUpdated options:"),e),e.oldGroupName);Ye(e=e.recentContactUpdateGroupItem)&&(o=!1,e.forEach((function(e){var r=e.contactOptType;e=e.recentContactItem,t=i._concatConvID(e),(t=i._getLocalConv(t))&&(n=t.conversationGroupList.indexOf(s),1===r?-1===n&&(t.conversationGroupList.push(s),o=!0):2===r&&-1!==n&&(t.conversationGroupList.splice(n,1),o=!0))})),!0===o)&&(this._emitConvUpdate(),this._emitConvInGroupUpdate(s))}},{key:"onConvAddedToOrDeletedFromGroup",value:function(e){var t,n,o=this,i=(Oe.l("".concat(this._n,".onConvAddedToOrDeletedFromGroup options:"),e),e.msgRecentContactItem),s=(e=e.msgRecentContactUpdateContactItem,i=this._concatConvID(i),this._getLocalConv(i));s&&Ye(e)&&(n=!1,e.forEach((function(e){var i=e.groupOptType;e=e.recentContactGroupItem.groupName,t=s.conversationGroupList.indexOf(e),1===i?-1===t&&(s.conversationGroupList.push(e),n=!0):2===i&&-1!==t&&(s.conversationGroupList.splice(t,1),n=!0),!0===n&&o._emitConvInGroupUpdate(e)})),!0===n)&&this._emitConvUpdate()}},{key:"onConvGroupListSynced",value:function(e){Ye(e)&&0!==e.length&&(Oe.l("".concat(this._n,".onConvGroupListSynced groupItem:"),e),this._fillConvGroupMap(e))}},{key:"getConvGroupListByID",value:function(e){var t,n=this;if(!qe(e))return t=[],e.forEach((function(e){n._convGroupMap.has(e)&&t.push(n._convGroupMap.get(e))})),t}},{key:"_onConvNotFound",value:function(e,t){e.push({conversationID:t,code:qn.CONV_NOT_FOUND,message:this._convM.getErrMsg(qn.CONV_NOT_FOUND)})}},{key:"_onConvIDInvalid",value:function(e,t){e.push({conversationID:t,code:qn.INVALID_CONV_ID,message:this._convM.getErrMsg(qn.INVALID_CONV_ID)})}},{key:"_getFlagBit",value:function(e){for(var t=e.toString(2),n=t.length,o=n-1;0<=o;o--)if("1"===t[o])return n-o-1}},{key:"_concatConvID",value:function(e){var t,n=e.type,o=e.to,i=e.groupID;return e=e.userID,1===n?lt(e)?lt(o)||(t="".concat(S.CONV_C2C).concat(o)):t="".concat(S.CONV_C2C).concat(e):2===n&&(t="".concat(S.CONV_GROUP).concat(i)),t}},{key:"_getMyUserID",value:function(){return this._convM.getMyUserID()}},{key:"_getLocalConv",value:function(e){return this._convM.getLocalConversation(e)}},{key:"_hasLocalConv",value:function(e){return this._convM.hasLocalConversation(e)}},{key:"_emitConvUpdate",value:function(){this._convM.emitConvUpdate(!0,!1)}},{key:"_emitConvGroupListUpdate",value:function(){this._convM.emitOEvt(T.CONVERSATION_GROUP_LIST_UPDATED,v(this._convGroupMap.values()))}},{key:"_emitConvInGroupUpdate",value:function(e){var t={groupName:e,conversationList:[]},n=this._convM.getLocalConvList();t.conversationList=n.filter((function(t){return t.conversationGroupList.includes(e)})),this._convM.emitOEvt(T.CONVERSATION_IN_GROUP_UPDATED,t)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=Ln}}]),Zo=(u(Di,Pn),s(Di,[{key:"_initListeners",value:function(){var e=this.getIEmitInst();e.on(xo.A2KEY_AND_TINYID_UPDATED,this._init,this),e.on(xo.PROFILE_UPDATED,this._onProfileUpdated,this),e.on(xo.CLOUD_CONFIG,this._onCloudConfig,this)}},{key:"_init",value:function(){var e=this,t=(Oe.l("".concat(this._n,"._init")),this.get(13).getItem("conversationMap")),n=this.isIntl(),o=this.isUsingChatCore();if(t){for(var i=t.length,s=0;s<i;s++){var r=t[s];if(r){if(this._isNonExistentAccount(r.conversationID))continue;if(r.groupProfile&&Mt(r.groupProfile.type))continue}this._convMap.set(r.conversationID,new Yo(t[s],n,o))}this.emitConvUpdate(!0,!1)}this.ready((function(){0<e._tmpGroupList.length&&(e.updateConvGroupProfile(e._tmpGroupList),e._tmpGroupList.length=0)})),this.syncConvList()}},{key:"_isNonExistentAccount",value:function(e){var t;return"@TLS#ERROR"===(t=e.startsWith(S.CONV_C2C)?e.replace(S.CONV_C2C,""):t)||"@TLS#NOT_FOUND"===t}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&this._msgListHandler.onCheckTimer(e)}},{key:"onMessageSent",value:function(e){this._onSendOrRcvMsg({conversationOptionsList:e.conversationOptionsList,isInstantMessage:!0})}},{key:"onNewMessage",value:function(e){this._onSendOrRcvMsg(e)}},{key:"_onSendOrRcvMsg",value:function(e){var t=this,n=e.conversationOptionsList,o=void 0===(o=e.isInstantMessage)||o,i=void 0!==(i=e.isUnreadC2CMessage)&&i,s=void 0===(s=e.updateUnreadCount)||s,r=void 0!==(r=e.isSyncingEnded)&&r;this._isReady?0!==n.length?(!0===o&&this._checkNewConv(n),this._updateLocalConvList({conversationOptionsList:n,isInstantMessage:o,isUnreadC2CMessage:i,isFromGetConversations:!1,updateUnreadCount:s}),o||(this._convIDFromUnreadDBMap=new Map([].concat(v(this._convIDFromUnreadDBMap),v(n.map((function(e){return[e.conversationID,1]}))))),this._diffAndDeleteConv(),r&&this.emitIEvt(xo.C2C_UNREAD_HANDLE_COMPLETED)),0<n.filter((function(e){return!t._isConvNeedShow(e.conversationID)})).length||this.emitConvUpdate()):r&&this.emitIEvt(xo.C2C_UNREAD_HANDLE_COMPLETED):this.ready((function(){t._onSendOrRcvMsg(e)}))}},{key:"updateConvGroupProfile",value:function(e){var t,n=this;Ye(e)&&0===e.length||(0!==this._convMap.size?(t=!1,e.forEach((function(e){var o="".concat(S.CONV_GROUP).concat(e.groupID);n._convMap.has(o)&&(t=!0,(o=n._convMap.get(o)).groupProfile=JSON.parse(JSON.stringify(e)),o.lastMessage.lastSequence<e.nextMessageSeq&&(o.lastMessage.lastSequence=e.nextMessageSeq-1),o.subType||(o.subType=e.type))})),t&&this.emitConvUpdate(!0,!1)):this._tmpGroupList=e)}},{key:"onMessageRevoked",value:function(e,t){var n,o,i,s=this;0!==e.length&&(n=null,o=!1,i=[],e.forEach((function(e){(n=s._convMap.get(e.conversationID))&&(t&&n.reduceUnreadCount()&&(o=n.type!==S.CONV_TOPIC),n.type===S.CONV_TOPIC?i.push(e):n.isLastMessageRevoked({sequence:e.sequence,time:e.time})&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(e.revoker),o=!0))})),this.get(10).onMessageRevoked(i),o)&&this.emitConvUpdate(!0,!1)}},{key:"updateRevokerInfo",value:function(e){for(var t=new Set,n=0;n<e.length;n++){var o=e[n].revoker;t.add(o)}var i=v(t),s=this.get(4);return new Promise((function(t){s.getUserProfile({userIDList:i}).then((function(n){if(!Ye(n=n.data)||0===n.length)return t(e);var o,i={},s=r(n);try{for(s.s();!(o=s.n()).done;){var a=o.value,c=a.userID,u=a.nick,l=a.avatar;i[c]={nick:u,avatar:l}}}catch(p){s.e(p)}finally{s.f()}e.forEach((function(e){var t=e.revoker;i[t]&&(e.revokerInfo.nick=i[t].nick||"",e.revokerInfo.avatar=i[t].avatar||"")})),t(e)})).catch((function(){t(e)}))}))}},{key:"isLastMessageRevoked",value:function(e){var t=!1,n=e.conversationID,o=e.sequence,i=e.time,s=this._convMap.get(n);return s&&(t=s.type===S.CONV_TOPIC?this.get(10).isLastMessageRevoked({topicID:n.replace(S.CONV_GROUP,""),sequence:o}):s.isLastMessageRevoked({sequence:o,time:i})),Oe.l("".concat(this._n,".isLastMessageRevoked options:"),e,"ret:".concat(t)),t}},{key:"onMessageDeleted",value:function(e){var t=this;if(0!==e.length){var n=null;e.forEach((function(e){(n=t._msgListHandler.getLocalMsg(e.conversationID,e.ID))&&(n.isDeleted=!0),e!==n&&(e.isDeleted=!0)})),e=e[0].conversationID;for(var o=this._msgListHandler.getLocalMsgList(e),i={},s=o.length-1;0<=s;s--)if(!o[s].isDeleted){i=o[s];break}var r,a=this._convMap.get(e);a&&(r=!1,a.lastMessage.lastSequence===i.sequence&&a.lastMessage.lastTime===i.time||(qe(i)&&(i=void 0),a.updateLastMessage(i),a.type!==S.CONV_TOPIC&&(r=!0),Oe.l("".concat(this._n,".onMessageDeleted. update convID:").concat(e," with lastMessage:"),a.lastMessage)),e.startsWith(S.CONV_C2C)&&this.updateUnreadCount(e),r)&&this.emitConvUpdate(!0,!1)}}},{key:"onMessageModified",value:function(e){var t="".concat(this._n,".onMessageModified"),n=e.conversationType,o=e.from,i=e.to,s=e.time,r=e.sequence,a=e.elements,c=e.cloudCustomData,u=e.messageVersion,l=this.getMyUserID(),p="".concat(n).concat(i),d=(n=(i===l&&n===S.CONV_C2C&&(p="".concat(n).concat(o)),l=this._msgListHandler.onMsgModified(p,e)).isUpdated,l=l.message,!0===n&&this.emitOEvt(T.MESSAGE_MODIFIED,[l]),this._isTopicConv(p));return null===l?Oe.l("".concat(t," message is null! options:"),e):Oe.l("".concat(t," isUpdated:").concat(n," isTopicMessage:").concat(d," from:").concat(o," to:").concat(i," sequence:").concat(l.sequence," time:").concat(l.time)),d?this.get(10).onMessageModified(e):(n=this._convMap.get(p))&&(o=n.lastMessage)&&o.lastTime===s&&o.lastSequence===r&&o.version!==u&&(Oe.l("".concat(t," convID:").concat(p," lastMessage updated")),o.type=a[0].type,o.payload=a[0].content,o.messageForShow=Ft(o.type,o.payload,this.isIntl()),o.cloudCustomData=c,o.version=u,this.emitConvUpdate(!0,!1)),l}},{key:"onNewGroupAtTips",value:function(e){var t=this,n=(e=e.dataList,null);e.forEach((function(e){e.groupAtTips?n=e.groupAtTips:e.elements?n=g(g({},e.elements),{},{sync:!0}):e.groupAtType&&(n=g(g({},e),{},{sync:!0})),n.__random=e.random,n.__sequence=e.clientSequence,t._tmpGroupAtTipsList.push(n)})),Oe.l("".concat(this._n,".onNewGroupAtTips isReady:").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:"_handleGroupAtTipsList",value:function(){var e,t=this;0!==this._tmpGroupAtTipsList.length&&(e=!1,this._tmpGroupAtTipsList.forEach((function(n){var o=n.groupID,i=n.from,s=void 0===(s=n.topicID)?void 0:s,r=void 0!==(r=n.sync)&&r;i!==t.getMyUserID()&&(lt(s)?(i=t._convMap.get("".concat(S.CONV_GROUP).concat(o)))&&(i.updateGroupAtInfoList(n),e=!0):((o=t._convMap.get("".concat(S.CONV_GROUP).concat(s)))&&(o.updateGroupAtInfoList(n),t.get(10).onAtInfoUpdated({topicID:s,groupAtInfoList:o.groupAtInfoList})),qe(o)&&r&&(t.updateTopicConversation([{conversationID:"".concat(S.CONV_GROUP).concat(s),type:S.CONV_TOPIC}]),t._convMap.get("".concat(S.CONV_GROUP).concat(s)).updateGroupAtInfoList(n))))})),e&&this.emitConvUpdate(!0,!1),this._tmpGroupAtTipsList.length=0)}},{key:"_checkNewConv",value:function(e){var t=this,n=[],o=[];e.forEach((function(e){t._convMap.has(e.conversationID)||(e.type===S.CONV_C2C?n.push(e.conversationID.replace(S.CONV_C2C,"")):e.type===S.CONV_GROUP&&o.push(e.conversationID.replace(S.CONV_GROUP,"")))})),0<n.length&&(this._onNewC2CConv(n),n=null),0<o.length&&(this._onNewGroupConv(o),o=null)}},{key:"_onNewC2CConv",value:function(e){var t=this.get(6);return Promise.all([t.getRemotePeerReadTime(e),this._msgRemindHandler.getC2CMsgRemindType(e),this._convGroupHandler.searchConvGroupAndMark(e,1)])}},{key:"_onNewGroupConv",value:function(e){var t=this.get(7);return t?Promise.all([t.getMsgRemindType(e),this._convGroupHandler.searchConvGroupAndMark(e,2)]):Promise.resolve()}},{key:"_setStorageConvList",value:function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=this.getLocalConvList().filter((function(e){return e.type===S.CONV_C2C||e.type===S.CONV_GROUP&&e.lastMessage.type!==S.MSG_GRP_TIP})).slice(0,20).map((function(e){return{conversationID:e.conversationID,type:e.type,subType:e.subType,lastMessage:e.lastMessage,groupProfile:e.groupProfile,userProfile:e.userProfile}}));this.get(13).setItem("conversationMap",t,e)}},{key:"emitConvUpdate",value:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],n=this.getLocalConvList();t&&(t=this.get(7))&&t.updateGroupLastMessage(n),e&&(this.get(12).isPartialUpdatedConvs()?(this._diffConvMap(this._convMapForDiff,this._convMap),0<this._partialUpdatedConvMap.size&&(this.emitOEvt(T.CONVERSATION_LIST_UPDATED),this.onTotalUnreadCountUpdate(),this._convMapForDiff.clear(),this._convMapForDiff=et(this._convMap,!0)),0===this._convMapForDiff.size&&(this._convMapForDiff=et(this._convMap,!0))):(this.emitOEvt(T.CONVERSATION_LIST_UPDATED),this.onTotalUnreadCountUpdate()))}},{key:"_diffConvMap",value:function(e,t){var n,o=r(t);try{for(o.s();!(n=o.n()).done;){var i=_(n.value,2),s=i[0],a=i[1];e.has(s)&&JSON.stringify(a)===e.get(s)||this._partialUpdatedConvMap.set(s,a)}}catch(c){o.e(c)}finally{o.f()}}},{key:"getPartialUpdatedConvs",value:function(){var e=v(et(this._partialUpdatedConvMap,!1).values());return this._partialUpdatedConvMap.clear(),e}},{key:"getLocalConvList",value:function(){var e=this;return v(this._convMap.values()).filter((function(t){return e._isConvNeedShow(t.conversationID)}))}},{key:"getLocalConversation",value:function(e){return this._convMap.get(e)}},{key:"hasLocalConversation",value:function(e){return this._convMap.has(e)}},{key:"getLocalOldestMessage",value:function(e){return this._msgListHandler.getLocalOldestMsg(e)}},{key:"syncConvList",value:function(){var e=this,t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],n="syncConvList",o=new io(n);return this._pagingStatus===Ln&&this._convMap.clear(),this._pagingGetConvList(t).then((function(t){var i=Kt(e._pagingGetCostList),s=Ht(e._pagingGetCostList);return e._pagingGetCostList.length=0,e._pagingStatus=On,e._diffAndDeleteConv(),e.emitConvUpdate(!0,!1),e._setStorageConvList(),e._handleC2CPeerReadTime(),e.emitIEvt(xo.CONV_SYNC_COMPLETED),s="count:".concat(e._convMap.size," sum:").concat(s," avg:").concat(i),Oe.l("".concat(e._n,".").concat(n,". ").concat(s)),o.setMessage(s).end(),t})).catch((function(t){return e._pagingStatus=An,o.setMessage(e._pagingTs).setError(t).end(),Sn(t)}))}},{key:"_diffAndDeleteConv",value:function(){var e,t=this;this._isSyncCompleted()&&(e=[],this._convMap.forEach((function(n,o){!t._pagingConvIDMap.has(o)&&t._convIDFromUnreadDBMap.has(o)&&(t._convMap.delete(o),e.push(o))})),Oe.l("".concat(this._n,"._diffAndDeleteConv list:").concat(e)),e=null)}},{key:"_pagingGetConvList",value:function(){var e=this,t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],n="".concat(this._n,"._pagingGetConvList"),o=(Oe.l("".concat(n," incrementalPullFlag:").concat(t," ts:").concat(this._pagingTs," startIdx:").concat(this._pagingStartIdx)+" pinnedTs:".concat(this._pagingPinnedTs," pinnedStartIdx:").concat(this._pagingPinnedStartIdx)),Date.now());return this._pagingStatus=Rn,this.req({P:jn.PAGING_GET_CONV_LIST,data:{fromAccount:this.getMyUserID(),timeStamp:t?this._pagingTs:0,startIndex:t?this._pagingStartIdx:0,pinnedTimeStamp:t?this._pagingPinnedTs:0,pinnedStartIndex:t?this._pagingPinnedStartIdx:0,orderType:1}}).then((function(t){var i=(t=t.data).completeFlag,s=void 0===(s=t.conversations)?[]:s,r=t.timeStamp,a=t.startIndex,c=t.pinnedTimeStamp,u=t.pinnedStartIndex;if(t=t.groupItem,e._pagingGetCostList.push($t(o,!1)),Oe.l("".concat(n," ok. completeFlag:").concat(i," count:").concat(s.length," cost:").concat($t(o))),e._convGroupHandler.onConvGroupListSynced(t),0<s.length&&(t=e._getConvOptions(s),e._pagingConvIDMap=new Map([].concat(v(e._pagingConvIDMap),v(t.map((function(e){return[e.conversationID,1]}))))),e._updateLocalConvList({conversationOptionsList:t,isFromGetConversations:!0,updateUnreadCount:!0}),e.isLoggedIn())&&e.emitConvUpdate(),!e._isReady){if(!e.isLoggedIn())return Tn();e.triggerReady()}return e._pagingTs=r,e._pagingStartIdx=a,e._pagingPinnedTs=c,e._pagingPinnedStartIdx=u,1!==i?e._pagingGetConvList():(e._handleGroupAtTipsList(),e._convGroupHandler.getRemoteConvGroupList(),Tn())})).catch((function(t){throw!e.isLoggedIn()||e._isReady||(Oe.w("".concat(n," failed. error:"),t),e.triggerReady()),t}))}},{key:"_updateLocalConvList",value:function(e){var t=e.isFromGetConversations,n=Date.now();e=this._getTmpConvListMapping(e).newConvList,this._convMap=new Map(this._sortConvList(v(this._convMap))),t||this._updateUserOrGroupProfile(e),Oe.l("".concat(this._n,"._updateLocalConvList cost:").concat($t(n)))}},{key:"_getTmpConvListMapping",value:function(e){for(var t=e.conversationOptionsList,n=e.isFromGetConversations,o=e.isInstantMessage,i=e.isUnreadC2CMessage,s=void 0!==i&&i,r=e.updateUnreadCount,a=[],c=[],u=this.get(7),l=this.get(8),p=this.isIntl(),d=this.isUsingChatCore(),h=0,g=t.length;h<g;h++){var f=new Yo(t[h],p,d),m=f.conversationID,_=f.type;if(!this._isNonExistentAccount(m)){if(this._convMap.has(m)){var v=this._convMap.get(m);if(n&&_!==S.CONV_TOPIC){this._convMap.set(m,f),_===S.CONV_C2C?f.unreadCount=v.unreadCount:_===S.CONV_GROUP&&(f.groupProfile=JSON.parse(JSON.stringify(v.groupProfile)));continue}var y=["unreadCount","allowType","adminForbidType","payload"],I=(!1===o&&y.push("lastMessage"),"boolean"==typeof o&&y.push("isPinned"),t[h].lastMessage),M=!lt(I);M||t[h].type===S.CONV_TOPIC||this._onLastMsgNotExist(t[h]),lt(o)&&M&&null===v.lastMessage.payload&&(v.lastMessage.payload=I.payload),qe(v.lastMessage.revoker)||(v.lastMessage.revoker=null),Qe(v,f,y,[null,void 0,"",0,NaN]),!0===r&&v.updateUnreadCount({nextUnreadCount:f.unreadCount,isFromGetConversations:n,isUnreadC2CMessage:s}),o&&M&&(I.payload&&(v.lastMessage.payload=I.payload),v.type===S.CONV_GROUP)&&(v.lastMessage.nameCard=I.nameCard,v.lastMessage.nick=I.nick),M&&v.lastMessage.cloudCustomData!==I.cloudCustomData&&(v.lastMessage.cloudCustomData=I.cloudCustomData||"")}else _===S.CONV_GROUP&&u?(y=f.groupProfile.groupID,(M=u.getLocalGroupProfile(y))&&(f.groupProfile=M,!0===r)&&f.updateUnreadCount({nextUnreadCount:0})):_===S.CONV_C2C&&(v=m.replace(S.CONV_C2C,""),l)&&l.isMyFriend(v)&&(f.remark=l.getFriendRemark(v)),a.push(f),this._convMap.set(m,f);this._convMap.get(m).type===S.CONV_TOPIC&&c.push(this._convMap.get(m))}}for(var C=this.get(10),T=0,E=c.length;T<E;T++){var k,D=(k=c[T]).conversationID;qe(k=k.groupAtInfoList)||C.onAtInfoUpdated({topicID:D.replace(S.CONV_GROUP,""),groupAtInfoList:k})}return{newConvList:a}}},{key:"_onLastMsgNotExist",value:function(e){new io("lastMsgNotExist").setMessage(JSON.stringify(e)).end()}},{key:"_sortConvList",value:function(e){var t=[],n=[],o=[],i=[];return e.forEach((function(e){(!0===e[1].isPinned?qe(e[1].lastMessage.lastTime)?n:t:qe(e[1].lastMessage.lastTime)?i:o).push(e)})),t.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})).concat(n).concat(o.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime}))).concat(i)}},{key:"_sortConvListAndEmitEvent",value:function(){this._convMap=new Map(this._sortConvList(v(this._convMap))),this.emitConvUpdate(!0,!1)}},{key:"_updateUserOrGroupProfile",value:function(e){var t,n,o,i,s=this;0!==e.length&&(t=[],n=[],o=this.get(4),i=this.get(7),e.forEach((function(e){var o;e.type===S.CONV_C2C?t.push(e.toAccount):e.type===S.CONV_GROUP&&(o=e.toAccount,i.hasLocalGroup(o)?e.groupProfile=i.getLocalGroupProfile(o):n.push(o))})),Oe.l("".concat(this._n,"._updateUserOrGroupProfile userIDList:").concat(t," groupIDList:").concat(n)),0<t.length&&o.getUserProfile({userIDList:t}).then((function(e){Ye(e=e.data)?e.forEach((function(e){s._doUpdateUserProfile("".concat(S.CONV_C2C).concat(e.userID),e)})):s._doUpdateUserProfile("".concat(S.CONV_C2C).concat(e.userID),e)})),0<n.length)&&i.getGroupProfileAdvance({groupIDList:n,responseFilter:{groupBaseInfoFilter:["Type","Name","FaceUrl"]}}).then((function(e){e=e.data.successGroupList;var t=!1;e.forEach((function(e){var n="".concat(S.CONV_GROUP).concat(e.groupID);s._convMap.has(n)&&(Qe((n=s._convMap.get(n)).groupProfile,e,[],[null,void 0,"",0,NaN]),!n.subType&&e.type&&(n.subType=e.type),t=!0)})),t&&s.emitConvUpdate()}))}},{key:"_doUpdateUserProfile",value:function(e,t){this.hasLocalConversation(e)&&(this.getLocalConversation(e).userProfile=t,this.emitConvUpdate())}},{key:"_getConvOptions",value:function(e){var t=this,n=[],o=(e=e.filter((function(e){var n=e.type;return e=e.userID,1===n&&!t._isNonExistentAccount(e)||2===n})),this.getMyUserID());return e=e.map((function(e){var i;return lt(e.lastMsg)&&(e.lastMsg={elements:[]}),1===e.type?(i={userID:e.userID,nick:e.peerNick,avatar:e.peerAvatar},n.push(i),{conversationID:"".concat(S.CONV_C2C).concat(e.userID),type:S.CONV_C2C,lastMessage:{lastTime:e.time,lastSequence:e.sequence,fromAccount:e.lastC2CMsgFromAccount,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:null,payload:e.lastMsg.elements[0]?t._amendLayersOverLimitProp(e.lastMsg.elements[0].content,e.lastMsg.elements[0].type):null,cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:8===e.lastMessageFlag,onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:e.lastC2CMsgFromAccount===o&&e.time<=e.c2cPeerReadTime,revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null},unreadCount:0,userProfile:new Ho(i),peerReadTime:e.c2cPeerReadTime,isPinned:1===e.isPinned,customData:e.customMark||"",markList:qt(e.standardMark),conversationGroupList:t._convGroupHandler.getConvGroupListByID(e.contactGroupId),remark:e.friendRemark||"",messageRemindType:t._transMsgRemindType(e.messageRemindType)}):{conversationID:"".concat(S.CONV_GROUP).concat(e.groupID),type:S.CONV_GROUP,lastMessage:g(g({lastTime:e.time,lastSequence:e.sequence,fromAccount:e.msgGroupFromAccount},t._patchTypeAndPayload(e)),{},{cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:2===e.lastMessageFlag,onlineOnlyFlag:!1,nick:e.senderNick||"",nameCard:e.senderNameCard||"",revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null}),groupProfile:new zo({groupID:e.groupID,name:e.groupNick,avatar:e.groupImage,type:e.groupType,nextMessageSeq:e.nextMessageSeq}),unreadCount:t._computeGroupUnreadCount(e),peerReadTime:0,isPinned:1===e.isPinned,version:0,customData:e.customMark||"",markList:qt(e.standardMark),conversationGroupList:t._convGroupHandler.getConvGroupListByID(e.contactGroupId),messageRemindType:t._transMsgRemindType(e.messageRemindType)}})),0<n.length&&this.get(4).onConvProfileUpdated(n),e}},{key:"_transMsgRemindType",value:function(e){var t="";return 0===e?t=S.MSG_REMIND_ACPT_AND_NOTE:1===e?t=S.MSG_REMIND_DISCARD:2===e?t=S.MSG_REMIND_ACPT_NOT_NOTE:3===e&&(t=S.NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT),t}},{key:"_computeGroupUnreadCount",value:function(e){var t;return 0<(t=(void 0===(t=e.unreadCount)?0:t)-(void 0===(e=e.noUnreadCount)?0:e))?t:0}},{key:"_patchTypeAndPayload",value:function(e){var t=(e=e.lastMsg).event,n=void 0===(n=e.elements)?[]:n;return e=void 0===(e=e.groupTips)?{}:e,lt(void 0===t?void 0:t)||qe(e)?{type:n[0]?n[0].type:null,payload:n[0]?this._amendLayersOverLimitProp(n[0].content,n[0].type):null}:((t=new Do(e)).setElement({type:S.MSG_GRP_TIP,content:g(g({},e.elements),{},{groupProfile:e.groupProfile})}),n=JSON.parse(JSON.stringify(t.payload)),t=null,{type:S.MSG_GRP_TIP,payload:n})}},{key:"_amendLayersOverLimitProp",value:function(e,t){var n=this.getFileDownloadProxy(),o=this.getDownloadFileAuthKey(),i=this.get(17).getFileDNList(),s=e.layersOverLimit,r=null;return t===S.MSG_IMAGE&&(r=new ho(e,n,o,i)),t===S.MSG_VIDEO&&(r=new Co(e,n,o,i)),t===S.MSG_SOUND&&(r=new fo(e,n,o,i)),t===S.MSG_FILE&&((r=new Io(e,n,o,i)).content.url=void 0),0===s?e.layersOverLimit=!1:1===s&&(e.layersOverLimit=!0),r&&Object.assign(e,r.content),e}},{key:"getLocalMessageList",value:function(e){return this._msgListHandler.getLocalMsgList(e)}},{key:"deleteLocalMessage",value:function(e){e instanceof Do&&this._msgListHandler.remove(e)}},{key:"onConvDeleted",value:function(e){Ye(e)&&(e=e.map((function(e){var t=e.type,n=e.userID;return e=e.groupID,1===t?"".concat(S.CONV_C2C).concat(n):2===t?"".concat(S.CONV_GROUP).concat(e):void 0})),Oe.l("".concat(this._n,".onConvDeleted convIDList:").concat(e)),this.deleteLocalConvList(e))}},{key:"onConvPinnedStatus",value:function(e,t){var n,o=this;Ye(e)&&(n=!1,e.forEach((function(e){var i,s=e.type,r=e.userID;e=e.groupID,1===s?i=o.getLocalConversation("".concat(S.CONV_C2C).concat(r)):2===s&&(i=o.getLocalConversation("".concat(S.CONV_GROUP).concat(e))),i&&(Oe.l("".concat(o._n,".onConvPinnedStatus convID:").concat(i.conversationID," localPinned:").concat(i.isPinned," remotePinned:").concat(t)),t?i.isPinned||(i.isPinned=!0,n=!0):i.isPinned&&(i.isPinned=!1,n=!0))})),n)&&this._sortConvListAndEmitEvent()}},{key:"getMessageList",value:function(e){var t=this,n=e.conversationID,o=e.nextReqMessageID,i=(e=e.count,"".concat(this._n,".getMessageList")),s="";if((a=this.getLocalConversation(n))&&a.groupProfile&&(s=a.groupProfile.type),Mt(s))return Oe.l("".concat(i," not available in ").concat(s,". convID:").concat(n)),Tn({messageList:[],nextReqMessageID:"",isCompleted:!0});(lt(e)||15<e)&&(e=15),o||this._isMeInCommunity(n)||this.clearMemMsg(n);var r=this._computeRemainingCount({conversationID:n,nextReqMessageID:o}),a=this._completedMap.has(n);return Oe.l("".concat(i," convID:").concat(n," isEverCleared:").concat(this._isEverCleared(n)," nextReqMessageID:").concat(o)+" remainingCount:".concat(r," count:").concat(e," isCompleted:").concat(a)),this._needGetHistory({conversationID:n,remainingCount:r,count:e})?this.getHistoryMessages({conversationID:n,nextReqMessageID:o,count:20}).then((function(e){var o=e.nextReqID,s=e.storedMessageList,a=e.assembledMessageList,c=(e=e.isPullingCompleted,t._completedMap.has(n)),u=s,l=(0<r&&(u=t._msgListHandler.getLocalMsgList(n).slice(0,s.length+r)),{nextReqMessageID:void 0,messageList:void 0,isCompleted:void 0});return t._isEverCleared(n)?(l.nextReqMessageID=o,l.messageList=a,l.isCompleted=e):(l.nextReqMessageID=c?"":o,l.messageList=u,l.isCompleted=c),s=l.messageList.filter((function(e){return e.isRevoked}))||[],a=l.messageList.map((function(e){return e.sequence})),Oe.l("".concat(i," ret.nextReqMessageID:").concat(l.nextReqMessageID," ret.isCompleted:").concat(l.isCompleted," sequenceList:"),a),Ye(s)&&0!==s.length?t.updateRevokerInfo(s).then((function(e){return e.forEach((function(e){var t=e.revokerInfo;l.messageList=l.messageList.map((function(n){return n.ID===e.ID&&t&&(n.revokeReason=t.reason||"",n.revokerInfo={userID:t.revoker||n.revoker,nick:t.nick,avatar:t.avatar}),n}))})),Cn(l)})):Cn(l)})):(this.modifyMessageList(n),Tn(s=this._getMsgListFromMem({conversationID:n,nextReqMessageID:o,count:e})))}},{key:"_isEverCleared",value:function(e){return this._everClearedMap.has(e)}},{key:"_getMsgListFromMem",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=(e=e.count,"".concat(this._n,"._getMsgListFromMem")),i=this._msgListHandler.getLocalMsgList(t),s=i.length,r=St(t),a=0,c={isCompleted:!1,nextReqMessageID:"",messageList:[]};return n?(a=r?i.findIndex((function(e){return e.ID===n})):i.findIndex((function(e){return e.sequence+""===n})))>e?(c.messageList=i.slice(a-e,a),c.nextReqMessageID=r?i[a-e].ID:i[a-e].sequence+""):(c.messageList=i.slice(0,a),c.isCompleted=!0):e<s?(c.messageList=i.slice(a=s-e,s),c.nextReqMessageID=r?i[a].ID:i[a].sequence+""):(c.messageList=i.slice(0,s),c.isCompleted=!0),e=c.messageList.map((function(e){return e.sequence})),Oe.l("".concat(o," convID:").concat(t)+" ret.nextReqMessageID:".concat(c.nextReqMessageID," ret.isCompleted:").concat(c.isCompleted," sequenceList:").concat(e)),c}},{key:"getMessageListHopping",value:function(e){var t,n,o=e.conversationID,i=e.sequence,s=e.time,r=e.count;return e=void 0===(e=e.direction)?0:e,(lt(r)||15<r)&&(r=15),o.startsWith(S.CONV_C2C)?(t=this.get(6),n=o.replace(S.CONV_C2C,""),t.getRoamingMessagesHopping({peerAccount:n,time:s,count:r,direction:e})):o.startsWith(S.CONV_GROUP)?(t=this.get(7),n=o.replace(S.CONV_GROUP,""),t.getRoamingMessagesHopping({groupID:n,sequence:i,count:r,direction:e})):void 0}},{key:"_computeRemainingCount",value:function(e){var t,n=e.conversationID,o=e.nextReqMessageID,i=(e=this._msgListHandler.getLocalMsgList(n)).length;return Oe.l("".concat(this._n,"._computeRemainingCount convID:").concat(n," nextReqMessageID:").concat(o," length:").concat(i)),o?(t=0,St(n)?t=e.findIndex((function(e){return e.ID===o})):Et(n)&&(t=-1!==o.indexOf("-")?e.findIndex((function(e){return e.ID===o})):e.findIndex((function(e){return e.sequence+""===o}))),-1===t?0:t):i}},{key:"_needGetHistory",value:function(e){var t=e.conversationID,n=e.remainingCount,o=(e=e.count,this.getLocalConversation(t)),i="";return o&&o.groupProfile&&(i=o.groupProfile.type),!(kt(t)||Mt(i)||!this._isEverCleared(t)&&(o=n<=e&&!this._completedMap.has(t),Oe.l("".concat(this._n,"._needGetHistory convID:").concat(t," ret:").concat(o)),!o))}},{key:"_isTopicConv",value:function(e){return Tt(e=e.replace(S.CONV_GROUP,""))}},{key:"getHistoryMessages",value:function(e){var t,n,o,i,s,r,a=e.conversationID,c=e.count;return e=e.nextReqMessageID,a===S.CONV_SYSTEM?Tn():(c=20<c?20:15,t=null,St(a)?(r=0,n="",o=!1,s=this._roamingMsgKeyAndTimeMap.has(a),e&&(o=!0,s?(r=this._roamingMsgKeyAndTimeMap.get(a).lastMessageTime,n=this._roamingMsgKeyAndTimeMap.get(a).messageKey):(i=this._msgListHandler.findMessage(e))&&(r=i.time,Oe.l("".concat(this._n,".getHistoryMessages convID:").concat(a," isRelayInfoExisted:").concat(s," lastMessageTime:").concat(r)))),(t=this.get(6)).getRoamingMessage({conversationID:a,peerAccount:a.replace(S.CONV_C2C,""),count:c,lastMessageTime:o?r:0,messageKey:o?n:""})):Et(a)?(t=this.get(7))?(i=a.replace(S.CONV_GROUP,""),s=null,this._convMap.has(a)&&!Tt(i)&&(s=this._convMap.get(a).lastMessage),r=0,e?r=Number(e):s&&(r=s.lastSequence),t.getRoamingMessage({conversationID:a,groupID:i,count:c,sequence:r})):Sn({code:qn.NO_MODULE}):Tn())}},{key:"patchConvLastMessage",value:function(e){var t,n,o=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=this.getLocalConversation(e);i&&(t=(n=i.lastMessage).messageForShow,n=n.payload,qe(t)||qe(n)||o)&&0!==(t=this._msgListHandler.getLocalMsgList(e)).length&&(n=t[t.length-1],Oe.l("".concat(this._n,".patchConvLastMessage bForceUpdate:").concat(o," convID:").concat(e," payload:"),n.payload),i.updateLastMessage(n))}},{key:"onRoamingMessage",value:function(){var e,t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],o=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],i=3<arguments.length?arguments[3]:void 0,s=(c=1<arguments.length?arguments[1]:void 0).startsWith(S.CONV_C2C)?S.CONV_C2C:S.CONV_GROUP,r=null,a=[],c=[],u=0,l=n.length,p=s===S.CONV_GROUP,d=this.getFileDownloadProxy(),h=this.getDownloadFileAuthKey(),f=Ye(i),m=this.get(17).getFileDNList(),_=function(){p?--u:++u},v=function(){return p?l<=u:u<l};for(u=p?n.length-1:0,l=p?0:n.length;v();_())1!==n[u].isPlaceMessage&&((r=new Do(n[u])).to=n[u].to,s!==S.CONV_GROUP||lt(n[u].topicID)||(r.to=n[u].topicID),r.isSystemMessage=!!n[u].isSystemMessage,r.conversationType=s,e=4===n[u].event?{type:S.MSG_GRP_TIP,content:g(g({},n[u].elements),{},{groupProfile:n[u].groupProfile})}:n[u].elements,p||r.setNickAndAvatar({nick:n[u].nick,avatar:n[u].avatar}),qe(e)?((t=new io("emptyMessageBody")).setMessage("from:".concat(r.from," to:").concat(r.to," sequence:").concat(r.sequence," event:").concat(n[u].event)),t.setLevel("warning").end()):(r.setElement(e,d,h,m),r.reInitialize(this.getMyUserID()),a.push(r),f&&i.push(r)));return _=v=null,o?(this._msgListHandler.unshift(a,c),a=null,c):a}},{key:"findMessage",value:function(e){return this._msgListHandler.findMessage(e)}},{key:"_isMeInCommunity",value:function(e){var t=!0;return this._isTopicConv(e)&&(e=Gt(e.replace(S.CONV_GROUP,"")),this.get(7).hasLocalGroup(e)||(t=!1,Oe.l("".concat(this._n,"._isMeInCommunity groupID:").concat(e," ret:").concat(t)))),t}},{key:"deleteTopicRoamingInfo",value:function(e){var t=this;Ct({groupID:e})&&this._msgListHandler.getTopicConvIDList(e).forEach((function(e){t.clearMemMsg(e)}))}},{key:"deleteGroupRoamingInfo",value:function(e){e="".concat(S.CONV_GROUP).concat(e),0<this._msgListHandler.getLocalMsgList(e).length&&this.clearMemMsg(e)}},{key:"setMessageRead",value:function(e){var t=e.conversationID,n=this.getLocalConversation(t);if(e="".concat(this._n,".setMessageRead"),Oe.l("".concat(e," convID:").concat(t," unreadCount:").concat(n?n.unreadCount:0)),!n)return Tn();if(n.type!==S.CONV_GROUP&&n.type!==S.CONV_TOPIC||qe(n.groupAtInfoList)||this.deleteGroupAtTips(t),0===n.unreadCount)return Tn();var o=this._msgListHandler.getLocalLastMsg(t),i=n.lastMessage.lastTime,s=(i<(s=this._msgListHandler.getLocalMaxTime(t))&&(Oe.l("".concat(e," update lastMessageTime from ").concat(i," to ").concat(s)),i=s),this._msgListHandler.getLocalMaxSeq(t)),r=n.lastMessage.lastSequence,a=(r<s&&(Oe.l("".concat(e," update lastMessageSeq from ").concat(r," to ").concat(s)),r=s),n.type===S.CONV_TOPIC&&lt(o)&&(e=this.get(10),o=Gt(s=t.replace(S.CONV_GROUP,"")),e=e.getLocalTopic(o,s))&&(r=e.nextMessageSeq-1),null);switch(n.type){case S.CONV_C2C:return(a=this.get(6))?a.setMessageRead({conversationID:t,lastMessageTime:i}):Sn({code:qn.NO_MODULE});case S.CONV_GROUP:case S.CONV_TOPIC:return(a=this.get(7))?a.setMessageRead({conversationID:t,lastMessageSeq:r}):Sn({code:qn.NO_MODULE});case S.CONV_SYSTEM:return n.unreadCount=0,this.emitConvUpdate(!0,!1),Tn();default:return Tn()}}},{key:"setAllMessageRead",value:function(){var e,t=this,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},o="setAllMessageRead",i="".concat(this._n,".").concat(o),s=(n.scope||(n.scope=S.READ_ALL_MSG),Oe.l("".concat(i," options:"),n),this._createSetAllMessageReadPack(n));return 0===s.readAllC2CMessage&&0===s.groupMessageReadInfoList.length?Tn():(e=new io(o),this.req({P:jn.SET_ALL_MSG_READ,data:s}).then((function(o){return o=o.data,o=t._handleAllMsgRead(o),e.setMessage("scope:".concat(n.scope," failureGroups:").concat(JSON.stringify(o))).end(),Tn()})).catch((function(t){return e.setError(t).end(),Oe.w("".concat(i," failed. error:"),t),Sn({code:t&&t.code?t.code:qn.MSG_UNREAD_ALL_FAIL,message:t&&t.message?t.message:void 0})})))}},{key:"setConvCustomData",value:function(e){return this._convGroupHandler.setConvCustomData(e)}},{key:"markConv",value:function(e){return this._convGroupHandler.markConv(e)}},{key:"getConvGroupList",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:"createConvGroup",value:function(e){return this._convGroupHandler.createConvGroup(e)}},{key:"deleteConvGroup",value:function(e){return this._convGroupHandler.deleteConvGroup(e)}},{key:"renameConvGroup",value:function(e){return this._convGroupHandler.renameConvGroup(e)}},{key:"addConvsToGroup",value:function(e){return this._convGroupHandler.addConvsToGroup(e)}},{key:"deleteConvsFromGroup",value:function(e){return this._convGroupHandler.deleteConvsFromGroup(e)}},{key:"onConvMarkUpdated",value:function(e){this._convGroupHandler.onConvMarkUpdated(e)}},{key:"onConvGroupCreated",value:function(e){this._convGroupHandler.onConvGroupCreated(e)}},{key:"onConvGroupDeleted",value:function(e){this._convGroupHandler.onConvGroupDeleted(e)}},{key:"onConvGroupNameUpdated",value:function(e){this._convGroupHandler.onConvGroupNameUpdated(e)}},{key:"onConvInGroupUpdated",value:function(e){this._convGroupHandler.onConvInGroupUpdated(e)}},{key:"onConvAddedToOrDeletedFromGroup",value:function(e){this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e)}},{key:"_getConvLastMessageSeq",value:function(e){var t=this._msgListHandler.getLocalLastMsg(e.conversationID);return e=e.lastMessage.lastSequence,t&&e<t.sequence?t.sequence:e}},{key:"_getConvLastMessageTime",value:function(e){var t=this._msgListHandler.getLocalLastMsg(e.conversationID);return e=e.lastMessage.lastTime,t&&e<t.time?t.time:e}},{key:"_createSetAllMessageReadPack",value:function(e){var t,n={readAllC2CMessage:0,groupMessageReadInfoList:[]},o=e.scope,i=r(this._convMap);try{for(i.s();!(t=i.n()).done;){var s,a=_(t.value,2)[1];if(0<a.unreadCount)if(a.type===S.CONV_C2C&&0===n.readAllC2CMessage){if(o===S.READ_ALL_MSG)n.readAllC2CMessage=1;else if(o===S.READ_ALL_C2C_MSG){n.readAllC2CMessage=1;break}}else a.type!==S.CONV_GROUP||o!==S.READ_ALL_GROUP_MSG&&o!==S.READ_ALL_MSG||(s=this._getConvLastMessageSeq(a),n.groupMessageReadInfoList.push({groupID:a.groupProfile.groupID,messageSequence:s}))}}catch(c){i.e(c)}finally{i.f()}return n}},{key:"onPushedAllMessageRead",value:function(e){this._handleAllMsgRead(e)}},{key:"_handleAllMsgRead",value:function(e){var t=e.groupMessageReadInfoList;return e=e.readAllC2CMessage,t=this._parseGroupReadInfo(t),1<=this._updateAllConvUnreadCount({readAllC2CMessage:e})&&this.emitConvUpdate(!0,!1),t}},{key:"_parseGroupReadInfo",value:function(e){var t=[];if(e&&e.length)for(var n=0,o=e.length;n<o;n++){var i=(a=e[n]).groupID,s=a.sequence,r=a.retCode,a=a.lastMessageSeq;lt(r)?this._remoteGroupReadSeqMap.set(i,a):(this._remoteGroupReadSeqMap.set(i,s),0!==r&&t.push("".concat(i,"-").concat(s,"-").concat(r)))}return t}},{key:"_updateAllConvUnreadCount",value:function(e){var t,n=e.readAllC2CMessage,o=0,i=r(this._convMap);try{for(i.s();!(t=i.n()).done;){var s,a,c,u,l=_(t.value,2),p=l[0],d=l[1];1<=d.unreadCount&&(1===n&&d.type===S.CONV_C2C?(s=this._getConvLastMessageTime(d),this.updateIsReadAfterReadReport({conversationID:p,lastMessageTime:s})):d.type===S.CONV_GROUP&&(a=p.replace(S.CONV_GROUP,""),this._remoteGroupReadSeqMap.has(a))&&(c=this._remoteGroupReadSeqMap.get(a),u=this._getConvLastMessageSeq(d),this.updateIsReadAfterReadReport({conversationID:p,remoteReadSequence:c}),c<=u)&&this._remoteGroupReadSeqMap.delete(a),this.updateUnreadCount(p,!1))&&(o+=1)}}catch(h){i.e(h)}finally{i.f()}return o}},{key:"isRemoteRead",value:function(e){var t,n=e.conversationID,o=(e=e.sequence,n.replace(S.CONV_GROUP,"")),i=!1;return this._remoteGroupReadSeqMap.has(o)&&(e<=(t=this._remoteGroupReadSeqMap.get(o))&&(i=!0,Oe.l("".concat(this._n,".isRemoteRead convID:").concat(n," msgSeq:").concat(e," remoteReadSeq:").concat(t))),t+10<=e)&&this._remoteGroupReadSeqMap.delete(o),i}},{key:"updateIsReadAfterReadReport",value:function(e){var t=e.conversationID,n=e.lastMessageSeq,o=e.lastMessageTime,i=this._msgListHandler.getLocalMsgList(t);if(0!==i.length)for(var s,r=i.length-1;0<=r;r--)if(s=i[r],!(o&&s.time>o||n&&s.sequence>n)){if("in"===s.flow&&s.isRead)break;s.setIsRead(!0)}}},{key:"updateUnreadCount",value:function(e){var t,n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=!1,i=this.getLocalConversation(e),s=this._msgListHandler.getLocalMsgList(e);if(i)return(t=i.unreadCount)!==(s=s.filter((function(e){return!e.isRead&&!e._onlineOnlyFlag&&!e.isDeleted})).length)&&(i.unreadCount=s,o=!0,Oe.l("".concat(this._n,".updateUnreadCount from ").concat(t," to ").concat(s,", convID:").concat(e)),!0===n)&&this.emitConvUpdate(!0,!1),o&&i.type===S.CONV_TOPIC&&(t=i.unreadCount,s=this.get(10),n=e.replace(S.CONV_GROUP,""),s.onUnreadCountUpdatedFromConv(n,t)),o}},{key:"clearGroupAtInfoList",value:function(e){var t,n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],o=this.getLocalConversation(e);o&&0<o.groupAtInfoList.length&&(o.clearGroupAtInfoList(),Oe.l("".concat(this._n,".clearGroupAtInfoList convID:").concat(e)),o.type===S.CONV_TOPIC&&(o=o.groupAtInfoList,t=this.get(10),e=e.replace(S.CONV_GROUP,""),t.onAtInfoUpdated({topicID:e,groupAtInfoList:o})),!0===n)&&this.emitConvUpdate(!0,!1)}},{key:"updateReadReceiptInfo",value:function(e){var t,n,o,i=this,s=void 0===(a=e.userID)?void 0:a,r=void 0===(a=e.groupID)?void 0:a,a=e.readReceiptList,c=void 0===(e=e.timestamp)?0:e;qe(a)||(t=[],lt(s)?lt(r)||(n="".concat(S.CONV_GROUP).concat(r),a.forEach((function(e){var o=e.tinyID,s=e.clientTime,a=e.random,c=e.readCount;e=e.unreadCount,o="".concat(o,"-").concat(s,"-").concat(a),s=i._msgListHandler.getLocalMsg(n,o)||i._msgListHandler.getHoppingMsg(n,o),a={groupID:r,messageID:o,readCount:0,unreadCount:0},s&&(Ke(c)&&(s.readReceiptInfo.readCount=c,a.readCount=c),Ke(e)&&(s.readReceiptInfo.unreadCount=e,a.unreadCount=e),t.push(a))}))):(o="".concat(S.CONV_C2C).concat(s),a.forEach((function(e){var n=e.tinyID,r=e.clientTime;e=e.random,n="".concat(n,"-").concat(r,"-").concat(e),(r=i._msgListHandler.getLocalMsg(o,n)||i._msgListHandler.getHoppingMsg(o,n))&&!r.readReceiptInfo.isPeerRead&&(r.readReceiptInfo.isPeerRead=!0,r.readReceiptInfo.timestamp=c,t.push({userID:s,messageID:n,isPeerRead:!0,timestamp:c}))}))),0<t.length&&this.emitOEvt(T.MESSAGE_READ_RECEIPT_RECEIVED,t))}},{key:"updateIsRead",value:function(e){var t=this.getLocalConversation(e),n=this.getLocalMessageList(e);if(t&&0!==n.length&&!kt(t.type)){for(var o=[],i=0,s=n.length;i<s;i++)"in"!==n[i].flow?"out"!==n[i].flow||n[i].isRead||n[i].setIsRead(!0):o.push(n[i]);var r=0;r=t.type===S.CONV_C2C?(e=o.slice(-t.unreadCount).filter((function(e){return e.isRevoked})).length,o.length-t.unreadCount-e):o.length-t.unreadCount;for(var a=0;a<r&&!o[a].isRead;a++)o[a].setIsRead(!0)}}},{key:"deleteGroupAtTips",value:function(e){var t,n,o,i=this,s="".concat(this._n,".deleteGroupAtTips"),r=(Oe.l("".concat(s)),this._convMap.get(e));return r&&0!==(t=r.groupAtInfoList).length?(r=void 0,e.startsWith(S.CONV_GROUP)&&(r=e.replace(S.CONV_GROUP,"")),n=v(t),(Ct({groupID:r})||Tt(r))&&0===(n=t.filter((function(e){return!e.atTypeArray.includes(S.CONV_AT_ALL)}))).length?(this.clearGroupAtInfoList(e,!1),Promise.resolve()):(o=this.getMyUserID(),this.req({P:jn.DEL_GROUP_AT_TIPS,data:{messageListToDelete:n.map((function(e){return{from:e.from,to:o,messageSeq:e.__sequence,messageRandom:e.__random,groupID:lt(e.topicID)?e.groupID:e.topicID}}))}}).then((function(){return Oe.l("".concat(s," ok. count:").concat(t.length)),i.clearGroupAtInfoList(e,!1),Promise.resolve()})).catch((function(e){return Oe.e("".concat(s," failed. error:"),e),Sn(e)})))):Promise.resolve()}},{key:"appendToMessageList",value:function(e){return this._msgListHandler.pushIn(e)}},{key:"setMessageRandom",value:function(e){this._sll.set(e.random)}},{key:"deleteMessageRandom",value:function(e){this._sll.delete(e.random)}},{key:"pushIntoMessageList",value:function(e,t,n){return!(!this._msgListHandler.pushIn(t,n)||this._sll.has(t.random)&&!n||(e.push(t),0))}},{key:"revoke",value:function(e,t,n){return this._msgListHandler.revoke(e,t,n)}},{key:"getPeerReadTime",value:function(e){return this._peerReadTimeMap.get(e)}},{key:"recordPeerReadTime",value:function(e,t){(!this._peerReadTimeMap.has(e)||this._peerReadTimeMap.get(e)<t)&&this._peerReadTimeMap.set(e,t)}},{key:"updateMsgIsPeerReadProp",value:function(e,t){var n;e.startsWith(S.CONV_C2C)&&0<t&&(0<(n=this._msgListHandler.updateMsgIsPeerReadProp(e,t)).length&&this.emitOEvt(T.MESSAGE_READ_BY_PEER,n),this._convMap.has(e))&&!qe(n=this._convMap.get(e).lastMessage)&&n.fromAccount===this.getMyUserID()&&n.lastTime<=t&&!n.isPeerRead&&(n.isPeerRead=!0,this.emitConvUpdate(!0,!1))}},{key:"updateMsgIsModifiedProp",value:function(e){this._msgListHandler.updateMsgIsModifiedProp(e)}},{key:"setCompleted",value:function(e){Oe.l("".concat(this._n,".setCompleted convID:").concat(e)),this._completedMap.set(e,!0)}},{key:"updateRoamingMsgKeyAndTime",value:function(e,t,n){this._roamingMsgKeyAndTimeMap.set(e,{messageKey:t,lastMessageTime:n})}},{key:"getConvList",value:function(e){var t,n=this,o="".concat(this._n,".").concat("getConvList"),i="pagingStatus:".concat(this._pagingStatus,", local conversation count:").concat(this._convMap.size,", options:").concat(JSON.stringify(e));return Oe.l("".concat(o,". ").concat(i)),this._pagingStatus===An?((t=new io("getConvList")).setMessage(i),this.syncConvList().then((function(){return t.end(),Cn({conversationList:n._getConvList(e),isSyncCompleted:n._isSyncCompleted()})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(o," failed. error:"),e),Sn(e)}))):(i=this._getConvList(e),Oe.l("".concat(o,". returned conversation count:").concat(i.length)),Tn({conversationList:i,isSyncCompleted:this._isSyncCompleted()}))}},{key:"_getConvList",value:function(e){var t,n,o,i,s,r=this;return lt(e)?this.getLocalConvList():Ye(e)?0===e.length?[]:this.getLocalConvList().filter((function(t){return e.includes(t.conversationID)})):ze(e)?(t=e.type,n=e.markType,o=e.groupName,i=e.hasUnreadCount,s=e.hasGroupAtInfo,this.getLocalConvList().filter((function(e){return r._filterType(e,t)&&r._filterMarkType(e,n)&&r._filterGroupName(e,o)&&r._filterUnreadCount(e,i)&&r._filterGroupAtInfo(e,s)}))):[]}},{key:"_filterType",value:function(e,t){return t!==S.CONV_C2C&&t!==S.CONV_GROUP||e.type===t}},{key:"_filterGroupName",value:function(e,t){return!ut(t)||(""===t?0===e.conversationGroupList.length:e.conversationGroupList.includes(t))}},{key:"_filterMarkType",value:function(e,t){return!Ke(t)||(0===t?0===e.markList.length:e.markList.includes(t))}},{key:"_filterUnreadCount",value:function(e,t){var n=!0;return!0===t?n=1<=e.unreadCount:!1===t&&(n=0===e.unreadCount),n}},{key:"_filterGroupAtInfo",value:function(e,t){var n=!0;return!0===t?n=1<=e.groupAtInfoList.length:!1===t&&(n=0===e.groupAtInfoList.length),n}},{key:"_handleC2CPeerReadTime",value:function(){var e,t=r(this._convMap);try{for(t.s();!(e=t.n()).done;){var n=_(e.value,2),o=n[0],i=n[1];i.type===S.CONV_C2C&&this.recordPeerReadTime(o,i.peerReadTime)}}catch(s){t.e(s)}finally{t.f()}}},{key:"_isPagingGetGroupListCompleted",value:function(){var e=this.get(7);return!e||e.isPagingGetCompleted()}},{key:"_getLocalGroupCount",value:function(){var e=this.get(7);return e?e.getLocalGroupList().length:0}},{key:"_hasLocalGroup",value:function(e){var t=this.get(7);return!!t&&t.hasLocalGroup(e.replace(S.CONV_GROUP,""))}},{key:"getConversationProfile",value:function(e){var t,n=this,o=!1;if(this._convMap.has(e)?t=this._convMap.get(e):(t=new Yo({conversationID:e,type:St(e)?S.CONV_C2C:S.CONV_GROUP},this.isIntl(),this.isUsingChatCore()),o=!0),t._isInfoCompleted||t.type===S.CONV_SYSTEM)return Tn({conversation:t});if(Et(e)){if(!this.get(7))return Sn({code:qn.NO_MODULE});if(!this._hasLocalGroup(e))return Tn({conversation:t})}var i="".concat(this._n,".").concat("getConversationProfile"),s=new io("getConversationProfile");return Oe.l("".concat(i,". convID:").concat(e," remark:").concat(t.remark," lastMessage:"),t.lastMessage),this._getUserOrGroupProfile(t).then((function(r){s.setMessage("convID:".concat(e," unreadCount:").concat(r.data.conversation.unreadCount)).end();var a,c=n.get(8);if(c&&t.type===S.CONV_C2C&&(a=e.replace(S.CONV_C2C,""),c.isMyFriend(a))&&(c=c.getFriendRemark(a),t.remark!==c)&&(t.remark=c,Oe.l("".concat(i,". convID:").concat(e," patch remark:").concat(t.remark))),Oe.l("".concat(i," ok. isNewConv:").concat(o," convID:").concat(e)),o){if(t.type===S.CONV_C2C)return n._onNewC2CConv([e.replace(S.CONV_C2C,"")]).then((function(){return Tn({conversation:t})}));if(t.type===S.CONV_GROUP)return n._onNewGroupConv([e.replace(S.CONV_GROUP,"")]).then((function(){return Tn({conversation:t})}))}return r})).catch((function(t){return s.setError(t).setMessage("convID:".concat(e)).end(),Oe.e("".concat(i," failed. error:"),t),Sn(t)}))}},{key:"_getUserOrGroupProfile",value:function(e){var t=this;return e.type===S.CONV_C2C?this.get(4).getUserProfile({userIDList:[e.toAccount]}).then((function(n){return 0===(n=n.data).length?Sn({code:qn.USER_OR_GRP_NOT_FOUND}):(e.userProfile=n[0],e._isInfoCompleted=!0,t._insertConvAfterTopmost(e),Tn({conversation:e}))})):this.get(7).getGroupProfile({groupID:e.toAccount}).then((function(n){return e.groupProfile=n.data.group,e._isInfoCompleted=!0,t._insertConvAfterTopmost(e),Tn({conversation:e})}))}},{key:"_insertConvAfterTopmost",value:function(e){var t,n;e instanceof Yo&&!this._convMap.has(e.conversationID)&&(n=(t=v(this._convMap)).findIndex((function(e){return!1===e[1].isPinned})),t.splice(n,0,[e.conversationID,e]),this._convMap=new Map(t),this._setStorageConvList(),this.emitConvUpdate(!0,!1))}},{key:"_onProfileUpdated",value:function(e){var t=this;e.data.forEach((function(e){var n=e.userID;n===t.getMyUserID()?t._onMyProfileModified({latestNick:e.nick,latestAvatar:e.avatar}):(n=t._convMap.get("".concat(S.CONV_C2C).concat(n)))&&(n.userProfile=e)}))}},{key:"_onCloudConfig",value:function(e){"0"===this.getCloudConfig("pull_on_invite")&&(this._bPullOnInvite=!1),Oe.l("".concat(this._n,"._onCloudConfig bPullOnInvite:").concat(this._bPullOnInvite))}},{key:"disableMsgPullOnInvite",value:function(){this._bPullOnInvite=!1}},{key:"_isSyncCompleted",value:function(){return this._pagingStatus===On}},{key:"_errorLog",value:function(e,t,n,o){var i=new Error("Params validate failed."),s="".concat(this.getErrMsg("API_REFER")).concat(e);throw Oe.w("[".concat(e,"] | ").concat(t," | ").concat(this.getErrMsg(n,o),", ").concat(s)),Oe.e("[".concat(e,"] Invalid ").concat(t,": type check failed for ").concat(t,".")),i}},{key:"_isValidConvID",value:function(e){return St(e)||Et(e)||kt(e)}},{key:"deleteConversation",value:function(e){var t=this,n="deleteConversation";return ut(e)||$e(e)||this._errorLog(n,"options","StringOrObjectRequiredLog"),ut(e)?(this._isValidConvID(e)||this._errorLog(n,"options","InvalidConversationID",e),Oe.l("".concat(this._n,".").concat(n," convID:").concat(e)),this.deleteConvList({conversationIDList:[e],flag:1})):(Ye(e.conversationIDList)||this._errorLog(n,"conversationIDList","ArrayRequiredLog"),0===e.conversationIDList.length&&this._errorLog(n,"conversationIDList","NonEmptyArrayLog"),e.conversationIDList.forEach((function(e){t._isValidConvID(e)||t._errorLog(n,"conversationIDList","InvalidConversationID",e)})),"clearHistoryMessage"in e&&"boolean"!=typeof e.clearHistoryMessage&&this._errorLog(n,"clearHistoryMessage","BooleanRequiredLog"),100<e.conversationIDList.length&&(e.conversationIDList=e.conversationIDList.slice(0,100)),this.deleteConvList(e))}},{key:"deleteConvList",value:function(e){var t=void 0===(t=e.conversationIDList)?[]:t,n=void 0===(n=e.clearHistoryMessage)||n,o=void 0===(e=e.flag)?0:e,i="".concat(this._n,".").concat("deleteConvList"),s=(e="convIDList:".concat(t," clearHistoryMessage:").concat(n),Oe.l("".concat(i," ").concat(e)),new io("deleteConvList"));return s.setMessage(e),Promise.all([this.rmLocalOnlyConvList(t),this.rmLocalAndRemoteConvList(t,n)]).then((function(e){return s.end(),0===(e=[].concat(v(e[0]),v(e[1]))).length?Sn(new Bn({code:qn.CONV_NOT_FOUND})):(Oe.l("".concat(i," ok")),Tn(1===o?{conversationID:e[0]}:{conversationIDList:e}))})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(i," failed. error:"),e),Sn(e)}))}},{key:"rmLocalOnlyConvList",value:function(e){var t=this;return e.filter((function(e){var n;return!!t._convMap.has(e)&&((n=t.getLocalConversation(e).type)!==S.CONV_GROUP||t._hasLocalGroup(e)?n===S.CONV_SYSTEM&&(t.get(7).deleteGroupSystemNotice({messageList:t._msgListHandler.getLocalMsgList(e)}),t.deleteLocalConv(e),!0):(t.deleteLocalConv(e),!0))}))}},{key:"rmLocalAndRemoteConvList",value:function(e,t){var n=this,o={fromAccount:this.getMyUserID(),conversationList:[],clearHistoryMessage:t?1:0};return e.forEach((function(e){var t;n._convMap.has(e)&&((t=n.getLocalConversation(e).type)===S.CONV_C2C?o.conversationList.push({toAccount:e.replace(t,""),type:1}):t===S.CONV_GROUP&&n._hasLocalGroup(e)&&o.conversationList.push({toGroupID:e.replace(t,""),type:2}))})),0===o.conversationList.length?[]:this.req({P:jn.DEL_CONV,data:o}).then((function(e){var t=[];return 0<e.data.resultList.length&&e.data.resultList.map((function(e){0===e.code&&(e=1===e.type?"".concat(S.CONV_C2C).concat(e.to):"".concat(S.CONV_GROUP).concat(e.groupID),t.push(e))})),n.deleteLocalConvList(t),t}))}},{key:"setConvDraft",value:function(e){var t=e.conversationID,n=(e=e.draftText,"".concat(this._n,".").concat("setConvDraft"));return Oe.l("".concat(n," convID:").concat(t," draftText:").concat(e)),this._convMap.has(t)?((n=this._convMap.get(t)).setDraftText(e),this.emitConvUpdate(),Tn({code:0,conversation:n})):Sn({code:qn.CONV_NOT_FOUND})}},{key:"clearHistoryMessage",value:function(e){var t=this,n={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._convMap.has(e))return Sn({code:qn.CONV_NOT_FOUND});var o=this._convMap.get(e).type;if(o===S.CONV_C2C)n.type=1,n.toAccount=e.replace(S.CONV_C2C,"");else{if(o!==S.CONV_GROUP)return o===S.CONV_SYSTEM?(this.get(7).deleteGroupSystemNotice({messageList:this._msgListHandler.getLocalMsgList(e)}),Tn({conversationID:e})):Sn({code:qn.CONV_UN_RECORDED_TYPE});n.type=2,n.toGroupID=e.replace(S.CONV_GROUP,"")}var i="".concat(this._n,".").concat("clearHistoryMessage"),s=new io("clearHistoryMessage");return s.setMessage("convID:".concat(e)),Oe.l("".concat(i,". convID:").concat(e)),this.setMessageRead({conversationID:e}).then((function(){return t.req({P:jn.CLEAR_HISTORY_MSG,data:n})})).then((function(){s.end(),Oe.l("".concat(i," ok")),t.clearMemMsg(e);var n=t.getLocalConversation(e);return n&&(n.updateLastMessage(),t._sortConvListAndEmitEvent()),Tn({conversationID:e})})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(i," failed. error:"),e),Sn(e)}))}},{key:"pinConversation",value:function(e){var t,n,o,i=this,s=e.conversationID,r=e.isPinned,a=this.getLocalConversation(s);return a&&a.isPinned===r?Tn({conversationID:s}):kt(s)?(a&&(a.isPinned=r),this._sortConvListAndEmitEvent(),Tn({conversationID:s})):(e=null,St(s)?e={type:1,toAccount:s.replace(S.CONV_C2C,"")}:Et(s)&&(e={type:2,groupID:s.replace(S.CONV_GROUP,"")}),null===e?Sn({code:qn.INVALID_CONV_ID}):(t="".concat(this._n,".").concat("pinConversation"),n="convID:".concat(s," isPinned:").concat(r),(o=new io("pinConversation")).setMessage(n),Oe.l("".concat(t,". ").concat(n)),this.req({P:jn.PIN_CONV,data:{fromAccount:this.getMyUserID(),operationType:!0===r?1:2,itemList:[e]}}).then((function(){return o.end(),Oe.l("".concat(t," ok")),a?a.isPinned!==r&&(a.isPinned=r):i._convMap.set(s,new Yo({conversationID:s,type:St(s)?S.CONV_C2C:S.CONV_GROUP,isPinned:r},i.isIntl(),i.isUsingChatCore())),i._sortConvListAndEmitEvent(),Cn({conversationID:s})})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))))}},{key:"setMessageRemindType",value:function(e){return this._msgRemindHandler.set(e)}},{key:"patchMsgRemindType",value:function(e){var t=e.ID,n=e.isC2CConversation,o=e.messageRemindType,i=!1;return(n=this.getLocalConversation("".concat(n?S.CONV_C2C:S.CONV_GROUP).concat(t)))&&n.messageRemindType!==o&&(n.messageRemindType=o,i=!0),Oe.l("".concat(this._n,".patchMsgRemindType options:"),e,"ret:".concat(i)),i}},{key:"onC2CMsgRemindTypeFetched",value:function(e){var t,n=this;Ye(e)&&0<e.length&&(t=0,e.forEach((function(e){var o=e.userID;e=e.muteFlag,e=n._transMsgRemindType(e),!0===n.patchMsgRemindType({ID:o,isC2CConversation:!0,messageRemindType:e})&&(t+=1)})),Oe.l("".concat(this._n,".onC2CMsgRemindTypeFetched updateCount:").concat(t)),1<=t)&&this.emitConvUpdate(!0,!1)}},{key:"onC2CMsgRemindTypeSynced",value:function(e){var t=this,n="".concat(this._n,".onC2CMsgRemindTypeSynced");e.dataList.forEach((function(e){var o;qe(e.muteNotificationsSync)||(o=(e=e.muteNotificationsSync).to,e=e.muteFlag,e=t._transMsgRemindType(e),t.patchMsgRemindType({ID:o,isC2CConversation:!(o=0),messageRemindType:e})&&(o+=1),Oe.l("".concat(n," updateCount:").concat(o)),1<=o&&t.emitConvUpdate(!0,!1))}))}},{key:"onGroupMsgRemindTypeUpdated",value:function(e){this._msgRemindHandler.onGroupMsgRemindTypeUpdated(e)}},{key:"deleteLocalConv",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],n=this._convMap.has(e);Oe.l("".concat(this._n,".deleteLocalConv convID:").concat(e," has:").concat(n)),n&&(this._convMap.delete(e),this._convMapForDiff.delete(e),this.clearMemMsg(e),this._setStorageConvList(!0),t)&&(n=!this._isTopicConv(e),this.emitConvUpdate(n,!1))}},{key:"pullMsgOnInvite",value:function(e){var t,n,o,i,s,r=this.get(7);r&&(t="".concat(this._n,".pullMsgOnInvite"),Oe.l("".concat(t," flag:").concat(this._bPullOnInvite)),this._bPullOnInvite)&&(s=this.getLocalLastMessage(e),n=this.getLocalSecondLastMessage(e),i=o=1,s&&(o=s.sequence),n&&(i=n.sequence),s=r.getGroupRemoteLastSeq(e.replace(S.CONV_GROUP,"")),Oe.l("".concat(t," convID:").concat(e," localLastSeq:").concat(o," localSecondLastSeq:").concat(i," remoteLastSeq:").concat(s)),this.clearMemMsg(e),1<o-i?this._recursiveGetMsgList([],e,!1,o,i):1<s-o&&this._recursiveGetMsgList([],e,!0,s,o))}},{key:"_recursiveGetMsgList",value:function(e,t,n,o,i,s){var r=this;this.getMessageList({conversationID:t,nextReqMessageID:s}).then((function(s){var a=(s=s.data).messageList,c=s.isCompleted,u=(s=s.nextReqMessageID,a.filter((function(e){return n?e.sequence>i&&e.sequence<=o:e.sequence>i&&e.sequence<o})));e.unshift.apply(e,v(u)),!c&&0<a.length&&a[0].sequence>i&&e.length<60?r._recursiveGetMsgList(e,t,n,o,i,s):r._emitMsgReceived(t,e)}))}},{key:"_emitMsgReceived",value:function(e,t){var n,o,i=this;0<t.length&&(t=t.filter((function(e,t,n){return t===n.findIndex((function(t){return t.sequence===e.sequence}))})),n=this.hasLocalConversation(e),o=t.map((function(e){return e.sequence})),Oe.l("".concat(this._n,"._emitMsgReceived convID:").concat(e," has:").concat(n," count:").concat(o.length," sequenceList:"),o),this.emitOEvt(T.MESSAGE_RECEIVED,t),n?this.patchConvLastMessage(e,!0):this.getConversationProfile(e).then((function(){i.patchConvLastMessage(e,!0)})))}},{key:"deleteLocalConvList",value:function(e){var t=this,n=!1;e.forEach((function(e){t._convMap.has(e)&&(t.deleteLocalConv(e,!1),n=!0)})),Oe.l("".concat(this._n,".deleteLocalConvList convID:").concat(e," isConvIDExisted:").concat(n)),n&&this.emitConvUpdate(!0,!1)}},{key:"isMessageSentByCurrentInstance",value:function(e){return!(!this._msgListHandler.hasLocalMsg(e.conversationID,e.ID)&&!this._sll.has(e.random))}},{key:"modifyMessageList",value:function(e){var t,n;e.startsWith(S.CONV_C2C)&&this._convMap.has(e)&&(n=this._convMap.get(e),t=Date.now(),this._msgListHandler.modifyMsgSentByPeer({conversationID:e,latestNick:n.userProfile.nick,latestAvatar:n.userProfile.avatar}),n=this.get(4).getNickAndAvatarByUserID(this.getMyUserID()),this._msgListHandler.modifyMsgSentByMe({conversationID:e,latestNick:n.nick,latestAvatar:n.avatar}),Oe.l("".concat(this._n,".modifyMessageList convID:").concat(e," cost:").concat($t(t))))}},{key:"updateUserProfileSpecifiedKey",value:function(e){Oe.l("".concat(this._n,".updateUserProfileSpecifiedKey options:"),e);var t=e.conversationID,n=e.nick;e=e.avatar,this._convMap.has(t)&&(t=this._convMap.get(t).userProfile,ut(n)&&t.nick!==n&&(t.nick=n),ut(e)&&t.avatar!==e&&(t.avatar=e),this.emitConvUpdate(!0,!1))}},{key:"_onMyProfileModified",value:function(e){var t=this,n=this.getLocalConvList(),o=Date.now();n.forEach((function(n){t.modifyMessageSentByMe(g({conversationID:n.conversationID},e))})),Oe.l("".concat(this._n,"._onMyProfileModified. modify all messages sent by me, cost:").concat($t(o)))}},{key:"modifyMessageSentByMe",value:function(e){this._msgListHandler.modifyMsgSentByMe(e)}},{key:"getLatestMessageSentByMe",value:function(e){return this._msgListHandler.getLatestMsgSentByMe(e)}},{key:"modifyMessageSentByPeer",value:function(e){this._msgListHandler.modifyMsgSentByPeer(e)}},{key:"getLatestMessageSentByPeer",value:function(e){return this._msgListHandler.getLatestMsgSentByPeer(e)}},{key:"pushIntoNoticeResult",value:function(e,t){return!(!this._msgListHandler.pushIn(t)||this._sll.has(t.random)||(e.push(t),0))}},{key:"getLocalLastMessage",value:function(e){return this._msgListHandler.getLocalLastMsg(e)}},{key:"getLocalSecondLastMessage",value:function(e){return this._msgListHandler.getLocalSecondLastMsg(e)}},{key:"checkAndPatchRemark",value:function(){var e,t,n=this.get(8);0!==this._convMap.size&&n&&0!==(e=v(this._convMap.values()).filter((function(e){return e.type===S.CONV_C2C}))).length&&(t=0,e.forEach((function(e){var o=e.conversationID.replace(S.CONV_C2C,"");n.isMyFriend(o)&&(o=n.getFriendRemark(o),e.remark!==o)&&(e.remark=o,t+=1)})),Oe.l("".concat(this._n,".checkAndPatchRemark. c2cConvCount:").concat(e.length," patchedCount:").concat(t)),0<t)&&this.emitConvUpdate(!0,!1)}},{key:"updateTopicConversation",value:function(e){this._updateLocalConvList({conversationOptionsList:e,isFromGetConversations:!0,updateUnreadCount:!0})}},{key:"sendReadReceipt",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.get(6):t.conversationType===S.CONV_GROUP&&(n=this._m.get(7)),n?n.sendReadReceipt(e):Sn({code:qn.NO_MODULE})}},{key:"getReadReceiptList",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.get(6):t.conversationType===S.CONV_GROUP&&(n=this._m.get(7)),n?n.getReadReceiptList(e):Sn({code:qn.NO_MODULE})}},{key:"getLastMessageTime",value:function(e){return(e=this.getLocalConversation(e))?e.lastMessage.lastTime:0}},{key:"getTotalUnreadCount",value:function(){var e=this.getLocalConvList(),t=0;return e.forEach((function(e){e.type===S.CONV_SYSTEM||""!==e.messageRemindType&&e.messageRemindType!==S.MSG_REMIND_ACPT_AND_NOTE||(t+=e.unreadCount)})),t}},{key:"onTotalUnreadCountUpdate",value:function(){var e=this.getTotalUnreadCount();this._convTotalUnreadCount!==e&&(Oe.l("".concat(this._n,".onTotalUnreadCountUpdate from ").concat(this._convTotalUnreadCount," to ").concat(e)),this._convTotalUnreadCount=e,this.emitOEvt(T.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED))}},{key:"_isConvNeedShow",value:function(e){var t,n;return e=this.getLocalConversation(e),!(!lt(e)&&(t=e.type===S.CONV_TOPIC,n=e.type===S.CONV_GROUP&&e.groupProfile.type===S.GRP_ROOM,e=e.type===S.CONV_GROUP&&e.groupProfile.type===S.GRP_LIVE,t||n||e))}},{key:"setAllRcvMsgOpt",value:function(e){return this._msgRemindHandler.setAllRcvMsgOpt(e)}},{key:"getAllRcvMsgOpt",value:function(){return this._msgRemindHandler.getAllRcvMsgOpt()}},{key:"onAllRcvMsgOptNotify",value:function(e){this._msgRemindHandler.onAllRcvMsgOptNotify(e)}},{key:"clearUnreadCount",value:function(e){(e=this.getLocalConversation(e))&&0<e.unreadCount&&(e.unreadCount=0,this.emitConvUpdate(!0,!1))}},{key:"storeHoppingMessageList",value:function(e){this._msgListHandler.storeHoppingMsgList(e)}},{key:"clearMemMsg",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];Oe.l("".concat(this._n,".clearMemMsg convID:").concat(e," isOverLimit:").concat(t)),this._msgListHandler.removeByConvID(e),this._completedMap.delete(e),this._roamingMsgKeyAndTimeMap.delete(e),this._everClearedMap.set(e,1)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._setStorageConvList(!0),this._pagingStatus=Ln,this._msgListHandler.reset(),this._msgRemindHandler.reset(),this._roamingMsgKeyAndTimeMap.clear(),this._sll.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._convMap.clear(),this._pagingTs=0,this._pagingStartIdx=0,this._pagingPinnedTs=0,this._pagingPinnedStartIdx=0,this._remoteGroupReadSeqMap.clear(),this._convTotalUnreadCount=0,this._pagingGetCostList.length=0,this._pagingConvIDMap.clear(),this._convIDFromUnreadDBMap.clear(),this._pagingGetCostList.length=0,this._convMapForDiff.clear(),this._partialUpdatedConvMap.clear(),this._everClearedMap.clear(),this._bPullOnInvite=!0,this._convGroupHandler.reset(),this.resetReady()}}])),Qo=s((function e(t){o(this,e),this._grpM=t,this._n="GroupTipsHandler",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4}),[{key:"onCheckTimer",value:function(e){e%1==0&&0<this._cachedGroupTipsMap.size&&this._check()}},{key:"_check",value:function(){var e=this;this._cachedGroupTipsMap.forEach((function(t,n){var o=e._checkCountMap.get(n),i=e._grpM.hasLocalGroup(n);Oe.l("".concat(e._n,"._check groupID:").concat(n," hasLocalGroup:").concat(i," checkCount:").concat(o)),i?(e._notifyCachedGroupTips(n),e._checkCountMap.delete(n),e._grpM.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(n),e._checkCountMap.delete(n)):e._checkCountMap.set(n,++o)}))}},{key:"onNewGroupTips",value:function(e){Oe.l("".concat(this._n,".onNewGroupTips options:").concat(JSON.stringify(e.dataList)));var t=(e=this._assembly(e)).eventDataList,n=e.result;0<(e=e.AVChatRoomMessageList).length&&this._grpM.onAVChatRoomMessage(e),0<n.length&&(this._grpM.emitOEvt(T.MESSAGE_RECEIVED,n),this._handleTips(n)),0<t.length&&(this._grpM.updateNextMessageSeq(t),this._grpM.get(11).onNewMessage({conversationOptionsList:t,isInstantMessage:!0}))}},{key:"_assembly",value:function(e){for(var t=e.event,n=e.dataList,o=null,i=[],s=[],r={},a=[],c=0,u=n.length;c<u;c++){var l=at(n[c]);if(6===t){if(this._grpM.isGroupAttributesUpdatedNotice(l))continue;if(this._grpM.isGroupCountersNotice(l))continue}var p=(m=l.groupProfile).groupID,d=void 0===(d=m.communityType)?0:d,h=void 0===(h=m.topicID)?void 0:h,f=m.invisible,m=void 0===(m=m.groupType)?void 0:m,_=void 0;if((y=this._grpM.isMessageFromTopic(d,h))&&(_=S.CONV_TOPIC,l.to=h),(v=this._grpM.hasLocalGroup(p))||!this._grpM.isUnjoinedAVChatRoom(p))if(v||y)if(this._grpM.isMessageFromOrToAVChatroom(p))l.event=t,a.push(l);else if(l.currentUser=this._grpM.getMyUserID(),l.conversationType=S.CONV_GROUP,(o=new Do(l)).setElement({type:S.MSG_GRP_TIP,content:g(g({},l.elements),{},{groupProfile:l.groupProfile})}),o.isSystemMessage=!1,1!==f){var v=this._grpM.get(11),y=(f=(y=o).conversationID,y.sequence);if(6===t)o._onlineOnlyFlag=!0,s.push(o);else if(!v.pushIntoNoticeResult(s,o))continue;this._grpM.isMessageFromCommunityOfTopic(d,h)||6===t&&v.getLocalConversation(f)||(6!==t&&this._qualityStat(o),d=v.isRemoteRead({conversationID:f,sequence:y}),lt(r[f])?(h=0,"in"!==o.flow||o._isExcludedFromUnreadCount||o._onlineOnlyFlag||d||(h=1),r[f]=i.push({conversationID:f,unreadCount:h,type:lt(_)?o.conversationType:_,subType:o.conversationSubType,lastMessage:o._isExcludedFromLastMessage?"":o})-1):(i[v=r[f]].type=o.conversationType,i[v].subType=o.conversationSubType,i[v].lastMessage=o._isExcludedFromLastMessage?"":o,"in"!==o.flow||o._isExcludedFromUnreadCount||o._onlineOnlyFlag||d||i[v].unreadCount++))}else this._qualityStat(o);else this._cacheAndCompare({groupID:p,event:t,item:l,groupType:m})}return{eventDataList:i,result:s,AVChatRoomMessageList:a}}},{key:"_qualityStat",value:function(e){this._grpM.get(26).addMessageSequence({key:Xn,message:e})}},{key:"_handleTips",value:function(e){var t=this;e.forEach((function(e){switch(e.payload.operationType){case 1:t._onNewMemberComeIn(e);break;case 2:t._onMemberQuit(e);break;case 3:t._onMemberKickedOut(e);break;case 4:t._onMemberSetAdmin(e);break;case 5:t._onMemberCancelledAdmin(e);break;case 6:t._onGroupProfileModified(e);break;case 7:t._onMemberInfoModified(e);break;case 8:t._onTopicProfileUpdated(e);break;default:Oe.w("".concat(t._n,"._handleTips unknown operationType:").concat(e.payload.operationType))}}))}},{key:"_onNewMemberComeIn",value:function(e){var t=(e=e.payload).memberNum;e=e.groupProfile.groupID,(e=this._grpM.getLocalGroupProfile(e))&&Ke(t)&&e.memberCount!==t&&(e.memberCount=t,this._updateConvGroupProfile(e))}},{key:"_onMemberQuit",value:function(e){var t=(n=e.payload).memberNum,n=n.groupProfile.groupID,o=this._grpM.getLocalGroupProfile(n);o&&Ke(t)&&o.memberCount!==t&&(o.memberCount=t,this._updateConvGroupProfile(o)),this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(n,e.payload.userIDList)}},{key:"_onMemberKickedOut",value:function(e){var t=(n=e.payload).memberNum,n=n.groupProfile.groupID,o=this._grpM.getLocalGroupProfile(n);o&&Ke(t)&&o.memberCount!==t&&(o.memberCount=t,this._updateConvGroupProfile(o)),this._grpM.getGroupMemberHandler().deleteLocalGroupMembers(n,e.payload.userIDList)}},{key:"_updateConvGroupProfile",value:function(e){this._grpM.get(11).updateConvGroupProfile([e])}},{key:"_onMemberSetAdmin",value:function(e){var t=e.payload.groupProfile.groupID,n=(e=e.payload.userIDList,this._grpM.getGroupMemberHandler());e.forEach((function(e){(e=n.getLocalGroupMemberInfo(t,e))&&e.updateRole(S.GRP_MBR_ROLE_ADMIN)}))}},{key:"_onMemberCancelledAdmin",value:function(e){var t=e.payload.groupProfile.groupID,n=(e=e.payload.userIDList,this._grpM.getGroupMemberHandler());e.forEach((function(e){(e=n.getLocalGroupMemberInfo(t,e))&&e.updateRole(S.GRP_MBR_ROLE_MEMBER)}))}},{key:"_onGroupProfileModified",value:function(e){var t=this,n=(e=e.payload).newGroupProfile,o=e.groupProfile,i=e.operatorInfo,s=(e=o.groupID,this._grpM.getLocalGroupProfile(e));Object.keys(n).forEach((function(e){switch(e){case"ownerID":t._ownerChanged(s,n);break;case"groupName":s.name=n[e];break;default:s[e]=n[e]}})),lt(i)||Object.keys(i).forEach((function(e){var t;"nameCard"===e?s.updateSelfInfo({nameCard:i[e]}):"role"===e&&(t="",400===i[e]?t=S.GRP_MBR_ROLE_OWNER:300===i[e]?t=S.GRP_MBR_ROLE_ADMIN:200===i[e]&&(t=S.GRP_MBR_ROLE_MEMBER),s.updateSelfInfo({role:t}))})),o=!s.isSupportTopic,this._grpM.emitGroupListUpdate(!0,o)}},{key:"_ownerChanged",value:function(e,t){e=e.groupID;var n=this._grpM.getLocalGroupProfile(e),o=this._grpM.getMyUserID();o===t.ownerID&&(n.updateGroup({selfInfo:{role:S.GRP_MBR_ROLE_OWNER}}),n=(t=this._grpM.getGroupMemberHandler()).getLocalGroupMemberInfo(e,o),o=this._grpM.getLocalGroupProfile(e).ownerID,t=t.getLocalGroupMemberInfo(e,o),n&&n.updateRole(S.GRP_MBR_ROLE_OWNER),t)&&t.updateRole(S.GRP_MBR_ROLE_MEMBER)}},{key:"_onMemberInfoModified",value:function(e){var t=e.to,n=(o=e.payload).groupProfile,o=o.memberList,i=n.groupID,s=(Tt(t)&&this._updateTopicMuteTime(e),this._grpM.getGroupMemberHandler());o.forEach((function(e){var t=s.getLocalGroupMemberInfo(i,e.userID);t&&Ke(e.muteTime)&&t.updateMuteUntil(e.muteTime)}))}},{key:"_updateTopicMuteTime",value:function(e){var t=e.to,n=(e=e.payload).groupProfile,o=void 0===(e=e.memberList)?[]:e,i=(e=this._grpM.get(10),n=n.groupID,e.getLocalTopic(n,t));if(i){for(var s=!1,r=0;r<o.length;r++){var a=o[r];if(a.userID===this._grpM.getMyUserID()&&0<=a.muteTime){i.updateSelfInfo({muteTime:a.muteTime}),s=!0;break}}s&&this._grpM.emitOEvt(T.TOPIC_UPDATED,{groupID:n,topic:i})}}},{key:"_onTopicProfileUpdated",value:function(e){var t=(n=e.payload).groupProfile.groupID,n=n.newTopicInfo;this._grpM.get(10).onTopicProfileUpdated(g({groupID:t,topicID:e.to},n))}},{key:"_cacheGroupTips",value:function(e,t){this._cachedGroupTipsMap.has(e)||this._cachedGroupTipsMap.set(e,[]),this._cachedGroupTipsMap.get(e).push(t)}},{key:"_deleteCachedGroupTips",value:function(e){this._cachedGroupTipsMap.has(e)&&this._cachedGroupTipsMap.delete(e)}},{key:"_notifyCachedGroupTips",value:function(e,t){var n=this,o=this._cachedGroupTipsMap.get(e)||[];Oe.l("".concat(this._n,"._notifyCachedGroupTips groupID:").concat(e," groupType:").concat(t," count:").concat(o.length)),o.forEach((function(e){n.onNewGroupTips(e)})),this._deleteCachedGroupTips(e)}},{key:"_cacheAndCompare",value:function(e){var t=e.groupID,n=e.event,o=e.item;e=e.groupType,Oe.l("".concat(this._n,"._cacheAndCompare groupID:").concat(t," groupType:").concat(e)),this._cacheGroupTips(t,{event:n,dataList:[o]}),n={groupID:t,type:e},e===S.GRP_AVCHATROOM?this._grpM.hasLocalGroup(t)?this._notifyCachedGroupTips(t,e):this._grpM.setUnjoinedAVChatRoom(t):(this._grpM.updateGroupMap([n]),this._notifyCachedGroupTips(t,e)),this._checkCountMap.has(t)||this._checkCountMap.set(t,0)}},{key:"reset",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear()}}]),ei=s((function e(t){o(this,e),this._grpM=t,this._n="CommonGroupHandler",this.tempConversationList=null,this._cachedGroupMessageMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this.PAGING_GRP_COUNT_LIMIT=200,this._pagingStatus=Ln,this._pagingGetCostList=[],t.getIEmitInst().on(xo.A2KEY_AND_TINYID_UPDATED,this.syncGroupList,this)}),[{key:"onCheckTimer",value:function(e){e%1==0&&0<this._cachedGroupMessageMap.size&&this._check()}},{key:"_check",value:function(){var e=this;this._cachedGroupMessageMap.forEach((function(t,n){var o=e._checkCountMap.get(n),i=e._grpM.hasLocalGroup(n);Oe.l("".concat(e._n,"._check groupID:").concat(n," hasLocalGroup:").concat(i," checkCount:").concat(o)),i?(e._notifyCachedGroupMessage(n),e._checkCountMap.delete(n),e._grpM.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(n),e._checkCountMap.delete(n)):e._checkCountMap.set(n,++o)}))}},{key:"updateLastMsg",value:function(e){var t="".concat(this._n,".updateLastMsg");if(0!==this._grpM.getGroupMap().size){for(var n,o,i,s,r=!1,a=e.length,c=0;c<a;c++)(n=e[c]).type===S.CONV_GROUP&&0!==n.lastMessage.lastSequence&&null!==n.lastMessage.payload&&(o=n.conversationID.split(/^GROUP/)[1],o=this._grpM.getLocalGroupProfile(o))&&(i=o.lastMessage,s=n.lastMessage,JSON.stringify(i)!==JSON.stringify(s))&&(o.lastMessage=g({},n.lastMessage),r=!0);Oe.l("".concat(t," convCount:").concat(a," groupCount:").concat(this._grpM.getLocalGroupList().length," isUpdated:").concat(r)),r&&(this._grpM.sortLocalGroupList(),this._grpM.emitGroupListUpdate(!0,!1))}else this.tempConversationList=e}},{key:"onNewMessage",value:function(e){var t,n=(t=this._assembly(e)).conversationOptionsList,o=t.messageList;0<(0<(0<(t=t.AVChatRoomMessageList).length&&this._grpM.onAVChatRoomMessage(t),t=vt(o)).length&&this._grpM.emitOEvt(T.MESSAGE_MODIFIED,t),0<n.length&&(this._grpM.get(11).onNewMessage({conversationOptionsList:n,isInstantMessage:!1!==e.isInstantMessage,updateUnreadCount:!1!==e.updateUnreadCount}),this._grpM.updateNextMessageSeq(n)),t=It(o)).length&&this._grpM.emitOEvt(T.MESSAGE_RECEIVED,t),o.length=0}},{key:"_assembly",value:function(e){var t=e.dataList,n=e.event,o=e.isInstantMessage,i=null,s=[],r=[],a=[],c={},u=this._grpM.getFileDownloadProxy(),l=this._grpM.getDownloadFileAuthKey(),p=this._grpM.get(17).getFileDNList(),d=t.length;1<d&&t.sort((function(e,t){return e.sequence-t.sequence}));for(var h=this._grpM.get(11),g=this._grpM.get(4),f=0;f<d;f++){var m,_=at(t[f]),v=(C=_.groupProfile).groupID,y=void 0===(y=C.communityType)?0:y,I=void 0===(I=C.topicID)?void 0:I,M=C.invisible,C=void 0===(C=C.groupType)?void 0:C,T=void 0,E=this._grpM.isMessageFromTopic(y,I),k=(E&&(T=S.CONV_TOPIC,_.to=I),this._grpM.hasLocalGroup(v));!k&&this._grpM.isUnjoinedAVChatRoom(v)||(k||E?this._grpM.isMessageFromOrToAVChatroom(v)?(_.event=n,a.push(_)):(_.currentUser=this._grpM.getMyUserID(),_.conversationType=S.CONV_GROUP,_.isSystemMessage=!!_.isSystemMessage,(i=new Do(_)).setElement(_.elements,u,l,p),1!==M?(k=1===t[f].isModified,h.isMessageSentByCurrentInstance(i)?i.isModified=k:k=!1,1===_.onlineOnlyFlag?(i._onlineOnlyFlag=!0,h.isMessageSentByCurrentInstance(i)||r.push(i)):this._grpM.isMessageFromCommunityOfTopic(y,I)?r.push(i):(i.from===this._grpM.getMyUserID()&&(E=h.getLatestMessageSentByMe(i.conversationID))&&(M=E.nick,y=E.avatar,M===i.nick&&y===i.avatar||(h.modifyMessageSentByMe({conversationID:m,latestNick:i.nick,latestAvatar:i.avatar}),g.mockOnNickAvatarModified(i.nick,i.avatar))),h.pushIntoMessageList(r,i,k)&&(this._qualityStat(o,i),m=(I=i).conversationID,E=I.sequence,M=h.isRemoteRead({conversationID:m,sequence:E}),lt(c[m])?(y=0,"in"!==i.flow||i._isExcludedFromUnreadCount||M||(y=1),c[m]=s.push({conversationID:m,unreadCount:y,type:lt(T)?i.conversationType:T,subType:i.conversationSubType,lastMessage:i._isExcludedFromLastMessage?"":i})-1):(s[k=c[m]].type=lt(T)?i.conversationType:T,s[k].subType=i.conversationSubType,s[k].lastMessage=i._isExcludedFromLastMessage?"":i,"in"!==i.flow||i._isExcludedFromUnreadCount||M||s[k].unreadCount++)))):this._qualityStat(o,i)):this._cacheAndCompare({groupID:v,event:n,item:_,groupType:C}))}return{conversationOptionsList:s,messageList:r,AVChatRoomMessageList:a}}},{key:"_qualityStat",value:function(e,t){var n=this._grpM.get(26);n.addMessageSequence({key:Xn,message:t}),e&&0<t.clientTime&&n.addMessageDelay(t.clientTime)}},{key:"onMsgRevoked",value:function(e,t){var n=this,o=this._grpM.get(11),i=[],s=[];e.dataList.forEach((function(e){var t=e.elements.revokedInfos,n=e.revokerInfo,r=e.groupProfile,a=!1;r&&(a=Ct({groupID:r.groupID})||!qe(r.topicID)),lt(t)||t.forEach((function(e){var t,c=qe(e.topicID)?"GROUP".concat(e.groupID):"GROUP".concat(e.topicID),u=o.getLocalConversation(c),l=e.revokerInfo&&e.revokerInfo.revoker||n&&n.revoker,p=n&&n.reason||"";u&&Mt(u.type)?t={conversationID:c,sequence:e.sequence,ID:"".concat(e.tinyID,"-").concat(e.clientTime,"-").concat(e.random)}:(u=o.revoke(c,e.sequence,e.random))?t=u:(t={conversationID:c,sequence:e.sequence},e.tinyID&&e.clientTime&&e.random&&(t.ID="".concat(e.tinyID,"-").concat(e.clientTime,"-").concat(e.random)),e.time&&(t.time=e.time)),t&&(t.revoker=l,t.revokeReason=p,t.revokerInfo={userID:l,nick:"",avatar:""},(a?(t.revokerInfo.nick=r.nick,t.revokerInfo.avatar=r.avatar,i):s).push(t))}))})),0===s.length&&0===i.length||(o.onMessageRevoked([].concat(i,s),t),0<i.length&&this._grpM.emitOEvt(T.MESSAGE_REVOKED,i),0<s.length&&o.updateRevokerInfo(s).then((function(e){n._grpM.emitOEvt(T.MESSAGE_REVOKED,e)})))}},{key:"_groupListTreeShaking",value:function(e){for(var t=new Map(v(this._grpM.getGroupMap())),n=0,o=e.length;n<o;n++)t.delete(e[n].groupID);this._grpM.hasJoinedAVChatRoom()&&this._grpM.getJoinedAVChatRoom().forEach((function(e){t.delete(e)})),this._grpM.getGroupMap().forEach((function(e,n){e.isSupportTopic&&t.delete(n)}));for(var i=v(t.keys()),s=0,r=i.length;s<r;s++)this._grpM.deleteGroup(i[s])}},{key:"syncGroupList",value:function(){var e,t,n=this,o=0<arguments.length&&void 0!==arguments[0]&&arguments[0],i=(this._pagingStatus===Ln&&this._grpM.clearGroupMap(),v(w)),s=this.PAGING_GRP_COUNT_LIMIT,r=[];return!0===o?this._pagingGetGroupListWithTopic({limit:s,offset:0,groupBaseInfoFilter:i,groupList:r}):(o="syncGroupList",e="".concat(this._n,".").concat(o),t=new io(o),this._pagingGetGroupList({limit:s,offset:0,groupBaseInfoFilter:i,groupList:r}).then((function(){var o=Kt(n._pagingGetCostList),i=Ht(n._pagingGetCostList),s=(n._pagingGetCostList.length=0,n._pagingStatus=On,n._groupListTreeShaking(r),n._grpM.updateGroupMap(r),n._grpM.getLocalGroupList().length);return s="count:".concat(s," sum:").concat(i," avg:").concat(o),Oe.l("".concat(e," ok. ").concat(s)),t.setMessage(s).end(),n.tempConversationList&&(n.updateLastMsg(n.tempConversationList),n.tempConversationList=null),n._grpM.emitGroupListUpdate(!0,!0),Cn({groupList:n._grpM.getLocalGroupList()})})).catch((function(o){return n._pagingStatus=An,t.setError(o).end(),Oe.e("".concat(e," failed. error:"),o),Sn(o)})))}},{key:"getGroupList",value:function(){var e,t=this,n="".concat(this._n,".").concat("getGroupList");return Oe.l("".concat(n," pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===An||this._pagingStatus===Ln?this.syncGroupList().then((function(){return Cn({groupList:t._grpM.getLocalGroupList(),isSyncCompleted:t.isPagingGetCompleted()})})).catch((function(e){return Oe.e("".concat(n," failed. error:"),e),Sn(e)})):(e=this._grpM.getLocalGroupList(),Oe.l("".concat(n,". returned group count:").concat(e.length)),Tn({groupList:e,isSyncCompleted:this.isPagingGetCompleted()}))}},{key:"isPagingGetCompleted",value:function(){return this._pagingStatus===On}},{key:"_pagingGetGroupList",value:function(e){var t=this,n="".concat(this._n,".").concat("_pagingGetGroupList"),o=void 0!==(c=e.isCommunityRelay)&&c,i=e.limit,s=e.offset,r=e.groupBaseInfoFilter,a=e.groupList,c=void 0,u=(o&&(c=S.GRP_COMMUNITY,r.push("AtInfoList")),Date.now());return this._grpM.req({P:jn.GET_GRP_LIST,data:{type:c,memberAccount:this._grpM.getMyUserID(),limit:i,offset:s,responseFilter:{groupBaseInfoFilter:r,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]}}}).then((function(e){var c=void 0===(c=(e=e.data).groups)?[]:c,l=(e=e.totalCount,a.push.apply(a,v(c)),t._handleGroupAtInfoWithoutTopic(o,c),!((c=s+i)<e));return e="offset:".concat(s," limit:").concat(i," total:").concat(e," isCompleted:").concat(l," ")+"current:".concat(a.length," isCommunityRelay:").concat(o),t._pagingGetCostList.push($t(u,!1)),Oe.l("".concat(n," ok. ").concat(e," cost:").concat($t(u))),o||l?!o&&l?(Oe.l("".concat(n," start to get community list")),s=0,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:a,isCommunityRelay:!0})):o&&!l?(s=c,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:a,isCommunityRelay:!0})):Cn({groupList:a}):(s=c,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:a}))})).catch((function(e){return 10018===e.code?(Oe.w("".concat(t.logPrefix," response size exceeds the limit, request count:").concat(i)),i=50,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:a,isCommunityRelay:o})):o?(11e3===e.code&&Oe.l("".concat(n," ok. community unavailable")),Tn({groupList:a})):Sn(e)}))}},{key:"_pagingGetGroupListWithTopic",value:function(e){var t=this,n="".concat(this._n,"._pagingGetGroupListWithTopic"),o=e.limit,i=e.offset,s=e.groupBaseInfoFilter,r=e.groupList,a=Date.now();return this._grpM.req({P:jn.GET_GRP_LIST,data:{type:S.GRP_COMMUNITY,memberAccount:this._grpM.getMyUserID(),limit:o,offset:i,responseFilter:{groupBaseInfoFilter:s,selfInfoFilter:v(U)},isSupportTopic:1,needAppDefineData:1}}).then((function(e){var c=(e=e.data).groups,u=(e=e.totalCount,r.push.apply(r,v(void 0===c?[]:c)),!((c=i+o)<e));return Oe.l("".concat(n," ok. offset:").concat(i," limit:").concat(o," totalCount:").concat(e," isCompleted:").concat(u," currentCount:").concat(r.length," cost:").concat($t(a))),u?(t._grpM.updateGroupMap(r),t._grpM.emitGroupListUpdate(!0,!1),Cn({groupList:e=t._grpM.getLocalGroupList().filter((function(e){return!0===e.isSupportTopic}))})):(i=c,t._pagingGetGroupListWithTopic({limit:o,offset:i,groupBaseInfoFilter:s,groupList:r}))})).catch((function(e){return 10018===e.code?(Oe.w("".concat(t.logPrefix," response size exceeds the limit, request count:").concat(o)),o=50,t._pagingGetGroupListWithTopic({limit:o,offset:i,groupBaseInfoFilter:s,groupList:r})):Sn(e)}))}},{key:"_cacheGroupMessage",value:function(e,t){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(t)}},{key:"_deleteCachedGroupMessage",value:function(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}},{key:"_notifyCachedGroupMessage",value:function(e,t){var n=this,o=this._cachedGroupMessageMap.get(e)||[];Oe.l("".concat(this._n,"._notifyCachedGroupMessage groupID:").concat(e," groupType:").concat(t," count:").concat(o.length)),o.forEach((function(e){n.onNewMessage(e)})),this._deleteCachedGroupMessage(e)}},{key:"_cacheAndCompare",value:function(e){var t=e.groupID,n=e.event,o=e.item;e=e.groupType,Oe.l("".concat(this._n,"._cacheAndCompare groupID:").concat(t," groupType:").concat(e)),this._cacheGroupMessage(t,{event:n,dataList:[o]}),n={groupID:t,type:e},e===S.GRP_AVCHATROOM?this._grpM.hasLocalGroup(t)?this._notifyCachedGroupMessage(t,e):this._grpM.setUnjoinedAVChatRoom(t):(this._grpM.updateGroupMap([n]),this._notifyCachedGroupMessage(t,e)),this._checkCountMap.has(t)||this._checkCountMap.set(t,0)}},{key:"_handleGroupAtInfoWithoutTopic",value:function(e,t){var n=this;e&&0!==t.length&&t.forEach((function(e){var t=e.groupID,o=(e=e.groupAtInfoList,[]);lt(e)||(e.forEach((function(e){o.push(g(g({},e),{},{groupID:t}))})),n._grpM.get(11).onNewGroupAtTips({dataList:o}))}))}},{key:"setPagingGroupCount",value:function(e){lt(e)||(this.PAGING_GRP_COUNT_LIMIT=parseInt(e,10))}},{key:"reset",value:function(){this.PAGING_GRP_COUNT_LIMIT=200,this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._pagingStatus=Ln,this._pagingGetCostList=[]}}]),ti=s((function e(t){o(this,e),this._grpM=t,this._n="GroupAttributesHandler",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._grpM.getIEmitInst().on(xo.CLOUD_CONFIG,this._onCloudConfig,this)}),[{key:"_onCloudConfig",value:function(){var e=this._grpM.getCloudConfig("grp_attr_cache_time");lt(e)||(this.CACHE_EXPIRE_TIME=Number(e))}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesMap.forEach((function(e){e.localMainSequence=0}))}},{key:"isGroupAttributesUpdatedNotice",value:function(e){var t=e.to,n=(e=e.elements.newGroupProfile,!lt(e)&&!qe(e.groupAttributeOption));return n&&this._onGroupAttributesUpdated({groupID:t,groupAttributeOption:e.groupAttributeOption}),n}},{key:"_onGroupAttributesUpdated",value:function(e){var t,n=this,o=e.groupID,i=(e=e.groupAttributeOption).mainSequence,s=e.isWithChangedAttributeInfo,r=void 0===(r=e.groupAttributeList)?[]:r;e=e.operationType,Oe.l("".concat(this._n,".onGroupAttributesUpdated. ")+"groupID:".concat(o," isWithChangedAttributeInfo:").concat(s," operationType:").concat(e)),lt(e)||(this._groupAttributesCopy=this._getCachedAttributes({groupID:o}),0!=(t=i-this._getLocalGroupAttributes(o).localMainSequence)&&(1===s&&1==t?(this._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:i,groupAttributeList:r,operationType:e}),this._emitGroupAttributesUpdated(o)):this._hasLocalGroupAttributes(o)&&(s=this._getLocalGroupAttributes(o).avChatRoomKey,this._getGroupAttributes({groupID:o,avChatRoomKey:s}).then((function(){n._emitGroupAttributesUpdated(o)})))))}},{key:"initGroupAttributesCache",value:function(e){var t=e.groupID;e=void 0===(e=e.avChatRoomKey)?void 0:e,this._groupAttributesMap.set(t,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:e}),Oe.l("".concat(this._n,".initGroupAttributesCache groupID:").concat(t," avChatRoomKey:").concat(e))}},{key:"initGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.groupAttributes,i=(e=this._getLocalGroupAttributes(n)).remoteMainSequence,s=(e=e.avChatRoomKey,new io("initGroupAttributes"));return s.setMessage("groupID:".concat(n," avChatRoomKey:").concat(e," mainSequence:").concat(i)),this._grpM.req({P:jn.SET_GRP_ATTR,data:{groupID:n,avChatRoomKey:e,mainSequence:i,groupAttributeList:this._transformGroupAttributes(o)}}).then((function(e){Oe.l("".concat(t._n,".").concat("initGroupAttributes"," ok. groupID:").concat(n));var i=(e=e.data).mainSequence;return(e=v(e.groupAttributeList)).forEach((function(e){e.value=o[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:i,groupAttributeList:e,operationType:1}),t._emitGroupAttributesUpdated(n),s.end(),Cn({groupAttributes:o})})).catch((function(e){return s.setError(e).end(),Sn(e)}))}},{key:"setGroupAttributes",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupAttributes"),o=e.groupID,i=e.groupAttributes,s=(e=this._getLocalGroupAttributes(o)).remoteMainSequence,r=e.avChatRoomKey,a=e.attributes,c=((e=this._transformGroupAttributes(i)).forEach((function(e){var t=e.key;e.sequence=0,a.has(t)&&(e.sequence=a.get(t).sequence)})),new io("setGroupAttributes"));return c.setMessage("groupID:".concat(o," groupAttributes:").concat(JSON.stringify(i))),Oe.l("".concat(n,". groupID:").concat(o," mainSequence:").concat(s)),this._grpM.req({P:jn.MODIFY_GRP_ATTR,data:{groupID:o,avChatRoomKey:r,mainSequence:s,groupAttributeList:e}}).then((function(e){Oe.l("".concat(n," ok."));var s=(e=e.data).mainSequence;return(e=v(e.groupAttributeList)).forEach((function(e){e.value=i[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:o}),t._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:s,groupAttributeList:e,operationType:2}),t._emitGroupAttributesUpdated(o),c.end(),Cn({groupAttributes:i})})).catch((function(e){return c.setError(e).end(),Sn(e)}))}},{key:"deleteGroupAttributes",value:function(e){var t=this,n=e.groupID,o=(e=void 0===(e=e.keyList)?[]:e,(a=this._getLocalGroupAttributes(n)).remoteMainSequence),i=a.avChatRoomKey,s=a.attributes,r=v(s.keys()),a=jn.CLEAR_GRP_ATTR,c=3,u=(i={groupID:n,avChatRoomKey:i,mainSequence:o},[]),l=(0<e.length&&(r=[],a=jn.DEL_GRP_ATTR,c=4,e.forEach((function(e){var t=0;s.has(e)&&(t=s.get(e).sequence,r.push(e)),u.push({key:e,sequence:t})})),i.groupAttributeList=u),new io("deleteGroupAttributes"));return l.setMessage("groupID:".concat(n," mainSequence:").concat(o," keyList:").concat(e," proto:").concat(a)),this._grpM.req({P:a,data:i}).then((function(e){return Oe.l("".concat(t._n,".").concat("deleteGroupAttributes"," ok. groupID:").concat(n)),e=e.data.mainSequence,t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:e,groupAttributeList:u,operationType:c}),t._emitGroupAttributesUpdated(n),l.end(),Cn({keyList:r})})).catch((function(e){return l.setError(e).end(),Sn(e)}))}},{key:"getGroupAttributes",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupAttributes"),o=e.groupID,i=(a=this._getLocalGroupAttributes(o)).avChatRoomKey,s=a.lastUpdateTime,r=a.localMainSequence,a=a.remoteMainSequence,c=new io("getGroupAttributes");return c.setMessage("groupID:".concat(o," localMainSequence:").concat(r," remoteMainSequence:").concat(a," keyList:").concat(e.keyList)),Date.now()-s>=this.CACHE_EXPIRE_TIME||r<a?this._getGroupAttributes({groupID:o,avChatRoomKey:i}).then((function(i){return c.setMoreMessage("get attributes from remote. count:".concat(i.length)).end(),Oe.l("".concat(n," from remote. groupID:").concat(o)),Cn({groupAttributes:i=t._getCachedAttributes(e)})})).catch((function(e){return c.setError(e).end(),Sn(e)})):(c.setMoreMessage("get attributes from cache").end(),Oe.l("".concat(n," from cache. groupID:").concat(o)),Tn({groupAttributes:s=this._getCachedAttributes(e)}))}},{key:"_getGroupAttributes",value:function(e){var t=this,n=0;return lt(e.avChatRoomKey)||(n=1),this._grpM.req({P:jn.GET_GRP_ATTR,data:g(g({},e),{},{groupType:n})}).then((function(n){Oe.l("".concat(t._n,"._getGroupAttributes ok. groupID:").concat(e.groupID));var o=(n=n.data).mainSequence,i=v(n=n.groupAttributeList);return lt(o)||t._refreshCachedGroupAttributes({groupID:e.groupID,remoteMainSequence:o,groupAttributeList:i,operationType:5}),n})).catch((function(e){return Sn(e)}))}},{key:"_refreshCachedGroupAttributes",value:function(e){var t=e.groupID,n=e.remoteMainSequence,o=e.groupAttributeList;if(e=e.operationType,this._hasLocalGroupAttributes(t)){var i=this._getLocalGroupAttributes(t),s=i.localMainSequence;if(5===e||n-s==1)i.remoteMainSequence=n,i.localMainSequence=n,i.lastUpdateTime=Date.now(),this._updateCachedAttributes({groupAttributes:i,groupAttributeList:o,operationType:e});else{if(s===n)return;i.remoteMainSequence=n}this._groupAttributesMap.set(t,i),o="operationType:".concat(e," localMainSequence:").concat(s," remoteMainSequence:").concat(n),Oe.l("".concat(this._n,"._refreshCachedGroupAttributes. ").concat(o))}}},{key:"_getCachedAttributes",value:function(e){var t=e.groupID,n=(e=void 0===(e=e.keyList)?[]:e,{});if(this._hasLocalGroupAttributes(t)){var o=this._getLocalGroupAttributes(t).attributes;if(0<e.length)e.forEach((function(e){o.has(e)&&(n[e]=o.get(e).value)}));else{var i,s=r(o.keys());try{for(s.s();!(i=s.n()).done;){var a=i.value;n[a]=o.get(a).value}}catch(c){s.e(c)}finally{s.f()}}}return n}},{key:"_updateCachedAttributes",value:function(e){var t=e.groupAttributes,n=e.groupAttributeList;3!==(e=e.operationType)?4!==e?(1===e&&t.attributes.clear(),n.forEach((function(e){var n=e.key,o=e.value;e=e.sequence,t.attributes.set(n,{value:o,sequence:e})}))):n.forEach((function(e){t.attributes.delete(e.key)})):t.attributes.clear()}},{key:"_hasLocalGroupAttributes",value:function(e){return this._groupAttributesMap.has(e)}},{key:"_getLocalGroupAttributes",value:function(e){return this._hasLocalGroupAttributes(e)||this.initGroupAttributesCache({groupID:e}),this._groupAttributesMap.get(e)}},{key:"_transformGroupAttributes",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_emitGroupAttributesUpdated",value:function(e){var t=this._getCachedAttributes({groupID:e}),n=(o=this._computeAttrChangedInfo(t)).updatedKeyList,o=o.deletedKeyList;Oe.l("".concat(this._n,"._emitGroupAttributesUpdated update:").concat(n.length,", delete:").concat(o.length)),0===n.length&&0===o.length||this._grpM.emitOEvt(T.GROUP_ATTRIBUTES_UPDATED,{groupID:e,groupAttributes:t,updatedKeyList:n,deletedKeyList:o})}},{key:"_computeAttrChangedInfo",value:function(e){var t=this,n=[],o=[];return Object.keys(e).forEach((function(o){e[o]!==t._groupAttributesCopy[o]&&n.push(o)})),Object.keys(this._groupAttributesCopy).forEach((function(t){lt(e[t])&&o.push(t)})),this._groupAttributesCopy={},{updatedKeyList:n,deletedKeyList:o}}},{key:"deleteLocalGroupAttributes",value:function(e){this._hasLocalGroupAttributes(e)&&this._groupAttributesMap.delete(e)}},{key:"reset",value:function(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}]),ni=s((function e(t){o(this,e),this._grpM=t,this._n="GroupCountersHandler",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._grpM.getIEmitInst().on(xo.CLOUD_CONFIG,this._onCloudConfig,this)}),[{key:"_onCloudConfig",value:function(){var e=this._grpM.getCloudConfig("grp_counter_expire_time");lt(e)||(this.EXPIRE_TIME=Number(e))}},{key:"isGroupCountersNotice",value:function(e){var t=e.to,n=!1;return qe(e=e.elements.groupCounterInfo)||(this._onGroupCountersUpdated({groupID:t,groupCounterInfo:e}),n=!0),n}},{key:"_onGroupCountersUpdated",value:function(e){var t=this,n=e.groupID;e.groupCounterInfo.forEach((function(e){var o=e.type,i=e.groupCounterSeq;e=void 0===(e=e.counterList)?[]:e,0!==o&&2!==o||(t._updateLocalGroupCounters({groupID:n,groupCounterSeq:i,counterList:e}),e.forEach((function(e){t._grpM.emitOEvt(T.GROUP_COUNTER_UPDATED,{groupID:n,key:e.key,value:e.value})}))),1===o&&t._deleteLocalGroupCounters({groupID:n,groupCounterSeq:i,counterList:e})})),Oe.l("".concat(this._n,"._onGroupCountersUpdated groupID:").concat(n))}},{key:"initGroupCountersCache",value:function(e){var t=e.groupID;e=e.avChatRoomKey,this._groupCountersMap.set(t,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:e}),Oe.l("".concat(this._n,".initGroupCountersCache groupID:").concat(t," avChatRoomKey:").concat(e))}},{key:"setGroupCounters",value:function(e){var t,n,o,i,s;return this._grpM.canIUse(N.GRP_COUNTER)?(t="".concat(this._n,".").concat("setGroupCounters"),n=e.groupID,e=e.counters,e=this._convertObjectToList(e),o=this._getLocalGroupCounters(n).avChatRoomKey,i="groupID:".concat(n," count:").concat(e.length),(s=new io("setGroupCounters")).setMessage("".concat(i)),Oe.l("".concat(t,". ").concat(i)),this._updateGroupCounters({groupID:n,counterList:e,avChatRoomKey:o,mode:"Set"}).then((function(e){return s.end(),Oe.l("".concat(t," ok.")),Cn({counters:e})})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._grpM.noUse("setGroupCounters")}},{key:"increaseGroupCounter",value:function(e){var t,n,o,i,s,r,a="increaseGroupCounter";return this._grpM.canIUse(N.GRP_COUNTER)?(t="".concat(this._n,".").concat(a),n=e.groupID,o=e.key,e=e.value,i=this._getLocalGroupCounters(n).avChatRoomKey,s="groupID:".concat(n," key:").concat(o," value:").concat(e),(r=new io(a)).setMessage("".concat(s)),Oe.l("".concat(t,". ").concat(s)),this._updateGroupCounters({groupID:n,counterList:[{key:o,value:e}],avChatRoomKey:i,mode:"Increase"}).then((function(e){return r.end(),Oe.l("".concat(t," ok.")),Cn({counters:e})})).catch((function(e){return r.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._grpM.noUse(a)}},{key:"decreaseGroupCounter",value:function(e){var t,n,o,i,s,r,a="decreaseGroupCounter";return this._grpM.canIUse(N.GRP_COUNTER)?(t="".concat(this._n,".").concat(a),n=e.groupID,o=e.key,e=e.value,i=this._getLocalGroupCounters(n).avChatRoomKey,s="groupID:".concat(n," key:").concat(o," value:").concat(e),(r=new io(a)).setMessage("".concat(s)),Oe.l("".concat(t,". ").concat(s)),this._updateGroupCounters({groupID:n,counterList:[{key:o,value:e}],avChatRoomKey:i,mode:"Decrease"}).then((function(e){return r.end(),Oe.l("".concat(t," ok.")),Cn({counters:e})})).catch((function(e){return r.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._grpM.noUse(a)}},{key:"getGroupCounters",value:function(e){var t=this;if(!this._grpM.canIUse(N.GRP_COUNTER))return this._grpM.noUse("getGroupCounters");var n="".concat(this._n,".").concat("getGroupCounters"),o=e.groupID,i=void 0===(e=e.keyList)?[]:e,s=(e=this._getLocalGroupCounters(o)).avChatRoomKey,r=(e=e.lastUpdateTime,new io("getGroupCounters"));return r.setMessage("groupID:".concat(o)),Date.now()-e>=this.EXPIRE_TIME?this._getRemoteGroupCounters({groupID:o,avChatRoomKey:s}).then((function(e){return r.setMoreMessage("from remote. count:".concat(e.length)).end(),Oe.l("".concat(n," from remote. groupID:").concat(o)),Cn({counters:e=t._getLocalCounters(o,i)})})).catch((function(e){return r.setError(e).end(),Sn(e)})):(r.setMoreMessage("from cache").end(),Oe.l("".concat(n," from cache. groupID:").concat(o)),Tn({counters:e=this._getLocalCounters(o,i)}))}},{key:"_getRemoteGroupCounters",value:function(e){var t=this;return this._grpM.req({P:jn.GET_GRP_COUNTER,data:g({},e)}).then((function(n){var o=void 0===(o=(n=n.data).counterList)?[]:o;return n=n.groupCounterSeq,t._updateLocalGroupCounters({groupID:e.groupID,counterList:o,groupCounterSeq:n}),Oe.l("".concat(t._n,"._getRemoteGroupCounters ok. groupID:").concat(e.groupID)),o})).catch((function(e){return Sn(e)}))}},{key:"_convertObjectToList",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_updateGroupCounters",value:function(e){var t="".concat(this._n,"._updateGroupCounters"),n=e.groupID,o=e.avChatRoomKey,i=e.mode;return Oe.l("".concat(t,". groupID:").concat(n," avChatRoomKey:").concat(o," mode:").concat(i)),this._grpM.req({P:jn.UPDATE_GRP_COUNTER,data:g({},e)}).then((function(e){Oe.l("".concat(t," ok.")),e=e.data.counterList;var n={};return(void 0===e?[]:e).forEach((function(e){var t=e.key;e=e.value,n[t]=e})),n})).catch((function(e){return Sn(e)}))}},{key:"_hasLocalGroupCounters",value:function(e){return this._groupCountersMap.has(e)}},{key:"_getLocalGroupCounters",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:"_updateLocalGroupCounters",value:function(e){var t,n,o,i=e.groupID,s=void 0===(s=e.counterList)?[]:s;e=e.groupCounterSeq,this._hasLocalGroupCounters(i)&&(o=this._getLocalGroupCounters(i),t=o.counters,n=o.avChatRoomKey,o=o.groupCounterSeq,0<e&&e<o||(s.forEach((function(e){var n=e.key;e=e.value,t.set(n,e)})),this._groupCountersMap.set(i,{lastUpdateTime:Date.now(),groupCounterSeq:e,counters:t,avChatRoomKey:n})))}},{key:"_deleteLocalGroupCounters",value:function(e){var t,n,o=e.groupID,i=void 0===(i=e.counterList)?[]:i;e=e.groupCounterSeq,this._hasLocalGroupCounters(o)&&(n=this._getLocalGroupCounters(o),t=n.counters,n=n.avChatRoomKey,i.forEach((function(e){t.delete(e.key)})),this._groupCountersMap.set(o,{lastUpdateTime:Date.now(),groupCounterSeq:e,counters:t,avChatRoomKey:n}))}},{key:"_getLocalCounters",value:function(e,t){var n={};if(this._hasLocalGroupCounters(e)){var o=this._getLocalGroupCounters(e).counters;if(0<t.length)t.forEach((function(e){o.has(e)&&(n[e]=o.get(e))}));else{var i,s=r(o.keys());try{for(s.s();!(i=s.n()).done;){var a=i.value;n[a]=o.get(a)}}catch(c){s.e(c)}finally{s.f()}}}return n}},{key:"reset",value:function(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}]),oi=s((function e(t){o(this,e);var n=t.manager,i=t.groupID,s=t.onInit,r=t.onSuccess;t=t.onFail,this._n="Polling",this._manager=n,this._grpM=n._grpM,this._onInit=s,this._onSuccess=r,this._onFail=t,this._groupID=i,this._timeoutID=-1,this._isRunning=!1,this._proto=jn.AV_POLLING}),[{key:"start",value:function(){var e=this._grpM.isLoggedIn();e||(this._proto=jn.AV_NOAUTH_POLLING),Oe.l("".concat(this._n,".start pollingInterval:").concat(this._manager.getPollingInterval()," isLoggedIn:").concat(e)),this._isRunning=!0,this._request()}},{key:"isRunning",value:function(){return this._isRunning}},{key:"_request",value:function(){var e=this,t=this._onInit(this._groupID);this._grpM.req({P:this._proto,data:t}).then((function(t){e._onSuccess(e._groupID,t),e.isRunning()&&(-1<e._timeoutID&&clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.getPollingInterval()))})).catch((function(t){e._onFail(e._groupID,t),e.isRunning()&&(-1<e._timeoutID&&clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.MAX_POLLING_INTERVAL))}))}},{key:"stop",value:function(){Oe.l("".concat(this._n,".stop")),-1<this._timeoutID&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}},{key:"getPollingTimerID",value:function(){return this._timeoutID}}]),ii={3:!0,4:!0,5:!0,6:!0,17:!0,20:!0,21:!0,100:!0},si=s((function e(t){o(this,e),this._grpM=t,this._n="AVChatRoomHandler",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this._seqSll=new Ko(200),this._IDSll=new Ko(100),this._reportMessageStackedCount=0,this._onlineMemberCountMap=new Map,this.DEFAULT_EXPIRE_TIME=60,this.DEFAULT_POLLING_INTERVAL=300,this.MAX_POLLING_INTERVAL=2e3,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0,this._startBroadcastSeq=1,this._broadcastMessageIDMap=new Map,this.DEFAULT_POLLING_SIMPLIFIED_MSG=0}),[{key:"hasJoinedAVChatRoom",value:function(){var e=[];return 0<(e=0<this._joinedGroupMap.size?v(this._joinedGroupMap.values()).filter((function(e){return e.type===S.GRP_AVCHATROOM})):e).length}},{key:"getJoinedLiveList",value:function(){var e=[];return 0<this._joinedGroupMap.size?v(this._joinedGroupMap.values()).filter((function(e){return e.type===S.GRP_LIVE})):e}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._joinedGroupMap.has(e)}},{key:"getJoinedAVChatRoom",value:function(){return 0<this._joinedGroupMap.size?v(this._joinedGroupMap.keys()):[]}},{key:"_updatedata",value:function(e){var t=this._pollingRequestInfoMap.get(e);return e===v(this._pollingInstanceMap.keys())[0]?g(g({},t),{},{startBroadcastSeq:this._startBroadcastSeq,simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG}):g(g({},t),{},{simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG})}},{key:"_handleSuccess",value:function(e,t){var n,o=(c=t.data).key,i=c.nextSeq,s=c.rspMsgList,r=c.errorCode,a=c.nextBroadcastSeq,c=c.broadcastMessageList;0!==r?(r=this._pollingRequestInfoMap.get(e),n=new io("longPollingAVError"),r=r?"".concat(r.key,"-").concat(r.startSeq):"requestInfo is undefined",n.setMessage("".concat(e,"-").concat(r,"-").concat(t.errorInfo)).setCode(t.errorCode).end(!0)):this.checkJoinedAVChatRoomByID(e)&&(ut(o)&&Ke(i)&&this._pollingRequestInfoMap.set(e,{key:o,startSeq:i}),Ke(a)&&a>this._startBroadcastSeq&&(this._startBroadcastSeq=a),Ye(s)&&0<s.length?(s.forEach((function(e){e.to=e.groupID})),this.onMessage(s,e)):(this._pollingNoMessageCount+=1,this._pollingNoMessageCount===this.DEFAULT_POLLING_NO_MESSAGE_COUNT&&(this._pollingInterval=this.DEFAULT_POLLING_INTERVAL+this.DEFAULT_POLLING_INTERVAL_PLUS)),this._onBroadcastMessage(c))}},{key:"_handleFailure",value:function(e,t){}},{key:"onMessage",value:function(e,t){if(Ye(e)&&0!==e.length){var n="".concat(this._n,".onMessage"),o=(t&&(n+=" groupID:".concat(t)),0!==this._pollingNoMessageCount&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL),null),i=[],s=this._get(11),r=this._get(26),a=e.length,c=(1<a&&e.sort((function(e,t){return e.sequence-t.sequence})),this._get(12).isUnlimitedAVChatRoom()),u=!1;Oe.getLevel()<=0&&(t=e.map((function(e){return e.sequence})),Oe.l("".concat(n," count:").concat(t.length," sequenceList:").concat(t)),t.length=0);for(var l=0;l<a;l++){var p=this.restoreMessageFromSimplified(e[l]);if(ii[p.event]){if(6===p.event){if(this._grpM.isGroupAttributesUpdatedNotice(p))continue;if(this._grpM.isGroupCountersNotice(p))continue}if(20!==p.event)if(21!==p.event)if(100!==p.event){o=this.packMessage(p,p.event);var d=1===p.isModified;if(u=1===p.isHistoryMessage,!c){if(this._seqSll.has(o.sequence))continue;this._seqSll.set(o.sequence)}var h=this._IDSll.has(o.ID);h?Oe.w("".concat(n," ID:").concat(o.ID," has:").concat(h)):(this._IDSll.set(o.ID),h=!1,!u&&this._isMessageSentByCurrentInstance(o)?d&&(h=!0,o.isModified=d,s.updateMsgIsModifiedProp(o)):h=!0,h&&(o.conversationType===S.CONV_SYSTEM&&5===o.payload.operationType&&this._onGroupDismissed(o.payload.groupProfile.groupID),u||o.conversationType===S.CONV_SYSTEM||(d=o.conversationID.replace(S.CONV_GROUP,""),this._pollingInstanceMap.has(d)?this._grpM.isLoggedIn()&&r.addMessageSequence({key:Qn,message:o}):(o.type!==S.MSG_GRP_TIP&&0<o.clientTime&&r.addMessageDelay(o.clientTime),r.addMessageSequence({key:Zn,message:o}))),i.push(o)))}else this.onRoomCustomData(p);else this._get(34).onMessageReactionNotify({event:21,dataList:p.elements.messageReactionNotifyList});else this.handleMessageRevokedNotice(p)}else Oe.w("".concat(n,". unknown event:").concat(p.event))}0!==i.length&&(0<(t=vt(i)).length&&this._grpM.emitOEvt(T.MESSAGE_MODIFIED,t),u||0<(t=this.packConversationOption(i)).length&&s.onNewMessage({conversationOptionsList:t,isInstantMessage:!0}),this._checkMessageStacked(i),0<(t=It(i)).length&&this._grpM.emitOEvt(T.MESSAGE_RECEIVED,t),i.length=0)}}},{key:"handleMessageRevokedNotice",value:function(e){var t=this,n=e.groupID,o=e.elements.revokeMsgList,i=e.revokerInfo,s=[];o.forEach((function(e){var t=e.tinyID,o=e.clientTime,r=e.random;e=e.sequence,t={conversationID:"".concat(S.CONV_GROUP).concat(n),ID:"".concat(t,"-").concat(o,"-").concat(r),revoker:i.revoker,revokeReason:i.reason||"",revokerInfo:{userID:i.revoker,nick:"",avatar:""},sequence:e},s.push(t)})),0!==s.length&&this._get(11).updateRevokerInfo(s).then((function(e){t._grpM.emitOEvt(T.MESSAGE_REVOKED,e)}))}},{key:"isBroadcastOrNormal",value:function(e){return 3===e||17===e}},{key:"isGroupTip",value:function(e){return 4===e||6===e}},{key:"isGroupSystemNotice",value:function(e){return 5===e}},{key:"restoreGroupTipElements",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=void 0===(t=e.operatorInfo)?{}:t,n=e.operatorID,o=void 0===(o=e.userIDList)?[]:o,i=e.operationType,s=(Ke(e.groupJoinType)||1!==i&&2!==i||(e.groupJoinType=2===i?0:1),i=t.userID,t.avatar);return t=t.nick,e.operatorInfo={userID:void 0===i?n:i,avatar:void 0===s?"":s,nick:void 0===t?"":t},n=o.map((function(e){return{userID:e}})),e.memberInfoList=e.memberInfoList||n,e}},{key:"restoreMessageFromSimplified",value:function(e){var t,n,o,i=e.event;return this.isBroadcastOrNormal(i)&&(e.cloudCustomData=e.cloudCustomData||"",e.elements=e.elements.map((function(e){var t;return e.type===S.MSG_CUSTOM&&(t=e.content,e.content=g({data:"",description:"",extension:""},void 0===t?{}:t)),e}))),(this.isGroupTip(i)||this.isGroupSystemNotice(i))&&(e.from=e.from||"@TIM#SYSTEM"),this.isGroupTip(i)&&(e.elements=this.restoreGroupTipElements(e.elements),n=(o=void 0===(o=e.elements)?{}:o).operationType,t=o.operatorInfo,1===n)&&(n=[{userID:(void 0===t?{}:t).userID}],o.memberInfoList=o.memberInfoList||n),this.isGroupSystemNotice(i)&&(o=(t=e.elements).memberInfoList,n=t.operatorInfo,e.elements.memberInfoList=g({userID:e.elements.operatorID,avatar:"",nick:""},o=o||(void 0===n?{}:n)),e.elements=g({authentication:"",remarkInfo:"",messageKey:1e3*e.time},e.elements),i=Object.keys(e.elements).filter((function(e){return"operatorInfo"!==e})).reduce((function(t,n){return g(g({},t),{},a({},n,e.elements[n]))}),{}),e.elements=i),e}},{key:"_onGroupDismissed",value:function(e){Oe.l("".concat(this._n,"._onGroupDismissed groupID:").concat(e)),this._grpM.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:"_checkMessageStacked",value:function(e){var t="MessageStacked";100<=(e=e.length)&&(this._grpM.warn(t,e),this._reportMessageStackedCount<5)&&(new io(t).setMessage("count:".concat(e," groupID:").concat(v(this._joinedGroupMap.keys()))).setLevel("warning").end(),this._reportMessageStackedCount+=1)}},{key:"_isMessageSentByCurrentInstance",value:function(e){return!!this._get(11).isMessageSentByCurrentInstance(e)}},{key:"packMessage",value:function(e,t){e.currentUser=this._grpM.getMyUserID(),e.conversationType=5===t?S.CONV_SYSTEM:S.CONV_GROUP,e.isSystemMessage=!!e.isSystemMessage;var n=new Do(e),o=(e=this.packElements(e,t),t=this._grpM.getFileDownloadProxy(),this._grpM.getDownloadFileAuthKey()),i=this._get(17).getFileDNList();return n.setElement(e,t,o,i),n}},{key:"packElements",value:function(e,t){return 4===t||6===t?(this._updateMemberCountByGroupTips(e),{type:S.MSG_GRP_TIP,content:g(g({},e.elements),{},{groupProfile:e.groupProfile})}):5===t?{type:S.MSG_GRP_SYS_NOTICE,content:g(g({},e.elements),{},{groupProfile:g(g({},e.groupProfile),{},{groupID:e.groupID})})}:e.elements}},{key:"packConversationOption",value:function(e){for(var t=new Map,n=0;n<e.length;n++){var o,i=e[n],s=i.conversationID;t.has(s)?"in"===((o=t.get(s)).lastMessage=i).flow&&o.unreadCount++:t.set(s,{conversationID:i.conversationID,unreadCount:"out"===i.flow?0:1,type:i.conversationType,subType:i.conversationSubType,lastMessage:i})}return v(t.values())}},{key:"_updateMemberCountByGroupTips",value:function(e){var t,n,o,i=e.groupProfile.groupID;qe(e=void 0===(e=e.elements.onlineMemberInfo)?void 0:e)||(t=void 0===(t=e.onlineMemberNum)?0:t,e=void 0===(e=e.expireTime)?this.DEFAULT_EXPIRE_TIME:e,n=this._onlineMemberCountMap.get(i)||{},o=Date.now(),qe(n)?Object.assign(n,{lastReqTime:0,lastSyncTime:0,latestUpdateTime:o,memberCount:t,expireTime:e}):(n.latestUpdateTime=o,n.memberCount=t),this._onlineMemberCountMap.set(i,n))}},{key:"_onBroadcastMessage",value:function(e){if(!qe(e)){for(var t=[],n=e.length,o=null,i=0;i<n;i++){var s=this.restoreMessageFromSimplified(e[i]);ii[s.event]?((o=this.packMessage(s,s.event)).isBroadcastMessage=!0,this._broadcastMessageIDMap.has(o.ID)||(t.push(o),this._broadcastMessageIDMap.set(o.ID,1))):Oe.w("".concat(this._n,"._onBroadcastMessage unknown event:").concat(s.event))}0<t.length&&this._grpM.emitOEvt(T.MESSAGE_RECEIVED,t)}}},{key:"start",value:function(e){var t;this._pollingInstanceMap.has(e)?(t=this._pollingInstanceMap.get(e)).isRunning()||t.start():((t=new oi({manager:this,groupID:e,onInit:this._updatedata.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)})).start(),this._pollingInstanceMap.set(e,t),Oe.l("".concat(this._n,".start groupID:").concat(e)))}},{key:"handleJoinResult",value:function(e){var t=this;return this._preCheck(e.group).then((function(){var n=e.longPollingKey,o=e.group,i=o.groupID;return t._joinedGroupMap.set(i,o),t._grpM.updateGroupMap([o]),t._grpM.deleteUnjoinedAVChatRoom(i),t._grpM.emitGroupListUpdate(!0,!1),lt(n)?Tn({status:Ue,group:o}):Promise.resolve()}))}},{key:"startRunLoop",value:function(e){var t=this;return this.handleJoinResult(e).then((function(){var n=e.longPollingKey,o=e.group,i=e.startSeq,s=o.groupID;return t._pollingRequestInfoMap.set(s,{key:n,startSeq:void 0===i?0:i}),t.start(s),t._grpM.isLoggedIn()?Tn({status:Ue,group:o}):Tn({status:Ue})}))}},{key:"_preCheck",value:function(e){if(!this._get(12).isUnlimitedAVChatRoom()&&this.hasJoinedAVChatRoom()&&e.type!==S.GRP_LIVE){var t=(e=_(this._joinedGroupMap.entries().next().value,2))[0];if(e=e[1],this._grpM.isLoggedIn()&&e.selfInfo.role!==S.GRP_MBR_ROLE_OWNER&&e.ownerID!==this._grpM.getMyUserID())return this._grpM.quitGroup(t);this._grpM.deleteLocalGroupAndConversation(t),this.reset(t)}return Promise.resolve()}},{key:"joinWithoutAuth",value:function(e){var t=this,n=e.groupID,o="".concat(this._n,".").concat("joinWithoutAuth"),i=new io("joinWithoutAuth");return this._grpM.req({P:jn.APPLY_JOIN_GRP_NOAUTH,data:e}).then((function(e){if(e=e.data.longPollingKey,i.setMessage("groupID:".concat(n," longPollingKey:").concat(e)).end(!0),lt(e))return Sn({code:qn.CANNOT_JOIN_NON_AV_WITHOUT_LOGIN});Oe.l("".concat(o," ok. groupID:").concat(n)),t._get(11).setCompleted("".concat(S.CONV_GROUP).concat(n));var s=new zo({groupID:n});return t.startRunLoop({group:s,longPollingKey:e}),Cn({status:Ue})})).catch((function(e){return Oe.e("".concat(o," failed. groupID:").concat(n," error:"),e),i.setError(e).setMessage("groupID:".concat(n)).end(!0),Sn(e)})).finally((function(){t._grpM.get(14).reportAtOnce()}))}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this._onlineMemberCountMap.get(e)||{},n=Date.now();return qe(t)||n-t.lastSyncTime>1e3*t.expireTime&&1e4<n-t.latestUpdateTime&&3e3<n-t.lastReqTime?(t.lastReqTime=n,this._onlineMemberCountMap.set(e,t),this._getGroupOnlineMemberCount(e).then((function(e){return Cn({memberCount:e.memberCount})})).catch((function(e){return Sn(e)}))):Tn({memberCount:t.memberCount})}},{key:"_getGroupOnlineMemberCount",value:function(e){var t=this,n="".concat(this._n,".").concat("_getGroupOnlineMemberCount"),o=new io("_getGroupOnlineMemberCount");return this._grpM.requestOnlineCount(e).then((function(o){var i=t._onlineMemberCountMap.get(e)||{},s=void 0===(s=(o=o.data).memberCount)?0:s,r=(o=void 0===(o=o.expireTime)?t.DEFAULT_EXPIRE_TIME:o,Oe.l("".concat(n," ok. groupID:").concat(e," memberCount:").concat(s," expireTime:").concat(o)),Date.now());return qe(i)&&(i.lastReqTime=r),t._onlineMemberCountMap.set(e,Object.assign(i,{lastSyncTime:r,latestUpdateTime:r,memberCount:s,expireTime:o})),{memberCount:s}})).catch((function(t){return Oe.w("".concat(n," failed. error:"),t),o.setCode(t.code).setMessage("groupID:".concat(e," error:").concat(JSON.stringify(t))).end(),Promise.reject(t)}))}},{key:"_get",value:function(e){return this._grpM.get(e)}},{key:"setPollingInterval",value:function(e){lt(e)||(Ke(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}},{key:"setPollingIntervalPlus",value:function(e){lt(e)||(Ke(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}},{key:"setPollingNoMessageCount",value:function(e){lt(e)||(Ke(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}},{key:"setPollingSimplifiedMessage",value:function(e){lt(e)||"0"!==e&&"1"!==e||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(e,10))}},{key:"getPollingInterval",value:function(){return this._pollingInterval}},{key:"onAVChatRoomMemberBanned",value:function(e){e=e.payload.groupProfile.groupID,Oe.l("".concat(this._n,".onAVChatRoomMemberBanned groupID:").concat(e)),this._grpM.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:"restartPolling",value:function(){Oe.l("".concat(this._n,".restartPolling count:").concat(this._pollingInstanceMap.size));var e,t=r(this._pollingInstanceMap.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.stop(),n.start()}}catch(o){t.e(o)}finally{t.f()}}},{key:"getPollingTimerID",value:function(e){var t;return this._pollingInstanceMap.has(e)?(t=this._pollingInstanceMap.get(e).getPollingTimerID(),Oe.l("".concat(this._n,".getPollingTimerID groupID:").concat(e," timerID:").concat(t)),t):-1}},{key:"hasPollingInstance",value:function(e){return this._pollingInstanceMap.has(e)}},{key:"onRoomCustomData",value:function(e){var t=e.groupID,n=e.sequence,o=e.time;e=(e=e.elements)&&e.content,this._get(30).onRoomCustomDataReceived(e),Oe.l("".concat(this._n,".onRoomCustomData groupID:").concat(t," sequence:").concat(n," time:").concat(o," data:").concat(e))}},{key:"reset",value:function(e){if(e){Oe.l("".concat(this._n,".reset groupID:").concat(e));var t=this._pollingInstanceMap.get(e);t&&t.stop(),this._pollingInstanceMap.delete(e),this._joinedGroupMap.delete(e),this._pollingRequestInfoMap.delete(e),this._onlineMemberCountMap.delete(e)}else{Oe.l("".concat(this._n,".reset all"));var n,o=r(this._pollingInstanceMap.values());try{for(o.s();!(n=o.n()).done;)n.value.stop()}catch(i){o.e(i)}finally{o.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this._seqSll.reset(),this._IDSll.reset(),this._reportMessageStackedCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=300,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0}}]),ri=s((function e(t){o(this,e),this.userID="",this.avatar="",this.nick="",this.role="",this.joinTime="",this.lastSendMsgTime="",this.nameCard="",this.muteUntil=0,this.memberCustomField=[],this.isOnline=!1,this.updateMember(t)}),[{key:"updateMember",value:function(e){lt(e.onlineStatus)||(this.isOnline="Online"===e.onlineStatus);var t=[null,void 0,"",0,NaN];e.memberCustomField&&_t(this.memberCustomField,e.memberCustomField),Qe(this,e,["memberCustomField","marks","onlineStatus"],t)}},{key:"updateRole",value:function(e){["Owner","Admin","Member"].indexOf(e)<0||(this.role=e)}},{key:"updateMuteUntil",value:function(e){lt(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}},{key:"updateNameCard",value:function(e){lt(e)||(this.nameCard=e)}},{key:"updateMemberCustomField",value:function(e){e&&_t(this.memberCustomField,e)}}]),ai=s((function e(t){o(this,e),this._grpM=t,this._n="GroupMemberHandler",this.groupMemberListMap=new Map,this.DEFAULT_MEMBER_INFO_FILTER=["Role","JoinTime","NameCard","ShutUpUntil","OnlineStatus"],this._grpM.getIEmitInst().on(xo.PROFILE_UPDATED,this._onProfileUpdated,this)}),[{key:"_onProfileUpdated",value:function(e){for(var t=this,n=e.data,o=0;o<n.length;o++)!function(){var e=n[o];t.groupMemberListMap.forEach((function(t){t.has(e.userID)&&t.get(e.userID).updateMember({nick:e.nick,avatar:e.avatar})}))}()}},{key:"deleteGroupMemberList",value:function(e){this.groupMemberListMap.delete(e)}},{key:"getGroupMemberList",value:function(e){var t,n=this,o=e.groupID,i=void 0===(i=e.role)?void 0:i,s=void 0===(c=e.offset)?0:c,r=void 0===(c=e.count)?15:c,a=(e=void 0===(c=e.filter)?void 0:c,"".concat(this._n,".").concat("getGroupMemberList")),c=this._grpM.hasLocalGroup(o);if(Oe.l("".concat(a," groupID:").concat(o," role:").concat(i," offset:").concat(s," count:").concat(r," hasLocalGroup:").concat(c)),!c)return Tn({memberList:[],offset:0});if(this._grpM.getLocalGroupProfile(o).type===S.GRP_AVCHATROOM){if(this._grpM.canIUse(N.AV_MBR_LIST))return this._getAVChatRoomMemberList({groupID:o,offset:s,filter:e});this._grpM.warn("LiveOnlineMember")}i!==S.GRP_MBR_ROLE_ADMIN&&i!==S.GRP_MBR_ROLE_OWNER&&i!==S.GRP_MBR_ROLE_MEMBER||(t=i);var u=new io("getGroupMemberList"),l=0,p=(c={groupID:o,limit:100<r?100:r,memberRoleFilter:t?[t]:void 0,memberInfoFilter:this.DEFAULT_MEMBER_INFO_FILTER},Ct({groupID:o})?c.next="".concat(s):l=(c.offset=s)+r,[]);return this._grpM.req({P:jn.GET_GRP_MBR_LIST,data:c}).then((function(e){var t=(e=e.data).members,i=e.memberNum;return e=e.next,lt(e=void 0===e?void 0:e)||(l=qe(e)?0:e),Ye(t)&&0!==t.length?(n._grpM.hasLocalGroup(o)&&(n._grpM.getLocalGroupProfile(o).memberNum=i),p=n._updateLocalGroupMemberMap(o,t),n._grpM.get(4).getUserProfile({userIDList:t.map((function(e){return e.userID})),tagList:[be.NICK,be.AVATAR]})):(l=0,Promise.resolve([]))})).then((function(e){return Ye(e=e.data)&&0!==e.length?(e=e.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}})),n._updateLocalGroupMemberMap(o,e),p.length<r&&(l=0),u.setMessage("groupID:".concat(o," offset:").concat(s," count:").concat(r)).end(),Oe.l("".concat(a," ok.")),Cn({memberList:p,offset:l})):Tn({memberList:[],offset:l})})).catch((function(e){return u.setError(e).end(),Oe.e("".concat(a," failed. error:"),e),Sn(e)}))}},{key:"_getAVChatRoomMemberList",value:function(e){var t=this,n=e.groupID,o=e.offset,i=(e=e.filter,"".concat(this._n,".").concat("_getAVChatRoomMemberList")),s=new io("_getAVChatRoomMemberList");return s.setMessage("groupID:".concat(n," offset:").concat(o," filter:").concat(e)),this._grpM.req({P:jn.GET_AV_MBR_LIST,data:{groupID:n,offset:o,filter:e}}).then((function(e){var o=void 0===(o=(e=e.data).memberList)?[]:o;return e=void 0===(e=e.offset)?0:e,s.end(),Oe.l("".concat(i," ok. member count:").concat(o.length,", next request timestamp:").concat(e)),o=o.map((function(e){return g(g({},e),{},{onlineStatus:"Online"})})),Cn({memberList:o=t._updateLocalGroupMemberMap(n,o),offset:e})})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(i," failed. error:"),e),Sn(e)}))}},{key:"getGroupMemberProfile",value:function(e){var t,n=this,o="getGroupMemberProfile",i="".concat(this._n,".").concat(o),s="groupID:".concat(e.groupID),r=(5<e.userIDList.length?s+=" userIDList.length:".concat(e.userIDList.length):s+=" userIDList:".concat(e.userIDList),Oe.l("".concat(i," ").concat(s)),50<e.userIDList.length&&(e.userIDList=e.userIDList.slice(0,50)),e.groupID),a=e.userIDList;return(i=this._grpM.getLocalGroupProfile(r))&&Mt(i.type)?Sn({code:i=qn.OPERATION_NOT_SUPPORTED_IN_AV,message:this._grpM.getErrMsg(i,o)}):((t=new io(o)).setMessage(s),this._getGroupMemberProfileAdvance(g(g({},e),{},{userIDList:a})).then((function(e){return Ye(e=e.data.members)&&0!==e.length?(n._updateLocalGroupMemberMap(r,e),n._grpM.get(4).getUserProfile({userIDList:e.map((function(e){return e.userID})),tagList:[be.NICK,be.AVATAR]})):Tn([])})).then((function(e){return e=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}})),n._updateLocalGroupMemberMap(r,e),e=a.filter((function(e){return n.hasLocalGroupMember(r,e)})).map((function(e){return n.getLocalGroupMemberInfo(r,e)})),t.end(),Cn({memberList:e})})))}},{key:"addGroupMember",value:function(e){var t=this,n="".concat(this._n,".").concat("addGroupMember"),o=e.groupID,i=this._grpM.getLocalGroupProfile(o),s=i.type,r=new io("addGroupMember");return r.setMessage("groupID:".concat(o," groupType:").concat(s)),Mt(s)?(s=new Bn({code:qn.CANNOT_ADD_MEMBER_IN_AV}),r.setError(s).end(),Sn(s)):(e.userIDList=e.userIDList.map((function(e){return{userID:e}})),Oe.l("".concat(n," groupID:").concat(o)),this._grpM.req({P:jn.ADD_GRP_MBR,data:e}).then((function(o){o=o.data.members;var s=(Oe.l("".concat(n," ok")),o.filter((function(e){return 1===e.result})).map((function(e){return e.userID}))),a=o.filter((function(e){return 0===e.result})).map((function(e){return e.userID})),c=o.filter((function(e){return 2===e.result})).map((function(e){return e.userID})),u=(o=o.filter((function(e){return 4===e.result})).map((function(e){return e.userID})),"groupID:".concat(e.groupID,", ")+"successUserIDList:".concat(s,", ")+"failureUserIDList:".concat(a,", ")+"existedUserIDList:".concat(c,", ")+"overLimitUserIDList:".concat(o));return r.setMoreMessage(u).end(),0===s.length?Cn({successUserIDList:s,failureUserIDList:a,existedUserIDList:c,overLimitUserIDList:o}):(t._updateConvGroupProfile(i),Cn({successUserIDList:s,failureUserIDList:a,existedUserIDList:c,overLimitUserIDList:o,group:i}))})).catch((function(e){return r.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)})))}},{key:"deleteGroupMember",value:function(e){var t,n,o=this,i="".concat(this._n,".").concat("deleteGroupMember"),s=e.groupID,r=e.userIDList,a=this._grpM.getLocalGroupProfile(s);return lt(a)?Sn({code:qn.CANNOT_FIND_GRP}):Mt(a.type)?this._grpM.canIUse(N.AV_BAN_MBR)?this._banAVChatRoomMember(e):this._grpM.noUse("deleteGroupMember"):(t="groupID:".concat(s," ").concat(5<r.length?"userIDList.length:".concat(r.length):"userIDList:".concat(r)),Oe.l("".concat(i," groupID:").concat(s," userIDList:"),r),(n=new io("deleteGroupMember")).setMessage(t),this._grpM.req({P:jn.DEL_GRP_MBR,data:e}).then((function(){return n.end(),Oe.l("".concat(i," ok")),o._updateConvGroupProfile(a),o.deleteLocalGroupMembers(s,r),Cn({group:a,userIDList:r})})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(i," failed. error:"),e),Sn(e)})))}},{key:"_updateConvGroupProfile",value:function(e){this._grpM.get(11).updateConvGroupProfile([e])}},{key:"_banAVChatRoomMember",value:function(e){var t=this,n="".concat(this._n,".").concat("_banAVChatRoomMember"),o=e.groupID,i=e.userIDList,s="groupID:".concat(o," ").concat(5<i.length?"userIDList.length:".concat(i.length):"userIDList:".concat(i)),r=new io("_banAVChatRoomMember"),a=(r.setMessage(s),Oe.l("".concat(n," groupID:").concat(o," userIDList:"),i),this._grpM.getLocalGroupProfile(o));return lt(e.duration)||0===e.duration?Sn({code:qn.BAN_DURATION_INVALID}):this._grpM.req({P:jn.BAN_AV_MBR,data:e}).then((function(){return r.end(),Oe.l("".concat(n," ok")),t.deleteLocalGroupMembers(o,i),Cn({group:a,userIDList:i})})).catch((function(e){return r.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"setGroupMemberMuteTime",value:function(e){var t,n,o=this,i=e.groupID,s=e.userID,r=(e=e.muteTime,"".concat(this._n,".").concat("setGroupMemberMuteTime"));return s===this._grpM.getMyUserID()?Sn({code:qn.CANNOT_MUTE_SELF}):(t="groupID:".concat(i," userID:").concat(s," muteTime:").concat(e),Oe.l("".concat(r," ").concat(t)),(n=new io("setGroupMemberMuteTime")).setMessage(t),this.modifyGroupMemberInfo({groupID:i,userID:s,muteTime:e}).then((function(e){return n.end(),Oe.l("".concat(r," ok")),Cn({group:o._grpM.getLocalGroupProfile(i),member:e})})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(r," failed. error:"),e),Sn(e)})))}},{key:"setGroupMemberRole",value:function(e){var t,n,o="".concat(this._n,".").concat("setGroupMemberRole"),i=e.groupID,s=e.userID,r=(e=e.role,"groupID:".concat(i," userID:").concat(s," role:").concat(e)),a=this._grpM.getLocalGroupProfile(i);return a&&a.selfInfo.role!==S.GRP_MBR_ROLE_OWNER?Sn({code:qn.NOT_OWNER}):(t=[S.GRP_MBR_ROLE_ADMIN,S.GRP_MBR_ROLE_MEMBER],Ct({groupID:i})&&t.push(S.GRP_MBR_ROLE_CUSTOM),t.indexOf(e)<0?Sn({code:qn.INVALID_MEMBER_ROLE}):s===this._grpM.getMyUserID()?Sn({code:qn.CANNOT_SET_SELF_MEMBER_ROLE}):((n=new io("setGroupMemberRole")).setMessage(r),Oe.l("".concat(o," ").concat(r)),this.modifyGroupMemberInfo({groupID:i,userID:s,role:e}).then((function(e){return n.end(),Oe.l("".concat(o," ok")),Cn({group:a,member:e})})).catch((function(e){return n.setError(e).end(),Oe.e("".concat(o," failed. error:"),e),Sn(e)}))))}},{key:"_filterProfanity",value:function(e,t){var n,o=this._grpM.get(29);return!o||(n=(o=o.filterText(t[e],"group_member_profile")).isAllowedToSend,o=o.modifiedText,!0===n&&(t[e]=o,!0))}},{key:"setGroupMemberNameCard",value:function(e){var t,n,o,i,s,r=this,a="setGroupMemberNameCard",c="".concat(this._n,".").concat(a);return e.nameCard&&!1===this._filterProfanity("nameCard",e)?Sn({code:qn.PROFANITY_FOUND}):(t=e.groupID,i=e.userID,n=void 0===i?this._grpM.getMyUserID():i,o=e.nameCard,i="groupID:".concat(t," userID:").concat(n," nameCard:").concat(o),Oe.l("".concat(c," ").concat(i)),(e=this._grpM.getLocalGroupProfile(t))&&Mt(e.type)?Sn({code:e=qn.OPERATION_NOT_SUPPORTED_IN_AV,message:this._grpM.getErrMsg(e,a)}):((s=new io(a)).setMessage(i),this.modifyGroupMemberInfo({groupID:t,userID:n,nameCard:o}).then((function(e){Oe.l("".concat(c," ok")),s.end();var i=r._grpM.getLocalGroupProfile(t);return n===r._grpM.getMyUserID()&&i&&i.setSelfNameCard(o),Cn({group:i,member:e})})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(c," failed. error:"),e),Sn(e)}))))}},{key:"setGroupMemberCustomField",value:function(e){var t,n=this,o="setGroupMemberCustomField",i="".concat(this._n,".").concat(o),s=e.groupID,r=void 0===(r=e.userID)?this._grpM.getMyUserID():r,a=(e=e.memberCustomField,"groupID:".concat(s," userID:").concat(r," memberCustomField:").concat(JSON.stringify(e))),c=(Oe.l("".concat(i," ").concat(a)),this._grpM.getLocalGroupProfile(s));return c&&Mt(c.type)?Sn({code:c=qn.OPERATION_NOT_SUPPORTED_IN_AV,message:this._grpM.getErrMsg(c,o)}):((t=new io(o)).setMessage(a),this.modifyGroupMemberInfo({groupID:s,userID:r,memberCustomField:e}).then((function(e){return t.end(),Oe.l("".concat(i," ok")),Cn({group:n._grpM.getLocalGroupProfile(s),member:e})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(i," failed. error:"),e),Sn(e)})))}},{key:"modifyGroupMemberInfo",value:function(e){var t=this,n=e.groupID,o=e.userID,i=void 0;return Tt(n)&&(n=Gt(i=n)),this._grpM.req({P:jn.MODIFY_GRP_MBR_INFO,data:g(g({},e),{},{groupID:n,topicID:i})}).then((function(){var i;return t.hasLocalGroupMember(n,o)?(i=t.getLocalGroupMemberInfo(n,o),lt(e.muteTime)||i.updateMuteUntil(e.muteTime),lt(e.role)||i.updateRole(e.role),lt(e.nameCard)||i.updateNameCard(e.nameCard),lt(e.memberCustomField)||i.updateMemberCustomField(e.memberCustomField),i):(i=t._grpM.getLocalGroupProfile(n))&&!Mt(i.type)?t.getGroupMemberProfile({groupID:n,userIDList:[o]}).then((function(e){return _(e.data.memberList,1)[0]})):void 0}))}},{key:"markGroupMemberList",value:function(e){var t="".concat(this._n,".").concat("markGroupMemberList"),n=e.groupID,o=e.markType,i=e.enableMark,s=void 0===(e=e.userIDList)?[]:e,r=(e="groupID:".concat(n," markType:").concat(o," enableMark:").concat(i," userIDList count:").concat(s.length),Oe.l("".concat(t," ").concat(e)),2),a=[],c=(!0===i&&(r=1),i=v(s),500<s.length&&(i=s.slice(0,500),Oe.w("".concat(t," ").concat(jt(500)))),i.forEach((function(e){a.push({userID:e,markType:[o]})})),i=null,new io("markGroupMemberList"));return c.setMessage(e),this._grpM.req({P:jn.MARK_AV_MBR_INFO,data:{groupID:n,operationType:r,memberList:a}}).then((function(e){e=e.data.memberList;var n=[],o=[];return(e=void 0===e?[]:e).length===s.length?n.push.apply(n,v(s)):(e.forEach((function(e){n.push(e.userID)})),s.forEach((function(e){n.includes(e)||o.push(e)}))),e="success count:".concat(n.length," fail count:").concat(o.length),c.setMessage(e).end(),Oe.l("".concat(t," ok. ").concat(e)),Cn({successUserIDList:n,failureUserIDList:o})})).catch((function(e){return c.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"_getGroupMemberProfileAdvance",value:function(e){return this._grpM.req({P:jn.GET_GRP_MBR_PROFILE,data:g(g({},e),{},{memberInfoFilter:e.memberInfoFilter||this.DEFAULT_MEMBER_INFO_FILTER})})}},{key:"_updateLocalGroupMemberMap",value:function(e,t){var n=this;return Ye(t)&&0!==t.length?t.map((function(t){return n.hasLocalGroupMember(e,t.userID)?n.getLocalGroupMemberInfo(e,t.userID).updateMember(t):n.setLocalGroupMember(e,new ri(t)),n.getLocalGroupMemberInfo(e,t.userID)})):[]}},{key:"deleteLocalGroupMembers",value:function(e,t){var n=this.groupMemberListMap.get(e);n&&t.forEach((function(e){n.delete(e)}))}},{key:"getLocalGroupMemberInfo",value:function(e,t){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(t):null}},{key:"setLocalGroupMember",value:function(e,t){this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).set(t.userID,t):(t=(new Map).set(t.userID,t),this.groupMemberListMap.set(e,t))}},{key:"getLocalGroupMemberList",value:function(e){return this.groupMemberListMap.get(e)}},{key:"hasLocalGroupMember",value:function(e,t){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(t)}},{key:"hasLocalGroupMemberMap",value:function(e){return this.groupMemberListMap.has(e)}},{key:"reset",value:function(){this.groupMemberListMap.clear()}}]),ci=[17,18,20],ui=s((function e(t){o(this,e),this._grpM=t,this._n="GroupSystemNoticeHandler",this.pendencyMap=new Map}),[{key:"onNewGroupSystemNotice",value:function(e){var t=e.dataList,n=e.isSyncingEnded,o=(e=e.isInstantMessage,(Oe.d("".concat(this._n,".onReceiveSystemNotice count:").concat(t.length)),t=this._assembly({notifiesList:t,isInstantMessage:e})).eventDataList);t=t.result,0<o.length&&(this._grpM.get(11).onNewMessage({conversationOptionsList:o,isInstantMessage:e}),this._onReceivedGroupSystemNotice({result:t,isInstantMessage:e})),e?0<t.length&&this._grpM.emitOEvt(T.MESSAGE_RECEIVED,t):!0===n&&this._clearGroupSystemNotice()}},{key:"_assembly",value:function(e){var t=e.notifiesList,n=e.isInstantMessage,o=null,i=t.length,s=0,r=[],a={conversationID:S.CONV_SYSTEM,unreadCount:0,type:S.CONV_SYSTEM,subType:null,lastMessage:null};for(s=0;s<i;s++){var c=t[s],u=(l=c.groupProfile).communityType,l=void 0===(l=l.topicID)?void 0:l,p=void 0===(p=(d=c.elements).topicIDList)?void 0:p,d=d.operationType;if(!(2!==(void 0===u?0:u)||qe(l)&&qe(p))){if(ci.includes(d)){this._handleTopicSystemNotice(c);continue}qe(l)||(c.to=l)}15!==c.elements.operationType&&(c.currentUser=this._grpM.getMyUserID(),c.conversationType=S.CONV_SYSTEM,c.conversationID=S.CONV_SYSTEM,(o=new Do(c)).setElement({type:S.MSG_GRP_SYS_NOTICE,content:g(g({},c.elements),{},{groupProfile:g({},c.groupProfile)})}),o.isSystemMessage=!0,(1===o.sequence&&1===o.random||2===o.sequence&&2===o.random)&&(o.sequence=ot(),o.random=ot(),o.generateMessageID(),Oe.l("".concat(this._n,"._assembly regenerate ID:").concat(o.ID))),this._grpM.get(11).pushIntoNoticeResult(r,o))&&(n?a.unreadCount++:o.setIsRead(!0),a.subType=o.conversationSubType)}return a.lastMessage=r[r.length-1],{eventDataList:0<r.length?[a]:[],result:r}}},{key:"_clearGroupSystemNotice",value:function(){var e=this;this._getPendencyList().then((function(t){t.forEach((function(t){e.pendencyMap.set("".concat(t.from,"_").concat(t.groupID,"_").concat(t.to),t)})),t=e._grpM.get(11).getLocalMessageList(S.CONV_SYSTEM);var n=[];t.forEach((function(t){var o=(s=t.payload).operatorID,i=s.operationType,s=s.groupProfile;1===i&&(i="".concat(o,"_").concat(s.groupID,"_").concat(s.to),o=e.pendencyMap.get(i))&&Ke(o.handled)&&0!==o.handled&&n.push(t)})),e.deleteGroupSystemNotice({messageList:n})}))}},{key:"deleteGroupSystemNotice",value:function(e){var t=this,n="".concat(this._n,".deleteGroupSystemNotice");return Ye(e.messageList)&&0!==e.messageList.length?(Oe.l("".concat(n," ")+e.messageList.map((function(e){return e.ID}))),this._grpM.req({P:jn.DEL_GRP_SYSTEM_NOTICE,data:{messageListToDelete:e.messageList.map((function(e){return{from:S.CONV_SYSTEM,messageSeq:e.clientSequence,messageRandom:e.random}}))}}).then((function(){Oe.l("".concat(n," ok"));var o=t._grpM.get(11);return e.messageList.forEach((function(e){o.deleteLocalMessage(e)})),Cn()})).catch((function(e){return Oe.e("".concat(n," error:"),e),Sn(e)}))):Tn()}},{key:"_getPendencyList",value:function(){var e=this,t=(o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).type,n=o.startTime,o=o.limit;return this._grpM.req({P:jn.GET_GRP_PENDENCY,data:{type:void 0===t?void 0:t,startTime:void 0===n?0:n,limit:void 0===o?20:o,handleAccount:this._grpM.getMyUserID()}}).then((function(t){var n=t.data.pendencyList;return 0!==t.data.nextStartTime?e._getPendencyList({startTime:t.data.nextStartTime}).then((function(e){return[].concat(v(n),v(e))})):n}))}},{key:"getGroupApplicationList",value:function(){var e=this;return this._getPendencyList().then((function(t){return e._getPendencyList({type:S.GRP_COMMUNITY}).then((function(n){return t.push.apply(t,v(n)),e._handlePendencyResult(t)})).catch((function(n){return e._handlePendencyResult(t)}))}))}},{key:"_handlePendencyResult",value:function(e){var t=this,n=[];return e.forEach((function(e){t.pendencyMap.set("".concat(e.from,"_").concat(e.groupID,"_").concat(e.to),e),0===e.handled&&n.push({applicant:e.from,applicantNick:e.fromUserNickName,groupName:e.groupName,groupID:e.groupID,authentication:e.authentication,messageKey:e.time,applicationType:e.applicationType,userID:e.userID,note:e.note})})),Tn({applicationList:n})}},{key:"_onReceivedGroupSystemNotice",value:function(e){var t=this,n=e.result;e.isInstantMessage&&n.forEach((function(e){switch(e.payload.operationType){case 1:case 3:case 6:case 11:case 12:case 15:break;case 2:t._onApplyJoinGroup(e);break;case 4:t._onMemberKicked(e);break;case 5:t._onGroupDismissed(e);break;case 7:t._onInviteGroup(e);break;case 8:t._onQuitGroup(e);break;case 9:t._onSetManager(e);break;case 10:t._onDeleteManager(e);break;case 20:t._onMessageRemindTypeSynced(e);break;case 21:t._grpM.onAVChatRoomMemberBanned(e)}}))}},{key:"_onApplyJoinGroup",value:function(e){var t=this,n=(e=e.payload.groupProfile).groupID,o=(e=e.groupType,this._grpM.hasLocalGroup(n));Oe.l("".concat(this._n,"._onApplyJoinGroup groupID:").concat(n," groupType:").concat(e," hasGroup:").concat(o)),o||Mt(e)||this._grpM.getGroupProfile({groupID:n}).then((function(e){(e=e.data.group)&&(t._grpM.updateGroupMap([e]),e=!e.isSupportTopic,t._grpM.emitGroupListUpdate(!0,e))}))}},{key:"_onMemberKicked",value:function(e){e=e.payload.groupProfile.groupID,this._grpM.hasLocalGroup(e)&&this._grpM.deleteLocalGroupAndConversation(e)}},{key:"_onGroupDismissed",value:function(e){e=e.payload.groupProfile.groupID;var t=(this._grpM.hasLocalGroup(e)&&this._grpM.deleteLocalGroupAndConversation(e),this._grpM._AVChatRoomHandler);t&&t.checkJoinedAVChatRoomByID(e)&&t.reset(e)}},{key:"_onInviteGroup",value:function(e){var t=this,n=e.payload.groupProfile.groupID;e=this._grpM.hasLocalGroup(n),Oe.l("".concat(this._n,"._onInviteGroup groupID:").concat(n," hasGroup:").concat(e)),this._grpM.getGroupProfile({groupID:n}).then((function(){t._grpM.emitGroupListUpdate(),t._grpM.get(11).pullMsgOnInvite("".concat(S.CONV_GROUP).concat(n))}))}},{key:"_onQuitGroup",value:function(e){var t=(e=e.payload.groupProfile).groupID,n=(e=e.groupType,this._grpM.hasLocalGroup(t));Oe.l("".concat(this._n,"._onQuitGroup groupID:").concat(t," groupType:").concat(e," hasGroup:").concat(n)),n&&this._grpM.deleteLocalGroupAndConversation(t)}},{key:"_onSetManager",value:function(e){var t=(e=e.payload.groupProfile).to;e=e.groupID,(e=this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(e,t))&&e.updateRole(S.GRP_MBR_ROLE_ADMIN)}},{key:"_onDeleteManager",value:function(e){var t=(e=e.payload.groupProfile).to;e=e.groupID,(e=this._grpM.getGroupMemberHandler().getLocalGroupMemberInfo(e,t))&&e.updateRole(S.GRP_MBR_ROLE_MEMBER)}},{key:"_onMessageRemindTypeSynced",value:function(e){var t=e.payload.groupProfile.groupID;e=e.payload.messageRemindType,this._grpM.get(11).onGroupMsgRemindTypeUpdated({groupID:t,messageRemindType:e})}},{key:"_handleTopicSystemNotice",value:function(e){var t=(n=e.groupProfile).groupID,n=n.topicID,o=(e=e.elements).operationType,i=e.topicIDList,s=(e=e.messageRemindType,this._grpM.get(10));17===o?s.onTopicCreated({groupID:t,topicID:n}):18===o?s.onTopicDeleted({groupID:t,topicIDList:i}):20===o&&s.onMessageRemindTypeUpdated({groupID:t,topicID:n,messageRemindType:e})}},{key:"reset",value:function(){this.pendencyMap.clear()}}]),li=["relayFlag"],pi=(u(ki,Pn),s(ki,[{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("polling_interval"),t=this.getCloudConfig("polling_interval_plus"),n=this.getCloudConfig("polling_no_msg_count"),o=this.getCloudConfig("polling_simplified_msg"),i=this.getCloudConfig("paging_grp_count");Oe.l("".concat(this._n,"._onCloudConfig pollingInterval:").concat(e)+" pollingIntervalPlus:".concat(t," pollingNoMessageCount:").concat(n)+" pollingSimplifiedMessage:".concat(o," pagingGroupCount:").concat(i)),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(t),this._AVChatRoomHandler.setPollingNoMessageCount(n),this._AVChatRoomHandler.setPollingSimplifiedMessage(o),this._commonGroupHandler.setPagingGroupCount(i)}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}},{key:"guardForAVChatRoom",value:function(e){var t,n=this;return e.conversationType!==S.CONV_GROUP||(t=Tt(e.to)?Gt(e.to):e.to,this.hasLocalGroup(t))?Tn():this.getGroupProfile({groupID:t}).then((function(o){return o=o.data.group.type,Oe.l("".concat(n._n,".guardForAVChatRoom. groupID:").concat(t," type:").concat(o)),o===S.GRP_AVCHATROOM?Sn(new Bn({code:o=qn.MSG_SEND_FAIL_NOT_IN_AV,message:n.getErrMsg(o,e.from,t),data:{message:e}})):Tn()}))}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"onNewMessage",value:function(e){this._commonGroupHandler.onNewMessage(e)}},{key:"updateNextMessageSeq",value:function(e){var t,n=this;Ye(e)&&(t=this.get(10),e.forEach((function(e){var o=e.conversationID.replace(S.CONV_GROUP,"");Tt(o)&&t.updateUnreadCountAndLastMsg(o,e.lastMessage),n.groupMap.has(o)&&(n.groupMap.get(o).nextMessageSeq=e.lastMessage.sequence+1)})))}},{key:"onNewGroupTips",value:function(e){this._groupTipsHandler.onNewGroupTips(e)}},{key:"onMsgRevoked",value:function(e){this._commonGroupHandler.onMsgRevoked(e,!(1<arguments.length&&void 0!==arguments[1])||arguments[1])}},{key:"onNewGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}},{key:"onMsgReadNotice",value:function(e){var t=this;e.dataList.forEach((function(e){var n;e=e.elements.groupMessageReadNotice,lt(e)||(n=t.get(11),e.forEach((function(e){var o=e.groupID,i=void 0===(i=e.topicID)?void 0:i,s=(e=e.lastMessageSeq,Oe.l("".concat(t._n,".onMsgReadNotice groupID:").concat(o," lastMessageSeq:").concat(e)),o="".concat(S.CONV_GROUP).concat(o),!0);qe(i)||(o="".concat(S.CONV_GROUP).concat(i),s=!1),n.updateIsReadAfterReadReport({conversationID:o,lastMessageSeq:e}),n.updateUnreadCount(o,s),n.clearGroupAtInfoList(o,s)})))}))}},{key:"onReadReceiptList",value:function(e){var t=this;Oe.l("".concat(this._n,".onReadReceiptList options:"),e),e.dataList.forEach((function(e){var n=e.groupProfile,o=(e=e.elements,n=n.groupID,t.get(11));e=e.readReceiptList,o.updateReadReceiptInfo({groupID:n,readReceiptList:e})}))}},{key:"onMsgModified",value:function(e){Oe.l("".concat(this._n,".onMsgModified options:"),e);var t=this.get(11);e.dataList.forEach((function(e){t.onMessageModified(g(g({},e),{},{conversationType:S.CONV_GROUP,to:e.topicID||e.groupID}))}))}},{key:"deleteGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}},{key:"initGroupMap",value:function(e){this.groupMap.set(e.groupID,new zo(e))}},{key:"clearGroupMap",value:function(){this.groupMap.clear()}},{key:"deleteGroup",value:function(e){this.groupMap.delete(e)}},{key:"updateGroupMap",value:function(e){var t,n=this,o=this.get(11);e.forEach((function(e){t=e.groupID,n.groupMap.has(t)?n.groupMap.get(t).updateGroup(e):(n.groupMap.set(t,new zo(e)),o.deleteGroupRoamingInfo(t))}));var i,s=this.getMyUserID(),a=r(this.groupMap);try{for(a.s();!(i=a.n()).done;){var c=_(i.value,2)[1];c.selfInfo.userID=s,"Owner"===c.selfInfo.role&&(c.ownerID=s)}}catch(u){a.e(u)}finally{a.f()}}},{key:"getGroupMap",value:function(){return this.groupMap}},{key:"getLocalGroupList",value:function(){return v(this.groupMap.values()).filter((function(e){return e.type!==S.GRP_ROOM&&e.type!==S.GRP_LIVE}))}},{key:"getLocalGroupProfile",value:function(e){return this.groupMap.get(e)}},{key:"sortLocalGroupList",value:function(){var e=v(this.groupMap).filter((function(e){return(e=_(e,2))[0],!qe(e[1].lastMessage)}));e.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})),this.groupMap=new Map(v(e))}},{key:"updateGroupLastMessage",value:function(e){this._commonGroupHandler.updateLastMsg(e)}},{key:"emitGroupListUpdate",value:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],n=this.getLocalGroupList();e&&this.emitOEvt(T.GROUP_LIST_UPDATED),t&&(e=JSON.parse(JSON.stringify(n)),this.get(11).updateConvGroupProfile(e))}},{key:"getMyNameCardByGroupID",value:function(e){return(e=this.getLocalGroupProfile(e))?e.selfInfo.nameCard:""}},{key:"isPagingGetCompleted",value:function(){return this._commonGroupHandler.isPagingGetCompleted()}},{key:"getMsgRemindType",value:function(e){var t=this;return Ye(e)&&0!==e.length&&0!==(e=e.filter((function(e){return!Mt(t.getLocalGroupProfile(e).type)}))).length?(Oe.l("".concat(this._n,".getMsgRemindType groupIDList:").concat(e)),this.getGroupProfileAdvance({groupIDList:e,responseFilter:{memberInfoFilter:["MsgFlag"]}}).then((function(e){e=e.data.successGroupList;var n=t.get(11);e.forEach((function(e){n.onGroupMsgRemindTypeUpdated({groupID:e.groupID,messageRemindType:Ye(e.members)?e.members[0].messageRemindType:""})}))}))):Promise.resolve()}},{key:"getGroupList",value:function(){return this._commonGroupHandler.getGroupList()}},{key:"syncCommunityWithTopic",value:function(){return this._commonGroupHandler.syncGroupList(!0)}},{key:"getGroupProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupProfile"),o=new io("getGroupProfile"),i=e.groupID,s=e.groupCustomFieldFilter;return Oe.l("".concat(n," groupID:").concat(i)),s={groupIDList:[i],responseFilter:{groupBaseInfoFilter:v(w),groupCustomFieldFilter:s,memberInfoFilter:[].concat(v(U),["NameCard"])}},this.getGroupProfileAdvance(s).then((function(e){var s=(e=e.data).successGroupList;return e=e.failureGroupList,Oe.l("".concat(n," ok")),0<e.length?Sn(e[0]):((e=Mt(s[0].type)&&!t.hasLocalGroup(i)?new zo(s[0]):(t.updateGroupMap(s),t.getLocalGroupProfile(i))).isSupportTopic||t.get(11).updateConvGroupProfile([e]),o.setMessage("groupID:".concat(i," type:").concat(e.type," muteAllMembers:").concat(e.muteAllMembers," ownerID:").concat(e.ownerID)).end(),Cn({group:e}))})).catch((function(t){return o.setError(t).setMessage("groupID:".concat(e.groupID)).end(),Oe.e("".concat(n," failed. error:"),t),Sn(t)}))}},{key:"getGroupProfileAdvance",value:function(e){var t,n="".concat(this._n,".getGroupProfileAdvance"),o=(Ye(s=e.groupIDList)&&50<s.length&&(this.warn("GetGroupProfileLimit"),s.length=50),[]),i=[],s=(s.forEach((function(e){(Ct({groupID:e})?i:o).push(e)})),[]);return 0<o.length&&(t=this._getGroupProfileAdvance(g(g({},e),{},{groupIDList:o})),s.push(t)),0<i.length&&(t=this._getGroupProfileAdvance(g(g({},e),{},{groupIDList:i,relayFlag:0<o.length})),s.push(t)),Promise.all(s).then((function(e){var t=[],n=[];return e.forEach((function(e){t.push.apply(t,v(e.successGroupList)),n.push.apply(n,v(e.failureGroupList))})),Cn({successGroupList:t,failureGroupList:n})})).catch((function(e){return Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"_getGroupProfileAdvance",value:function(e){var t=this,n=e.relayFlag,o=void 0!==n&&n,i=f(e,li);return this.req({P:jn.GET_GRP_PROFILE,data:i}).then((function(e){return Oe.l("".concat(t._n,"._getGroupProfileAdvance ok. options:"),i),{successGroupList:(e=e.data.groups).filter((function(e){return lt(e.errorCode)||0===e.errorCode})),failureGroupList:e.filter((function(e){return e.errorCode&&0!==e.errorCode})).map((function(e){return new Bn({code:e.errorCode,message:e.errorInfo,data:{groupID:e.groupID}})}))}})).catch((function(t){return o&&Ct({groupID:e.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Sn(t)}))}},{key:"createGroup",value:function(e){var t=this,n=[S.GRP_PUBLIC,S.GRP_WORK,S.GRP_MEETING,S.GRP_AVCHATROOM,S.GRP_COMMUNITY],o="".concat(this._n,".").concat("createGroup"),i=e.type,s=e.groupID;if(e.name&&!1===this._filterProfanity("name",e))return Sn({code:qn.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Sn({code:qn.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Sn({code:qn.PROFANITY_FOUND});if(!n.includes(i))return Sn({code:qn.ILLEGAL_GRP_TYPE});if(!Ct({type:i})){if(!qe(s)&&Ct({groupID:s}))return Sn({code:qn.ILLEGAL_GRP_ID});e.isSupportTopic=void 0}if(Mt(i)&&!lt(e.memberList)&&0<e.memberList.length&&(e.memberList=void 0),this._canIUseJoinOption(i)||lt(e.joinOption)||(e.joinOption=void 0),Ct({type:i})){if(!qe(s)&&!Ct({groupID:s}))return Sn({code:qn.ILLEGAL_GRP_ID});e.isSupportTopic=!0===e.isSupportTopic?1:0}var r=new io("createGroup"),a=(Oe.l("".concat(o," options:"),e),null),c=[];return this.req({P:jn.CREATE_GRP,data:g(g({},e),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then((function(n){var i,s,u,l=(n=n.data).groupID,p=void 0===(n=n.overLimitUserIDList)?[]:n;return a=l,c=p,n="groupType:".concat(e.type," groupID:").concat(l," overLimitUserIDList:").concat(p),r.setMessage(n).end(),Oe.l("".concat(o," ok. ").concat(n)),e.type===S.GRP_AVCHATROOM||e.type===S.GRP_COMMUNITY&&1===e.isSupportTopic||(qe(e.memberList)||qe(p)||(e.memberList=e.memberList.filter((function(e){return-1===p.indexOf(e.userID)}))),t.updateGroupMap([g(g({},e),{},{groupID:l})]),n=t.get(2),u="",i=0,e.type===S.GRP_COMMUNITY?(u=t.isIntl()?"Create Community":"创建社群",i=1):u=t.isIntl()?"Create Group":"创建群组",s=t.get(4).getMyNick(),u=n.createCustomMessage({to:l,conversationType:S.CONV_GROUP,payload:{data:JSON.stringify({businessID:"group_create",content:u,cmd:i,opUser:s||t.getMyUserID(),version:4})}}),n.sendMessageInstance(u),t.emitGroupListUpdate()),t.getGroupProfile({groupID:l})})).then((function(e){var t=(n=(e=e.data.group).selfInfo).nameCard,n=n.joinTime;return e.updateSelfInfo({nameCard:t,joinTime:n,messageRemindType:S.MSG_REMIND_ACPT_AND_NOTE,role:S.GRP_MBR_ROLE_OWNER}),Cn({group:e,overLimitUserIDList:c})})).catch((function(n){var i;return r.setMessage("groupType:".concat(e.type)).setError(n).end(),10010===n.code||10007===n.code?(t._silentlyGetGroupProfile(n.code,a),t.updateGroupMap([g(g({},e),{},{groupID:a})]),(i=t.getLocalGroupProfile(a)).selfInfo.role=S.GRP_MBR_ROLE_OWNER,Cn({group:i,overLimitUserIDList:c})):(Oe.e("".concat(o," failed. error:"),n),Sn(n))}))}},{key:"dismissGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("dismissGroup"),o="groupID:".concat(e),i=new io("dismissGroup");return i.setMessage(o),Oe.l("".concat(n," ").concat(o)),this.req({P:jn.DISMISS_GRP,data:{groupID:e}}).then((function(){return i.end(),Oe.l("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),t.checkJoinedAVChatRoomByID(e)&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),Cn({groupID:e})})).catch((function(e){return i.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"updateGroupProfile",value:function(e){var t,n,o=this,i="".concat(this._n,".").concat("updateGroupProfile");return this.hasLocalGroup(e.groupID)&&(t=this.getLocalGroupProfile(e.groupID).type,this._canIUseJoinOption(t)||lt(e.joinOption)||(Oe.w("".concat(i," joinOption is unavailable for Work/Meeting/AVChatRoom")),e.joinOption=void 0)),lt(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers="On":e.muteAllMembers="Off"),e.name&&!1===this._filterProfanity("name",e)||e.introduction&&!1===this._filterProfanity("introduction",e)||e.notification&&!1===this._filterProfanity("notification",e)?Sn({code:qn.PROFANITY_FOUND}):((n=new io("updateGroupProfile")).setMessage(JSON.stringify(e)),Oe.l("".concat(i," groupID:").concat(e.groupID)),this.req({P:jn.UPDATE_GRP_PROFILE,data:e}).then((function(){return n.end(),Oe.l("".concat(i," ok")),o.hasLocalGroup(e.groupID)&&o.groupMap.get(e.groupID).updateGroup(e),Cn({group:o.groupMap.get(e.groupID)})})).catch((function(e){return n.setError(e).end(),Oe.l("".concat(i," failed. error:"),e),Sn(e)})))}},{key:"_filterProfanity",value:function(e,t){var n,o=this.get(29);return!o||(n=(o=o.filterText(t[e],x)).isAllowedToSend,o=o.modifiedText,!0===n&&(t[e]=o,!0))}},{key:"joinGroup",value:function(e){var t,n=this,o=e.groupID,i="".concat(this._n,".joinGroup");return this.deleteUnjoinedAVChatRoom(o),this.hasLocalGroup(o)?this.isLoggedIn()?(t=new io("applyJoinGroup"),this.getGroupProfile({groupID:o}).then((function(){return t.setMessage("groupID:".concat(o," joinedStatus:").concat(S.JOIN_STATUS_ALREADY_IN_GROUP)).end(),Tn({status:S.JOIN_STATUS_ALREADY_IN_GROUP})})).catch((function(s){return t.setMessage("groupID:".concat(o," unjoined")).end(),Oe.w("".concat(i," ").concat(o," was unjoined, now join!")),n.groupMap.delete(o),n.applyJoinGroup(e)}))):Tn({status:S.JOIN_STATUS_ALREADY_IN_GROUP}):(Oe.l("".concat(i," groupID:").concat(o)),this.isLoggedIn()?this.applyJoinGroup(e):this._AVChatRoomHandler.joinWithoutAuth(e))}},{key:"applyJoinGroup",value:function(e){var t,n,o=this,i="".concat(this._n,".").concat("applyJoinGroup"),s=e.groupID;return qe(e.applyMessage)||!1!==this._filterProfanity("applyMessage",e)?(t=new io("applyJoinGroup"),e=g({},e),(n=this.canIUse(N.AV_HISTORY_MSG))&&(e.historyMessageFlag=1),this.get(11).deleteTopicRoamingInfo(s),this.req({P:jn.APPLY_JOIN_GRP,data:e}).then((function(e){var r=(e=e.data).joinedStatus,a=e.longPollingKey,c=e.startSeq,u=e.avChatRoomFlag,l=e.avChatRoomKey,p=e.messageList;switch(e="groupID:".concat(s," joinedStatus:").concat(r," longPollingKey:").concat(a," startSeq:").concat(c)+" avChatRoomFlag:".concat(u," canGetAVChatRoomHistoryMsg:").concat(n,",")+" historyMsgCount:".concat(qe(p)?0:p.length),t.setMessage(e).end(),Oe.l("".concat(i," ok. ").concat(e)),r){case Ge:return Cn({status:Ge});case Ue:return o.getGroupProfile({groupID:s}).then((function(e){return e=e.data.group,o._handleJoinResult({group:e,avChatRoomFlag:u,longPollingKey:a,startSeq:c,avChatRoomKey:l,messageList:p})})).catch((function(e){var t;return 10010===e.code||10007===e.code?(o._silentlyGetGroupProfile(e.code,s),t=new zo({groupID:s}),o.updateGroupMap([t]),o._handleJoinResult({group:t,avChatRoomFlag:u,longPollingKey:a,startSeq:c,avChatRoomKey:l,messageList:p})):(Oe.e("".concat(i," failed. error:"),e),Sn(e))}));default:var d=new Bn({code:qn.JOIN_GRP_FAIL});return Oe.e("".concat(i," failed. error:"),d),Sn(d)}})).catch((function(e){return t.setMessage("groupID:".concat(s)).setError(e).end(),Oe.e("".concat(i," failed. error:"),e),Sn(e)}))):Sn({code:qn.PROFANITY_FOUND})}},{key:"_handleJoinResult",value:function(e){var t=this,n=e.group,o=e.avChatRoomFlag,i=e.longPollingKey,s=e.startSeq,r=e.avChatRoomKey,a=e.messageList,c=n.groupID;return 1===o?(this.get(11).setCompleted("".concat(S.CONV_GROUP).concat(c)),this._groupAttributesHandler.initGroupAttributesCache({groupID:c,avChatRoomKey:r}),this._groupCountersHandler.initGroupCountersCache({groupID:c,avChatRoomKey:r}),(e=lt(i)?this._AVChatRoomHandler.handleJoinResult({group:n}):this._AVChatRoomHandler.startRunLoop({group:n,longPollingKey:i,startSeq:s})).then((function(){t._onAVChatRoomHistoryMessage(a,c)})),e):(this.emitGroupListUpdate(!0,!1),Cn({status:Ue,group:n}))}},{key:"quitGroup",value:function(e){var t,n=this,o="".concat(this._n,".").concat("quitGroup"),i="groupID:".concat(e),s=(Oe.l("".concat(o," ").concat(i)),this.checkJoinedAVChatRoomByID(e));return s||this.hasLocalGroup(e)?s&&!this.isLoggedIn()?(Oe.l("".concat(o," anonymously ok. ").concat(i)),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),Tn({groupID:e})):((t=new io("quitGroup")).setMessage(i),this.req({P:jn.QUIT_GRP,data:{groupID:e}}).then((function(){return t.end(),Oe.l("".concat(o," ok")),n.deleteLocalGroupAndConversation(e),s&&n._AVChatRoomHandler.reset(e),n._groupAttributesHandler.deleteLocalGroupAttributes(e),Cn({groupID:e})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(o," failed. error:"),e),Sn(e)}))):Sn({code:qn.MEMBER_NOT_IN_GRP})}},{key:"searchGroupByID",value:function(e){var t="".concat(this._n,".").concat("searchGroupByID"),n={groupIDList:[e]},o=new io("searchGroupByID");return o.setMessage("groupID:".concat(e)),Oe.l("".concat(t," groupID:").concat(e)),this.req({P:jn.SEARCH_GRP,data:n}).then((function(e){if(0!==(e=e.data.groupProfile)[0].errorCode)throw new Bn({code:e[0].errorCode,message:e[0].errorInfo});return o.end(),Oe.l("".concat(t," ok")),Cn({group:new zo(e[0])})})).catch((function(e){return o.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"changeGroupOwner",value:function(e){var t,n=this,o="".concat(this._n,".").concat("changeGroupOwner");return this.hasLocalGroup(e.groupID)&&this.getLocalGroupProfile(e.groupID).type===S.GRP_AVCHATROOM?Sn({code:qn.CANNOT_CHANGE_OWNER_IN_AV}):e.newOwnerID===this.getMyUserID()?Sn({code:qn.CANNOT_CHANGE_OWNER_TO_SELF}):((t=new io("changeGroupOwner")).setMessage("groupID:".concat(e.groupID," newOwnerID:").concat(e.newOwnerID)),Oe.l("".concat(o," groupID:").concat(e.groupID)),this.req({P:jn.CHANGE_GRP_OWNER,data:e}).then((function(){t.end(),Oe.l("".concat(o," ok"));var i,s=e.groupID,r=e.newOwnerID,a=(n.groupMap.get(s).ownerID=r,n._groupMemberHandler.getLocalGroupMemberList(s));return a instanceof Map&&(i=a.get(n.getMyUserID()),lt(i)||(i.updateRole("Member"),n.groupMap.get(s).selfInfo.role="Member"),i=a.get(r),lt(i)||i.updateRole("Owner")),n.emitGroupListUpdate(!0,!1),Cn({group:n.groupMap.get(s)})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(o," failed. error:"),e),Sn(e)})))}},{key:"getGroupApplicationList",value:function(){return this._groupSystemNoticeHandler.getGroupApplicationList()}},{key:"handleGroupApplication",value:function(e){var t,n,o,i,s,r=this,a="".concat(this._n,".").concat("handleGroupApplication"),c=e.handleAction,u=e.handleMessage,l=e.message,p=e.application,d=(l?(t=l.payload.operatorID,n=l.payload.groupProfile.groupID,o=l.payload.authentication,i=l.payload.messageKey):p&&(t=p.applicant,n=p.groupID,o=p.authentication,i=p.messageKey),jn.HANDLE_GRP_APPLICATION),h=(p&&2===p.applicationType&&(d=jn.HANDLE_INVITE_JOIN_GRP,s=p.userID),new io("handleGroupApplication"));return h.setMessage("groupID:".concat(n)),Oe.l("".concat(a," groupID:").concat(n)),this.req({P:d,data:{handleAction:c,handleMessage:u,applicant:t,invitee:s,groupID:n,authentication:o,messageKey:i}}).then((function(){return h.end(),Oe.l("".concat(a," ok")),l&&r._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Cn({group:r.getLocalGroupProfile(n)})})).catch((function(e){return h.setError(e).end(),Oe.e("".concat(a," failed. error"),e),Sn(e)}))}},{key:"handleGroupInvitation",value:function(e){var t=this,n="".concat(this._n,".").concat("handleGroupInvitation"),o=(r=e.message.payload).groupProfile.groupID,i=r.authentication,s=r.messageKey,r=r.operatorID,a=e.handleAction,c=new io("handleGroupInvitation");return c.setMessage("groupID:".concat(o," inviter:").concat(r," handleAction:").concat(a)),Oe.l("".concat(n," groupID:").concat(o," inviter:").concat(r," handleAction:").concat(a)),this.req({P:jn.HANDLE_GRP_INVITATION,data:g(g({},e),{},{inviter:r,groupID:o,authentication:i,messageKey:s})}).then((function(){return c.end(),Oe.l("".concat(n," ok")),t._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Cn({group:t.getLocalGroupProfile(o)})})).catch((function(e){return c.setError(e).end(),Oe.e("".concat(n," failed. error"),e),Sn(e)}))}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this,n="".concat(this._n,".getGroupOnlineMemberCount"),o=this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e),i=this.hasLocalGroup(e);if(Oe.l("".concat(n," groupID:").concat(e," isAVChatRoom:").concat(o," has:").concat(i)),o)return this._AVChatRoomHandler.getGroupOnlineMemberCount(e);if(!i)return Tn({memberCount:0});if(o=Date.now(),this._onlineMemberCountMap.has(e)){if(o-(i=this._onlineMemberCountMap.get(e)).lastReqTime<=6e4)return Tn({memberCount:i.memberCount});i.lastReqTime=o}return this.requestOnlineCount(e).then((function(o){return o=void 0===(o=o.data.memberCount)?0:o,t._onlineMemberCountMap.set(e,{lastReqTime:Date.now(),memberCount:o}),Oe.l("".concat(n," ok. groupID:").concat(e," memberCount:").concat(o)),Tn({memberCount:o})})).catch((function(e){return Oe.w("".concat(n," failed. error:"),e),Promise.reject(e)}))}},{key:"requestOnlineCount",value:function(e){return this.req({P:jn.GET_ONLINE_MBR_NUM,data:{groupID:e}})}},{key:"hasLocalGroup",value:function(e){return this.groupMap.has(e)}},{key:"deleteLocalGroupAndConversation",value:function(e){var t=this.checkJoinedAVChatRoomByID(e),n=(Oe.l("".concat(this._n,".deleteLocalGroupAndConversation groupID:").concat(e," isJoinedAVChatRoom:").concat(t)),this.get(11)),o="".concat(S.CONV_GROUP).concat(e);t&&(this.stopMessageLongPolling({groupID:e}),n.deleteLocalConv(o)),Ct({groupID:e})&&(t=this.getLocalGroupProfile(e))&&!0===t.isSupportTopic&&this.get(10).deleteTopicListInCommunity(e),n.clearUnreadCount(o),n.setCompleted(o),this._deleteLocalGroup(e),this._onlineMemberCountMap.delete(e),this.emitGroupListUpdate(!0,!1)}},{key:"_deleteLocalGroup",value:function(e){this.groupMap.delete(e),this._groupMemberHandler.deleteGroupMemberList(e)}},{key:"sendMessage",value:function(e,t){return Ye(e._receiverList)&&0<e._receiverList.length&&!this.canIUse(N.MSG_TO_SPECIFIED_GRP_MBR)?this.noUse("Targeted Group Message"):(e=this.createGroupMessagePack(e,t),this.req(e))}},{key:"createGroupMessagePack",value:function(e,t){var n=null,o=(t&&t.offlinePushInfo&&(n=t.offlinePushInfo),""),i=(ut(e.cloudCustomData)&&0<e.cloudCustomData.length&&(o=e.cloudCustomData),[]),s=void(ze(t)&&ze(t.messageControlInfo)&&(s=(a=t.messageControlInfo).excludedFromUnreadCount,r=a.excludedFromLastMessage,a=a.excludedFromContentModeration,!0===s&&i.push("NoUnread"),!0===r&&i.push("NoLastMsg"),!0===a)&&i.push("NoMsgCheck")),r=(Ye(e._receiverList)&&0<e._receiverList.length&&(s=e._receiverList,50<e._receiverList.length)&&(s=e._receiverList.slice(0,50),this.warn("ReceiverListLimit")),this.isOnlineMessage(e,t)?1:0),a=JSON.parse(JSON.stringify(e.getElements())),c=this.get(17).getFileDNList(),u=e.getGroupAtInfoList();return a={fromAccount:this.getMyUserID(),groupID:e.to,msgBody:uo(e.type,a,c),cloudCustomData:o,random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:e.type!==S.MSG_TEXT||qe(u)?void 0:u,onlineOnlyFlag:r,clientTime:e.clientTime,offlinePushInfo:Po(n),messageControlInfo:0==r?i:void 0,needReadReceipt:!0!==e.needReadReceipt||this.isMessageFromOrToAVChatroom(e.to)?0:1,receiverList:s,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0,cmConfigID:e._cmConfigID,forbidCallbackControl:yt(t)},Tt(e.to)&&(a.groupID=Gt(e.to),a.topicID=e.to),{P:jn.SEND_GRP_MSG,data:a}}},{key:"revokeMessage",value:function(e){var t={groupID:e.to,msgSeqList:[{msgSeq:e.sequence}]};return Tt(e.to)&&(t.groupID=Gt(e.to),t.topicID=e.to),this.req({P:jn.REVOKE_GRP_MSG,data:t})}},{key:"deleteMessage",value:function(e){var t=e.to;return e=e.keyList,Oe.l("".concat(this._n,".deleteMessage groupID:").concat(t," count:").concat(e.length)),e={groupID:t,deleter:this.getMyUserID(),keyList:e},Tt(t)&&(e.groupID=Gt(t),e.topicID=t),this.req({P:jn.DEL_GRP_MSG,data:e})}},{key:"modifyRemoteMessage",value:function(e){var t=e.to,n=e.sequence,o=e.payload,i=e.type,s=void 0===(s=e.version)?0:s,r=e.cloudCustomData,a=(e=e._elements,t),c=void 0;return t=void(Tt(t)&&(a=Gt(t),c=t)),Bt(i)&&(1<e.length&&e.splice(0,1,{type:i,content:o}),t=e),this.req({P:jn.MODIFY_GRP_MSG,data:{groupID:a,topicID:c,sequence:n,version:s,elements:t,cloudCustomData:r}})}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._n,".").concat("getRoamingMessage"),o=e.conversationID,i=e.groupID,s=(e=e.sequence,new io("getRoamingMessage")),r=0,a=void 0;return Tt(i)&&(i=Gt(a=i)),this._computeLastSequence({groupID:i,topicID:a,sequence:e}).then((function(e){return r=e,Oe.l("".concat(n," groupID:").concat(i," startSequence:").concat(r)),t.req({P:jn.GET_GRP_ROAMING_MSG,data:{groupID:i,count:21,sequence:r,topicID:a}})})).then((function(e){var c=(l=e.data).messageList,u=l.complete,l=void 0===(l=l.invisibleSequenceList)?[]:l,p=(e=void 0===(e=e.data.nextSequence)?0:e,lt(c)?Oe.l("".concat(n," ok. complete:").concat(u," nextSequence:").concat(e," but messageList is undefined!")):Oe.l("".concat(n," ok. complete:").concat(u," nextSequence:").concat(e," count:").concat(c.length)),s.setMessage("groupID:".concat(i," topicID:").concat(a," startSequence:").concat(r," complete:").concat(u," nextSequence:").concat(e)).end(),t.get(11)),d=[],h=[];return qe(c)||(d=p.onRoamingMessage(c,o,!0,h),p.updateIsRead(o),p.patchConvLastMessage(o)),(c=2===u||e<1)&&(p.setCompleted(o),e=""),Oe.l("".concat(n," isPullingCompleted:").concat(c," nextReqID:").concat(e," storedMsgCount:").concat(d.length)+" invisibleSeqCount:".concat(l.length)),{nextReqID:e+"",storedMessageList:d,assembledMessageList:h,isPullingCompleted:c}})).catch((function(e){return s.setError(e).setMessage("groupID:".concat(i," topicID:").concat(a," startSequence:").concat(r)).end(),Oe.w("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"_getGroupIDOfMessage",value:function(e){return e.conversationID.replace(S.CONV_GROUP,"")}},{key:"getReadReceiptList",value:function(e){var t,n="".concat(this._n,".").concat("getReadReceiptList"),o=this._getGroupIDOfMessage(e[0]),i=this.getMyUserID(),s=e.filter((function(e){return e.from===i&&!0===e.needReadReceipt})).map((function(e){return{sequence:e.sequence}}));return Oe.l("".concat(n," groupID:").concat(o," sequenceList:").concat(JSON.stringify(s))),0===s.length?Tn({messageList:e}):((t=new io("getReadReceiptList")).setMessage("groupID:".concat(o)),this.req({P:jn.GET_READ_RECEIPT,data:{groupID:o,sequenceList:s}}).then((function(o){return t.end(),Oe.l("".concat(n," ok")),Ye(o=o.data.readReceiptList)&&o.forEach((function(t){e.forEach((function(e){0===t.code&&t.sequence===e.sequence&&(e.readReceiptInfo.readCount=t.readCount,e.readReceiptInfo.unreadCount=t.unreadCount)}))})),Cn({messageList:e})})).catch((function(e){return t.setError(e).end(),Oe.w("".concat(n," failed. error:"),e),Sn(e)})))}},{key:"sendReadReceipt",value:function(e){var t="".concat(this._n,".").concat("sendReadReceipt"),n=this._getGroupIDOfMessage(e[0]),o=new io("sendReadReceipt"),i=(o.setMessage("groupID:".concat(n)),this.getMyUserID());return 0===(e=e.filter((function(e){return e.from!==i&&!0===e.needReadReceipt})).map((function(e){return{sequence:e.sequence}}))).length?Sn({code:qn.READ_RECEIPT_MSG_LIST_EMPTY}):(Oe.l("".concat(t,". sequenceList:").concat(JSON.stringify(e))),this.req({P:jn.SEND_READ_RECEIPT,data:{groupID:n,sequenceList:e}}).then((function(e){return o.end(),Oe.l("".concat(t," ok")),Cn()})).catch((function(e){return o.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)})))}},{key:"getReadReceiptDetail",value:function(e){var t=this,n=e.message,o=e.filter,i=e.cursor,s=(e=e.count,this._getGroupIDOfMessage(n)),r=n.ID,a=(n=n.sequence,"".concat(this._n,".").concat("getReadReceiptDetail")),c=this._receiptDetailCompleteMap.get(r)||!1,u=0!==o&&1!==o?0:o,l=(o=ut(i)?i:"",i=!Ke(e)||e<=0||100<=e?100:e,e="groupID:".concat(s," sequence:").concat(n," cursor:").concat(o," filter:").concat(u," completeFlag:").concat(c),Oe.l("".concat(a," ").concat(e)),{cursor:"",isCompleted:!1,messageID:r,unreadUserIDList:[],readUserIDList:[]}),p=new io("getReadReceiptDetail");return p.setMessage(e),this.req({P:jn.GET_READ_RECEIPT_DETAIL,data:{groupID:s,sequence:n,flag:u,cursor:o,count:i}}).then((function(e){p.end();var n=(e=e.data).cursor,o=e.isCompleted,i=e.unreadUserIDList;return e=e.readUserIDList,l.cursor=n,1===o&&(l.isCompleted=!0,t._receiptDetailCompleteMap.set(r,!0)),0===u?l.readUserIDList=e.map((function(e){return e.userID})):1===u&&(l.unreadUserIDList=i.map((function(e){return e.userID}))),Oe.l("".concat(a," ok")),Cn(l)})).catch((function(e){return p.setError(e).end(),Oe.w("".concat(a," failed. error:"),e),Sn(e)}))}},{key:"getGroupReceiptsByUsers",value:function(e){var t="".concat(this._n,".").concat("getGroupReceiptsByUsers"),n=e.groupID,o=(e=void 0===(e=e.dataList)?[]:e,"groupID:".concat(n," dataList length:").concat(e.length));return Oe.l("".concat(t," ").concat(o)),0===e.length&&Oe.w("".concat(t," dataList is empty.")),this.req({P:jn.GET_GRP_RECEIPTS_BY_USERS,data:{groupID:n,dataList:e}}).then((function(e){return e=void 0===(e=e.data.dataList)?[]:e,Oe.l("".concat(t," ok.")),Cn({dataList:e})})).catch((function(e){return Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._n,".").concat("getRoamingMessagesHopping"),o=e.groupID,i=e.count,s=e.sequence,r=e.direction,a=void 0;return lt(s)&&1===r?Tn({messageList:[],isCompleted:!0,nextMessageSeq:""}):(Tt(o)&&(o=Gt(a=o)),this._computeReqSeqHopping({groupID:o,topicID:a,sequence:s}).then((function(c){lt(s)||1!==r||(c=s+i-1);var u="".concat(a?"topicID:".concat(a):"groupID:".concat(o)," sequence:").concat(s," reqSeq:").concat(c," direction:").concat(r),l=(Oe.l("".concat(n," ").concat(u)),new io("getRoamingMessagesHopping"));return t.req({P:jn.GET_GRP_ROAMING_MSG,data:{groupID:o,topicID:a,count:i,sequence:c}}).then((function(o){var i=void 0===(i=(o=o.data).messageList)?[]:i,a=o.complete,c=void 0===(c=o.nextSequence)?0:c,p=(o=void 0===(o=o.invisibleSequenceList)?[]:o,"complete:".concat(a," nextSequence:").concat(c," remoteMsgCount:").concat(i.length," invisibleSequenceList:").concat(o)),d=(l.setMessage("".concat(u," ").concat(p)).end(),Oe.l("".concat(n," ok. ").concat(p)),p="".concat(S.CONV_GROUP).concat(e.groupID),t.get(11));return p=d.onRoamingMessage(i,p,!1),i=t._computeResult({groupID:e.groupID,direction:r,sequence:s,remoteMessageList:i,processedMessageList:p,complete:a,nextSequence:c,invisibleSequenceList:o}),d.storeHoppingMessageList(i.messageList),Cn(i)})).catch((function(e){return l.setError(e).setMessage("groupID:".concat(o," sequence:").concat(s," count:").concat(i)).end(),Oe.w("".concat(n," failed. error:"),e),Sn(e)}))})))}},{key:"_computeReqSeqHopping",value:function(e){var t=this,n=e.groupID,o=void 0===(o=e.topicID)?void 0:o;return 0<(e=void 0===(e=e.sequence)?void 0:e)?Promise.resolve(e):lt(o)?this.getGroupProfileAdvance({groupIDList:[n],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}}).then((function(e){var o=0;return qe(e=e.data.successGroupList)||(o=e[0].nextMessageSeq-1),Oe.l("".concat(t._n,"._computeReqSeqHopping groupID:").concat(n," lastSequence:").concat(o," from remote")),o})).catch((function(e){return Sn(e)})):Promise.resolve(0)}},{key:"_computeResult",value:function(e){var t={messageList:[],isCompleted:!1,nextMessageSeq:""},n=e.groupID,o=e.direction,i=e.sequence,s=void 0===(s=e.remoteMessageList)?[]:s,r=void 0===(r=e.processedMessageList)?[]:r,a=e.complete,c=e.nextSequence;if(e=e.invisibleSequenceList,0===o)return t.nextMessageSeq=c,(2===a||c<1)&&(t.isCompleted=!0,t.nextMessageSeq=""),t.messageList=r,t;if(1===o){if(qe(s)){if(qe(e))return t.isCompleted=!0,t.nextMessageSeq="",t;t.nextMessageSeq=e[0]+1}else a=s[0].sequence,c=e[0]||0,t.nextMessageSeq=c<a?a+1:c+1;return r.forEach((function(e){e.sequence>=i&&t.messageList.push(e)})),(Ct({groupID:n})||Tt(n))&&0===t.messageList.length&&s[0].sequence<i&&(t.isCompleted=!0,t.nextMessageSeq=""),t}}},{key:"setMessageRead",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageSeq,i="".concat(this._n,".").concat("setMessageRead"),s=(e="convID:".concat(n," lastMessageSeq:").concat(o),Oe.l("".concat(i," ").concat(e)),Ke(o)||this.warn("DoNotModifyLastSeq"),new io("setMessageRead")),r=(s.setMessage(e),n.replace(S.CONV_GROUP,"")),a=void 0;return Tt(r)&&(r=Gt(a=r)),this.req({P:jn.SET_GRP_MSG_READ,data:{groupID:r,topicID:a,messageReadSeq:o}}).then((function(){s.end(),Oe.l("".concat(i," ok"));var e,c=t.get(11),u=(c.updateIsReadAfterReadReport({conversationID:n,lastMessageSeq:o}),!0);return!lt(a)&&(u=!1,e=t.get(10).getLocalTopic(r,a))&&e.updateSelfInfo({readedSequence:o}),c.updateUnreadCount(n,u),Cn()})).catch((function(e){return s.setError(e).end(),Oe.l("".concat(i," failed. error:"),e),Sn(e)}))}},{key:"_computeLastSequence",value:function(e){var t=e.groupID,n=void 0===(n=e.topicID)?void 0:n;return 0<(e=e.sequence)?Promise.resolve(e):lt(n)?this.getGroupLastSequence(t):Promise.resolve(0)}},{key:"getGroupLastSequence",value:function(e){var t="".concat(this._n,".").concat("getGroupLastSequence"),n=new io("getGroupLastSequence"),o=0,i="",s="groupID:".concat(e);if(this.hasLocalGroup(e)){var r=this.getLocalGroupProfile(e),a=r.lastMessage;if(0<a.lastSequence&&!1===a.onlineOnlyFlag)return o=a.lastSequence,i="".concat(s,", ").concat(o," from group.lastMessage.lastSequence"),Oe.l("".concat(t," ").concat(i)),n.setMessage(i).end(),Promise.resolve(o);if(1<r.nextMessageSeq)return o=r.nextMessageSeq-1,i="".concat(s,", ").concat(o," from group.nextMessageSeq"),Oe.l("".concat(t," ").concat(i)),n.setMessage(i).end(),Promise.resolve(o)}return(a=this.get(11).getLocalConversation("GROUP".concat(e)))&&a.lastMessage.lastSequence&&!1===a.lastMessage.onlineOnlyFlag?(o=a.lastMessage.lastSequence,i="".concat(s,", ").concat(o," from conversation.lastMessage.lastSequence"),Oe.l("".concat(t," ").concat(i)),n.setMessage(i).end(),Promise.resolve(o)):this.getGroupProfileAdvance({groupIDList:[e],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}}).then((function(e){return qe(e=e.data.successGroupList)?Oe.w("".concat(t," ").concat(s,", empty successGroupList")):(o=e[0].nextMessageSeq-1,i="".concat(s,", ").concat(o," from remote"),Oe.l("".concat(t," ").concat(i))),n.setMessage(i).end(),o})).catch((function(e){return n.setError(e).setMessage(s).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"isMessageFromOrToAVChatroom",value:function(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"hasJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler.hasJoinedAVChatRoom()}},{key:"getJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler.getJoinedAVChatRoom()}},{key:"getGroupRemoteLastSeq",value:function(e){return(e=this.getLocalGroupProfile(e))?e.nextMessageSeq-1:1}},{key:"isOnlineMessage",value:function(e,t){return!(!this._canIUseOnlineOnlyFlag(e)||!t||!0!==t.onlineUserOnly)}},{key:"_canIUseOnlineOnlyFlag",value:function(e){var t=this.getJoinedAVChatRoom();return!t||!t.includes(e.to)||e.conversationType!==S.CONV_GROUP}},{key:"_onAVChatRoomHistoryMessage",value:function(e,t){var n;qe(e)||(Oe.l("".concat(this._n,"._onAVChatRoomHistoryMessage groupID:").concat(t," count:").concat(e.length)),n=[],e.forEach((function(e){n.push(g(g({},e),{},{isHistoryMessage:1}))})),this.onAVChatRoomMessage(n,t))}},{key:"onAVChatRoomMessage",value:function(e){this._AVChatRoomHandler.onMessage(e,1<arguments.length&&void 0!==arguments[1]?arguments[1]:"")}},{key:"onAVChatRoomMemberBanned",value:function(e){this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}},{key:"setUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.set(e,1)}},{key:"deleteUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}},{key:"isUnjoinedAVChatRoom",value:function(e){return this._unjoinedAVChatRoomList.has(e)}},{key:"isGroupAttributesUpdatedNotice",value:function(e){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e)}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:"initGroupAttributes",value:function(e){return this._groupAttributesHandler.initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._groupAttributesHandler.setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._groupAttributesHandler.getGroupAttributes(e)}},{key:"isMessageFromTopic",value:function(e,t){return 2===e&&!qe(t)}},{key:"isMessageFromCommunityOfTopic",value:function(e,t){return 2===e&&qe(t)}},{key:"getMessageExtensions",value:function(e,t){return Oe.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t)),this.req({P:jn.GET_GRP_MSG_EXT,data:{groupID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:"modifyMsgExts",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1;return Oe.l("".concat(this._n,".modifyMsgExts operateType:").concat(n)),this.req({P:jn.MODIFY_GRP_MSG_EXT,data:{groupID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:"_genNotifyReqList",value:function(e){for(var t,n,o,i,s=[],r=0,a=e.length;r<a;r++)t=e[r],i=this.getLocalGroupProfile(t).type,n=this._getGroupLastRevokedTime(t),o=1e3*ke(),i={notifyType:1,limit:20,type:Ct({type:i,groupID:t})?S.GRP_COMMUNITY:void 0,groupID:t,beginTime:n,endTime:o},s.push(i);return s}},{key:"getNotice",value:function(e){var t=this,n="".concat(this._n,".getNotice");0!==(e=e.filter((function(e){var n;return!!t.hasLocalGroup(e)&&(n=(e=t.getLocalGroupProfile(e)).type,e=e.isSupportTopic,!Mt(n))&&!e}))).length&&(Oe.l("".concat(n," list:").concat(e)),this.req({P:jn.GET_GRP_NOTIFY,data:{notifyReqList:this._genNotifyReqList(e)}}).then((function(e){e=e.data.notifyRspList;var o,i,s=[];Ye(e)&&(o={dataList:[]},i="".concat(n," ok."),e.forEach((function(e){var n=e.nextRevokedTime,r=e.groupID,a=e.notifyList;i+=" groupID:".concat(r," nextRevokedTime:").concat(n," count:").concat(a.length,"\n"),o.dataList.push({elements:{revokedInfos:t._genRevokedInfos(e)}}),0!==n?(t._setGroupLastRevokedTime(r,n),s.push(r)):t._setGroupLastRevokedTime(r,1e3*ke())})),Oe.l(i),t.onMsgRevoked(o,!1)),0<s.length&&t.getNotice(s)})).catch((function(e){Oe.e("".concat(n," failed. error:"),e)})))}},{key:"_genRevokedInfos",value:function(e){var t=e.notifyList,n=e.groupID,o=[];return Ye(t)&&t.forEach((function(e){o.push({groupID:n,sequence:e.sequence,random:e.random,revokerInfo:g({},e.revokerInfo)})})),o}},{key:"_getGroupLastRevokedTime",value:function(e){return this.hasLocalGroup(e)?this.getLocalGroupProfile(e)._lastRevokedTime:0}},{key:"_setGroupLastRevokedTime",value:function(e,t){this.hasLocalGroup(e)&&(this.getLocalGroupProfile(e)._lastRevokedTime=t)}},{key:"isGroupCountersNotice",value:function(e){return this._groupCountersHandler.isGroupCountersNotice(e)}},{key:"setGroupCounters",value:function(e){return this._groupCountersHandler.setGroupCounters(e)}},{key:"increaseGroupCounter",value:function(e){return this._groupCountersHandler.increaseGroupCounter(e)}},{key:"decreaseGroupCounter",value:function(e){return this._groupCountersHandler.decreaseGroupCounter(e)}},{key:"getGroupCounters",value:function(e){return this._groupCountersHandler.getGroupCounters(e)}},{key:"getGroupMemberHandler",value:function(){return this._groupMemberHandler}},{key:"getGroupMemberList",value:function(e){return this._groupMemberHandler.getGroupMemberList(e)}},{key:"getGroupMemberProfile",value:function(e){return this._groupMemberHandler.getGroupMemberProfile(e)}},{key:"addGroupMember",value:function(e){return this._groupMemberHandler.addGroupMember(e)}},{key:"deleteGroupMember",value:function(e){return this._groupMemberHandler.deleteGroupMember(e)}},{key:"setGroupMemberMuteTime",value:function(e){return this._groupMemberHandler.setGroupMemberMuteTime(e)}},{key:"setGroupMemberRole",value:function(e){return this._groupMemberHandler.setGroupMemberRole(e)}},{key:"setGroupMemberNameCard",value:function(e){return this._groupMemberHandler.setGroupMemberNameCard(e)}},{key:"setGroupMemberCustomField",value:function(e){return this._groupMemberHandler.setGroupMemberCustomField(e)}},{key:"markGroupMemberList",value:function(e){return this._groupMemberHandler.markGroupMemberList(e)}},{key:"modifyGroupMemberInfo",value:function(e){return this._groupMemberHandler.modifyGroupMemberInfo(e)}},{key:"restartPolling",value:function(){this._AVChatRoomHandler.restartPolling()}},{key:"getPollingTimerID",value:function(e){var t;return e&&(t=this.getLocalGroupProfile(e))&&Mt(t.type)?this._AVChatRoomHandler.getPollingTimerID(e):-1}},{key:"_canIUseJoinOption",value:function(e){return e===S.GRP_PUBLIC||Ct({type:e})}},{key:"_silentlyGetGroupProfile",value:function(e,t){var n=setTimeout(this.getGroupProfile.bind(this,{groupID:t}),3e3);this._timeoutIDs.push(n),Oe.l("".concat(this._n,"._silentlyGetGroupProfile errorCode:").concat(e," groupID:").concat(t," timeoutIDs:").concat(this._timeoutIDs))}},{key:"_clearTimeoutIDs",value:function(){this._timeoutIDs.forEach((function(e){e&&clearTimeout(e)})),this._timeoutIDs=[]}},{key:"startMessageLongPolling",value:function(e){var t,n=e.groupID,o=e.longPollingKey,i=(e=void 0===(e=e.longPollingSequence)?1:e,this.get(12).isUnlimitedAVChatRoom());if(!qe(o))return this._AVChatRoomHandler.hasPollingInstance(n)&&this.stopMessageLongPolling({groupID:n}),t=this._AVChatRoomHandler.getJoinedLiveList(),!i&&0<t.length&&this.stopMessageLongPolling({groupID:t[0]}),i=new zo({groupID:n,type:S.GRP_LIVE}),Oe.l("".concat(this._n,".startMessageLongPolling groupID:").concat(n," longPollingKey:").concat(o," longPollingSequence:").concat(e)),this._AVChatRoomHandler.startRunLoop({group:i,longPollingKey:o,startSeq:e});console.warn("".concat(this._n,".startMessageLongPolling longPollingKey is empty."))}},{key:"stopMessageLongPolling",value:function(e){e=e.groupID;var t=this.get(11);return this._AVChatRoomHandler.reset(e),this._deleteLocalGroup(e),t.deleteLocalConv("".concat(S.CONV_GROUP).concat(e)),Oe.l("".concat(this._n,".stopMessageLongPolling ok, groupID:").concat(e)),Tn({groupID:e})}},{key:"reset",value:function(){this.groupMap.clear(),this._unjoinedAVChatRoomList.clear(),this._receiptDetailCompleteMap.clear(),this._onlineMemberCountMap.clear(),this._commonGroupHandler.reset(),this._groupSystemNoticeHandler.reset(),this._groupTipsHandler.reset(),this._groupAttributesHandler.reset(),this._groupCountersHandler.reset(),this._AVChatRoomHandler.reset(),this._groupMemberHandler.reset(),this._clearTimeoutIDs()}}])),di=["topicID","topicName","avatar","introduction","notification","unreadCount","muteAllMembers","customData","groupAtInfoList","nextMessageSeq","selfInfo"],hi=s((function e(t,n){o(this,e),this.topicID="",this.topicName="",this.avatar="",this.introduction="",this.notification="",this.unreadCount=0,this.muteAllMembers=!1,this.customData="",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=Bo(t.lastMessage,n),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:"",excludedUnreadSequenceList:void 0},this._initTopic(t)}),[{key:"_initTopic",value:function(e){for(var t in e)di.indexOf(t)<0||("selfInfo"===t?this.updateSelfInfo(e[t]):this[t]="muteAllMembers"===t?1===e[t]:e[t])}},{key:"updateUnreadCount",value:function(){this.unreadCount=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0}},{key:"updateNextMessageSeq",value:function(e){this.nextMessageSeq=e}},{key:"updateLastMessage",value:function(e){this.lastMessage=Bo(e)}},{key:"updateGroupAtInfoList",value:function(e){this.groupAtInfoList=JSON.parse(JSON.stringify(e))}},{key:"updateTopic",value:function(e){lt(e.selfInfo)||this.updateSelfInfo(e.selfInfo),lt(e.muteAllMembers)||(this.muteAllMembers=1===e.muteAllMembers),Qe(this,e,["groupID","lastMessageTime","selfInfo","muteAllMembers","lastMsg"])}},{key:"updateSelfInfo",value:function(e){return 0===Qe(this.selfInfo,e,[],[""])}},{key:"reduceUnreadCount",value:function(){return 1<=this.unreadCount&&(--this.unreadCount,!0)}},{key:"isLastMessageRevoked",value:function(e){return e.sequence===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}}]),gi=(u(Ei,Pn),s(Ei,[{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("topic_cache_time"),t=this.getCloudConfig("topic_last_active_time");lt(e)||(this.TOPIC_CACHE_TIME=Number(e)),lt(t)||(this.TOPIC_LAST_ACTIVE_TIME=Number(t))}},{key:"onTopicCreated",value:function(e){var t=e.groupID;this.resetGetTopicTime(t),this.emitOEvt(T.TOPIC_CREATED,e)}},{key:"onTopicDeleted",value:function(e){var t=this,n=e.groupID,o=e.topicIDList;(void 0===o?[]:o).forEach((function(e){t._deleteLocalTopic(n,e)})),this.emitOEvt(T.TOPIC_DELETED,e)}},{key:"onTopicProfileUpdated",value:function(e){var t=e.groupID,n=e.topicID;(n=this.getLocalTopic(t,n))&&(n.updateTopic(e),this.emitOEvt(T.TOPIC_UPDATED,{groupID:t,topic:n}))}},{key:"onTopicLatestMsg",value:function(e){var t,n,o=(e=e||{}).topicLatestMessage;e=e.excludedUnreadSequenceList,qe(o)||(t=o.groupProfile.topicID,o.conversationType=S.CONV_GROUP,o.to=t,(n=new Do(o)).setElement(o.elements),this.updateUnreadCountAndLastMsg(t,n,e))}},{key:"onMessageRemindTypeUpdated",value:function(e){var t,n=e.groupID,o=e.topicID,i=(e=e.messageRemindType,this.getLocalTopic(n,o));i&&((t=i.updateSelfInfo({messageRemindType:e}))&&this.emitOEvt(T.TOPIC_UPDATED,{groupID:n,topic:i}),Oe.l("".concat(this._n,".onMessageRemindTypeUpdated topicID:").concat(o," messageRemindType:").concat(e," isUpdated:").concat(t)))}},{key:"onAtInfoUpdated",value:function(e){var t=e.topicID,n=(e=e.groupAtInfoList,Gt(t));(t=this.getLocalTopic(n,t))&&!lt(e)&&(t.updateGroupAtInfoList(e),this.emitOEvt(T.TOPIC_UPDATED,{groupID:n,topic:t}))}},{key:"onUnreadCountUpdatedFromConv",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=Gt(e);(e=this.getLocalTopic(n,e))&&e.unreadCount!==t&&(e.updateUnreadCount(t),0===t&&e.updateSelfInfo({readedSequence:e.lastMessage.lastSequence}),this.emitOEvt(T.TOPIC_UPDATED,{groupID:n,topic:e}))}},{key:"onMessageSent",value:function(e){var t,n,o=e.groupID,i=e.topicID;e=e.lastMessage,(i=this.getLocalTopic(o,i))&&(n=(t=void 0===(t=e.sequence)?0:t)+1)>i.nextMessageSeq&&(i.updateNextMessageSeq(n),i.updateLastMessage(e),i.updateSelfInfo({readedSequence:t}),i.updateUnreadCount(0),this.emitOEvt(T.TOPIC_UPDATED,{groupID:o,topic:i}))}},{key:"onMessageModified",value:function(e){var t,n=e.to,o=e.time,i=e.sequence,s=e.elements,r=e.cloudCustomData,a=e.messageVersion,c=Gt(n),u=this.getLocalTopic(c,n);u&&(t=u.lastMessage,Oe.d("".concat(this._n,".onMessageModified topicID:").concat(n," lastMessage:"),JSON.stringify(t),"options:",JSON.stringify(e)),t)&&(null===t.payload||t.lastTime===o&&t.lastSequence===i&&t.version!==a)&&(t.type=s[0].type,t.payload=s[0].content,t.messageForShow=Ft(t.type,t.payload,this.isIntl()),t.cloudCustomData=r,t.version=a,t.lastSequence=i,t.lastTime=o,this.emitOEvt(T.TOPIC_UPDATED,{groupID:c,topic:u}))}},{key:"onMessageRevoked",value:function(e){var t,n,o,i=this;0!==e.length&&(n=t=null,o=!1,e.forEach((function(e){var s=e.to;n=Gt(s),(t=i.getLocalTopic(n,s))&&(t.reduceUnreadCount()&&(o=!0),t.isLastMessageRevoked(e)&&(t.setLastMessageRevoked(!0),t.setLastMessageRevoker(e.revoker),o=!0),(s=t.selfInfo.excludedUnreadSequenceList||[]).push(e.sequence),t.updateSelfInfo({excludedUnreadSequenceList:s}))})),o)&&this.emitOEvt(T.TOPIC_UPDATED,{groupID:n,topic:t})}},{key:"isLastMessageRevoked",value:function(e){var t=e.topicID,n=(e=e.sequence,Gt(t));return n=this.getLocalTopic(n,t),t=!1,n?n.isLastMessageRevoked({sequence:e}):t}},{key:"updateUnreadCountAndLastMsg",value:function(e,t,n){var o,i=Gt(e),s=this.getLocalTopic(i,e);s&&(o=s.selfInfo.excludedUnreadSequenceList||[],lt(n)||(o=n),t._isExcludedFromUnreadCount&&o.push(t.sequence),s.updateSelfInfo({excludedUnreadSequenceList:o}),Oe.l("".concat(this._n,".updateUnreadCountAndLastMsg seq:").concat(t.sequence," lastSeq:").concat(s.lastMessage.lastSequence)),t.sequence>s.lastMessage.lastSequence)&&(s.updateLastMessage(t),n=t.sequence+1,s.updateNextMessageSeq(n),o=this._computeUnreadCount(s),s.updateUnreadCount(o),(t=this.get(11).getLocalConversation("".concat(S.CONV_GROUP).concat(e)))&&t.updateUnreadCount({nextUnreadCount:o,isFromGetConversations:!0}),this.emitOEvt(T.TOPIC_UPDATED,{groupID:i,topic:s}))}},{key:"getJoinedCommunityList",value:function(){return this.get(7).syncCommunityWithTopic()}},{key:"createTopicInCommunity",value:function(e){var t,n=this,o="".concat(this._n,".").concat("createTopicInCommunity"),i=e.topicID;return lt(i)||Tt(i)?e.topicName&&!1===this._filterProfanity("topicName",e)||e.introduction&&!1===this._filterProfanity("introduction",e)||e.notification&&!1===this._filterProfanity("notification",e)?Sn({code:qn.PROFANITY_FOUND}):(t=new io("createTopicInCommunity"),this.req({P:jn.CREATE_TOPIC,data:g({},e)}).then((function(i){return i=i.data.topicID,t.setMessage("topicID:".concat(i)).end(),Oe.l("".concat(o," ok. topicID:").concat(i)),n._updateTopicMap([g(g({},e),{},{topicID:i})]),Cn({topicID:i})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(o," failed. error:"),e),Sn(e)}))):Sn({code:qn.ILLEGAL_TOPIC_ID})}},{key:"deleteTopicFromCommunity",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteTopicFromCommunity"),o=e.groupID,i=(e=void 0===(e=e.topicIDList)?[]:e,new io("deleteTopicFromCommunity"));return i.setMessage("groupID:".concat(o," topicIDList:").concat(e)),this.req({P:jn.DEL_TOPIC,data:{groupID:o,topicIDList:e}}).then((function(e){e=e.data.resultList;var s=[],r=[];return(void 0===e?[]:e).forEach((function(e){var t=e.topicID,n=e.errorCode;e=e.errorInfo,0===n?s.push({topicID:t}):r.push({topicID:t,code:n,message:e})})),e="success count:".concat(s.length,", fail count:").concat(r.length),i.setMoreMessage(e).end(),Oe.l("".concat(n," ok. ").concat(e)),s.forEach((function(e){t._deleteLocalTopic(o,e.topicID)})),Cn({successTopicList:s,failureTopicList:r})})).catch((function(e){return i.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"updateTopicProfile",value:function(e){var t,n=this,o="".concat(this._n,".").concat("updateTopicProfile");return Oe.l("".concat(o," options:"),e),e.topicName&&!1===this._filterProfanity("topicName",e)||e.introduction&&!1===this._filterProfanity("introduction",e)||e.notification&&!1===this._filterProfanity("notification",e)?Sn({code:qn.PROFANITY_FOUND}):((t=new io("updateTopicProfile")).setMessage("groupID:".concat(e.groupID," topicID:").concat(e.topicID)),lt(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?"On":"Off"),this.req({P:jn.UPDATE_TOPIC_PROFILE,data:g({},e)}).then((function(){return t.end(),Oe.l("".concat(o," ok")),n._updateTopicMap([e]),Cn({topic:n.getLocalTopic(e.groupID,e.topicID)})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(o," failed. error:"),e),Sn(e)})))}},{key:"getTopicList",value:function(e){var t=this,n="".concat(this._n,".").concat("getTopicList"),o=e.groupID,i=0===(e=void 0===(e=e.topicIDList)?[]:e).length,s=new io("getTopicList");if(s.setMessage("groupID:".concat(o)),this._getTopicTimeMap.has(o)){var r=(a=this._getTopicTimeMap.get(o)).isGetAll,a=a.time;if((r||!r&&!i)&&Date.now()-a<1e3*this.TOPIC_CACHE_TIME&&(r=this._getLocalTopicList(o,e),i||r.length===e.length))return s.setMoreMessage("from cache, topic count:".concat(r.length)).end(),Oe.l("".concat(n," groupID:").concat(o," from cache, topic count:").concat(r.length)),Tn({successTopicList:r,failureTopicList:[]})}return this.req({P:jn.GET_TOPIC_LIST,data:{groupID:o,topicIDList:e}}).then((function(e){e=e.data.topicInfoList;var r=[],a=[],c=[];return(void 0===e?[]:e).forEach((function(e){var t=e.topic,n=e.selfInfo,o=e.errorCode,i=(e=e.errorInfo,t.topicID);0===o?(r.push(g(g({},t),{},{selfInfo:n})),a.push(i)):c.push({topicID:i,code:o,message:e})})),t._updateTopicMap(r),t._handleTopicAtInfo(r),e="success count:".concat(a.length,", fail count:").concat(c.length),s.setMoreMessage(e).end(),Oe.l("".concat(n," groupID:").concat(o," from remote, ").concat(e)),e=[],qe(a)||(t._getTopicTimeMap.set(o,{time:Date.now(),isGetAll:i}),e=t._getLocalTopicList(o,a)),Cn({successTopicList:e,failureTopicList:c})})).catch((function(e){return s.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"hasLocalTopic",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:"getLocalTopic",value:function(e,t){var n=null;return this._topicMap.has(e)?this._topicMap.get(e).get(t):n}},{key:"_getLocalTopicList",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n=[];return(e=this._topicMap.get(e))&&(n=v(e.values())),0===t.length?n:n.filter((function(e){return t.includes(e.topicID)}))}},{key:"_deleteLocalTopic",value:function(e,t){this._topicMap.has(e)&&this._topicMap.get(e).has(t)&&(this._topicMap.get(e).delete(t),Oe.l("".concat(this._n,"._deleteLocalTopic groupID:").concat(e," topicID:").concat(t)))}},{key:"_updateTopicMap",value:function(e){var t=this,n=[];e.forEach((function(e){var o=e.groupID,i=e.topicID,s=null;t._topicMap.has(o)||t._topicMap.set(o,new Map),t._topicMap.get(o).has(i)?(s=t._topicMap.get(o).get(i)).updateTopic(e):(t._getTopicLastMessage(e),s=new hi(e,t.isIntl()),t._topicMap.get(o).set(i,s)),e=t._computeUnreadCount(s),s.updateUnreadCount(e),n.push({conversationID:"".concat(S.CONV_GROUP).concat(i),type:S.CONV_TOPIC,unreadCount:e})})),0<n.length&&this.get(11).updateTopicConversation(n)}},{key:"resetGetTopicTime",value:function(e){var t=this;lt(e)?v(this._getTopicTimeMap.keys()).forEach((function(e){t._getTopicTimeMap.set(e,0)})):this._getTopicTimeMap.set(e,0)}},{key:"getTopicListOnReconnected",value:function(){var e=this,t=v(this._topicMap.keys()),n=[],o=this.get(11);t.forEach((function(t){var i=[],s=e._getLocalTopicList(t);o.deleteTopicRoamingInfo(t),s.forEach((function(t){var n=void 0===(n=t.lastMessage.lastTime)?0:n;Date.now()-1e3*n<1e3*e.TOPIC_LAST_ACTIVE_TIME&&i.push(t.topicID)})),0<i.length&&n.push({groupID:t,topicIDList:i})})),Oe.l("".concat(this._n,".getTopicListOnReconnected. active community count:").concat(n.length)),this._relayGetTopicList(n)}},{key:"_relayGetTopicList",value:function(e){var t,n,o,i=this;0!==e.length&&(n=5<(t=e.shift()).topicIDList.length?"topicIDList.length:".concat(t.topicIDList.length):"topicIDList:".concat(t.topicIDList),(o=new io("relayGetTopicList")).setMessage(n),Oe.l("".concat(this._n,"._relayGetTopicList. ").concat(n)),this.getTopicList(t).then((function(){o.end(),i._relayGetTopicList(e)})).catch((function(t){o.setError(t).end(),i._relayGetTopicList(e)})))}},{key:"_handleTopicAtInfo",value:function(e){var t=this;0!==e.length&&e.forEach((function(e){var n=e.groupID,o=e.topicID,i=(e=e.groupAtInfoList,[]);lt(e)||(e.forEach((function(e){i.push(g(g({},e),{},{groupID:n,topicID:o}))})),t.get(11).onNewGroupAtTips({dataList:i}))}))}},{key:"_getTopicLastMessage",value:function(e){var t;lt(e.lastMsg)||(t={time:e.lastMsg.time,sequence:e.lastMsg.sequence,from:e.lastMsg.from,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:"",nick:e.lastMsg.nick,avatar:e.lastMsg.avatar,version:e.lastMsg.messageVersion,cloudCustomData:e.lastMsg.cloudCustomData,isRevoked:2===e.lastMsg.isPlaceMessage,revoker:qe(e.lastMsg.revokerInfo)?null:e.lastMsg.revokerInfo.revoker},e.lastMessage=t)}},{key:"deleteTopicListInCommunity",value:function(e){var t=this,n=this._getLocalTopicList(e),o=this.get(11);n.forEach((function(n){n=n.topicID,t._deleteLocalTopic(e,n),t._getTopicTimeMap.delete(e),o.deleteLocalConv("".concat(S.CONV_GROUP).concat(n))}))}},{key:"_computeUnreadCount",value:function(e){var t,n=(i=e.selfInfo).excludedUnreadSequenceList,o=i.readedSequence,i=e.nextMessageSeq-e.selfInfo.readedSequence-1;return Ye(n)&&(t=0,n.forEach((function(n){o<n&&n<=e.nextMessageSeq-1&&(t+=1)})),1<=t)&&(i-=t),i<0?0:i}},{key:"_filterProfanity",value:function(e,t){var n,o=this.get(29);return!o||(n=(o=o.filterText(t[e],x)).isAllowedToSend,o=o.modifiedText,!0===n&&(t[e]=o,!0))}},{key:"getMessageExtensions",value:function(e,t){Oe.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t));var n=Gt(e.to);return this.req({P:jn.GET_GRP_MSG_EXT,data:{groupID:n,topicID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:"modifyMsgExts",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,o=(Oe.l("".concat(this._n,".modifyMsgExts operateType:").concat(n)),Gt(e.to));return this.req({P:jn.MODIFY_GRP_MSG_EXT,data:{groupID:o,topicID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}])),fi=s((function e(t){o(this,e),this._userM=t,this._n="ProfileHandler",this.TAG="profile",this.accountProfileMap=new Map,this.expirationTime=864e5}),[{key:"setExpirationTime",value:function(e){this.expirationTime=e}},{key:"getUserProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("getUserProfile"),o=e.userIDList;e.fromAccount=this._userM.getMyAccount(),100<o.length&&(Oe.w("".concat(n," ").concat(jt(100))),o.length=100);for(var i,s=[],r=[],a=0,c=o.length;a<c;a++)i=o[a],this._userM.isMyFriend(i)&&this._contains(i)?r.push(this._getProfileFromMap(i)):s.push(i);if(0===s.length)return Tn(r);e.toAccount=s;var u=e.bFromGetMyProfile||!1,l=[],p=(e.toAccount.forEach((function(e){l.push({toAccount:e,standardSequence:0,customSequence:0})})),e.userItem=l,new io("getUserProfile"));return p.setMessage(5<o.length?"userIDList.length:".concat(o.length):"userIDList:".concat(o)),this._userM.req({P:jn.GET_USER_PROFILE,data:e}).then((function(e){return p.end(),Oe.i("".concat(n," ok")),e=t._handleResponse(e).concat(r),Cn(u?e[0]:e)})).catch((function(e){return p.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"getMyProfile",value:function(){var e,t=this._userM.getMyAccount(),n="".concat(this._n,".getMyProfile");return Oe.l("".concat(n," myAccount:").concat(t)),this._fill(),this._contains(t)?(e=this._getProfileFromMap(t),Oe.d("".concat(n," from cache, myProfile:").concat(JSON.stringify(e))),Tn(e)):this.getUserProfile({fromAccount:t,userIDList:[t],bFromGetMyProfile:!0})}},{key:"_handleResponse",value:function(e){var t=e.data.userProfileItem;if(!Ye(t))return[];for(var n=[],o=(e=Date.now(),0),i=t.length;o<i;o++){var s=(r=t[o]).to,r=r.profileItem;"@TLS#NOT_FOUND"!==s&&""!==s&&(s=this._update(s,this._getLatestProfileFromResponse(s,r)).latestProfile,n.push(s))}return Oe.l("".concat(this._n,"._handleResponse cost:").concat($t(e))),n}},{key:"_getLatestProfileFromResponse",value:function(e,t){var n={userID:e,profileCustomField:[]};if(!qe(t))for(var o=0,i=t.length;o<i;o++)if(-1<t[o].tag.indexOf("Tag_Profile_Custom"))n.profileCustomField.push({key:t[o].tag,value:t[o].value});else switch(t[o].tag){case be.NICK:n.nick=t[o].value;break;case be.GENDER:n.gender=t[o].value;break;case be.BIRTHDAY:n.birthday=t[o].value;break;case be.LOCATION:n.location=t[o].value;break;case be.SELFSIGNATURE:n.selfSignature=t[o].value;break;case be.ALLOWTYPE:n.allowType=t[o].value;break;case be.LANGUAGE:n.language=t[o].value;break;case be.AVATAR:n.avatar=t[o].value;break;case be.MESSAGESETTINGS:n.messageSettings=t[o].value;break;case be.ADMINFORBIDTYPE:n.adminForbidType=t[o].value;break;case be.LEVEL:n.level=t[o].value;break;case be.ROLE:n.role=t[o].value;break;default:Oe.w("".concat(this._n,"._getLatestProfileFromResponse unknown tag:"),t[o].tag,t[o].value)}return n}},{key:"updateMyProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("updateMyProfile");if(e.nick&&!1===this._userM.filterProfanity("nick",e))return Sn({code:qn.PROFANITY_FOUND});if(e.selfSignature&&!1===this._userM.filterProfanity("selfSignature",e))return Sn({code:qn.PROFANITY_FOUND});var o=new io("updateMyProfile"),i=(o.setMessage(JSON.stringify(e)),(new Ho).validate(e));if(!i.valid)return o.setCode(qn.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(i.tips)).end(),Oe.e("".concat(n," info:").concat(i.tips)),Sn({code:qn.UPDATE_PROFILE_INVALID_PARAM});var s,r,a=[];for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&("profileCustomField"===s?e.profileCustomField.forEach((function(e){a.push({tag:e.key,value:e.value})})):a.push({tag:be[s.toUpperCase()],value:e[s]}));return 0===a.length?(i=new Bn({code:qn.UPDATE_PROFILE_NO_KEY}),o.setError(i).end(),Oe.e("".concat(n," failed. error:"),i),Sn(i)):(r=this._userM.getMyAccount(),this._userM.req({P:jn.UPDATE_MY_PROFILE,data:{fromAccount:r,profileItem:a}}).then((function(i){o.end(),Oe.i("".concat(n," ok"));var s=(a=t._update(r,e)).isProfileUpdated,a=a.latestProfile;return!0===s&&t._userM.emitOEvt(T.PROFILE_UPDATED,[a]),Tn(a)})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)})))}},{key:"onProfileModified",value:function(e){var t=e.dataList;if(!qe(t)){var n=t.length;Oe.d("".concat(this._n,".onProfileModified count:").concat(n," dataList:"),e.dataList);for(var o=[],i=0;i<n;i++){var s=t[i].userID,r=(s=this._update(s,this._getLatestProfileFromResponse(s,t[i].profileList))).isProfileUpdated;s=s.latestProfile,!0===r&&o.push(s)}0<o.length&&(this._userM.emitIEvt(xo.PROFILE_UPDATED,o),this._userM.emitOEvt(T.PROFILE_UPDATED,o))}}},{key:"_fill",value:function(){if(0===this.accountProfileMap.size){for(var e=this._getCachedProfiles(),t=Date.now(),n=0,o=e.length;n<o;n++)t-e[n].lastUpdatedTime<this.expirationTime&&this.accountProfileMap.set(e[n].userID,e[n]);Oe.l("".concat(this._n,"._fill from cache, size:").concat(this.accountProfileMap.size))}}},{key:"_update",value:function(e,t){var n,o=!1,i=Date.now();return this._contains(e)?(n=this._getProfileFromMap(e),t.profileCustomField&&!0===_t(n.profileCustomField,t.profileCustomField)&&(n.lastUpdatedTime=i,o=!0),0<Qe(n,t,["profileCustomField"])&&(n.lastUpdatedTime=i,o=!0)):(n=new Ho(t),!this._userM.isMyFriend(e)&&e!==this._userM.getMyAccount()||(n.lastUpdatedTime=i,o=!0,this.accountProfileMap.set(e,n))),this._flush(e===this._userM.getMyAccount()),!0===o&&Oe.l("".concat(this._n,"._update account:").concat(e," isUpdated:").concat(o)),{isProfileUpdated:o,latestProfile:n}}},{key:"_flush",value:function(e){var t=v(this.accountProfileMap.values()),n=this._userM.getStorageModule();Oe.d("".concat(this._n,"._flush length:").concat(t.length," flushAtOnce:").concat(e)),n.setItem(this.TAG,t,e)}},{key:"_contains",value:function(e){return this.accountProfileMap.has(e)}},{key:"_getProfileFromMap",value:function(e){return this.accountProfileMap.get(e)}},{key:"_getCachedProfiles",value:function(){var e=this._userM.getStorageModule().getItem(this.TAG);return qe(e)?[]:e}},{key:"onConvProfileUpdated",value:function(e){for(var t,n,o=[],i=0,s=e.length;i<s;i++)n=(t=e[i]).userID,this._userM.isMyFriend(n)&&(this._contains(n)?0<Qe(this._getProfileFromMap(n),t)&&o.push(n):o.push(t.userID));0!==o.length&&(Oe.l("".concat(this._n,".onConvProfileUpdated toAccountList:").concat(o)),this.getUserProfile({userIDList:o}))}},{key:"getNickAndAvatarByUserID",value:function(e){return this._contains(e)?{nick:(e=this._getProfileFromMap(e)).nick,avatar:e.avatar}:{nick:"",avatar:""}}},{key:"getUserNickAndAvatar",value:function(e){var t,n=this,o=v(new Set(e)),i=(Oe.l("".concat(this._n,".getUserNickAndAvatar userIDList.length:").concat(e.length," uniqueUserIDList.length:").concat(o.length)),[]);return 0===e.length?Promise.resolve(i):(e=this._createUserIDListGroup(o),t=[],e.forEach((function(e){t.push(n.getUserProfile({userIDList:e}))})),Promise.all(t).then((function(e){return e.forEach((function(e){e=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}})),i.push.apply(i,v(e))})),i})))}},{key:"_createUserIDListGroup",value:function(e){for(var t=[],n=0;n<e.length;)t.push(e.slice(n,n+=100));return t}},{key:"reset",value:function(){this._flush(!0),this.accountProfileMap.clear()}}]),mi=s((function e(t){o(this,e)})),_i=s((function e(t){o(this,e),this._userM=t,this._n="BlacklistHandler",this._blacklistMap=new Map,this._startIndex=0}),[{key:"getLocalBlacklist",value:function(){return v(this._blacklistMap.keys())}},{key:"getBlacklist",value:function(){var e=this,t="".concat(this._n,".getBlacklist"),n={fromAccount:this._userM.getMyAccount(),maxLimited:100,startIndex:this._startIndex},o=new io("getBlacklist");return this._userM.req({P:jn.GET_BL,data:n}).then((function(n){var i=(n=n.data).blackListItem,s=(n=n.startIndex,qe(i)?0:i.length);o.setMessage("count:".concat(s)).end(),Oe.i("".concat(t," ok")),e._startIndex=n,e._handleResponse(i,!0),e._userM.emitOEvt(T.BLACKLIST_UPDATED,v(e._blacklistMap.keys())),0!==e._startIndex&&e.getBlacklist()})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"addBlacklist",value:function(e){var t,n,o=this,i=new io("addToBlacklist"),s="".concat(this._n,".addBlacklist"),r=this._userM.getMyAccount();return 1===e.userIDList.length&&e.userIDList[0]===r?(n=this._userM.getErrMsg(t=qn.CANNOT_ADD_SELF_TO_BLACKLIST),i.setCode(t).setMessage(n).end(),n=new Bn({code:t}),Oe.e("".concat(s," failed. error:"),n),Sn(n)):(e.userIDList.includes(r)&&(e.userIDList=e.userIDList.filter((function(e){return e!==r}))),e.fromAccount=this._userM.getMyAccount(),e.toAccount=e.userIDList,this._userM.req({P:jn.ADD_TO_BL,data:e}).then((function(t){return i.setMessage(5<e.userIDList.length?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),Oe.i("".concat(s," ok")),o._handleResponse(t.resultItem,!0),Cn(v(o._blacklistMap.keys()))})).catch((function(e){return i.setError(e).end(),Oe.e("".concat(s," failed. error:"),e),Sn(e)})))}},{key:"_handleResponse",value:function(e,t){if(!qe(e))for(var n,o,i,s=0,r=e.length;s<r;s++)o=e[s].to,i=e[s].resultCode,!lt(i)&&0!==i||(t?((n=this._blacklistMap.has(o)?this._blacklistMap.get(o):new mi).userID=o,qe(e[s].addBlackTimeStamp)||(n.timeStamp=e[s].addBlackTimeStamp),this._blacklistMap.set(o,n)):this._blacklistMap.has(o)&&(n=this._blacklistMap.get(o),this._blacklistMap.delete(o)));Oe.l("".concat(this._n,"._handleResponse total:").concat(this._blacklistMap.size," bAdd:").concat(t))}},{key:"deleteBlacklist",value:function(e){var t=this,n="".concat(this._n,".deleteBlacklist"),o=new io("removeFromBlacklist");return e.fromAccount=this._userM.getMyAccount(),e.toAccount=e.userIDList,this._userM.req({P:jn.RM_FROM_BL,data:e}).then((function(i){return o.setMessage(5<e.userIDList.length?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),Oe.i("".concat(n," ok")),t._handleResponse(i.data.resultItem,!1),Cn(v(t._blacklistMap.keys()))})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))}},{key:"onAccountDeleted",value:function(e){for(var t=0,n=e.length;t<n;t++){var o=e[t];this._blacklistMap.has(o)&&this._blacklistMap.delete(o)}var i=e.length;0<i&&(Oe.l("".concat(this._n,".onAccountDeleted count:").concat(i," ").concat(i<30?"userIDList:".concat(e):"")),this._userM.emitOEvt(T.BLACKLIST_UPDATED,v(this._blacklistMap.keys())))}},{key:"onAccountAdded",value:function(e){for(var t,n=[],o=0,i=e.length;o<i;o++)t=e[o],this._blacklistMap.has(t)||(this._blacklistMap.set(t,new mi({userID:t})),n.push(t));0<n.length&&(Oe.l("".concat(this._n,".onAccountAdded count:").concat(n.length," userIDList:"),n),this._userM.emitOEvt(T.BLACKLIST_UPDATED,v(this._blacklistMap.keys())))}},{key:"reset",value:function(){this._blacklistMap.clear(),this._startIndex=0}}]),vi=s((function e(t){o(this,e),this._userM=t,this._n="UserStatusHandler",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userM.getIEmitInst().on(xo.CLOUD_CONFIG,this._onCloudConfig,this)}),[{key:"_onCloudConfig",value:function(){var e=this._userM.getCloudConfig("status_query_count"),t=this._userM.getCloudConfig("status_sub_count"),n=this._userM.getCloudConfig("status_unsub_count");Oe.l("".concat(this._n,"._onCloudConfig statusQueryCount:").concat(e," statusSubscribeCount:").concat(t)+" statusUnsubscribeCount:".concat(n)),lt(e)||(this.MAX_QUERY_USER_COUNT=parseInt(e,10)),lt(e)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(t,10)),lt(e)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(n,10))}},{key:"onUserStatusUpdated",value:function(e){e=e.dataList;var t=this._userM.getMyUserID(),n=this._userM.get(12);e=e.map((function(e){var o=e.to,i=e.statusType;return e=qo(e=e.customStatus),o===t&&n.setCustomStatus(e),{userID:o,statusType:i,customStatus:e}})),Oe.l("".concat(this._n,".onUserStatusUpdated list:").concat(JSON.stringify(e))),this._userM.emitOEvt(T.USER_STATUS_UPDATED,e)}},{key:"setSelfStatus",value:function(e){var t,n,o=this,i="".concat(this._n,".setSelfStatus");return!1===this._userM.filterProfanity("customStatus",e)?Sn({code:qn.PROFANITY_FOUND}):(t=new io("setSelfStatus"),n=e.customStatus,this._userM.req({P:jn.SET_SELF_STATUS,data:{customStatus:n}}).then((function(e){return t.setMessage("customStatus:".concat(n)).end(),Oe.l("".concat(i," ok. customStatus:").concat(n)),o._userM.get(12).setCustomStatus(n),Cn({userID:o._userM.getMyUserID(),statusType:1,customStatus:n})})).catch((function(e){return t.setError(e).end(),Oe.e("".concat(i," failed. error:"),e),Sn(e)})))}},{key:"getUserStatus",value:function(e){var t="".concat(this._n,".").concat("getUserStatus"),n=void 0===(e=e.userIDList)?[]:e,o=(e=this._userM.getMyUserID(),v(n)),i=void 0,s=o.indexOf(e);if(-1<s&&(o.splice(s,1),i={userID:e,statusType:1,customStatus:this._userM.get(12).getCustomStatus()}),0===o.length)return Tn({successUserList:[i],failureUserList:[]});if(!this._userM.canIUse(N.USER_STATUS))return this._userM.noUse("getUserStatus");o.length>this.MAX_QUERY_USER_COUNT&&(Oe.w("".concat(t," ").concat(jt(this.MAX_QUERY_USER_COUNT))),o=n.slice(0,this.MAX_QUERY_USER_COUNT));var r=new io("getUserStatus");return this._userM.req({P:jn.GET_USER_STATUS,data:{userIDList:o}}).then((function(e){var o=void 0===(o=(e=e.data).successUserList)?[]:o,s=(e=void 0===(e=e.failureUserList)?[]:e,o=o.map((function(e){return{userID:e.userID,statusType:e.statusType,customStatus:qo(e=e.customStatus)}})),e=e.map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode;return e=e.errorInfo,{userID:qe(n)?t:n,code:o,message:e}})),lt(i)||o.unshift(i),"userID count:".concat(n.length,", success count:").concat(o.length,", fail count:").concat(e.length));return r.setMessage("".concat(s)).end(),Oe.l("".concat(t," ok. ").concat(s,".")),Cn({successUserList:o,failureUserList:e})})).catch((function(e){return r.setMessage("userID count:".concat(n.length)).setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"subscribeUserStatus",value:function(e){var t,n,o,i,s="subscribeUserStatus";return this._userM.canIUse(N.USER_STATUS)?(t="".concat(this._n,".").concat(s),(n=v(e=void 0===(e=e.userIDList)?[]:e)).length>this.MAX_SUBSCRIBE_USER_COUNT&&(Oe.w("".concat(t," ").concat(jt(this.MAX_SUBSCRIBE_USER_COUNT))),n=e.slice(0,this.MAX_SUBSCRIBE_USER_COUNT)),o=new io(s),i="userID count:".concat(e.length),Oe.l("".concat(t," ").concat(i)),this._userM.req({P:jn.SUB_USER_STATUS,data:{userIDList:n}}).then((function(e){return e=(void 0===(e=e.data.failureUserList)?[]:e).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode;return e=e.errorInfo,{userID:qe(n)?t:n,code:o,message:e}})),o.setMessage("".concat(i," fail count:").concat(e.length)).end(),Oe.l("".concat(t," ok. fail count:").concat(e.length,".")),Cn({failureUserList:e})})).catch((function(e){return o.setMessage(i).setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._userM.noUse(s)}},{key:"unsubscribeUserStatus",value:function(e){var t,n,o,i,s="unsubscribeUserStatus";return this._userM.canIUse(N.USER_STATUS)?(t="".concat(this._n,".").concat(s),n=v(e=void 0===(e=(e||{}).userIDList)?[]:e),e.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(Oe.w("".concat(t," ").concat(jt(this.MAX_UNSUBSCRIBE_USER_COUNT))),n=e.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT)),o=new io(s),i="userID count:".concat(e.length),Oe.l("".concat(t," ").concat(i)),e={userIDList:n},0===n.length&&(e.userIDList=void 0,e.unsubscribeAll=1),this._userM.req({P:jn.UNSUB_USER_STATUS,data:e}).then((function(e){return e=(void 0===(e=e.data.failureUserList)?[]:e).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode;return e=e.errorInfo,{userID:qe(n)?t:n,code:o,message:e}})),o.setMessage("".concat(i," fail count:").concat(e.length)).end(),Oe.l("".concat(t," ok. fail count:").concat(e.length,".")),Cn({failureUserList:e})})).catch((function(e){return o.setMessage("".concat(i)).setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this._userM.noUse(s)}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),yi=(u(Si,Pn),s(Si,[{key:"onContextUpdated",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:"mockOnNickAvatarModified",value:function(e,t){Oe.l("".concat(this._n,"._mockOnNickAvatarModified nick:").concat(e," avatar:").concat(t)),this.onProfileModified({dataList:[{pushType:1,userID:this.getMyUserID(),profileList:[{tag:be.NICK,value:e},{tag:be.AVATAR,value:t}]}]})}},{key:"onProfileModified",value:function(e){this._profileHandler.onProfileModified(e)}},{key:"onRelationChainModified",value:function(e){var t,n;qe(e=e.dataList)||(t=[],e.forEach((function(e){e.blackListDelAccount&&t.push.apply(t,v(e.blackListDelAccount))})),0<t.length&&this._blacklistHandler.onAccountDeleted(t),n=[],e.forEach((function(e){e.blackListAddAccount&&n.push.apply(n,v(e.blackListAddAccount))})),0<n.length&&this._blacklistHandler.onAccountAdded(n))}},{key:"onConvProfileUpdated",value:function(e){this._profileHandler.onConvProfileUpdated(e)}},{key:"getMyAccount",value:function(){return this.getMyUserID()}},{key:"getMyNick",value:function(){return this._profileHandler.getNickAndAvatarByUserID(this.getMyUserID()).nick}},{key:"getMyProfile",value:function(){return this._profileHandler.getMyProfile()}},{key:"getStorageModule",value:function(){return this.get(13)}},{key:"filterProfanity",value:function(e,t){var n,o=this.get(29);return!o||(n=(o=o.filterText(t[e],"user_profile")).isAllowedToSend,o=o.modifiedText,!0===n&&(t[e]=o,!0))}},{key:"isMyFriend",value:function(e){var t=this.get(8);return!!t&&t.isMyFriend(e)}},{key:"getUserProfile",value:function(e){return this._profileHandler.getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._profileHandler.updateMyProfile(e)}},{key:"getNickAndAvatarByUserID",value:function(e){return this._profileHandler.getNickAndAvatarByUserID(e)}},{key:"getUserNickAndAvatar",value:function(e){return this._profileHandler.getUserNickAndAvatar(e)}},{key:"getLocalBlacklist",value:function(){return Tn(this._blacklistHandler.getLocalBlacklist())}},{key:"addBlacklist",value:function(e){return this._blacklistHandler.addBlacklist(e)}},{key:"deleteBlacklist",value:function(e){return this._blacklistHandler.deleteBlacklist(e)}},{key:"onUserStatusUpdated",value:function(e){this._userStatusHandler.onUserStatusUpdated(e)}},{key:"setSelfStatus",value:function(e){return this._userStatusHandler.setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._userStatusHandler.getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._userStatusHandler.subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._userStatusHandler.unsubscribeUserStatus(e)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}])),Ii=s((function e(t,n){o(this,e),this._m=t,this._isLoggedIn=!1,this._SDKAppID=n.SDKAppID,this._userID=n.userID||"",this._userSig=n.userSig||"",this._version="3.5.5",this._a2Key="",this._tinyID="",this._customStatus="",this._contentType="json",this._unlimitedAVChatRoom=n.unlimitedAVChatRoom,this._scene=n.scene||"",this._oversea=n.oversea,this._instanceID=n.instanceID,this._statusInstanceID=0,this._isDevMode=n.devMode,this._isTestEnv=n.testEnv,this._proxyServer=n.proxyServer,this._fileUploadProxy=n.fileUploadProxy,this._fileDownloadProxy=n.fileDownloadProxy,this._applicationID=0,this._isPartialUpdatedConvs=n.partialUpdatedConversations,this._isIndependentDomainDisabled=n.disableIndependentDomain,this._isUsingChatCore=!1,this._uiPlatform=0,this._authKey="",this._customLoginInfo=""}),[{key:"isLoggedIn",value:function(){return this._isLoggedIn}},{key:"isOversea",value:function(){return this._oversea}},{key:"isPrivateNetWork",value:function(){return this._proxyServer}},{key:"isDevMode",value:function(){return this._isDevMode}},{key:"isTestEnv",value:function(){return this._isTestEnv}},{key:"isPartialUpdatedConvs",value:function(){return this._isPartialUpdatedConvs}},{key:"isIndependentDomainDisabled",value:function(){return this._isIndependentDomainDisabled}},{key:"isSingaporeSite",value:function(){return 2e7<=this._SDKAppID&&this._SDKAppID<3e7||172e7<=this._SDKAppID&&this._SDKAppID<173e7}},{key:"isKoreaSite",value:function(){return 3e7<=this._SDKAppID&&this._SDKAppID<4e7||173e7<=this._SDKAppID&&this._SDKAppID<174e7}},{key:"isGermanySite",value:function(){return 4e7<=this._SDKAppID&&this._SDKAppID<5e7||174e7<=this._SDKAppID&&this._SDKAppID<175e7}},{key:"isIndiaSite",value:function(){return 5e7<=this._SDKAppID&&this._SDKAppID<6e7||175e7<=this._SDKAppID&&this._SDKAppID<176e7}},{key:"isJapanSite",value:function(){return 6e7<=this._SDKAppID&&this._SDKAppID<7e7||176e7<=this._SDKAppID&&this._SDKAppID<177e7}},{key:"isUSASite",value:function(){return 7e7<=this._SDKAppID&&this._SDKAppID<8e7||177e7<=this._SDKAppID&&this._SDKAppID<178e7}},{key:"isIndonesiaSite",value:function(){return 8e7<=this._SDKAppID&&this._SDKAppID<9e7||178e7<=this._SDKAppID&&this._SDKAppID<179e7}},{key:"isIntl",value:function(){return 0===(e=this._SDKAppID)||2e7<=e&&e<9e7||172e7<=e&&e<179e7;var e}},{key:"isUnlimitedAVChatRoom",value:function(){return this._unlimitedAVChatRoom}},{key:"isUsingChatCore",value:function(){return this._isUsingChatCore}},{key:"setUsingChatCore",value:function(e){this._isUsingChatCore=e}},{key:"getUIPlatform",value:function(){return this._uiPlatform}},{key:"setUIPlatform",value:function(e){this._uiPlatform=e}},{key:"setUserID",value:function(e){this._userID=e}},{key:"getUserID",value:function(){return this._userID}},{key:"setUserSig",value:function(e){this._userSig=e}},{key:"getUserSig",value:function(){return this._userSig}},{key:"getSDKAppID",value:function(){return this._SDKAppID}},{key:"setTinyID",value:function(e){this._tinyID=e,this._isLoggedIn=!0}},{key:"getTinyID",value:function(){return this._tinyID}},{key:"setCustomStatus",value:function(e){this._customStatus=e}},{key:"getCustomStatus",value:function(){return this._customStatus}},{key:"getScene",value:function(){return fe?window.tencent_cloud_im_csig_flutter_for_web_25F_cy:this._isTUIKit()?"tuikit":this._scene}},{key:"getInstanceID",value:function(){return this._instanceID}},{key:"getStatusInstanceID",value:function(){return this._statusInstanceID}},{key:"setStatusInstanceID",value:function(e){this._statusInstanceID=e}},{key:"getVersion",value:function(){return this._version}},{key:"getA2Key",value:function(){return this._a2Key}},{key:"setA2Key",value:function(e){this._a2Key=e}},{key:"getContentType",value:function(){return this._contentType}},{key:"getProxyServer",value:function(){return this._proxyServer}},{key:"getFileUploadProxy",value:function(){return this._fileUploadProxy}},{key:"getFileDownloadProxy",value:function(){return this._fileDownloadProxy}},{key:"setApplicationID",value:function(e){this._applicationID=e}},{key:"getApplicationID",value:function(){return this._applicationID}},{key:"setDowloadFileAuthKey",value:function(e){this._authKey=e}},{key:"getDownloadFileAuthKey",value:function(){return this._authKey}},{key:"setCustomLoginInfo",value:function(e){this._customLoginInfo=e}},{key:"getCustomLoginInfo",value:function(){return this._customLoginInfo}},{key:"_isTUIKit",value:function(){var e=!1,t=!1,n=!1,o=!1,i=[];Z&&(i=Object.keys(ne));for(var s=0,r=(i=te?X?Object.keys(Gn):Object.keys(window):i).length;s<r;s++)if(i[s].toLowerCase().includes("uikit")){e=!0;break}i=null;var a,c=(Z&&!Je(ne.createGamePortal)&&Je(getApp)&&!lt(getApp())&&ze(a=getApp().globalData)&&!0===a.isTUIKit&&(t=!0),!0===this._m.get(13).getStorageSync("TIM_".concat(this._SDKAppID,"_isTUIKit"))&&(n=!0),null);if(V&&!K&&void 0===Gn&&__wxConfig&&(c=__wxConfig.pages),H&&void 0===Gn&&__qqConfig&&(c=__qqConfig.pages),Ye(c)&&0<c.length){for(var u=0,l=c.length;u<l;u++)if(c[u].toLowerCase().includes("tui")){o=!0;break}c=null}return e||t||n||o}},{key:"reset",value:function(){this._isLoggedIn=!1,this._userSig="",this._a2Key="",this._tinyID="",this._customStatus="",this._statusInstanceID=0}}]),Mi={"k-vue2-pc":1,"k-vue2-h5":2,"k-vue2-h5-uni":3,"k-vue2-app-uni":4,"k-vue2-mp-uni":5,"k-vue2-pc-uni":6,"k-vue3-pc":7,"k-vue3-h5":8,"k-vue3-h5-uni":9,"k-vue3-app-uni":10,"k-vue3-mp-uni":11,"k-vue3-pc-uni":12,"k-rn":13},Ci=(u(Ti,Pn),s(Ti,[{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this._helloInterval==0&&this._hello()}},{key:"getPushModule",value:function(){var e=void 0,t=this.get(36),n=this.get(28);return t.canIUseTIMPush()?e=t:n.canIUseOfflinePush()&&(e=n),e}},{key:"login",value:function(e){if(this.isLoggedIn())return n=this.getMyUserID(),(n=this.getErrMsg("RepeatLogin",n))&&Oe.w(n),Tn({actionStatus:"OK",errorCode:0,errorInfo:n,repeatLogin:!0});if(Date.now()-this._lastLoginTs<=15e3)return this.warn("LoggingIn",e.userID),Sn({code:qn.REPEAT_LOGIN});Oe.l("".concat(this._n,".login userID:").concat(e.userID));var t,n=this._checkLoginInfo(e);return 0!==n.code?Sn(n):(n=this.get(12),t=e.userID,e=e.userSig,n.setUserID(t),n.setUserSig(e),this.get(20).updateProtocolConfig(),this._login())}},{key:"_login",value:function(){var e=this,t=this.get(12),n=t.getScene(),o=0,i=n,s=(n&&n.startsWith("k-")&&(i=Mi[n],n="tuikit"),new io("login")),r=(s.setMessage("".concat(i)).setMoreMessage("identifier:".concat(this.getMyUserID())),"tuikit"===n),a=0,c=(X?a=r?3===i||4===i||5===i||6===i?31:9===i||10===i||11===i||12===i?32:4:3:Z?a=j?36:"tuikit"===n?12:11:te?a=fe?"flutter_web_uikit"===n?21:20:this._isReactUIKit()?ge?25:24:r?1===i||2===i?29:7===i||8===i?30:ge?17:14:ge?16:13:13===i&&(a=38),s.setUIPlatform(a),t.setUIPlatform(a),(r=this.getPushModule())&&(this._isWebUniapp=r.getUniAppPlatform(),i=this._getStatusInstanceID(),t.setStatusInstanceID(i),this.get(20).updateProtocolConfig(),o=r.getDeviceBrand()),"".concat(this._n,"._login"));return this._lastLoginTs=Date.now(),this.req({P:jn.LOGIN,data:{deviceBrand:o,isWebUniapp:this._isWebUniapp,customInfo:t.getCustomLoginInfo()}}).then((function(o){e._lastLoginTs=0;var i=Date.now(),r=null,a=(f=o.data).a2Key,u=f.tinyID,l=f.helloInterval,p=f.instanceID,d=f.timeStamp,h=void 0===(h=f.customStatus)?"":h,g=f.purchaseBits,f=void 0===(f=f.authKey)?"":f,m=1e3*d,_=i-s.getStartTs();if(_=m+parseInt(_/2)-i,i=s.getStartTs()+_,s.start(i),i=m,Ee=_,(m=new Date).setTime(i),Oe.i("baseTime from server:".concat(m," offset:").concat(Ee)),u){if(a)return i=e.get(21).getSocketID(),m=qo(h),h="socketID:".concat(i," scene:").concat(n," helloInterval:").concat(l," instanceID:").concat(p," timeStamp:").concat(d)+" offset:".concat(_," customStatus:").concat(m," isWebUniapp:").concat(e._isWebUniapp),Oe.l("".concat(c," ok. ").concat(h)),d=i="",V&&Je(ne.getAccountInfoSync)&&(_=ne.getAccountInfoSync().miniProgram)&&(i=_.appId,d=_.envVersion),s.setMoreMessage("".concat(h," href:").concat(te?window.location.href:""," mpAppId:").concat(i," envVersion:").concat(d," authKey:").concat(f)).end(),t.setA2Key(a),t.setTinyID(u),t.setStatusInstanceID(p),t.setCustomStatus(m),t.setDowloadFileAuthKey(f),g&&e.get(27).onPushedConfig({errorCode:0,expiredTime:0,purchaseBits:g}),e.get(20).updateProtocolConfig(),e.emitIEvt(xo.A2KEY_AND_TINYID_UPDATED),e._helloInterval=l,e.triggerReady(),(_=e.getPushModule())&&(Gn.setStorageSync("timUniAppInstanceID",p),_.init()),e._fetchCloudControlConfig(),e.get(29).init(),o;r=new Bn({code:qn.NO_A2KEY})}else r=new Bn({code:qn.NO_TINYID});throw s.setError(r).end(),r})).catch((function(t){return s.setError(t).end(!0),e._m.setNotReadyReason(qn.LOGIN_FAILED),Oe.e("".concat(c," failed. error:"),t),e._lastLoginTs=0,e._m.onLoginFailed(),Sn(t)}))}},{key:"logout",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n="".concat(this._n,".logout"),o=this.isLoggedIn();return Oe.i("".concat(n," type:").concat(t," isLoggedIn:").concat(o," isWebUniapp:").concat(this._isWebUniapp)),o?(new io("logout").setMessage("identifier:".concat(this.getMyUserID())).end(!0),0===t&&this._m.setNotReadyReason(qn.LOGGED_OUT),this.req({P:jn.LOGOUT,data:{type:t,isWebUniapp:this._isWebUniapp}}).then((function(){return e.resetReady(),Tn({})})).catch((function(t){return Oe.e("".concat(n," error:"),t),e.resetReady(),Tn({})}))):Sn({code:qn.USER_NOT_LOGGED_IN})}},{key:"getLoginUser",value:function(){return this.isLoggedIn()?this.getMyUserID():""}},{key:"_fetchCloudControlConfig",value:function(){this.get(23).fetchConfig()}},{key:"_getStatusInstanceID",value:function(){return Gn.getStorageSync("timUniAppInstanceID")||0}},{key:"_hello",value:function(){var e=this;this._lastWsHelloTs=Date.now(),this.req({P:jn.HELLO,data:{isWebUniapp:this._isWebUniapp}}).catch((function(t){Oe.w("".concat(e._n,"._hello error:"),t)}))}},{key:"getLastWsHelloTs",value:function(){return this._lastWsHelloTs}},{key:"_checkLoginInfo",value:function(e){var t=0;return qe(this.get(12).getSDKAppID())?t=qn.NO_SDKAPPID:qe(e.userID)?t=qn.NO_IDENTIFIER:qe(e.userSig)&&(t=qn.NO_USERSIG),{code:t}}},{key:"_isReactUIKit",value:function(){return te&&void 0!==window.tencent_cloud_im_csig_react_uikit_23F_xa}},{key:"onMultipleAccountKickedOut",value:function(e){var t=this;new io("kickedOut").setMessage("type:".concat(S.KICKED_OUT_MULT_ACCOUNT," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),Oe.w("".concat(this._n,".onMultipleAccountKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOEvt(T.KICKED_OUT,{type:S.KICKED_OUT_MULT_ACCOUNT}),t._m.setNotReadyReason(qn.KICKED_OUT_MULT_ACCOUNT),t._m.reset()}))}},{key:"onMultipleDeviceKickedOut",value:function(e){var t=this;new io("kickedOut").setMessage("type:".concat(S.KICKED_OUT_MULT_DEVICE," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),Oe.w("".concat(this._n,".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOEvt(T.KICKED_OUT,{type:S.KICKED_OUT_MULT_DEVICE}),t._m.setNotReadyReason(qn.KICKED_OUT_MULT_DEVICE),t._m.reset()}))}},{key:"onUserSigExpired",value:function(){new io("kickedOut").setMessage(S.KICKED_OUT_USERSIG_EXPIRED).end(!0),Oe.w("".concat(this._n,".onUserSigExpired userID:").concat(this.getMyUserID())),0!==this.get(12).getStatusInstanceID()&&(this.emitOEvt(T.KICKED_OUT,{type:S.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(qn.KICKED_OUT_USERSIG_EXPIRED),this._m.reset())}},{key:"onRestApiKickedOut",value:function(e){new io("kickedOut").setMessage("type:".concat(S.KICKED_OUT_REST_API," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),Oe.w("".concat(this._n,".onRestApiKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),0!==this.get(12).getStatusInstanceID()&&(this.emitOEvt(T.KICKED_OUT,{type:S.KICKED_OUT_REST_API}),this._m.setNotReadyReason(qn.KICKED_OUT_REST_API),this._m.reset(),this.get(21).onRestApiKickedOut())}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]));function Ti(e){return o(this,Ti),(e=n(this,Ti,[e]))._n="SignModule",e._helloInterval=120,e._lastLoginTs=0,e._lastWsHelloTs=0,e._isWebUniapp=0,Go.mixin(e),e}function Si(e){return o(this,Si),(e=n(this,Si,[e]))._n="UserModule",e._profileHandler=new fi(e),e._blacklistHandler=new _i(e),e._userStatusHandler=new vi(e),e.getIEmitInst().on(xo.A2KEY_AND_TINYID_UPDATED,e.onContextUpdated,e),e}function Ei(e){return o(this,Ei),(e=n(this,Ei,[e]))._n="TopicModule",e._topicMap=new Map,e._getTopicTimeMap=new Map,e.TOPIC_CACHE_TIME=300,e.TOPIC_LAST_ACTIVE_TIME=3600,e.getIEmitInst().on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function ki(e){return o(this,ki),(e=n(this,ki,[e]))._n="GroupModule",e._commonGroupHandler=new ei(e),e._groupAttributesHandler=new ti(e),e._groupCountersHandler=new ni(e),e._AVChatRoomHandler=new si(e),e._groupTipsHandler=new Qo(e),e._groupSystemNoticeHandler=new ui(e),e._groupMemberHandler=new ai(e),e.groupMap=new Map,e._unjoinedAVChatRoomList=new Map,e._receiptDetailCompleteMap=new Map,e._onlineMemberCountMap=new Map,e._timeoutIDs=[],e.getIEmitInst().on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function Di(e){return o(this,Di),(e=n(this,Di,[e]))._n="ConvModule",Go.mixin(e),e._msgListHandler=new wo(e),e._msgRemindHandler=new Jo(e),e._convGroupHandler=new Xo(e),e._sll=new Ko(100),e._pagingStatus=Ln,e._pagingTs=0,e._pagingStartIdx=0,e._pagingPinnedTs=0,e._pagingPinnedStartIdx=0,e._pagingConvIDMap=new Map,e._convIDFromUnreadDBMap=new Map,e._convMap=new Map,e._tmpGroupList=[],e._tmpGroupAtTipsList=[],e._peerReadTimeMap=new Map,e._completedMap=new Map,e._roamingMsgKeyAndTimeMap=new Map,e._remoteGroupReadSeqMap=new Map,e._convTotalUnreadCount=0,e._pagingGetCostList=[],e._convMapForDiff=new Map,e._partialUpdatedConvMap=new Map,e._everClearedMap=new Map,e._bPullOnInvite=!0,e._initListeners(),e}function Li(){return null}function Ri(e){var t=e.get(12);return{SDKType:10,SDKAppID:t.getSDKAppID(),SDKVersion:t.getVersion(),tinyID:Number(t.getTinyID()),userID:t.getUserID(),platform:e.getPlatform(),instanceID:t.getInstanceID(),traceID:ke()}}var Oi=s((function e(t){o(this,e),this._m=t,this._n="StorageModule",this._storageQueue=new Map,this._errorTolerantHandle()}),[{key:"_errorTolerantHandle",value:function(){Z||"undefined"!=typeof window&&this._canIUseCookies()||(this.getItem=Li,this.setItem=Li,this.removeItem=Li,this.clear=Li)}},{key:"onCheckTimer",value:function(e){e%20==0&&0!==this._storageQueue.size&&this._doFlush()}},{key:"_doFlush",value:function(){try{var e,t=r(this._storageQueue);try{for(t.s();!(e=t.n()).done;){var n=_(e.value,2),o=n[0],i=n[1];this._setStorageSync(this._getKey(o),i)}}catch(s){t.e(s)}finally{t.f()}this._storageQueue.clear()}catch(s){Oe.w("".concat(this._n,"._doFlush error:"),s)}}},{key:"_getPrefix",value:function(){var e=this._m.get(12);return"TIM_".concat(e.getSDKAppID(),"_").concat(e.getUserID(),"_")}},{key:"_getKey",value:function(e){return"".concat(this._getPrefix()).concat(e)}},{key:"getItem",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;return this.getStorageSync(n)}catch(o){return Oe.w("".concat(this._n,".getItem error:"),o),{}}}},{key:"setItem",value:function(e,t){var n;2<arguments.length&&void 0!==arguments[2]&&arguments[2]?(n=3<arguments.length&&void 0!==arguments[3]&&!arguments[3]?e:this._getKey(e),this._setStorageSync(n,t)):this._storageQueue.set(e,t)}},{key:"clear",value:function(){try{Z?ne.clearStorageSync():this._canIUseCookies()&&localStorage.clear()}catch(e){Oe.w("".concat(this._n,".clear error:"),e)}}},{key:"removeItem",value:function(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;this._removeStorageSync(n)}catch(o){Oe.w("".concat(this._n,".removeItem error:"),o)}}},{key:"getSize",value:function(e){var t=this,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"b";try{var o={size:0,limitSize:5242880,unit:n};if(Object.defineProperty(o,"leftSize",{enumerable:!0,get:function(){return o.limitSize-o.size}}),Z&&(o.limitSize=1024*ne.getStorageInfoSync().limitSize),e)o.size=JSON.stringify(this.getItem(e)).length+this._getKey(e).length;else if(Z)ne.getStorageInfoSync().keys.forEach((function(e){o.size+=JSON.stringify(t.getStorageSync(e)).length+t._getKey(e).length}));else if(this._canIUseCookies())for(var i in localStorage)localStorage.hasOwnProperty(i)&&(o.size+=localStorage.getItem(i).length+i.length);return this._convertUnit(o)}catch(s){Oe.w("".concat(this._n," error:"),s)}}},{key:"_convertUnit",value:function(e){var t,n={},o=e.unit;for(t in n.unit=o,e)"number"==typeof e[t]&&("kb"===o.toLowerCase()?n[t]=Math.round(e[t]/1024):"mb"===o.toLowerCase()?n[t]=Math.round(e[t]/1024/1024):n[t]=e[t]);return n}},{key:"_setStorageSync",value:function(e,t){Z?z?my.setStorageSync({key:e,data:t}):ne.setStorageSync(e,t):this._canIUseCookies()&&localStorage.setItem(e,JSON.stringify(t))}},{key:"getStorageSync",value:function(e){return Z?z?my.getStorageSync({key:e}).data:ne.getStorageSync(e):this._canIUseCookies()?JSON.parse(localStorage.getItem(e)):{}}},{key:"_removeStorageSync",value:function(e){Z?z?my.removeStorageSync({key:e}):ne.removeStorageSync(e):this._canIUseCookies()&&localStorage.removeItem(e)}},{key:"_canIUseCookies",value:function(){return"undefined"!=typeof window&&navigator&&navigator.cookieEnabled&&localStorage}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._doFlush()}}]),Ai=s((function e(t){o(this,e),this._n="SSOLogBody",this._report=[]}),[{key:"pushIn",value:function(e){Oe.d("".concat(this._n,".pushIn"),this._report.length,e),this._report.push(e)}},{key:"backfill",value:function(e){var t;Ye(e)&&0!==e.length&&(Oe.d("".concat(this._n,".backfill"),this._report.length,e.length),(t=this._report).unshift.apply(t,v(e)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getLogsInMemory",value:function(){var e=this._report.slice();return this._reset(),e}}]),bi=(u(wi,Pn),s(wi,[{key:"reportAtOnce",value:function(){this._report()}},{key:"_onLoginSuccess",value:function(){var e=this,t=this.get(13),n=t.getItem(this.TAG,!1);!qe(n)&&Je(n.forEach)&&(Oe.l("".concat(this._n,"._onLoginSuccess. logs count:").concat(n.length)),n.forEach((function(t){e._reportBody.pushIn(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("evt_rpt_threshold"),t=this.getCloudConfig("evt_rpt_waiting"),n=this.getCloudConfig("evt_rpt_level"),o=this.getCloudConfig("evt_rpt_sdkappid_bl"),i=this.getCloudConfig("evt_rpt_tinyid_wl");lt(e)||(this.MIN_THRESHOLD=Number(e)),lt(t)||(this.WAITING_TIME=Number(t)),lt(n)||(this.REPORT_LEVEL=n.split(",").map((function(e){return Number(e)}))),lt(o)||(this.REPORT_SDKAPPID_BLACKLIST=o.split(",").map((function(e){return Number(e)}))),lt(i)||(this.REPORT_TINYID_WHITELIST=i.split(","))}},{key:"pushIn",value:function(e){e instanceof io&&(e.updateTimeStamp(),this._reportBody.pushIn(e),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD)&&this._report()}},{key:"onCheckTimer",value:function(){Date.now()<this._lastReportTime+this.WAITING_TIME||this._reportBody.isEmpty()||this._report()}},{key:"_filterLogs",value:function(e){var t=this,n=(o=this.get(12)).getSDKAppID(),o=o.getTinyID();return wt(this.REPORT_SDKAPPID_BLACKLIST,n)&&!Ut(this.REPORT_TINYID_WHITELIST,o)?[]:e.filter((function(e){return t.REPORT_LEVEL.includes(e.level)}))}},{key:"_report",value:function(){var e,t,n=this;this._reportBody.isEmpty()||(e=this._reportBody.getLogsInMemory(),0!==(t=this._filterLogs(e)).length?(t={header:Ri(this),event:t},this.req({P:jn.SSO_STAT,data:g({},t)}).then((function(){n._lastReportTime=Date.now()})).catch((function(t){Oe.w("".concat(n._n,"._report failed. error:"),t),n._lastReportTime=Date.now(),n._reportBody.backfill(e),n._reportBody.getLogsNumInMemory()>n.MAX_THRESHOLD&&n._flushAtOnce()}))):this._lastReportTime=Date.now())}},{key:"_flushAtOnce",value:function(){var e=this.get(13),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory(),o="".concat(this._n,"._flushAtOnce");qe(t)?(Oe.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1)):((n=n.concat(t)).length>this.MAX_THRESHOLD&&(n=n.slice(0,this.MAX_THRESHOLD)),Oe.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1))}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}])),Pi="none",Ni="online",xi=s((function e(t){o(this,e),this._m=t,this._networkType=Ni,this._n="NetMonitorModule",this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null,this._removeListener=null,this._m.getIEmitInst().on(xo.A2KEY_AND_TINYID_UPDATED,this._startRN,this)}),[{key:"_startRN",value:function(){var e,t=this;ee&&(e=this._m.get(18).getPlugin("chat-network-monitor"))&&(this._removeListener=e.addEventListener((function(e){var n=e.isConnected;e=e.type,t._networkType!==e&&t._onNetworkStatusChange({isConnected:void 0!==n&&n,networkType:e})})))}},{key:"start",value:function(){var e=this,t="".concat(this._n,".start");Z?(ne.getNetworkType({success:function(n){e._networkType=n.networkType||n.subtype||"",n.networkType===Pi?Oe.w("".concat(t," no network, please check!")):Oe.i("".concat(t," networkType:").concat(n.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),ne.onNetworkStatusChange(this._mpNetworkStatusCallback)):te&&(this._networkType=Ni,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window.addEventListener("online",this._webOnlineCallback),window.addEventListener("offline",this._webOfflineCallback))}},{key:"_onWebOnline",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:Ni})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:Pi})}},{key:"_onNetworkStatusChange",value:function(e){var t=e.isConnected,n=(e=e.networkType,"".concat(this._n,"._onNetworkStatusChange")),o=!1,i="previous:".concat(this._networkType," current:").concat(e);t?(Oe.i("".concat(n," ").concat(i)),this._networkType!==e&&(o=!0,this._networkType=e,this._m.get(21).reConnect(!0))):this._networkType!==e&&(o=!0,this._networkType=e,Oe.w("".concat(n," no network, please check!")),this._m.get(21).offline()),o&&new io("networkChange").setMessage("isConnected:".concat(t," ").concat(i)).end()}},{key:"isOnline",value:function(){return this._networkType!==Pi}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),Z?null!==this._mpNetworkStatusCallback&&(ne.offNetworkStatusChange&&ne.offNetworkStatusChange(this._mpNetworkStatusCallback),this._mpNetworkStatusCallback=null):te?(null!==this._webOnlineCallback&&(window.removeEventListener("online",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener("offline",this._webOfflineCallback),this._webOfflineCallback=null)):ee&&this._removeListener&&(this._removeListener(),this._removeListener=null)}}]);function wi(e){o(this,wi),(e=n(this,wi,[e]))._n="EventStatModule",e.TAG="im-ssolog-event",e._reportBody=new Ai,e.MIN_THRESHOLD=20,e.MAX_THRESHOLD=100,e.WAITING_TIME=6e4,e.REPORT_LEVEL=[4,5,6],e.REPORT_SDKAPPID_BLACKLIST=[],e.REPORT_TINYID_WHITELIST=[],e._lastReportTime=Date.now();var t=e.getIEmitInst();return t.on(xo.A2KEY_AND_TINYID_UPDATED,e._onLoginSuccess,e),t.on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function Ui(e,t){return e(t={exports:{}},t.exports),t.exports}var Gi=Ui((function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,o,s,r){if("function"!=typeof o)throw new TypeError("The listener must be a function");return o=new i(o,s||e,r),s=n?n+t:t,e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function a(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,o,i=[];if(0===this._eventsCount)return i;for(o in e=this._events)t.call(e,o)&&i.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){e=n?n+e:e;var t=this._events[e];if(!t)return[];if(t.fn)return[t.fn];for(var o=0,i=t.length,s=new Array(i);o<i;o++)s[o]=t[o].fn;return s},a.prototype.listenerCount=function(e){return e=n?n+e:e,(e=this._events[e])?e.fn?1:e.length:0},a.prototype.emit=function(e,t,o,i,s,r){var a=n?n+e:e;if(!this._events[a])return!1;var c,u=this._events[a],l=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),l){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,o),!0;case 4:return u.fn.call(u.context,t,o,i),!0;case 5:return u.fn.call(u.context,t,o,i,s),!0;case 6:return u.fn.call(u.context,t,o,i,s,r),!0}for(h=1,c=new Array(l-1);h<l;h++)c[h-1]=arguments[h];u.fn.apply(u.context,c)}else for(var p,d=u.length,h=0;h<d;h++)switch(u[h].once&&this.removeListener(e,u[h].fn,void 0,!0),l){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,t);break;case 3:u[h].fn.call(u[h].context,t,o);break;case 4:u[h].fn.call(u[h].context,t,o,i);break;default:if(!c)for(p=1,c=new Array(l-1);p<l;p++)c[p-1]=arguments[p];u[h].fn.apply(u[h].context,c)}return!0},a.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,o,i){if(e=n?n+e:e,this._events[e])if(t){var s=this._events[e];if(s.fn)s.fn!==t||i&&!s.once||o&&s.context!==o||r(this,e);else{for(var a=0,c=[],u=s.length;a<u;a++)(s[a].fn!==t||i&&!s[a].once||o&&s[a].context!==o)&&c.push(s[a]);c.length?this._events[e]=1===c.length?c[0]:c:r(this,e)}}else r(this,e);return this},a.prototype.removeAllListeners=function(e){return e?(e=n?n+e:e,this._events[e]&&r(this,e)):(this._events=new o,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,e.exports=a.EventEmitter=a})),Fi=["rich.my-imcloud.com","imrich.qcloud.com"],Bi=["requestSnapshotUrl"],qi=(u($i,Pn),s($i,[{key:"_init",value:function(){this._fileDownloadProxy=this.getFileDownloadProxy(),this._authKey=this.getDownloadFileAuthKey();var e=this.get(18);this.TIMUploadPlugin=e.getPlugin("tim-upload-plugin"),this.TIMUploadPlugin?this._initUploaderMethod():(this.COSSDK=e.getPlugin(e=Z?"cos-wx-sdk":"cos-js-sdk"),this.COSSDK?(this._getAuthorizationKey(),this.warn("CosReplacement",e)):this.warn("PluginUndetected"))}},{key:"_onCloudConfig",value:function(){var e=this,t="".concat(this._n,"._onCloudConfig"),n=this.getCloudConfig("upload_size_limit"),o=this.getCloudConfig("simple_cos"),i=this.getCloudConfig("file_dn_list");if(Oe.l("".concat(t," uploadSizeLimit:").concat(n," simpleCos:").concat(o)),!lt(n))try{var s=JSON.parse(n);this.UPLOAD_SIZE_LIMIT={A:s.a?1048576*parseInt(s.a):this.UPLOAD_SIZE_LIMIT.A,F:s.f?1048576*parseInt(s.f):this.UPLOAD_SIZE_LIMIT.F,I:s.i?1048576*parseInt(s.i):this.UPLOAD_SIZE_LIMIT.I,V:s.v?1048576*parseInt(s.v):this.UPLOAD_SIZE_LIMIT.V}}catch(r){}if(lt(o)||(this.isSimpleCos="1"===o),!lt(i))try{JSON.parse(i).forEach((function(t){e._fileDNList.includes(t)||e._fileDNList.push(t)}))}catch(r){}}},{key:"_getAuthorizationKey",value:function(){var e=this,t="".concat(this._n,".").concat("_getAuthorizationKey"),n=new io("_getAuthorizationKey"),o=Math.ceil(Date.now()/1e3);this.req({P:jn.COS_SIGN,data:{duration:this.expiredTimeLimit}}).then((function(i){i=i.data;var s=(Oe.l("".concat(t," ok. data:"),i),i.expiredTime-o);n.setMessage("requestId:".concat(i.requestId," requestTime:").concat(o," expiredTime:").concat(i.expiredTime," diff:").concat(s,"s")).end(),!Z&&i.region&&(e.region=i.region),e.appid=i.appid,e.bucketName=i.bucketName,e.ciUrl=i.ciUrl,e.directory=i.directory,e.downloadUrl=i.downloadUrl,e.uploadUrl=i.uploadUrl,e.cosOptions={secretId:i.secretId,secretKey:i.secretKey,sessionToken:i.sessionToken,expiredTime:i.expiredTime},Oe.l("".concat(t," ok. region:").concat(e.region," bucketName:").concat(e.bucketName)),e._initUploaderMethod()})).catch((function(e){n.setError(e).end(),Oe.w("".concat(t," failed. error:"),e)}))}},{key:"_getCosPreSigUrl",value:function(e){var t=this,n="".concat(this._n,".").concat("_getCosPreSigUrl"),o=Math.ceil(Date.now()/1e3),i=new io("_getCosPreSigUrl"),s={uploadMethod:e.uploadMethod,platform:this.getPlatform(),SDKAppID:this.getSDKAppID(),userID:e.userID,conversationType:e.conversationType,uploadConfig:[{fileID:1,fileType:e.fileType,fileName:e.fileName}]},r=jn.SIMPLE_COS_PRE_SIG;return this.isSimpleCos||(s={fileType:e.fileType,fileName:e.fileName,uploadMethod:e.uploadMethod,duration:e.duration},r=jn.COS_PRE_SIG),this.req({P:r,data:s}).then((function(e){t.tryCount=0,e=e.data||{};var s,r,a=(Oe.l("".concat(n," ok. isSimpleCos:").concat(t.isSimpleCos," data:"),e),"");return a=t.isSimpleCos?(s=(r=e.preSig[0]).uploadUrl,r=r.fileKey,"uploadIP:".concat(e.uploadIP," uploadUrl:").concat(s," fileKey:").concat(r," cost:").concat($t(o))):"requestId:".concat(e.requestId," expiredTime:").concat(e.expiredTime," diff:").concat(e.expiredTime-o,"s"),i.setMessage(a).end(),e})).catch((function(o){return-1===o.code&&(o.code=qn.COS_GET_SIG_FAIL),i.setError(o).end(),Oe.w("".concat(n," failed. error:"),o),t.tryCount<1?(t.tryCount++,t._getCosPreSigUrl(e)):(t.tryCount=0,Sn({code:qn.COS_GET_SIG_FAIL}))}))}},{key:"_initUploaderMethod",value:function(){var e=this;this.TIMUploadPlugin?(this.timUploadPlugin=new this.TIMUploadPlugin,this._cosUploadMethod=function(t,n){e.timUploadPlugin.uploadFile(t,n)}):this.appid&&(this.cos=Z?new this.COSSDK({ForcePathStyle:!0,getAuthorization:this._getAuthorization.bind(this)}):new this.COSSDK({getAuthorization:this._getAuthorization.bind(this)}),this._cosUploadMethod=Z?function(t,n){e.cos.postObject(t,n)}:function(t,n){e.cos.uploadFiles(t,n)})}},{key:"onCheckTimer",value:function(e){!this.COSSDK||this.TIMUploadPlugin||this.isLoggedIn()&&e%60==0&&Math.ceil(Date.now()/1e3)>=this.cosOptions.expiredTime-120&&this._getAuthorizationKey()}},{key:"getFileDNList",value:function(){return this._fileDNList}},{key:"_getAuthorization",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:"upload",value:function(e){if(!0===e._relayFlag)return Promise.resolve();var t=this.get(26);switch(e.type){case S.MSG_IMAGE:return t.addTotalCount(Jn),this._uploadImage(e);case S.MSG_FILE:return t.addTotalCount(Jn),this._uploadFile(e);case S.MSG_AUDIO:return t.addTotalCount(Jn),this._uploadAudio(e);case S.MSG_VIDEO:return t.addTotalCount(Jn),this._uploadVideo(e);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(e){var t=this,n=this.get(2),o=e.getElements()[0],i=n.getMessageOption(e.clientSequence);return this.doUploadImage({file:i.payload.file,to:i.to,message:e,onProgress:function(e){if(o.updatePercent(e),Je(i.onProgress))try{i.onProgress(e)}catch(t){return Sn({code:qn.MSG_ONPROGRESS_ERR})}}}).then((function(n){var i=n.location,s=n.fileType,r=n.fileSize,a=n.width,c=n.height,u=n.smallImageUrl,l=n.smallImageWidth,p=n.smallImageHeight,d=n.largeImageUrl,h=n.largeImageWidth,f=n.largeImageHeight,m=n.imageInfoArray;n=t.isPrivateNetWork()?i:rt(i),o.updateImageFormat(s);var _,v,y={size:r,url:n,width:a,height:c};if(m&&0<m.length)for(var I=0;I<m.length;I++){var M=m[I];1===M.type?_=M:2===M.type?v=M:y=g(g({},y),M)}else v=u&&d?(_={url:u,width:l,height:p},{url:d,width:h,height:f}):(_=bt({originUrl:n,originWidth:a,originHeight:c,min:198}),bt({originUrl:n,originWidth:a,originHeight:c,min:720}));return o.updateImageInfoArray([g({},y),g({},v),g({},_)]),e}))}},{key:"_uploadFile",value:function(e){var t=this,n=this.get(2),o=e.getElements()[0],i=n.getMessageOption(e.clientSequence);return this.doUploadFile({file:i.payload.file,to:i.to,message:e,onProgress:function(e){if(o.updatePercent(e),Je(i.onProgress))try{i.onProgress(e)}catch(t){return Sn({code:qn.MSG_ONPROGRESS_ERR})}}}).then((function(n){var i=n=n.location;return t.isPrivateNetWork()||(i=co(i=rt(n),t._fileDownloadProxy,t._authKey,t._fileDNList)),o.updateFileUrl(i),e}))}},{key:"_uploadAudio",value:function(e){var t=this,n=this.get(2),o=e.getElements()[0],i=n.getMessageOption(e.clientSequence);return this.doUploadAudio({file:i.payload.file,to:i.to,message:e,onProgress:function(e){if(o.updatePercent(e),Je(i.onProgress))try{i.onProgress(e)}catch(t){return Sn({code:qn.MSG_ONPROGRESS_ERR})}}}).then((function(n){return n=n.location,n=t.isPrivateNetWork()?n:rt(n),o.updateAudioUrl(n),e}))}},{key:"_uploadVideo",value:function(e){var t=this,n=this.get(2),o=e.getElements()[0],i=n.getMessageOption(e.clientSequence);return this.doUploadVideo({file:i.payload.file,to:i.to,message:e,onProgress:function(e){if(o.updatePercent(e),Je(i.onProgress))try{i.onProgress(e)}catch(t){return Sn({code:qn.MSG_ONPROGRESS_ERR})}}}).then((function(n){var i=n.location;return n=n.snapshotInfo,i=t.isPrivateNetWork()?i:rt(i),o.updateVideoUrl(i),qe(n)||o.updateSnapshotInfo(n),e}))}},{key:"_checkSizeError",value:function(e){var t="";return"A"===e?t="audio":"I"===e?t="image":"V"===e?t="video":"F"===e&&(t="file"),Sn({code:qn["MSG_".concat(e,"_SIZE_LIMIT")],message:this.getErrMsg("UploadSizeLimit",t,"".concat(this.UPLOAD_SIZE_LIMIT[e]/1048576,"MB"))})}},{key:"doUploadImage",value:function(e){var t,n,o=this;return!e.file||this._isEmptyFileList(e.file.files)?Sn({code:qn.MSG_I_SELECT_F_FIRST}):!0!==(t=this._checkImageType(e.file))||!0!==(t=this._checkImageSize(e.file))?t:(n=null,this._setUploadFileType(1),this.uploadByCOS(e).then((function(t){if(n=t,o.isPrivateNetWork())return Lt(s);if(Ye(n.imageInfoArray)){var i=n.imageInfoArray.find((function(e){return 3===e.type}));if(i)return i}var s;return ee?{width:e.file.width,height:e.file.height}:(s=rt(t.location),o.COSSDK?Lt(s):Lt(s=co(s,o._fileDownloadProxy,o._authKey,o._fileDNList)))})).then((function(e){return n.width=e.width,n.height=e.height,Promise.resolve(n)})))}},{key:"_checkImageType",value:function(e){var t="";return t=Z?e.url.slice(e.url.lastIndexOf(".")+1):ee?e.type.split("/")[1]:e.files[0].name.slice(e.files[0].name.lastIndexOf(".")+1),0<=Vo.indexOf(t.toLowerCase())||Sn({code:qn.MSG_I_TYPES_LIMIT})}},{key:"_checkImageSize",value:function(e){return 0===(e=(Z||ee?e:e.files[0]).size)?Sn({code:qn.MSG_F_IS_EMPTY}):e<this.UPLOAD_SIZE_LIMIT.I||this._checkSizeError("I")}},{key:"doUploadFile",value:function(e){return!e.file||this._isEmptyFileList(e.file.files)?Sn({code:qn.MSG_F_SELECT_F_FIRST}):e.file.files[0].size>this.UPLOAD_SIZE_LIMIT.F?this._checkSizeError("F"):0===e.file.files[0].size?Sn({code:qn.MSG_F_IS_EMPTY}):(this._setUploadFileType(255),this.uploadByCOS(e))}},{key:"doUploadVideo",value:function(e){return e.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.V?this._checkSizeError("V"):0===e.file.videoFile.size?Sn({code:qn.MSG_F_IS_EMPTY}):-1===jo.indexOf(e.file.videoFile.type)?Sn({code:qn.MSG_V_TYPES_LIMIT}):(this._setUploadFileType(2),Z||ee?this.handleVideoUpload(g(g({},e),{},{file:e.file.videoFile})):te?this.handleVideoUpload(e):void 0)}},{key:"handleVideoUpload",value:function(e){var t=this;return new Promise((function(n,o){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){o(new Bn({code:qn.MSG_V_UPLOAD_FAIL}))}))}))}))}},{key:"doUploadAudio",value:function(e){return e.file?e.file.size>this.UPLOAD_SIZE_LIMIT.A?this._checkSizeError("A"):0===e.file.size?Sn({code:qn.MSG_F_IS_EMPTY}):(this._setUploadFileType(3),this.uploadByCOS(e)):Sn({code:qn.MSG_A_UPLOAD_FAIL})}},{key:"uploadByCOS",value:function(e){var t,n,o,i,s=this;return Je(this._cosUploadMethod)?this.timUploadPlugin?this._uploadWithPreSigUrl(e):(t=new io("upload"),n="".concat(this._n,".uploadByCOS"),o=Date.now(),i=this._getFile(e),new Promise((function(r,a){var c=Z?s._createCosOptionsWXMiniApp(e):s._createCosOptionsWeb(e),u=s;s._cosUploadMethod(c,(function(e,c){var l,p,d=Object.create(null);c?e||Ye(c.files)&&c.files[0].error?(l=new Bn({code:qn.MSG_F_UPLOAD_FAIL}),t.setError(l).end(),Oe.l("".concat(n," failed. error:"),c.files[0].error),403===c.files[0].error.statusCode&&s._getAuthorizationKey(),a(l)):(d.fileName=i.name,d.fileSize=i.size,d.fileType=i.type.slice(i.type.indexOf("/")+1).toLowerCase(),d.location=(Z?c:c.files[0].data).Location,l=Date.now()-o,c=u._formatFileSize(i.size),p=u._formatSpeed(1e3*i.size/l),c="size:".concat(c," time:").concat(l,"ms speed:").concat(p),Oe.l("".concat(n," success. name:").concat(i.name," ").concat(c)),r(d),(p=s.get(26)).addCost(Jn,l),p.addFileSize(Jn,i.size),t.setMessage(c).end()):(d=new Bn({code:qn.MSG_F_UPLOAD_FAIL}),t.setError(d).end(),Oe.w("".concat(n," failed. error:"),e),403===e.statusCode&&s._getAuthorizationKey(),a(d))}))}))):(this.warn("PluginUndetected"),Sn({code:qn.COS_UNDETECTED}))}},{key:"_uploadWithPreSigUrl",value:function(e){var t=this,n="".concat(this._n,"._uploadWithPreSigUrl"),o=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then((function(e){return new Promise((function(i,s){var r=new io("upload"),a=e.requestSnapshotUrl,c=void 0===a?void 0:a,u=f(e,Bi),l=Date.now();t._cosUploadMethod(u,(function(a,p){if(a||403===p.statusCode)r.setError(new Bn(a)).end(),h={HttpStatusCode:9999,CostTime:$t(l,!1),error:a,url:e.url},p.data&&p.data.uploadIP&&(h.uploadIP=p.data.uploadIP),t._uploadSSOLog(h),Oe.l("".concat(n," failed, error:"),a),s(new Bn({code:qn.MSG_F_UPLOAD_FAIL}));else{var d=Object.create(null),h=p.data.location||"",g=(t.isPrivateNetWork()||0!==h.indexOf("https://")&&0!==h.indexOf("http://")||(h=h.split("//")[1]),d.fileName=o.name,d.fileSize=o.size,d.fileType=o.type.slice(o.type.indexOf("/")+1).toLowerCase(),d.location=h,a=$t(l,!1),h=t._formatFileSize(o.size),t._formatSpeed(1e3*o.size/a));if(h="size:".concat(h," time:").concat(a,"ms speed:").concat(g," res:").concat(JSON.stringify(p.data)),Oe.l("".concat(n," ok. name:").concat(o.name," ").concat(h)),r.setMessage(h).end(),g={HttpStatusCode:p.statusCode,FileSize:o.size,CostTime:a,url:e.url},(p.data&&p.data.uploadIP&&(g.uploadIP=p.data.uploadIP),t._uploadSSOLog(g),h=t.get(26)).addCost(Jn,a),h.addFileSize(Jn,o.size),g=[],u.thumbUrl&&u.largeUrl&&g.push.apply(g,[t._getSmallImageInfoByUrl(u.thumbUrl,d),t._getLargeImageInfoByUrl(u.largeUrl,d)]),1===t.uploadFileType&&t.isSimpleCos&&!t.isPrivateNetWork()&&(g.push(t._getImageInfoArray(u.downloadUrl,d)),p.data.uploadIP)&&g.push(t._getDownloadIP(u.downloadUrl.split("//")[1].split("/")[0],d)),c&&g.push(t._getSnapshotInfoByUrl(c,d)),0<g.length)return Promise.all(g).then((function(){i(d)}));i(d)}}))}))}))}},{key:"_getDownloadIP",value:function(e,t){var n="".concat(this._n,"._getDownloadIP"),o=Date.now();return this.req({P:jn.GET_IP,data:{domainName:e}}).then((function(e){var i;e.data&&e.data.ip&&(Oe.l("".concat(n," ok. downloadIP:").concat(e.data.ip," cost:").concat($t(o))),(i=t.location.split("/"))[0]=e.data.ip,t.location=i.join("/"))})).catch((function(e){}))}},{key:"_getImageInfoArray",value:function(e,t){var n=this,o="".concat(this._n,"._getImageInfoArray"),i=Date.now();return this.req({P:jn.GET_IMAGE_INFO,data:{imageUrl:e}}).then((function(e){return e=e.data||{},Oe.l("".concat(o," ok. data: ").concat(JSON.stringify(e)," cost:").concat($t(i))),t.imageInfoArray=e.imageInfoArray,e})).catch((function(o){t.imageInfoArray=void 0,n._uploadSSOLog({HttpStatusCode:1e4,CostTime:$t(i,!1),url:e})}))}},{key:"_uploadSSOLog",value:function(e){var t,n;this.isSimpleCos&&((t=new io).setEventType(18),e.error&&t.setError(new Bn(e.error)),n="HttpStatusCode:".concat(e.HttpStatusCode,"|CosRequestId:").concat(e.CosRequestId||"","|")+"FileAlreadyExist:".concat(e.FileAlreadyExist||0,"|FileSize:").concat(e.FileSize||0,"|CostTime:").concat(e.CostTime),e.uploadIP&&(n+="|FinalIP:".concat(e.uploadIP)),t.setMessage("OK").setMoreMessage(e.url).setExtension(n).end())}},{key:"_getRawOrUploadProxyUrl",value:function(e){var t=this.get(12).getFileUploadProxy(),n=e;return t?e.replace(/^https:\/\/[^/]+/,t):n}},{key:"_getFile",value:function(e){return Ye(e.file.files)||Xe(e.file.files)?e.file.files[0]:e.file}},{key:"_formatFileSize",value:function(e){return e<1024?e+"B":e<1048576?Math.floor(e/1024)+"KB":Math.floor(e/1048576)+"MB"}},{key:"_formatSpeed",value:function(e){return e<=1048576?xt(e/1024,1)+"KB/s":xt(e/1048576,1)+"MB/s"}},{key:"_createCosOptionsWeb",value:function(e){var t=this._getFile(e),n=(n=t.name).slice(n.lastIndexOf("."));return n=this._genFileName("".concat(ot(999999)).concat(n)),{files:[{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(n),Body:t}],SliceSize:1048576,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Oe.w("onProgress callback error:",n)}},onFileFinish:function(e,t,n){}}}},{key:"_createCosOptionsWXMiniApp",value:function(e){var t=this._getFile(e),n=this._genFileName(t.name);return t=t.url,{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(n),FilePath:t,onProgress:function(t){if(Oe.l(JSON.stringify(t)),"function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Oe.w("onProgress callback error:",n)}}}}},{key:"_createCosOptionsPreSigUrl",value:function(e){var t,n=this,o="",i="",s=0,r=this._getFile(e);return s=Z||ee?(o=e.message.type===S.MSG_FILE?(t=(t=r.name).slice(t.lastIndexOf(".")),this._genFileName("".concat(ot(999999)).concat(t))):this._genFileName(r.name),i=r.url,1):(t=(t=r.name).slice(t.lastIndexOf(".")),o=this._genFileName("".concat(ot(999999)).concat(t)),i=r,0),this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:o,uploadMethod:s,duration:this.duration,userID:e.message.from,conversationType:St(e.message.conversationID)?1:2}).then((function(t){var s=(l=n.isSimpleCos?t.preSig[0]:t).uploadUrl,r=l.downloadUrl,a=void 0===(a=l.requestSnapshotUrl)?void 0:a,c=l.thumbUrl,u=l.largeUrl,l=l.fileKey;return t=void 0===(t=t.uploadIP)?"":t,{url:n._getRawOrUploadProxyUrl(s),fileType:n.uploadFileType,fileName:o,resources:i,downloadUrl:r,requestSnapshotUrl:a,thumbUrl:c,largeUrl:u,fileKey:l,uploadIP:!n.isPrivateNetWork()&&t,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Oe.w("onProgress callback error:",n),Oe.e(n)}}}}))}},{key:"_genFileName",value:function(e){return"".concat(Rt(),"-").concat(e)}},{key:"_setUploadFileType",value:function(e){this.uploadFileType=e}},{key:"_getSnapshotInfoByUrl",value:function(e,t){var n=this,o="_getSnapshotInfoByUrl",i=new io(o);return this.req({P:jn.VIDEO_COVER,data:{platform:this.getPlatform(),coverName:this._genFileName(ot(99999)),requestSnapshotUrl:e}}).then((function(e){var s;return e=(e.data||{}).snapshotUrl,Oe.l("".concat(n._n,".").concat(o," ok. snapshotUrl:").concat(e)),i.setMessage("snapshotUrl:".concat(e)).end(),qe(e)?{}:Lt(s=co(e,n._fileDownloadProxy,n._authKey,n._fileDNList)).then((function(e){t.snapshotInfo={snapshotUrl:s,snapshotWidth:e.width,snapshotHeight:e.height}}))})).catch((function(e){return Oe.w("".concat(n._n,".").concat(o," failed. error:"),e),i.setCode(e.errorCode).setMessage(e.errorInfo).end(),{}}))}},{key:"_getSmallImageInfoByUrl",value:function(e,t){return Lt(co(e,this._fileDownloadProxy,this._authKey,this._fileDNList)).then((function(n){t.smallImageUrl=e,t.smallImageWidth=n.width,t.smallImageHeight=n.height}))}},{key:"_getLargeImageInfoByUrl",value:function(e,t){return Lt(co(e,this._fileDownloadProxy,this._authKey,this._fileDNList)).then((function(n){t.largeImageUrl=e,t.largeImageWidth=n.width,t.largeImageHeight=n.height}))}},{key:"_isEmptyFileList",value:function(e){return!(!Xe(e)||0!==e.length)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset"))}}])),Vi=["downloadKey","pbDownloadKey","messageList"],ji=s((function e(t){o(this,e),this._n="MergerMessageHandler",this._msgM=t}),[{key:"uploadMergerMessage",value:function(e,t){var n="".concat(this._n,".").concat("uploadMergerMessage"),o=(Oe.d("".concat(n," message:"),e,"messageBytes:".concat(t)),e=JSON.parse(JSON.stringify(e.payload)).messageList).length,i=this._msgM.get(17).getFileDNList(),s=new io("uploadMergerMessage");return e.forEach((function(e){uo(e.messageBody[0].type,e.messageBody,i)})),this._msgM.req({P:jn.UPLOAD_MERGER_MSG,data:{messageList:e}}).then((function(e){Oe.d("".concat(n," ok. response:"),e.data);var i={pbDownloadKey:i=(e=e.data).pbDownloadKey,downloadKey:e=e.downloadKey,messageNumber:o};return s.setMessage("".concat(o,"-").concat(t,"-").concat(e)).end(),i})).catch((function(e){throw Oe.w("".concat(n," failed. error:"),e),s.setError(e).end(),e}))}},{key:"downloadMergerMessage",value:function(e){var t=this,n="".concat(this._n,".").concat("downloadMergerMessage"),o=(Oe.d("".concat(n," message:"),e),e.payload.downloadKey),i=this._msgM.getFileDownloadProxy(),s=this._msgM.getDownloadFileAuthKey(),r=new io("downloadMergerMessage");return r.setMessage("downloadKey:".concat(o)),this._msgM.req({P:jn.DOWNLOAD_MERGER_MSG,data:{downloadKey:o}}).then((function(o){Oe.d("".concat(n," ok. response:"),o.data);var a,c,u=t._msgM.get(17).getFileDNList();return Je(e.clearElement)?((a=e.payload).downloadKey,a.pbDownloadKey,a.messageList,a=f(a,Vi),e.clearElement(),e.setElement({type:e.type,content:g({messageList:o.data.messageList},a)},i,s,u)):(c=[],o.data.messageList.forEach((function(e){qe(e)||(e=new So(e,i,s,u),c.push(e))})),e.payload.messageList=c,e.payload.downloadKey="",e.payload.pbDownloadKey=""),r.end(),e})).catch((function(e){throw Oe.w("".concat(n," failed. key:").concat(o," error:"),e),r.setError(e).end(),e}))}},{key:"createMergerMessagePack",value:function(e,t,n){return e.conversationType===S.CONV_C2C?this._createC2CMergerMessagePack(e,t,n):this._createGroupMergerMessagePack(e,t,n)}},{key:"_createC2CMergerMessagePack",value:function(e,t,n){var o=null,i=(t&&(t.offlinePushInfo&&(o=t.offlinePushInfo),!0===t.onlineUserOnly)&&(o?o.disablePush=!0:o={disablePush:!0}),[]),s=(ze(t)&&ze(t.messageControlInfo)&&(s=(a=t.messageControlInfo).excludedFromUnreadCount,r=a.excludedFromLastMessage,a=a.excludedFromContentModeration,!0===s&&i.push("NoUnread"),!0===r&&i.push("NoLastMsg"),!0===a)&&i.push("NoMsgCheck"),""),r=(ut(e.cloudCustomData)&&0<e.cloudCustomData.length&&(s=e.cloudCustomData),n.pbDownloadKey),a=n.downloadKey,c=(n=n.messageNumber,(l=e.payload).title),u=l.abstractList,l=l.compatibleText,p=(p=this._msgM.get(6))&&p.isOnlineMessage(e,t)?0:void 0;return{P:jn.SEND_C2C_MSG,data:{fromAccount:this._msgM.getMyUserID(),toAccount:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:r,downloadKey:a,title:c,abstractList:u,compatibleText:l,messageNumber:n}}],cloudCustomData:s,clientTime:e.clientTime,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:p,offlinePushInfo:Po(o),messageControlInfo:0!==p?i:void 0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0}}}},{key:"_createGroupMergerMessagePack",value:function(e,t,n){var o=null,i=(t&&t.offlinePushInfo&&(o=t.offlinePushInfo),[]),s=(ze(t)&&ze(t.messageControlInfo)&&(s=(a=t.messageControlInfo).excludedFromUnreadCount,r=a.excludedFromLastMessage,a=a.excludedFromContentModeration,!0===s&&i.push("NoUnread"),!0===r&&i.push("NoLastMsg"),!0===a)&&i.push("NoMsgCheck"),""),r=(ut(e.cloudCustomData)&&0<e.cloudCustomData.length&&(s=e.cloudCustomData),n.pbDownloadKey),a=n.downloadKey,c=(n=n.messageNumber,(l=e.payload).title),u=l.abstractList,l=l.compatibleText,p=this._msgM.get(7);return t=p&&p.isOnlineMessage(e,t)?1:0,{P:jn.SEND_GRP_MSG,data:{fromAccount:this._msgM.getMyUserID(),groupID:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:r,downloadKey:a,title:c,abstractList:u,compatibleText:l,messageNumber:n}}],random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:void 0,cloudCustomData:s,onlineOnlyFlag:t,offlinePushInfo:Po(o),clientTime:e.clientTime,needReadReceipt:!0!==e.needReadReceipt||p.isMessageFromOrToAVChatroom(e.to)?0:1,messageControlInfo:0==t?i:void 0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0}}}}]),Hi={ERR_SVR_COMM_SENSITIVE_TEXT:80001,ERR_SVR_COMM_BODY_SIZE_LIMIT:80002,OPEN_SERVICE_OVERLOAD_ERROR:60022,ERR_SVR_MSG_PKG_PARSE_FAILED:20001,ERR_SVR_MSG_INTERNAL_AUTH_FAILED:20002,ERR_SVR_MSG_INVALID_ID:20003,ERR_SVR_MSG_PUSH_DENY:20006,ERR_SVR_MSG_IN_PEER_BLACKLIST:20007,ERR_SVR_MSG_BOTH_NOT_FRIEND:20009,ERR_SVR_MSG_NOT_PEER_FRIEND:20010,ERR_SVR_MSG_NOT_SELF_FRIEND:20011,ERR_SVR_MSG_SHUTUP_DENY:20012,ERR_SVR_GROUP_INVALID_PARAMETERS:10004,ERR_SVR_GROUP_PERMISSION_DENY:10007,ERR_SVR_GROUP_NOT_FOUND:10010,ERR_SVR_GROUP_INVALID_GROUPID:10015,ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY:10016,ERR_SVR_GROUP_SHUTUP_DENY:10017,MSG_SEND_FAIL:2100,OVER_FREQUENCY_LIMIT:2996},Ki=[qn.MSG_ONPROGRESS_ERR,qn.MSG_I_SELECT_F_FIRST,qn.MSG_I_TYPES_LIMIT,qn.MSG_F_IS_EMPTY,qn.MSG_I_SIZE_LIMIT,qn.MSG_F_SELECT_F_FIRST,qn.MSG_F_SIZE_LIMIT,qn.MSG_V_SIZE_LIMIT,qn.MSG_V_TYPES_LIMIT,qn.MSG_A_UPLOAD_FAIL,qn.MSG_A_SIZE_LIMIT,qn.COS_UNDETECTED];function $i(e){o(this,$i),(e=n(this,$i,[e]))._n="UploadModule",e.TIMUploadPlugin=null,e.timUploadPlugin=null,e.COSSDK=null,e._cosUploadMethod=null,e.expiredTimeLimit=600,e.appid=0,e.bucketName="",e.ciUrl="",e.directory="",e.downloadUrl="",e.uploadUrl="",e.region="ap-shanghai",e.cos=null,e.cosOptions={secretId:"",secretKey:"",sessionToken:"",expiredTime:0},e.uploadFileType="",e.duration=900,e.tryCount=0,e.UPLOAD_SIZE_LIMIT={A:20971520,F:104857600,I:20971520,V:104857600},e.isSimpleCos=!1,e._fileDownloadProxy="",e._authKey="",e._fileDNList=Fi;var t=e.getIEmitInst();return t.on(xo.A2KEY_AND_TINYID_UPDATED,e._init,e),t.on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function zi(e){var t=!1;return Object.values(Hi).includes(e)&&(t=!0),120001<=e&&e<=13e4||10100<=e&&e<=10200||t}u(rs,Pn);var Yi=s(rs,[{key:"createTextMessage",value:function(e){var t=this.getMyUserID(),n=(e.currentUser=t,e.senderTinyID=this.getMyTinyID(),new Do(e));return e=ut(e.payload)?e.payload:e.payload.text,e=new so({text:e}),t=this._getNickAndAvatarByUserID(t),n.setElement(e),n.setNickAndAvatar(t),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createImageMessage",value:function(e){var t=this.getMyUserID(),n=(e.currentUser=t,e.senderTinyID=this.getMyTinyID(),new Do(e));if(Z){if(He(i=e.payload.file))return void this.warn("FileUnsupportedInMP","createImageMessage");var o=i.tempFiles[0].path||i.tempFiles[0].tempFilePath,i={url:o,name:o.slice(o.lastIndexOf("/")+1),size:i.tempFiles&&i.tempFiles[0].size||1,type:o.slice(o.lastIndexOf(".")+1).toLowerCase()};e.payload.file=i}else ee?(i={url:(o=e.payload.file).uri,name:o.fileName,size:o.fileSize||1,type:o.type,width:o.width,height:o.height},e.payload.file=i):te&&(He(e.payload.file)?(o=e.payload.file,e.payload.file={files:[o]}):ze(e.payload.file)&&void 0!==Gn&&(i=e.payload.file.tempFiles[0],e.payload.file={files:[i]}));return o=this.get(17).getFileDNList(),i=new ho({imageFormat:Ae.UNKNOWN,uuid:this._generateUUID(e.payload.file),file:e.payload.file},this.getFileDownloadProxy(),this.getDownloadFileAuthKey(),o),o=this._getNickAndAvatarByUserID(t),n.setElement(i),n.setNickAndAvatar(o),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:"createAudioMessage",value:function(e){var t=e.payload.file,n=(Z&&(n={url:t.tempFilePath,name:t.tempFilePath.slice(t.tempFilePath.lastIndexOf("/")+1),size:t.fileSize,second:parseInt(t.duration)/1e3,type:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(".")+1).toLowerCase()},e.payload.file=n),ee&&(n={url:t.uri,name:t.uri.slice(t.uri.lastIndexOf("/")+1),size:t.fileSize||1,second:Math.floor(t.duration/1e3),type:t.uri.slice(t.uri.lastIndexOf(".")+1).toLowerCase()},e.payload.file=n,qe(t.uri))&&this.warn("VoiceFileInRN"),this.getMyUserID()),o=(e.currentUser=n,e.senderTinyID=this.getMyTinyID(),this.get(17).getFileDNList()),i=new Do(e);return t=new fo({second:Math.floor(t.duration/1e3),size:t.fileSize||t.size||1,url:t.tempFilePath||t.uri,uuid:this._generateUUID(e.payload.file)},this.getFileDownloadProxy(),this.getDownloadFileAuthKey(),o),o=this._getNickAndAvatarByUserID(n),i.setElement(t),i.setNickAndAvatar(o),i.setNameCard(this._getNameCardByGroupID(i)),this._messageOptionsMap.set(i.clientSequence,e),i}},{key:"createVideoMessage",value:function(e){var t=this.getMyUserID(),n=(e.currentUser=t,e.senderTinyID=this.getMyTinyID(),e.payload.file.thumbUrl="",e.payload.file.thumbSize=0,{});if(Z){if(z)return void this.warn("VideoUnsupportedInAlipay");if(He(e.payload.file))return void this.warn("FileUnsupportedInMP","createVideoMessage");Ye((o=e.payload.file).tempFiles)&&(o=o.tempFiles[0]),n.url=o.tempFilePath,n.name=o.tempFilePath.slice(o.tempFilePath.lastIndexOf("/")+1),n.size=o.size||1,n.second=o.duration||0,n.type=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(".")+1).toLowerCase()}else ee?(o=e.payload.file,n.url=o.uri,n.name=o.fileName,n.size=o.fileSize||1,n.second=o.duration||0,n.type=o.type.split("/")[1]):te&&(He(e.payload.file)?(o=e.payload.file,e.payload.file.files=[o]):ze(e.payload.file)&&void 0!==Gn&&(o=e.payload.file.tempFile,e.payload.file.files=[o]),o=e.payload.file,n.url=window.URL.createObjectURL(o.files[0]),n.name=o.files[0].name,n.size=o.files[0].size||1,n.second=o.files[0].duration||0,n.type=o.files[0].type.split("/")[1]);e.payload.file.videoFile=n;var o=this.get(17).getFileDNList(),i=new Do(e);return n=new Co({videoFormat:n.type,videoSecond:xt(n.second,0),videoSize:n.size,remoteVideoUrl:"",videoUrl:n.url,videoUUID:this._generateUUID(e.payload.file.videoFile),thumbUUID:this._generateUUID(e.payload.file.videoFile,"jpg"),thumbWidth:e.payload.file.width||200,thumbHeight:e.payload.file.height||200,thumbUrl:e.payload.file.thumbUrl,thumbSize:e.payload.file.thumbSize,thumbFormat:"jpg"},this.getFileDownloadProxy(),this.getDownloadFileAuthKey(),o),o=this._getNickAndAvatarByUserID(t),i.setElement(n),i.setNickAndAvatar(o),i.setNameCard(this._getNameCardByGroupID(i)),this._messageOptionsMap.set(i.clientSequence,e),i}},{key:"createCustomMessage",value:function(e){var t=this.getMyUserID(),n=(e.currentUser=t,e.senderTinyID=this.getMyTinyID(),new Do(e));return e=new Mo({data:e.payload.data,description:e.payload.description,extension:e.payload.extension}),t=this._getNickAndAvatarByUserID(t),n.setElement(e),n.setNickAndAvatar(t),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createFaceMessage",value:function(e){var t=this.getMyUserID(),n=(e.currentUser=t,e.senderTinyID=this.getMyTinyID(),new Do(e));return e=new go(e.payload),t=this._getNickAndAvatarByUserID(t),n.setElement(e),n.setNickAndAvatar(t),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createMergerMessage",value:function(e){var t=this.getMyUserID(),n=(e.currentUser=t,e.senderTinyID=this.getMyTinyID(),t=this._getNickAndAvatarByUserID(t),new Do(e));return e=new Eo(e.payload),n.setElement(e),n.setNickAndAvatar(t),n.setNameCard(this._getNameCardByGroupID(n)),n.setRelayFlag(!0),n}},{key:"createForwardMessage",value:function(e){var t,n,o=e.to,i=e.conversationType,s=e.priority,r=e.payload,a=e.needReadReceipt,c=e.receiverList;return Ye(r._elements)?(t=this.getMyUserID(),n=this._getNickAndAvatarByUserID(t),r.type===S.MSG_GRP_TIP?Sn({code:qn.MSG_FORWARD_TYPE_INVALID}):(i={to:o,conversationType:i,conversationID:"".concat(i).concat(o),priority:s,isPlaceMessage:0,status:En,currentUser:t,senderTinyID:this.getMyTinyID(),cloudCustomData:e.cloudCustomData||r.cloudCustomData||"",needReadReceipt:a,receiverList:c,isSupportExtension:e.isSupportExtension||!1},(o=new Do(i)).setElement(r._elements[0]),o.setNickAndAvatar(n),o.setNameCard(this._getNameCardByGroupID(r)),o.setRelayFlag(!0),o)):Sn({code:qn.MSG_FORWARD_INVALID_ELEMENTS})}},{key:"downloadMergerMessage",value:function(e){return this._mergerMessageHandler.downloadMergerMessage(e)}},{key:"createFileMessage",value:function(e){if(Z){if(!V&&!H&&!W)return;var t=ne.getSystemInfoSync().SDKVersion;if(V&&At(t,"2.5.0")<0)return void this.warn("WXChooseMessageFile");if(H&&At(t,"1.18.0")<0)return void this.warn("QQChooseMessageFile")}te||W?He(e.payload.file)?(t=e.payload.file,e.payload.file={files:[t]}):ze(e.payload.file)&&void 0!==Gn&&(o=(t=e.payload.file).tempFiles,t=t.files,n=null,Ye(o)?n=o[0]:Ye(t)&&(n=t[0]),e.payload.file={files:[n]}):V||H?(t=g(g({},(o=e.payload.file.tempFiles)[0]),{},{url:o[0].path}),e.payload.file={files:[t]}):ee&&(o=g(g({},n=e.payload.file),{},{url:n.uri}),e.payload.file={files:[o]}),t=this.getMyUserID();var n=(e.currentUser=t,e.senderTinyID=this.getMyTinyID(),new Do(e)),o=new Io({uuid:this._generateUUID(e.payload.file),file:e.payload.file});return t=this._getNickAndAvatarByUserID(t),n.setElement(o),n.setNickAndAvatar(t),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:"createLocationMessage",value:function(e){var t=this.getMyUserID(),n=(e.currentUser=t,e.senderTinyID=this.getMyTinyID(),new Do(e));return e=new To(e.payload),t=this._getNickAndAvatarByUserID(t),n.setElement(e),n.setNickAndAvatar(t),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"_onNoModule",value:function(){return Sn({code:qn.NO_MODULE})}},{key:"sendMessageInstance",value:function(e,t){var n=this;if(!1===this.get(29).filterMessage(e,t))return e.hasRiskContent=!0,this._onSendMessageFailed(e,new Bn({code:qn.PROFANITY_FOUND}));var o,i,s,r,a=null;if(e.conversationType===S.CONV_C2C)a=this.get(6);else{if(e.conversationType!==S.CONV_GROUP)return Sn({code:qn.MSG_INVALID_CONV_TYPE});a=this.get(7)}return a?(i="".concat(this._n,".sendMessageInstance"),s=this.get(11),r=a.isOnlineMessage(e,t),this.get(17).upload(e).then((function(){return n._getSendMessageSpecifiedKey(e)===Wn&&n.get(26).addSuccessCount(Jn),n._guardForGroup(e).then((function(){if(!e.isSendable())return Sn({code:qn.MSG_F_URL_IS_EMPTY});n._addSendMessageTotalCount(e),o=Date.now();var i=function(e){var t="utf-8";te&&document&&(t=document.charset.toLowerCase());var n,o=0,i=e.length;if("utf-8"===t||"utf8"===t)for(var s=0;s<i;s++)(n=e.codePointAt(s))<=127?o+=1:n<=2047?o+=2:n<=65535?o+=3:(o+=4,s++);else if("utf-16"===t||"utf16"===t)for(var r=0;r<i;r++)(n=e.codePointAt(r))<=65535?o+=2:(o+=4,r++);else o=e.replace(/[^\x00-\xff]/g,"aa").length;return o}(JSON.stringify(e));return e.type===S.MSG_MERGER&&11264<i?n._mergerMessageHandler.uploadMergerMessage(e,i).then((function(o){return o=n._mergerMessageHandler.createMergerMessagePack(e,t,o),n.req(o)})):(s.setMessageRandom(e),a.sendMessage(e,t))})).then((function(a){var c=(a=a.data).time,u=a.sequence,l=a.readReceiptCode;return a=a.messageDropReason,Ke(l)&&0!==l&&(new io("sendMessageWithReceipt").setMessage("from:".concat(e.from," to:").concat(e.to," sequence:").concat(u," readReceiptCode:").concat(l)).end(),Oe.w("".concat(i," readReceiptCode:").concat(l," message:").concat(n.getErrMsg(l)))),a&&(l=new io("messageDropReason"),a="from:".concat(e.from," to:").concat(e.to," sequence:").concat(u," messageDropReason:").concat(a),l.setMessage(a).end(),Oe.w("".concat(i," ").concat(a))),n._addSendMessageSuccessCount(e,o),n._messageOptionsMap.delete(e.clientSequence),!0===e.isResend&&(l=s.findMessage(e.ID))&&(Oe.l("".concat(i," resend ok. ID:").concat(l.ID)),s.deleteLocalMessage(l)),e.status=kn,e.time=c,a=!1,e.conversationType===S.CONV_GROUP?e.sequence=u:e.conversationType===S.CONV_C2C&&(l=s.getLatestMessageSentByMe(e.conversationID))&&(c=l.nick,u=l.avatar,c===e.nick&&u===e.avatar||(a=!0)),a&&s.modifyMessageSentByMe({conversationID:e.conversationID,latestNick:e.nick,latestAvatar:e.avatar}),!0===r?e._onlineOnlyFlag=!0:(s.appendToMessageList(e),l=e,ze(t)&&ze(t.messageControlInfo)&&(!0===t.messageControlInfo.excludedFromLastMessage&&(e._isExcludedFromLastMessage=!0,l=""),!0===t.messageControlInfo.excludedFromUnreadCount)&&(e._isExcludedFromUnreadCount=!0),c=e.conversationType,Tt(e.to)&&(c=S.CONV_TOPIC,n.get(10).onMessageSent({groupID:Gt(e.to),topicID:e.to,lastMessage:l})),s.onMessageSent({conversationOptionsList:[{conversationID:e.conversationID,unreadCount:0,type:c,subType:e.conversationSubType,lastMessage:l}]})),e._relayFlag||"TIMImageElem"!==e.type||Pt(e.payload.imageInfoArray),Cn({message:e})}))})).catch((function(t){return n._onSendMessageFailed(e,t,r)}))):this._onNoModule()}},{key:"_guardForGroup",value:function(e){if(e.conversationType!==S.CONV_GROUP)return Promise.resolve();var t=this.get(7);if(!t)return this._onNoModule();if(Ct({groupID:e.to})){var n=t.getLocalGroupProfile(e.to);if(n&&n.isSupportTopic)return Sn({code:qn.MSG_SEND_GRP_WITH_TOPIC_FAIL})}return t.guardForAVChatRoom(e)}},{key:"_onSendMessageFailed",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],o="".concat(this._n,"._onSendMessageFailed"),i=(e.status=Dn,80001!==t.code&&80004!==t.code||(e.hasRiskContent=!0),this.get(11)),s=(i.deleteMessageRandom(e),10100<=t.code&&t.code<=10200||120001<=t.code&&t.code<=13e4);return n||s||!0===i.appendToMessageList(e)&&Oe.l("".concat(o," message stored, ID:").concat(e.ID)),this._addSendMessageFailCountOnUser(e,t),n=new io("sendMessage"),s="head.seq:".concat(t.data.headSeq," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to),te&&("connection"in navigator&&(i=navigator.connection,s+=" downlink:".concat(i.downlink," effectiveType:").concat(i.effectiveType," rtt:").concat(i.rtt)),"memory"in window.performance)&&(i=window.performance.memory,s+=" usedJSHeapSize:".concat(i.usedJSHeapSize," totalJSHeapSize:").concat(i.totalJSHeapSize," jsHeapSizeLimit:").concat(i.jsHeapSizeLimit)),n.setMessage(s).setError(t).end(),Oe.e("".concat(o," ").concat(s," error:"),t),Sn(new Bn({code:t&&t.code?t.code:qn.MSG_SEND_FAIL,message:t&&t.message?t.message:void 0,data:{message:e}}))}},{key:"_getSendMessageSpecifiedKey",value:function(e){if([S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_VIDEO,S.MSG_FILE].includes(e.type))return Wn;if(e.conversationType===S.CONV_C2C)return $n;if(e.conversationType===S.CONV_GROUP){var t=this.get(7);if(t&&(t=t.getLocalGroupProfile(e.to)))return Mt(e=t.type)?Yn:zn}}},{key:"_addSendMessageTotalCount",value:function(e){(e=this._getSendMessageSpecifiedKey(e))&&this.get(26).addTotalCount(e)}},{key:"_addSendMessageSuccessCount",value:function(e,t){var n;(e=this._getSendMessageSpecifiedKey(e))&&((n=this.get(26)).addSuccessCount(e),n.addCost(e,$t(t,!1)))}},{key:"_addSendMessageFailCountOnUser",value:function(e,t){t=void 0===(t=t.code)?-1:t;var n,o=this.get(26);(e=this._getSendMessageSpecifiedKey(e))===Wn&&(n=!1,n=!!Ki.includes(t)||n)?o.addFailedCountOfUserSide(Jn):zi(t)&&e&&o.addFailedCountOfUserSide(e)}},{key:"resendMessage",value:function(e,t){return e.isResend=!0,e.status=En,this.sendMessageInstance(e,t)}},{key:"revokeMessage",value:function(e){var t,n,o=this,i=null;return e.conversationType===S.CONV_C2C?i=this.get(6):e.conversationType===S.CONV_GROUP&&(i=this.get(7)),i?((t=new io("revokeMessage")).setMessage("type:".concat(e.type," from:").concat(e.from," to:").concat(e.to)),n="".concat(this._n,".").concat("revokeMessage"),i.revokeMessage(e).then((function(i){return qe(i=i.data.recallRetList)||0===i[0].retCode?(Oe.i("".concat(n," ok. ID:").concat(e.ID)),e.isRevoked=!0,t.end(),o.get(11).onMessageRevoked([e]),Cn({message:e})):(i=new Bn({code:i[0].retCode,data:{message:e}}),t.setCode(i.code).setMoreMessage(i.message).end(),Sn(i))})).catch((function(o){t.setError(o).end();var i=new Bn({code:o&&o.code?o.code:qn.MSG_REVOKE_FAIL,message:o&&o.message?o.message:void 0,data:{message:e}});return Oe.w("".concat(n," failed. error:"),o),Sn(i)}))):this._onNoModule()}},{key:"deleteMessage",value:function(e){var t=this,n=null,o=e[0],i=o.conversationID,s="",r=[],a=[];if(o.conversationType===S.CONV_C2C)n=this.get(6),s=i.replace(S.CONV_C2C,""),e.forEach((function(e){e&&e.status===kn&&e.conversationID===i&&(e._onlineOnlyFlag||r.push("".concat(e.sequence,"_").concat(e.random,"_").concat(e.time)),a.push(e))}));else if(o.conversationType===S.CONV_GROUP)n=this.get(7),s=i.replace(S.CONV_GROUP,""),e.forEach((function(e){e&&e.status===kn&&e.conversationID===i&&(e._onlineOnlyFlag||r.push("".concat(e.sequence)),a.push(e))}));else if(o.conversationType===S.CONV_SYSTEM)return Sn({code:qn.CANNOT_DELETE_GRP_SYSTEM_NOTICE});if(!n)return this._onNoModule();if(0===r.length)return this._onMessageDeleted(a);30<r.length&&(r=r.slice(0,30),a=a.slice(0,30));var c=new io("deleteMessage"),u=(c.setMessage("to:".concat(s," count:").concat(r.length)),"".concat(this._n,".").concat("deleteMessage"));return n.deleteMessage({to:s,keyList:r}).then((function(e){return c.end(),Oe.i("".concat(u," ok")),t._onMessageDeleted(a)})).catch((function(e){return c.setError(e).end(),Oe.w("".concat(u," failed. error:"),e),Sn(e=new Bn({code:e&&e.code?e.code:qn.MSG_DELETE_FAIL,message:e&&e.message?e.message:void 0}))}))}},{key:"_onMessageDeleted",value:function(e){return this.get(11).onMessageDeleted(e),Tn({messageList:e})}},{key:"translateText",value:function(e){var t="".concat(this._n,".").concat("translateText"),n=e.sourceTextList,o=e.sourceLanguage,i=(e=e.targetLanguage,new io("translateText"));return i.setMessage("sourceLanguage:".concat(o," targetLanguage:").concat(e)),this.req({P:jn.TRANSLATE_TEXT,data:{sourceTextList:n,source:o||"auto",target:e,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then((function(e){var n=(e=e.data).error,o=e.requestID;if(e=e.translatedTextList,0===n.code)return i.end(),Oe.i("".concat(t," ok. requestID:").concat(o)),Cn({translatedTextList:e});throw g(g({},n),{},{requestID:o})})).catch((function(e){return i.setCode(e.code).setMoreMessage(e.requestID).end(),Oe.w("".concat(t," failed. error:"),e),Sn({code:e.code||qn.TRANSLATE_TEXT_FAIL,message:e.message})}))}},{key:"convertVoiceToText",value:function(e){var t,n,o,i=e.message,s=(e=e.language,i.payload.url);return(i.from===this.getMyUserID()&&"out"===i.flow&&(s=i.payload.remoteAudioUrl),i=/\.(wav|pcm|ogg-opus|speex|silk|mp3|m4a|aac|amr)/).test(s)?(i=i.exec(s)[1]||"mp3",t="16k_zh-PY",e?"zh (cmn-Hans-CN)"===e?t="16k_zh":"en-US"===e?t="16k_en":"yue-Hant-HK"===e?t="16k_yue":"ja-JP"===e&&(t="16k_ja"):t="16k_zh-PY",e="serviceType:".concat(t," url:").concat(s),n="".concat(this._n,".").concat("convertVoiceToText"),Oe.i("".concat(n," ").concat(e)),(o=new io("convertVoiceToText")).setMessage(e),this.req({P:jn.VOICE_TO_TEXT,data:{url:s,language:t,SDKAppID:this.getSDKAppID(),format:i}}).then((function(e){var t=(e=e.data).error,i=e.requestID;if(e=e.result,0===t.code)return o.end(),Oe.i("".concat(n," ok. requestID:").concat(i)),Cn({result:e});throw g(g({},t),{},{requestID:i})})).catch((function(e){return o.setCode(e.code).setMoreMessage(e.requestID||"").end(),Oe.w("".concat(n," failed. error:"),e),Sn({code:qn.VOICE_TO_TEXT_FAIL})}))):Sn({code:qn.UNSUPPORTED_VOICE_FORMAT})}},{key:"modifyRemoteMessage",value:function(e){var t=this;if(!1===this.get(29).filterMessage(e))return e.hasRiskContent=!0,Sn({code:qn.PROFANITY_FOUND,data:{message:e}});var n=null,o=e.conversationType,i=e.to;if(o===S.CONV_C2C)n=this.get(6);else if(o===S.CONV_GROUP){if(!(n=this.get(7)))return this._onNoModule();if(n.isMessageFromOrToAVChatroom(i))return Sn({code:qn.MSG_MODIFY_DISABLED_IN_AV,data:{message:e}})}var s=new io("modifyMessage"),r=(s.setMessage("to:".concat(i)),"".concat(this._n,".modifyRemoteMessage"));return n.modifyRemoteMessage(e).then((function(n){return s.end(),Oe.i("".concat(r," ok")),Cn({message:n=t._onModifyRemoteMessageResp(e,n.data)})})).catch((function(n){var o;return s.setCode(n.code).setMoreMessage(n.message).end(),Oe.w("".concat(r," failed. error:"),n),20027===n.code?(o=t._onModifyRemoteMessageResp(e,n.data),Sn({code:qn.MSG_MODIFY_CONFLICT,data:{message:o}})):Sn({code:n.code,message:n.message,data:{message:e}})}))}},{key:"_onModifyRemoteMessageResp",value:function(e,t){Oe.d("".concat(this._n,"._onModifyRemoteMessageResp options:"),t);var n=e.conversationType,o=e.from,i=e.to,s=e.random,r=e.sequence,a=(e=e.time,t.elements),c=t.messageVersion;return t=void 0===(t=t.cloudCustomData)?"":t,this.get(11).onMessageModified({conversationType:n,from:o,to:i,time:e,random:s,sequence:r,elements:a,cloudCustomData:t,messageVersion:c})}},{key:"_generateUUID",value:function(e,t){var n=this.get(12);return n="".concat(n.getSDKAppID(),"-").concat(n.getUserID(),"-").concat(it()),t?"".concat(n,".").concat(t):(e=(t=e.name||e.value||e.url||e.tempFilePath)&&t.slice(t.lastIndexOf(".")+1))?"".concat(n,".").concat(e):n}},{key:"getMessageOption",value:function(e){return this._messageOptionsMap.get(e)}},{key:"_getNickAndAvatarByUserID",value:function(e){return this.get(4).getNickAndAvatarByUserID(e)}},{key:"_getNameCardByGroupID",value:function(e){if(e.conversationType===S.CONV_GROUP){var t=this.get(7);if(t)return t.getMyNameCardByGroupID(e.to)}return""}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._messageOptionsMap.clear()}}]),Wi=(u(ss,Pn),s(ss,[{key:"onMsgExtNotify",value:function(e){var t=this,n=(e=e.dataList).messageInfo,o=e.operateType,i=e.operateResultList,s=e.tinyID,r=(e=e.globalSequence,n.clientTime),a=(n=n.random,"".concat(s,"-").concat(r,"-").concat(n)),c=[],u=[],l=(Oe.l("".concat(this._n,".onMsgExtNotify messageID:").concat(a," operateType:").concat(o," globalSequence:").concat(e)),this._updateGlobalSeq(a,e),!1),p=!1;i.forEach((function(e){var n=void 0===(n=e.extensions)?[]:n,i=e.clearSequence;1===o?(l=!0,n.forEach((function(e){c.push({key:e.key,value:e.value})})),t._updateLocalExt(a,n)):2===o?(p=!0,n.forEach((function(e){u.push(e.key)})),t._updateLocalExt(a,n)):3===o&&(p=!0,t._hasLocalExt(a)&&t._getLocalExt(a).forEach((function(e,t){e.seq<=i&&!qe(e.value)&&u.push(t)})),t._clearLocalExt(a,i))})),l&&this.emitOEvt(T.MESSAGE_EXTENSIONS_UPDATED,{messageID:a,extensions:c}),p&&this.emitOEvt(T.MESSAGE_EXTENSIONS_DELETED,{messageID:a,keyList:u})}},{key:"setMessageExtensions",value:function(e,t){var n,o,i,s,r,a,c,u="setMessageExtensions";return this.canIUse(N.MSG_EXT)?(n="".concat(this._n,".").concat(u),o=e.ID,i=e.conversationID,s=e.sequence,r=e.time,a=v(t),20<t.length&&(a=t.slice(0,20),Oe.w("".concat(n,". the length of extensions cannot exceed 20."))),t="convID:".concat(i," messageID:").concat(o," sequence:").concat(s," time:").concat(r," count:").concat(a.length),(c=new io(u)).setMessage(t),Oe.l("".concat(n," ").concat(t)),this._modifyMsgExts(e,a).then((function(e){var t=e.resultList,o=e.successCount;return e=e.failureCount,o="successCount:".concat(o," failCount:").concat(e),c.setMoreMessage(o).end(),Oe.l("".concat(n," ok. ").concat(o)),Cn({extensions:t})})).catch((function(e){return c.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))):this.noUse(u)}},{key:"getMessageExtensions",value:function(e){var t,n,o,i,s,r,a,c=this,u="getMessageExtensions";return this.canIUse(N.MSG_EXT)?(t="".concat(this._n,".").concat(u),n=e.ID,s=e.conversationID,o=e.sequence,i=e.time,s="convID:".concat(s," messageID:").concat(n," sequence:").concat(o," time:").concat(i),(r=new io(u)).setMessage(s),a=void Oe.l("".concat(t," ").concat(s)),this.getMsgExtsMap.has(n)&&(a=this._getGlobalSeq(n)),this._getMsgExts(e,a).then((function(e){return r.end(),Oe.l("".concat(t," ok. extCount:").concat(e.length)),lt(a)&&0<e.length&&c.getMsgExtsMap.set(n,1),Cn({extensions:e})})).catch((function(e){return r.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this.noUse(u)}},{key:"deleteMessageExtensions",value:function(e,t){var n,o,i,s,r,a,c,u="deleteMessageExtensions";return this.canIUse(N.MSG_EXT)?(n="".concat(this._n,".").concat(u),o=[],i=3,qe(t)||(i=2,t.forEach((function(e){o.push({key:e,value:"",seq:0})}))),t=e.ID,a=e.conversationID,s=e.sequence,r=e.time,a="convID:".concat(a," messageID:").concat(t," sequence:").concat(s," time:").concat(r," operateType:").concat(i),(c=new io(u)).setMessage(a),Oe.l("".concat(n," ").concat(a)),this._modifyMsgExts(e,o,i).then((function(e){var t=e.resultList,o=e.successCount,s=(e=e.failureCount,"");return 2===i&&(s="success count:".concat(o," fail count:").concat(e)),c.setMoreMessage("".concat(s)).end(),Oe.l("".concat(n," ok. ").concat(s)),Cn({extensions:t})})).catch((function(e){return c.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))):this.noUse(u)}},{key:"_modifyMsgExts",value:function(e,t){var n=this,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=Tt(e.to)?S.CONV_TOPIC:e.conversationType,s=void 0,r=(3!==o&&(s=this._getReqExts(e,t)),null);switch(i){case S.CONV_C2C:r=this.get(6);break;case S.CONV_GROUP:r=this.get(7);break;case S.CONV_TOPIC:r=this.get(10);break;default:return Sn({code:qn.NO_MODULE})}return r.modifyMsgExts(e,s,o).then((function(t){var o=(t=t.data).extensions,i=(t=t.seq,[]),s=0,r=0,a=[];return(o=qe(o)?[]:o).forEach((function(e){var t=e.errorCode,n=(e=e.extension).key,o=e.value;e=e.seq,i.push({code:t,key:n,value:o}),0===t?s++:r++,a.push({key:n,value:o,seq:e})})),n._updateGlobalSeq(e.ID,t),0<a.length&&(n._updateLocalExt(e.ID,a),a=null),{resultList:i,successCount:s,failureCount:r}})).catch((function(e){return Sn(e)}))}},{key:"_getReqExts",value:function(e,t){var n,o=[];return this._hasLocalExt(e.ID)?(n=this._getLocalExt(e.ID),t.forEach((function(e){var t=e.key,i=(e=e.value,0);n.has(t)&&(i=n.get(t).seq),o.push({key:t,value:e,seq:i})}))):t.forEach((function(e){var t=e.key;e=e.value,o.push({key:t,value:e,seq:0})})),o}},{key:"_getMsgExts",value:function(e,t){var n=this,o="".concat(this._n,"._getMsgExts"),i=e.ID,s=null;switch(Tt(e.to)?S.CONV_TOPIC:e.conversationType){case S.CONV_C2C:s=this.get(6);break;case S.CONV_GROUP:s=this.get(7);break;case S.CONV_TOPIC:s=this.get(10);break;default:return Sn({code:qn.NO_MODULE})}return s.getMessageExtensions(e,t).then((function(t){var s=(t=t.data).extensions,r=t.completeFlag,a=t.globalSequence;return t=t.clearSequence,s=qe(s)?[]:s,Oe.l("".concat(o," ok. completeFlag:").concat(r," globalSequence:").concat(a," clearSequence:").concat(t," count:").concat(s.length)),n._updateLocalExt(i,s),n._clearLocalExt(i,t),n._updateGlobalSeq(i,a),1!==r?(t=s.slice(-1)[0].seq+1,n._getMsgExts(e,t)):n._getLocalExtList(i)})).catch((function(e){return Sn(e)}))}},{key:"_hasLocalExt",value:function(e){return this.msgExtMap.has(e)}},{key:"_getLocalExt",value:function(e){return this.msgExtMap.get(e)}},{key:"_updateLocalExt",value:function(e,t){this._hasLocalExt(e)||this.msgExtMap.set(e,new Map);var n=this._getLocalExt(e);t.forEach((function(e){var t=e.key,o=e.value;e=e.seq,n.set(t,{value:void 0===o?"":o,seq:e})}))}},{key:"_clearLocalExt",value:function(e,t){var n;t<=0||!this._hasLocalExt(e)||(n=this._getLocalExt(e)).forEach((function(e,o){e.seq<=t&&n.delete(o)}))}},{key:"_getLocalExtList",value:function(e){var t=[];return this._hasLocalExt(e)&&this._getLocalExt(e).forEach((function(e,n){qe(e=e.value)||t.push({key:n,value:e})})),t}},{key:"_getGlobalSeq",value:function(e){return this.globalSeqMap.get(e)}},{key:"_updateGlobalSeq",value:function(e,t){this.globalSeqMap.set(e,t)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this.msgExtMap.clear(),this.globalSeqMap.clear(),this.getMsgExtsMap.clear()}}])),Ji=(u(is,Pn),s(is,[{key:"onReactionNotifyList",value:function(e){var t=this;(void 0===(e=(e||{}).dataList)?[]:e).forEach((function(e){var n=e.C2CMessageInfo,o=void 0===(o=e.groupMessageInfo)?{}:o,i=(e=void 0===(e=e.reactionList)?[]:e,o=(n=g(g({},void 0===n?{}:n),o)).tinyID,n.clientTime),s=(n=n.random,o="".concat(o,"-").concat(i,"-").concat(n),[]);e.forEach((function(e){lt(e.userIDList)&&(e.userIDList=[],e.count=0),s.push.apply(s,v(e.userIDList))})),Oe.l("".concat(t._n,".onReactionNotifyList messageID:").concat(o," reactionList:").concat(e.length)),t._handleReactionSummary([{messageID:o,reactionList:e}],s).then((function(e){t.emitOEvt(T.MESSAGE_REACTIONS_UPDATED,g({},e[0]))}))}))}},{key:"onReactionNotify",value:function(e){var t=(e=e.dataList||{}).C2CMessageInfo,n=void 0===(n=e.groupMessageInfo)?{}:n,o=e.reactionID,i=(e=e.operateType,n=(t=g(g({},void 0===t?{}:t),n)).tinyID,t.clientTime);t=t.random,n="".concat(n,"-").concat(i,"-").concat(t),Oe.l("".concat(this._n,".onReactionNotify messageID:").concat(n," reactionID:").concat(o," operateType:").concat(e)),1===e?this._addReactedByMyselfMap(n,o):this._removeReactedByMyselfMap(n,o),i="".concat(n,"-").concat(o),this._reactionInfoMap.has(i)&&((t=this._reactionInfoMap.get(i)).reactedByMyself=1===e,this.emitOEvt(T.MESSAGE_REACTIONS_UPDATED,{messageID:n,reactionList:[t]}))}},{key:"addMessageReaction",value:function(e,t){var n,o,i,s,r=this,a="addMessageReaction";return this.canIUse(N.MSG_REACTION)?(n="".concat(this._n,".").concat(a),s=e.ID,o=e.conversationID,o="convID:".concat(o," messageID:").concat(s," reactionID:").concat(t),(i=new io(a)).setMessage(o),Oe.l("".concat(n," ").concat(o)),s=this._createReactionOperationPack(e,t,1),this._addReactedByMyselfMap(e.ID,t),this.req(s).then((function(){return i.end(),Oe.l("".concat(n," ok.")),Cn()})).catch((function(o){return r._removeReactedByMyselfMap(e.ID,t),i.setError(o).end(),Oe.e("".concat(n," failed. error:"),o),Sn(o)}))):this.noUse(a)}},{key:"removeMessageReaction",value:function(e,t){var n,o,i,s,r="removeMessageReaction";return this.canIUse(N.MSG_REACTION)?(n="".concat(this._n,".").concat(r),s=e.ID,o=e.conversationID,o="convID:".concat(o," messageID:").concat(s," reactionID:").concat(t),(i=new io(r)).setMessage(o),Oe.l("".concat(n," ").concat(o)),s=this._createReactionOperationPack(e,t,2),this._removeReactedByMyselfMap(e.ID,t),this.req(s).then((function(){return i.end(),Oe.l("".concat(n," ok.")),Cn()})).catch((function(e){return i.setError(e).end(),Oe.e("".concat(n," failed. error:"),e),Sn(e)}))):this.noUse(r)}},{key:"getMessageReactions",value:function(e){var t,n,o,i,s,r,a=this,c="getMessageReactions";return this.canIUse(N.MSG_REACTION)?(t="".concat(this._n,".").concat(c),n=e.messageList,r=e.maxUserCountPerReaction,o=n[0].conversationID,o="convID:".concat(o," maxUserCountPerReaction:").concat(r," msgCount:").concat(n.length),(i=new io(c)).setMessage(o),Oe.l("".concat(t," ").concat(o)),s=new Map,r=this._createReactionSummaryPack(g(g({},e),{},{messageIDMap:s})),this.req(r).then((function(e){e=e.data.resultList;var t=[],n=[];return(void 0===e?[]:e).forEach((function(e){var o=void 0===(o=e.messageKey)?void 0:o,i=void 0===(i=e.messageSequence)?void 0:i;e=void 0===(e=e.reactionList)?[]:e,i=lt(o)?s.get(i):s.get(o),t.push({messageID:i,reactionList:e}),e.forEach((function(e){n.push.apply(n,v(e.userIDList))}))})),a._handleReactionSummary(t,n)})).then((function(e){return i.end(),Oe.l("".concat(t," ok.")),s.clear(),Cn({resultList:e})})).catch((function(e){return i.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this.noUse(c)}},{key:"getAllUserListOfMessageReaction",value:function(e){var t,n,o,i,s,r,a,c,u=this,l="getAllUserListOfMessageReaction";return this.canIUse(N.MSG_REACTION)?(t="".concat(this._n,".").concat(l),s=e.message,n=e.reactionID,o=e.nextSeq,i=e.count,c=s.ID,s=s.conversationID,s="convID:".concat(s," messageID:").concat(c," reactionID:").concat(n," nextSeq:").concat(o," count:").concat(i),(r=new io(l)).setMessage(s),Oe.l("".concat(t," ").concat(s)),a={userList:[],nextSeq:0,isCompleted:!1},c=this._createReactionUserListPack(e),this.req(c).then((function(e){var t=void 0===(t=(e=e.data).userIDList)?[]:t;return e=void 0===(e=e.nextSeq)?0:e,a.nextSeq=e,a.isCompleted=0===e,u.get(4).getUserNickAndAvatar(t)})).then((function(e){return a.userList=e,r.end(),Oe.l("".concat(t," ok.")),Cn(a)})).catch((function(e){return r.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this.noUse(l)}},{key:"_createReactionOperationPack",value:function(e,t,n){var o,i,s=void 0;return t={reactionID:t,userIDList:[this.getMyUserID()]},e.conversationType===S.CONV_C2C&&(o=this.get(6),s=1===n?jn.ADD_C2C_MSG_REACTION:jn.RM_C2C_MSG_REACTION,t.from=e.from,t.to=e.to,t.messageKey=o.getMessageKey(e)),e.conversationType===S.CONV_GROUP&&(o=void 0,i=e.to,Tt(e.to)&&(i=Gt(o=e.to)),s=1===n?jn.ADD_GRP_MSG_REACTION:jn.RM_GRP_MSG_REACTION,t.groupID=i,t.topicID=o,t.messageSequence=e.sequence),{P:s,data:t}}},{key:"_createReactionSummaryPack",value:function(e){var t,n,o,i=e.messageList,s=void 0===(s=e.maxUserCountPerReaction)?10:s,r=e.messageIDMap,a=void 0,c=void 0;return(e=i[0]).conversationType===S.CONV_C2C&&(t=this.get(6),n=i.map((function(e){var n=t.getMessageKey(e);return r.set(n,e.ID),n})),a=jn.GET_C2C_MSG_REACTIONS,c={from:e.from,to:e.to,messageKeyList:n,count:s}),e.conversationType===S.CONV_GROUP&&(n=void 0,o=e.to,Tt(e.to)&&(o=Gt(n=e.to)),e=i.map((function(e){return r.set(e.sequence,e.ID),e.sequence})),a=jn.GET_GRP_MSG_REACTIONS,c={groupID:o,topicID:n,messageSequenceList:e,count:s}),{P:a,data:c}}},{key:"_createReactionUserListPack",value:function(e){var t=e.message,n=e.reactionID,o=e.nextSeq,i=void 0;return n={reactionID:n,nextSeq:void 0===o?0:o,count:100<(e=void 0===(e=e.count)?100:e)?100:e},t.conversationType===S.CONV_C2C&&(o=this.get(6),i=jn.GET_C2C_MSG_REACTION_USER_LIST,n.from=t.from,n.to=t.to,n.messageKey=o.getMessageKey(t)),t.conversationType===S.CONV_GROUP&&(e=void 0,o=t.to,Tt(t.to)&&(o=Gt(e=t.to)),i=jn.GET_GRP_MSG_REACTION_USER_LIST,n.groupID=o,n.topicID=e,n.messageSequence=t.sequence),{P:i,data:n}}},{key:"_handleReactionSummary",value:function(e,t){var n=this;return this.get(4).getUserNickAndAvatar(t).then((function(t){var o=[];return e.forEach((function(e){var i=[];e.reactionList.forEach((function(o){var s=o.reactionID,r=o.count,a=o.userIDList,c=(o=void 0===(o=o.reactedByMyself)?void 0:o,[]);a.forEach((function(e){t.forEach((function(t){e===t.userID&&c.push(t)}))})),a={reactionID:s,totalUserCount:r,partialUserList:c,reactedByMyself:n._computeReactedByMyself({reactedByMyself:o,messageID:e.messageID,reactionID:s})},i.push(a),lt(o)&&!n._reactedByMyselfMap.has(e.messageID)&&(r="".concat(e.messageID,"-").concat(s),n._reactionInfoMap.set(r,a))})),o.push({messageID:e.messageID,reactionList:i})})),o}))}},{key:"_addReactedByMyselfMap",value:function(e,t){this._reactedByMyselfMap.has(e)||this._reactedByMyselfMap.set(e,[]),-1===(e=this._reactedByMyselfMap.get(e)).indexOf(t)&&e.push(t)}},{key:"_removeReactedByMyselfMap",value:function(e,t){this._reactedByMyselfMap.has(e)&&-1<(t=(e=this._reactedByMyselfMap.get(e)).indexOf(t))&&e.splice(t,1)}},{key:"_computeReactedByMyself",value:function(e){var t=e.reactedByMyself,n=e.messageID;return e=e.reactionID,lt(t)?!!this._reactedByMyselfMap.has(n)&&this._reactedByMyselfMap.get(n).includes(e):1===t}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._reactedByMyselfMap.clear(),this._reactionInfoMap.clear()}}])),Xi=(u(os,Pn),s(os,[{key:"sendMessage",value:function(e){var t=this,n=this._createMsg(e);if(null===n)return Sn({code:qn.MSG_SEND_FAIL});this._addSendMessageTotalCount(n);var o=Date.now();return this.get(11).setMessageRandom(n),this._sendComboMessage(n,e).then((function(e){var i=(e=e.data).time,s=e.sequence;return Ke(e=e.readReceiptCode)&&0!==e&&(new io("sendMessageWithReceipt").setMessage("from:".concat(n.from," to:").concat(n.to," sequence:").concat(s," readReceiptCode:").concat(e)).end(),Oe.w("".concat(t._n,".sendMessage readReceiptCode:").concat(e," message:").concat(t.getErrMsg(e)))),t._addSendMessageSuccessCount(n,o),e=t.get(11),n.status=kn,n.time=i,n.conversationType===S.CONV_GROUP&&(n.sequence=s),e.appendToMessageList(n),i=n,!0===n._isExcludedFromLastMessage&&(i=""),e.onMessageSent({conversationOptionsList:[{conversationID:n.conversationID,unreadCount:0,type:n.conversationType,subType:n.conversationSubType,lastMessage:i}]}),Cn({message:n})})).catch((function(e){return t._onSendMessageFailed(n,e)}))}},{key:"_sendComboMessage",value:function(e,t){var n=this._m.get(20),o="";return e.conversationType===S.CONV_C2C&&(o="".concat(P.NAME.OPEN_IM,".").concat(jn.SEND_C2C_MSG)),e.conversationType===S.CONV_GROUP&&(o="".concat(P.NAME.GRP,".").concat(jn.SEND_GRP_MSG)),n.sendComboMessage({servcmd:o,data:t})}},{key:"_createMsg",value:function(e){var t="".concat(this._n,"._createMsg"),n=null;try{var o,i=this.getMyUserID(),s={};s.senderTinyID=this.getMyTinyID(),s.currentUser=i,s.from=e.From_Account||i,e.GroupId?(s.conversationID="".concat(S.CONV_GROUP).concat(e.GroupId),s.conversationType=S.CONV_GROUP,s.to=e.GroupId):e.To_Account&&(s.conversationID="".concat(S.CONV_C2C).concat(e.To_Account),s.conversationType=S.CONV_C2C,s.to=e.To_Account),s.time=e.MsgTimeStamp||0,s.random=e.Random||e.MsgRandom||0,s.priority=e.MsgPriority,ut(e.CloudCustomData)&&0<e.CloudCustomData.length&&(s.cloudCustomData=e.CloudCustomData),Ye(e.SendMsgControl)&&(s.messageControlInfo={},e.SendMsgControl.includes("NoUnread")&&(s.messageControlInfo.excludedFromUnreadCount=1),e.SendMsgControl.includes("NoLastMsg"))&&(s.messageControlInfo.excludedFromLastMessage=1),s.conversationType===S.CONV_GROUP&&Ye(e.To_Account)&&0<e.To_Account.length&&(o=e.To_Account,50<e.To_Account.length&&(o=e.To_Account.slice(0,50),Oe.w("".concat(t," To_Account must be less than or equal to 50."))),s.receiverList=v(o),e.To_Account=v(o)),1!==e.IsNeedReadReceipt&&1!==e.NeedReadReceipt||(s.needReadReceipt=!0),1===e.SupportMessageExtension&&(s.isSupportExtension=!0),(n=new Do(s)).status=En,e.MsgClientTime=n.clientTime,n.conversationType===S.CONV_C2C&&(e.MsgSeq=n.sequence);for(var r,a=e.MsgBody.length,c=0;c<a;c++)"TIMTextElem"===(r=e.MsgBody[c]).MsgType?n.setTextElement(r.MsgContent.Text):"TIMCustomElem"===r.MsgType?n.setCustomElement({data:r.MsgContent.Data||"",description:r.MsgContent.Desc||"",extension:r.MsgContent.Ext||""}):"TIMFaceElem"===r.MsgType&&n.setFaceElement({index:r.MsgContent.Index,data:r.MsgContent.Data});var u=n.getElements();n.payload=u[0].content,n.type=u[0].type}catch(l){n=null,Oe.e("".concat(t," failed. error:"),l)}return n}},{key:"_onSendMessageFailed",value:function(e,t){e.status=Dn,this.get(11).deleteMessageRandom(e),this._addSendMessageFailCountOnUser(e,t);var n=new io("sendMessage"),o="head.seq:".concat(t.data.headSeq," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to);return n.setMessage(o).setError(t).end(),Oe.e("".concat(this._n,"._onSendMessageFailed ").concat(o," error:"),t),Sn(new Bn({code:t&&t.code?t.code:qn.MSG_SEND_FAIL,message:t&&t.message?t.message:void 0,data:{message:e}}))}},{key:"_getSendMessageSpecifiedKey",value:function(e){return e.conversationType===S.CONV_C2C?$n:e.conversationType===S.CONV_GROUP&&(e=this.get(7).getLocalGroupProfile(e.to))?Mt(e=e.type)?Yn:zn:void 0}},{key:"_addSendMessageTotalCount",value:function(e){(e=this._getSendMessageSpecifiedKey(e))&&this.get(26).addTotalCount(e)}},{key:"_addSendMessageSuccessCount",value:function(e,t){var n;(e=this._getSendMessageSpecifiedKey(e))&&((n=this.get(26)).addSuccessCount(e),n.addCost(e,$t(t,!1)))}},{key:"_addSendMessageFailCountOnUser",value:function(e,t){t=void 0===(t=t.code)?-1:t;var n=this.get(26);e=this._getSendMessageSpecifiedKey(e),zi(t)&&e&&n.addFailedCountOfUserSide(e)}}])),Zi=(u(ns,Pn),s(ns,[{key:"registerPlugin",value:function(e){var t=this,n="0";Object.keys(e).forEach((function(o){t.plugins[o]=e[o],"tim-upload-plugin"===o&&"function"==typeof e[o].getVersion&&(n=e[o].getVersion())})),new io("registerPlugin").setMessage("".concat(Object.keys(e))).setMoreMessage("version:".concat(n)).end()}},{key:"getPlugin",value:function(e){return this.plugins[e]}},{key:"reset",value:function(){}}])),Qi=(u(ts,Pn),s(ts,[{key:"_init",value:function(){this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:0})}},{key:"_startSync",value:function(e){var t=this,n=e.cookie,o=e.syncFlag,i=e.isOnlineSync,s="".concat(this._n,"._startSync"),r=(Oe.l("".concat(s," options:"),e),new io("syncUnread"));r.setMessage(JSON.stringify(e)),this.req({P:jn.SYNC_UNREAD_MSG,data:{cookie:n,syncFlag:o,isOnlineSync:i}}).then((function(e){var n=(o=e.data).cookie,o=o.syncFlag,i="$cookie:".concat(n," syncFlag:").concat(o);Oe.l("".concat(s," ok. ").concat(i)),t._cookie=n,r.setMoreMessage(i).end(),qe(n)||(0===o||1===o?(t._dispatch(g(g({},e.data),{},{isSyncingEnded:!1})),t._startSync({cookie:n,syncFlag:o,isOnlineSync:0})):2===o&&t._dispatch(g(g({},e.data),{},{isSyncingEnded:!0})))})).catch((function(e){r.setError(e).end(),Oe.e("".concat(s," failed. error:"),e)}))}},{key:"_dispatch",value:function(e){e.eventArray&&this.get(20).onMessage({head:{},body:{eventArray:e.eventArray,isInstantMessage:this._onlineSyncFlag,isSyncingEnded:e.isSyncingEnded}}),this.get(6).onNewMessage({dataList:e.messageList,isInstantMessage:!!e.isSyncingEnded&&this._onlineSyncFlag,C2CRemainingUnreadList:e.C2CRemainingUnreadList,C2CPairUnreadList:e.C2CPairUnreadList,isSyncingEnded:e.isSyncingEnded})}},{key:"syncOnNeed",value:function(){Oe.l("".concat(this._n,".syncOnNeed cookie:").concat(this._cookie)),this._onlineSyncFlag=!0,this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:1})}},{key:"syncOnReconnected",value:function(){Oe.l("".concat(this._n,".syncOnReconnected cookie:").concat(this._cookie)),this._onlineSyncFlag=!0,this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:0})}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._onlineSyncFlag=!1,this._cookie=""}}])),es={req:{toAccount:"To_Account",fromAccount:"From_Account",to:"To_Account",from:"From_Account",groupID:"GroupId",groupAtUserID:"GroupAt_Account",extension:"Ext",data:"Data",description:"Desc",elements:"MsgBody",sizeType:"Type",downloadFlag:"Download_Flag",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",videoUrl:"",imageUrl:"URL",fileUrl:"Url",uuid:"UUID",priority:"MsgPriority",receiverUserID:"To_Account",receiverGroupID:"GroupId",messageSender:"SenderId",messageReceiver:"ReceiverId",nick:"From_AccountNick",avatar:"From_AccountHeadurl",messageNumber:"MsgNum",pbDownloadKey:"PbMsgKey",downloadKey:"JsonMsgKey",applicationType:"PendencyType",userIDList:"To_Account",groupNameList:"GroupName",userID:"To_Account",groupAttributeList:"GroupAttr",mainSequence:"AttrMainSeq",avChatRoomKey:"BytesKey",attributeControl:"AttrControl",sequence:"seq",messageControlInfo:"SendMsgControl",updateSequence:"UpdateSeq",clientTime:"MsgClientTime",sequenceList:"MsgSeqList",topicID:"TopicId",customData:"CustomString",isSupportTopic:"SupportTopic",isWebUniapp:"is_web_uniapp",isSupportExtension:"SupportMessageExtension",messageSequence:"MsgSeq",messageKey:"MsgKey",startSequence:"startSeq",simplifiedMessage:"DownsizeFlag",isRelayMessage:"IsRelayMsg",reactionID:"Reaction",messageSequenceList:"MsgSeqList",messageKeyList:"MsgKeyList",cmConfigID:"CustomModerationConfigID"},res:{MsgPriority:"priority",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",Download_Flag:"downloadFlag",GroupId:"groupID",Member_Account:"userID",MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",MsgSeq:"sequence",MsgRandom:"random",MsgTime:"time",MsgTimeStamp:"time",MsgContent:"content",MsgBody:"elements",From_AccountNick:"nick",From_AccountHeadurl:"avatar",GroupWithdrawInfoArray:"revokedInfos",GroupReadInfoArray:"groupMessageReadNotice",LastReadMsgSeq:"lastMessageSeq",WithdrawC2cMsgNotify:"c2cMessageRevokedNotify",C2cWithdrawInfoArray:"revokedInfos",C2cReadedReceipt:"c2cMessageReadReceipt",ReadC2cMsgNotify:"c2cMessageReadNotice",LastReadTime:"peerReadTime",MsgRand:"random",MsgType:"type",MsgShow:"messageShow",NextMsgSeq:"nextMessageSeq",FaceUrl:"avatar",ProfileDataMod:"profileModify",Profile_Account:"userID",ValueBytes:"value",ValueNum:"value",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgFrom_AccountExtraInfo:"messageFromAccountExtraInformation",Operator_Account:"operatorID",OpType:"operationType",ReportType:"operationType",UserId:"userID",User_Account:"userID",List_Account:"userIDList",MsgOperatorMemberExtraInfo:"operatorInfo",MsgMemberExtraInfo:"memberInfoList",ImageUrl:"avatar",NickName:"nick",MsgGroupNewInfo:"newGroupProfile",MsgAppDefinedData:"groupCustomField",Owner_Account:"ownerID",GroupFaceUrl:"avatar",GroupIntroduction:"introduction",GroupNotification:"notification",GroupApplyJoinOption:"joinOption",MsgKey:"messageKey",GroupInfo:"groupProfile",ShutupTime:"muteTime",Desc:"description",Ext:"extension",GroupAt_Account:"groupAtUserID",MsgNum:"messageNumber",PbMsgKey:"pbDownloadKey",JsonMsgKey:"downloadKey",MsgModifiedFlag:"isModified",PendencyItem:"applicationItem",PendencyType:"applicationType",AddTime:"time",AddSource:"source",AddWording:"wording",ProfileImImage:"avatar",PendencyAdd:"friendApplicationAdded",FrienPencydDel_Account:"friendApplicationDeletedUserIDList",Peer_Account:"userID",GroupAttr:"groupAttributeList",GroupAttrAry:"groupAttributeList",AttrMainSeq:"mainSequence",seq:"sequence",GroupAttrOption:"groupAttributeOption",BytesChangedKeys:"changedKeyList",GroupAttrInfo:"groupAttributeList",GroupAttrSeq:"mainSequence",PushChangedAttrValFlag:"isWithChangedAttributeInfo",SubKeySeq:"sequence",Val:"value",MsgGroupFromCardName:"senderNameCard",MsgGroupFromNickName:"senderNick",C2cNick:"peerNick",C2cImage:"peerAvatar",SendMsgControl:"messageControlInfo",NoLastMsg:"excludedFromLastMessage",NoUnread:"excludedFromUnreadCount",UpdateSeq:"updateSequence",MuteNotifications:"muteFlag",MsgClientTime:"clientTime",TinyId:"tinyID",GroupMsgReceiptList:"readReceiptList",ReadNum:"readCount",UnreadNum:"unreadCount",TopicId:"topicID",MillionGroupFlag:"communityType",SupportTopic:"isSupportTopic",MsgTopicNewInfo:"newTopicInfo",ShutupAll:"muteAllMembers",CustomString:"customData",TopicFaceUrl:"avatar",TopicIntroduction:"introduction",TopicNotification:"notification",TopicIdArray:"topicIDList",MsgVersion:"messageVersion",C2cMsgModNotifys:"c2cMessageModified",GroupMsgModNotifys:"groupMessageModified",ApplyJoinOption:"joinOption",MsgFlag:"messageRemindType",AtInfoList:"groupAtInfoList",AtFlagList:"groupAtType",AtMsgSeq:"sequence",BanDuration:"duration",BanDescription:"reason",NotVisible:"invisible",BytesTag:"tag",BytesValue:"value",RptBytesValue:"value",LatestSeq:"globalSequence",ClearSeq:"clearSequence",SupportMessageExtension:"isSupportExtension",ExtensionList:"extensions",GroupCounter:"counterList",Revoker_Account:"revoker",MsgExtensionNotify:"messageExtensionNotify",ExtensionC2cMsgInfo:"messageInfo",ExtensionGroupMsgInfo:"messageInfo",MsgOptType:"operateType",SetKVInfo:"operateResultList",DeleteKVInfo:"operateResultList",ClearKVInfo:"operateResultList",MsgKeyValue:"extensions",ClearMsgSeq:"clearSequence",MsgLastSeq:"globalSequence",InviteJoinOption:"inviteOption",MemberList_Account:"inviteeList",MsgMemberExtraInfoList:"inviteeInfoList",E:"event",GInf:"groupProfile",MCT:"clientTime",MR:"random",MP:"priority",MTS:"time",GId:"groupID",MS:"sequence",CCD:"cloudCustomData",F_Account:"from",F_Hd:"avatar",F_NN:"nick",GN:"groupName",GT:"groupType",IsSys:"isSystemMessage",OpInf:"operatorInfo",Img:"avatar",NN:"nick",OnlineInf:"onlineMemberInfo",ET:"expireTime",Num:"onlineMemberNum",Opt:"operationType",O_Account:"operatorID",RT:"operationType",UDF:"userDefinedField",L_Account:"userIDList",IsPlaceMsg:"isPlaceMessage",MsgCheckResult:"checkResult",Results:"resultList",Reaction:"reactionID",Reaction_Account:"userIDList",MsgReactionNotifyList:"messageReactionNotifyList",MsgReactionNotify:"messageReactionNotify",MsgReactionSummary:"reactionList",C2CMsgInfo:"C2CMessageInfo",GroupMsgInfo:"groupMessageInfo",int32_err_code:"errorCode",str_err_msg:"errorMsg",MsgDropReason:"messageDropReason",ReactedByMe:"reactedByMyself",Level:"messageRemindType",PeerReadTime:"timestamp",NoUnreadSeqList:"excludedUnreadSequenceList",NewMsg:"topicLatestMessage"},ignoreKeyWord:["C2C","ID","USP"]};function ts(e){return o(this,ts),(e=n(this,ts,[e]))._n="SyncUnreadMsgModule",e._cookie="",e._onlineSyncFlag=!1,e.getIEmitInst().on(xo.A2KEY_AND_TINYID_UPDATED,e._init,e),e}function ns(e){return o(this,ns),(e=n(this,ns,[e]))._n="PluginModule",e.plugins={},e}function os(e){return o(this,os),(e=n(this,os,[e]))._n="ComboMsgModule",e}function is(e){return o(this,is),(e=n(this,is,[e]))._n="MsgReactionModule",e._reactedByMyselfMap=new Map,e._reactionInfoMap=new Map,e}function ss(e){return o(this,ss),(e=n(this,ss,[e]))._n="MsgExtModule",e.msgExtMap=new Map,e.globalSeqMap=new Map,e.getMsgExtsMap=new Map,e}function rs(e){return o(this,rs),(e=n(this,rs,[e]))._n="MessageModule",e._messageOptionsMap=new Map,e._mergerMessageHandler=new ji(e),e}function as(e,t){if("string"==typeof e||Array.isArray(e))return t=Object.assign({pascalCase:!1},t),0===(e=Array.isArray(e)?e.map((function(e){return e.trim()})).filter((function(e){return e.length})).join("-"):e.trim()).length?"":1===e.length?t.pascalCase?e.toUpperCase():e.toLowerCase():(e=e=(e=e!==e.toLowerCase()?cs(e):e).replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(function(e,t){return t.toUpperCase()})).replace(/\d+(\w|$)/g,(function(e){return e.toUpperCase()})),t.pascalCase?e.charAt(0).toUpperCase()+e.slice(1):e);throw new TypeError("Expected the input to be `string | string[]`")}var cs=function(e){for(var t=!1,n=!1,o=!1,i=0;i<e.length;i++){var s=e[i];t&&/[a-zA-Z]/.test(s)&&s.toUpperCase()===s?(e=e.slice(0,i)+"-"+e.slice(i),o=n,n=!(t=!1),i++):n&&o&&/[a-zA-Z]/.test(s)&&s.toLowerCase()===s?(e=e.slice(0,i-1)+"-"+e.slice(i-1),o=n,t=!(n=!1)):(t=s.toLowerCase()===s&&s.toUpperCase()!==s,o=n,n=s.toUpperCase()===s&&s.toLowerCase()!==s)}return e};function us(e,t){var n=0;return function e(t,o){var i,s,r,a;return 100<++n?(n--,t):Ye(t)?(i=t.map((function(t){return $e(t)?e(t,o):t})),n--,i):$e(t)?(s=t,r=function(e,t){if(!Ze(t))return!1;if(t!==as(t))for(var n=0;n<es.ignoreKeyWord.length&&!t.includes(es.ignoreKeyWord[n]);n++);var i;return lt(o[t])?(i=t)[0].toUpperCase()+as(i).slice(1):o[t]},a=Object.create(null),Object.keys(s).forEach((function(e){var t=r(s[e],e);t&&(a[t]=s[e])})),i=Dt(i=a,(function(t,n){return Ye(t)||$e(t)?e(t,o):t})),n--,i):void 0}(e,t)}for(var ls=String.fromCharCode,ps=function(e){var t=0|e.charCodeAt(0);if(55296<=t)if(t<56320)if(56320<=(e=0|e.charCodeAt(1))&&e<=57343){if(65535<(t=(t<<10)+e-56613888|0))return ls(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533;else t<=57343&&(t=65533);return t<=2047?ls(192|t>>>6,128|63&t):ls(224|t>>>12,128|t>>>6&63,128|63&t)},ds=function(e){for(var t=void 0===e?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,ps),n=0|t.length,o=new Uint8Array(n),i=0;i<n;i=i+1|0)o[i]=0|t.charCodeAt(i);return o},hs=s((function e(t){o(this,e);var n,i,s=(this._handler=t).getURL();this._socket=null,this._workerSocket=null,this._id=ot(),this._handler.getIsWorkerEnabled()?(n=URL.createObjectURL(new Blob([';let _socket = null;onmessage = function(event) { if (event.data.cmd === "start") { const url = event.data.url; _socket = new WebSocket(url); _socket.binaryType = "arraybuffer"; _socket.onopen = function() { postMessage({ callback: "onOpen", extensions: _socket.extensions }); }; _socket.onclose = function(e) { postMessage({ callback: "onOpen", e: { code: e.code, reason: e.reason } }); }; _socket.onmessage = function(e) { postMessage({ callback: "onMessage", data: e.data }); }; _socket.onerror = function(e) { postMessage({ callback: "onError", e: { isTrusted: "true" } }); }; } else if (event.data.cmd === "sendMessage") { if (_socket !== null) { _socket.send(event.data.data); } } else if (event.data.cmd === "stop") { if (_socket !== null) { _socket.close(event.data.code); _socket = null; } }};'],{type:"application/javascript; charset=utf-8"})),this._workerSocket=new Worker(n),(i=this)._workerSocket.onmessage=function(e){var t=(o=e.data).callback,n=o.e,o=o.extensions;"onOpen"===t?i._onOpen(o):"onClose"===t?i._onClose(n):"onError"===t?i._onError(n):"onMessage"===t&&i._onMessage(e.data)},this._workerSocket.postMessage({cmd:"start",id:this._id,url:s})):Z?z?(ne.connectSocket({url:s,header:{"content-type":"application/json"}}),ne.onSocketClose(this._onClose.bind(this)),ne.onSocketOpen(this._onOpen.bind(this)),ne.onSocketMessage(this._onMessage.bind(this)),ne.onSocketError(this._onError.bind(this))):(this._socket=ne.connectSocket({url:s,header:{"content-type":"application/json"},complete:function(){}}),this._socket.onClose(this._onClose.bind(this)),this._socket.onOpen(this._onOpen.bind(this)),this._socket.onMessage(this._onMessage.bind(this)),this._socket.onError(this._onError.bind(this))):(this._socket=new WebSocket(s),this._socket.binaryType="arraybuffer",this._socket.onopen=this._onOpen.bind(this,this._socket.extensions),this._socket.onmessage=this._onMessage.bind(this),this._socket.onclose=this._onClose.bind(this),this._socket.onerror=this._onError.bind(this)),this._canIUseBinaryFrame=t.canIUseBinaryFrame()}),[{key:"getID",value:function(){return this._id}},{key:"_onOpen",value:function(e){this._handler.onOpen({id:this._id,res:JSON.stringify(e)})}},{key:"_onClose",value:function(e){this._handler.onClose({id:this._id,e:e})}},{key:"_onMessage",value:function(e){e=this._canIUseBinaryFrame?this._isAppCompressedData(e.data)?this._handler.inflate(e.data):function(e){for(var t=new Uint8Array(e),n="",o=0,i=t.length;o<i;){var s=t[o],r=0,a=0;if(s<=127?(r=0,a=255&s):s<=223?(r=1,a=31&s):s<=239?(r=2,a=15&s):s<=244&&(r=3,a=7&s),0<i-o-r)for(var c=0;c<r;)a=a<<6|63&(s=t[o+c+1]),c+=1;else a=65533,r=i-o;n+=String.fromCodePoint(a),o+=r+1}return n}(e.data):e.data,this._handler.onMessage({data:e})}},{key:"_isAppCompressedData",value:function(e){return 67===(e=new Uint8Array(e))[0]&&79===e[1]&&77===e[2]&&80===e[3]}},{key:"_onError",value:function(e){this._handler.onError({id:this._id,e:e})}},{key:"setIsWorkerEnabled",value:function(e){this._isWorkerEnabled=!0}},{key:"close",value:function(e){this._workerSocket&&(this._workerSocket.postMessage({cmd:"stop",code:e}),this._workerSocket.terminate(),this._workerSocket=null),z?(ne.offSocketClose(),ne.offSocketMessage(),ne.offSocketOpen(),ne.offSocketError(),ne.closeSocket()):this._socket&&(Z?(this._socket.onClose((function(){})),this._socket.onOpen((function(){})),this._socket.onMessage((function(){})),this._socket.onError((function(){}))):(this._socket.onopen=null,this._socket.onmessage=null,this._socket.onclose=null,this._socket.onerror=null),$?this._socket.close({code:e}):this._socket.close(e),this._socket=null)}},{key:"send",value:function(e){this._workerSocket?this._workerSocket.postMessage({cmd:"sendMessage",data:this._canIUseBinaryFrame?ds(e.data).buffer:e.data}):z?ne.sendSocketMessage({data:e.data,fail:function(){e.fail&&e.requestID&&e.fail(e.requestID)}}):this._socket&&(Z?this._socket.send({data:this._canIUseBinaryFrame?ds(e.data).buffer:e.data,fail:function(){e.fail&&e.requestID&&e.fail(e.requestID)}}):this._socket.send(this._canIUseBinaryFrame?ds(e.data):e.data))}}]),gs=["keyMap"],fs=["keyMap"],ms="connected",_s="connecting",vs="disconnected",ys=s((function e(t){o(this,e),this._chM=t,this._n="SocketHandler",this._promiseMap=new Map,this._readyState=vs,this._simpleRequestMap=new Map,this.MAX_SIZE=100,this._startSequence=ot(),this._startTs=0,this._reConnectFlag=!1,this._nextPingTs=0,this._reConnectCount=0,this.MAX_RECONNECT_COUNT=3,this._socketID=-1,this._random=0,this._socket=null,this._url="",this._onOpenTs=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0,this._currentSite=b,this._setWebsocketHost(),this._initConnection()}),[{key:"_setWebsocketHost",value:function(){var e=this._chM.get(12);this._currentSite=b,this._chM.isOversea()&&(this._currentSite="OVERSEA"),e.isSingaporeSite()?this._currentSite="SINGAPORE":e.isKoreaSite()?this._currentSite="KOREA":e.isGermanySite()?this._currentSite="GERMANY":e.isIndiaSite()?this._currentSite="IND":e.isJapanSite()?this._currentSite="JPN":e.isUSASite()?this._currentSite="USA":e.isIndonesiaSite()&&(this._currentSite="INDONESIA"),P.HOST.setCurrent(this._currentSite)}},{key:"_initConnection",value:function(){var e=this._chM.get(12).getSDKAppID()+"",t=this._chM.get(12).isIndependentDomainDisabled();qe(e=(lt(P.HOST.CURRENT.BACKUP)?this._url=P.HOST.CURRENT.DEFAULT:""===this._url?this._url=t?P.HOST.CURRENT.DEFAULT:P.HOST.CURRENT.DEFAULT0.replace("*",e):-1<this._url.indexOf(e)?this._url=P.HOST.CURRENT.DEFAULT:this._url===P.HOST.CURRENT.DEFAULT?this._url=P.HOST.CURRENT.IPV6:this._url===P.HOST.CURRENT.IPV6?this._url=te?this._genRandomDomain():P.HOST.CURRENT.BACKUP:this._isWebBackupUrl(this._url)||this._url===P.HOST.CURRENT.BACKUP?this._url=this._canIUseAnyCast()?P.HOST.CURRENT.ANYCAST:P.HOST.CURRENT.DEFAULT:this._url===P.HOST.CURRENT.ANYCAST&&(P.HOST.CURRENT.ANYCAST="",this._url=P.HOST.CURRENT.DEFAULT),t=this._chM.get(12)).getProxyServer())||(this._url=e),t.isTestEnv()&&(this._url=L.TEST[this._currentSite].DEFAULT),this._connect(),this._nextPingTs=0}},{key:"_genRandomDomain",value:function(){var e=Math.floor(10001*Math.random())+1e4;return P.HOST.CURRENT.BACKUP_WEB.replace("*",e)}},{key:"_isWebBackupUrl",value:function(e){return e.includes("my-cpaas.com")}},{key:"_canIUseAnyCast",value:function(){return te&&P.HOST.CURRENT.ANYCAST}},{key:"onCheckTimer",value:function(e){e%1==0&&(this._checkPromiseMap(),this._checkNativeAppWS())}},{key:"_checkPromiseMap",value:function(){var e=this;0!==this._promiseMap.size&&this._promiseMap.forEach((function(t,n){var o=t.reject,i=t.timestamp,s=(t=t.headSeq,15e3);-1!==n.indexOf(jn.LOGIN)?s=9e4:-1!==n.indexOf(jn.PING)&&(s=3e3),Date.now()-i>=s&&(Oe.l("".concat(e._n,"._checkPromiseMap request timeout, delete requestID:").concat(n)),e._promiseMap.delete(n),o(new Bn({code:qn.NETWORK_TIMEOUT,data:{headSeq:t}})),e._chM.onRequestTimeout())}))}},{key:"_checkNativeAppWS",value:function(){W&&!this.isConnected()&&this._reConnect()}},{key:"onOpen",value:function(e){var t,n;this._readyState!==vs&&(this._onOpenTs=Date.now(),n=e.id,e=e.res,this._socketID=n,t=$t(this._startTs,!1),n="socketID:".concat(n," res:").concat(e),Oe.l("".concat(this._n,"._onOpen cost:").concat(t," ms. ").concat(n)),new io("wsOnOpen").setMessage(t).setCostTime(t).setMoreMessage(n).end(),this._readyState=ms,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._chM.onReconnected(),this._reConnectFlag=!1),this._chM.onOpen())}},{key:"onClose",value:function(e){var t=new io("wsOnClose"),n=e.id,o=(e=e.e,"sourceSocketID:".concat(n," currentSocketID:").concat(this._socketID," code:").concat(e.code," reason:").concat(e.reason)),i=0;0!==this._onOpenTs&&(i=Date.now()-this._onOpenTs),t.setMessage(i).setCostTime(i).setMoreMessage(o).setCode(e.code).end(!0),Oe.l("".concat(this._n,"._onClose ").concat(o," onlineTime:").concat(i)),n===this._socketID&&(this._readyState=vs,i<1e3?this._chM.onReconnectFailed():this._chM.onClose())}},{key:"onError",value:function(e){var t=e.id,n=(e=e.e,"sourceSocketID:".concat(t," currentSocketID:").concat(this._socketID));new io("wsOnError").setMessage(e.errMsg||JSON.stringify(e,["message","code"])).setMoreMessage(n).setLevel("error").end(!0),Oe.w("".concat(this._n,"._onError"),e,n),t===this._socketID&&(this._readyState=vs,this._chM.onError())}},{key:"onMessage",value:function(e){var t,n,o,i,s,r;try{t=JSON.parse(e.data)}catch(a){new io("jsonParseError").setMessage(e.data).end()}t&&t.head&&(e=this._getRequestIDFromHead(t.head),n=t.body,this._chM.get(30).isTRTCCommand(e)||(r=Nt(t.head),n=function e(t,n){var o,i,s;return Ye(t)?t.map((function(t){return $e(t)?e(t,n):t})):$e(t)?(o=t,i=function(e,t){return lt(n[t])?as(t):n[t]},s={},Object.keys(o).forEach((function(e){s[i(o[e],e)]=o[e]})),Dt(s,(function(t){return Ye(t)||$e(t)?e(t,n):t}))):void 0}(t.body,this._getResKeyMap(r))),Oe.d("".concat(this._n,".onMessage ret:").concat(JSON.stringify(n)," requestID:").concat(e," has:").concat(this._promiseMap.has(e))),this._setNextPingTs(),this._promiseMap.has(e)?(o=(r=this._promiseMap.get(e)).resolve,i=r.reject,s=r.timestamp,r=r.headSeq,this._promiseMap.delete(e),this._calcRTT(s),n.errorCode&&0!==n.errorCode?(this._chM.onErrorCodeNotZero(n),i(new Bn({code:n.errorCode,message:n.errorInfo||"",data:e.includes(jn.MODIFY_C2C_MSG)||e.includes(jn.MODIFY_GRP_MSG)?{elements:n.elements,messageVersion:n.messageVersion,cloudCustomData:n.cloudCustomData,headSeq:r}:{headSeq:r}}))):o(Cn(n))):this._chM.onMessage({head:t.head,body:n}))}},{key:"_calcRTT",value:function(e){e=Date.now()-e,this._chM.get(26).addRTT(e)}},{key:"_connect",value:function(){this._readyState!==_s&&this._readyState!==ms&&(this._startTs=Date.now(),this._onOpenTs=0,this._readyState=_s,this._socket=new hs(this),this._socketID=this._socket.getID(),Oe.l("".concat(this._n,"._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled()," socketID:").concat(this._socketID," url:").concat(this.getURL())),new io("wsConnect").setMessage("socketID:".concat(this._socketID," url:").concat(this.getURL())).end())}},{key:"getURL",value:function(){this._chM.isDevMode()&&(this._canIUseBinaryFrame=!1);var e=Ot(),t=((z||V&&"windows"===e||W)&&(this._canIUseBinaryFrame=!1),-1),n=("ios"===e?t=re||-1:"android"===e&&(t=ce||-1),this._chM.get(12)),o=this._chM.getPlatform(),i=n.getSDKAppID();return n=n.getInstanceID(),i="sdkappid=".concat(i,"&instanceid=").concat(n,"&random=").concat(this._getRandom(),"&platform=").concat(o,"&host=").concat(e)+"&version=".concat(t,"&sdkversion=").concat("3.5.5"),j&&(i+="&isminigame=1"),this._chM.canIUseInflate()&&(i+="&compress=gzip"),(this._canIUseBinaryFrame?"".concat(this._url,"/binfo?"):"".concat(this._url,"/info?")).concat(i)}},{key:"_closeConnection",value:function(e){Oe.l("".concat(this._n,"._closeConnection socketID:").concat(this._socketID)),this._socket&&(this._socket.close(e),this._socketID=-1,this._socket=null,this._readyState=vs)}},{key:"_resend",value:function(){var e=this;if(Oe.l("".concat(this._n,"._resend reConnectFlag:").concat(this._reConnectFlag),"promiseMap.size:".concat(this._promiseMap.size," simpleRequestMap.size:").concat(this._simpleRequestMap.size)),0<this._promiseMap.size&&this._promiseMap.forEach((function(t,n){var o=t.uplinkData,i=t.resolve;t=t.reject,-1!==n.indexOf(jn.AV_POLLING)?e._promiseMap.delete(n):(e._promiseMap.set(n,{resolve:i,reject:t,timestamp:Date.now(),uplinkData:o}),e._execute(n,o))})),0<this._simpleRequestMap.size){var t,n=r(this._simpleRequestMap);try{for(n.s();!(t=n.n()).done;){var o=_(t.value,2),i=o[0],s=o[1];this._execute(i,s)}}catch(a){n.e(a)}finally{n.f()}this._simpleRequestMap.clear()}}},{key:"send",value:function(e){var t=this,n=(e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.head.cs=this._calcCheckSum(e.head.servcmd,e.body),e.keyMap,f(e,gs)),o=this._getRequestIDFromHead(e.head),i=JSON.stringify(n);return new Promise((function(s,r){t._promiseMap.set(o,{resolve:s,reject:r,timestamp:Date.now(),uplinkData:i,headSeq:e.head.seq}),Oe.d("".concat(t._n,".send uplinkData:").concat(JSON.stringify(n)," requestID:").concat(o," readyState:").concat(t._readyState)),t._readyState!==ms?t._reConnect():(t._execute(o,i),t._chM.get(26).addRequestCount())}))}},{key:"simplySend",value:function(e){e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var t=f(e,fs);e=this._getRequestIDFromHead(e.head),t=JSON.stringify(t),this._readyState!==ms?(this._simpleRequestMap.size<this.MAX_SIZE?this._simpleRequestMap.set(e,t):Oe.l("".concat(this._n,".simplySend. simpleRequestMap is full, drop request!")),this._reConnect()):this._execute(e,t)}},{key:"_execute",value:function(e,t){this._socket.send({data:t,fail:Z?this._onSendFail.bind(this):void 0,requestID:e})}},{key:"_onSendFail",value:function(e){Oe.l("".concat(this._n,"._onSendFail requestID:").concat(e)),this._chM.onSendFail()}},{key:"_getSequence",value:function(){var e;if(this._startSequence<2415919103)return e=this._startSequence,this._startSequence+=1,2415919103===this._startSequence&&(this._startSequence=ot()),e}},{key:"_getRequestIDFromHead",value:function(e){return e.servcmd+e.seq}},{key:"_getResKeyMap",value:function(e){return e=this._chM.getKeyMap(e),g(g({},es.res),e.res)}},{key:"_reConnect",value:function(){this._readyState!==ms&&this._readyState!==_s&&this.forcedReconnect()}},{key:"forcedReconnect",value:function(){var e="".concat(this._n,".forcedReconnect");Oe.l("".concat(e," count:").concat(this._reConnectCount," readyState:").concat(this._readyState)),this._reConnectFlag=!0,this._resetRandom(),this._reConnectCount<this.MAX_RECONNECT_COUNT?(this._reConnectCount+=1,this._closeConnection(4001),this._initConnection()):(this._reConnectCount=0,this._chM.get(15).isOnline()?(Oe.w("".concat(e," disconnected from wsserver but network is ok, continue...")),this._closeConnection(4001),this._initConnection()):this._chM.onReconnectFailed())}},{key:"getReconnectFlag",value:function(){return this._reConnectFlag}},{key:"_setNextPingTs",value:function(){this._nextPingTs=W?Date.now()+5e3:Date.now()+1e4}},{key:"getNextPingTs",value:function(){return this._nextPingTs}},{key:"isConnected",value:function(){return this._readyState===ms}},{key:"canIUseBinaryFrame",value:function(){return this._canIUseBinaryFrame}},{key:"getSocketID",value:function(){return this._socketID}},{key:"inflate",value:function(e){if(this._chM.canIUseInflate())return this._chM.get(37).inflate(e)}},{key:"setIsWorkerEnabled",value:function(e){Oe.l("".concat(this._n,".setIsWorkerEnabled flag:").concat(e)),this._isWorkerEnabled=e}},{key:"getIsWorkerEnabled",value:function(){return this._isWorkerEnabled&&he}},{key:"_getRandom",value:function(){return 0===this._random&&(this._random=Math.random()),this._random}},{key:"_resetRandom",value:function(){this._random=0}},{key:"_calcCheckSum",value:function(e,t){if(-1!==e.indexOf(jn.PING)||-1!==e.indexOf(jn.LOGIN)||-1!==e.indexOf(jn.LOGOUT)||-1!==e.indexOf(jn.AV_POLLING)||-1!==e.indexOf(jn.AV_NOAUTH_POLLING))return 0;for(var n=ds(JSON.stringify(t)),o=4294967295,i=0,s=n.length;i<s;i++){o^=n[i];for(var r=0;r<8;r++)1&~o?o>>>=1:o=o>>>1^3988292384}return(4294967295^o)>>>0}},{key:"close",value:function(){Oe.l("".concat(this._n,".close")),this._closeConnection(4e3),this._promiseMap.clear(),this._startSequence=ot(),this._readyState=vs,this._simpleRequestMap.clear(),this._reConnectFlag=!1,this._reConnectCount=0,this._onOpenTs=0,this._url="",this._random=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0}}]),Is=function(e,t,n){return new Promise((function(o,i){var s,r,a="application/x-www-form-urlencoded;charset=UTF-8";Z?ne.request({url:t,data:n,method:e,timeout:3e3,header:{"content-type":a},success:function(e){e&&e.data&&e.data.NetCheckInfo&&Oe.l("".concat("getconninfo ok in"," miniapp. ret:"),e.data),o()},fail:function(){i(new Bn({code:qn.NETWORK_ERROR}))}}):(s=new XMLHttpRequest,r=setTimeout((function(){s.abort(),i(new Bn({code:qn.NETWORK_TIMEOUT}))}),3e3),s.onreadystatechange=function(){4===s.readyState&&(r&&clearTimeout(r),200===s.status||304===s.status?(s.responseText&&-1<s.responseText.indexOf("NetCheckInfo")&&Oe.l("".concat("getconninfo ok in"," web. ret:"),JSON.parse(s.responseText)),o()):i(new Bn({code:qn.NETWORK_ERROR})))},s.open(e,t,!0),s.setRequestHeader("Content-type",a),n?s.send(n):s.send())}))},Ms=(u(bs,Pn),s(bs,[{key:"onCheckTimer",value:function(e){this._socketHandler&&(this.isLoggedIn()?(0<this._timerForNotLoggedIn&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(e)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:"onErrorCodeNotZero",value:function(e){this.get(20).onErrorCodeNotZero(e)}},{key:"onMessage",value:function(e){this.get(20).onMessage(e)}},{key:"send",value:function(e){return this._socketHandler?this._previousState!==S.NET_STATE_CONNECTED&&e.head.servcmd.includes(jn.SSO_STAT)?(this.reConnect(),this.isPrivateNetWork()?Promise.resolve():this._sendLogViaHTTP(e)):this._socketHandler.send(e):Promise.reject()}},{key:"_sendLogViaHTTP",value:function(e){var t=P.HOST.CURRENT.STAT;return t="".concat(t,"/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(e.head.sdkappid,"&reqtime=").concat(Date.now()),e=JSON.stringify(e.body),Is("POST",t,e)}},{key:"simplySend",value:function(e){return this._socketHandler?this._socketHandler.simplySend(e):Promise.reject()}},{key:"onOpen",value:function(){this._ping()}},{key:"onClose",value:function(){this._socketHandler&&this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED),this.reConnect()}},{key:"onError",value:function(){Z&&!W&&this.warn("DomainNameInMP"),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"getKeyMap",value:function(e){return this.get(20).getKeyMap(e)}},{key:"onRequestTimeout",value:function(){3e4<=Date.now()-this._lastDiagnoseTS&&this.diagnose()}},{key:"onSendFail",value:function(){this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"onReconnected",value:function(){Oe.l("".concat(this._n,".onReconnected cost:").concat($t(this._disconnectedTS,!0,!0))),this._m.restartTimer(),this.get(20).onReconnected($t(this._disconnectedTS,!1,!1)),this._disconnectedTS=0,this._emitNetStateChangeEvent(S.NET_STATE_CONNECTED)}},{key:"onReconnectFailed",value:function(){Oe.l("".concat(this._n,".onReconnectFailed")),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"setIsWorkerEnabled",value:function(e){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:"offline",value:function(){this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"reConnect",value:function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=!1,n=(this._socketHandler&&(t=this._socketHandler.getReconnectFlag()),"forcedFlag:".concat(e," fatalErrorFlag:").concat(this._fatalErrorFlag," previousState:").concat(this._previousState," reconnectFlag:").concat(t));Oe.l("".concat(this._n,".reConnect ").concat(n)),this._fatalErrorFlag||!this._socketHandler||!0!==e&&this._previousState===S.NET_STATE_CONNECTING&&t||(this._socketHandler.forcedReconnect(),this._emitNetStateChangeEvent(S.NET_STATE_CONNECTING))}},{key:"_emitNetStateChangeEvent",value:function(e){this._previousState!==e&&(Oe.l("".concat(this._n,"._emitNetStateChangeEvent from ").concat(this._previousState," to ").concat(e)),e===S.NET_STATE_DISCONNECTED&&0===this._disconnectedTS&&(this._disconnectedTS=Date.now(),this.diagnose()),this._previousState=e,this.emitOEvt(T.NET_STATE_CHANGE,{state:e}))}},{key:"_ping",value:function(){var e,t=this;!0!==this._probing&&(this._probing=!0,e=this.get(20).getProtocolData({P:jn.PING}),this.send(e).then((function(){t._probing=!1})).catch((function(e){t._probing=!1;var n=t.get(15).isOnline();Oe.w("".concat(t._n,"._ping failed. bOnline:").concat(n," error:"),e),e&&60002===e.code?(new io("error").setMessage("code:".concat(e.code," message:").concat(e.message)).end(),t._fatalErrorFlag=!0,t._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)):n?t.reConnect():t._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)})))}},{key:"_checkNextPing",value:function(){this._socketHandler&&this._socketHandler.isConnected()&&Date.now()>=this._socketHandler.getNextPingTs()&&this._ping()}},{key:"dealloc",value:function(){this._socketHandler&&(this._socketHandler.close(),this._socketHandler=null),-1<this._timerForNotLoggedIn&&clearInterval(this._timerForNotLoggedIn)}},{key:"onRestApiKickedOut",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:"canIUseInflate",value:function(){return this._m.canIUseInflate()}},{key:"getSocketID",value:function(){if(this._socketHandler)return this._socketHandler.getSocketID()}},{key:"diagnose",value:function(){this.isPrivateNetWork()||(this._lastDiagnoseTS=Date.now(),this._diagnoseBySSO(),this._diagnoseByCDN())}},{key:"_diagnoseBySSO",value:function(){var e=this,t=this._socketHandler.getURL(),n=t.split("/")[2];n.startsWith("ws")&&(t=t.slice(t.indexOf("info?")+5),n="https://".concat(n,"/v3/netcheck/getconninfo?").concat(t,"&reqtime=").concat(Date.now()),Is("GET",n).catch((function(t){Oe.w("".concat(e._n,"._diagnoseBySSO failed. error:"),t)})))}},{key:"_diagnoseByCDN",value:function(){var e=this,t=(t=this._socketHandler.getURL()).slice(t.indexOf("info?")+5);t="https://boce-cdn.my-imcloud.com/v3/netcheck/getconninfo?".concat(t,"&reqtime=").concat(Date.now()),Is("GET",t).catch((function(t){Oe.w("".concat(e._n,"._diagnoseByCDN failed. error:"),t)}))}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._previousState=S.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3),this._disconnectedTS=0,this._lastDiagnoseTS=0}}])),Cs=["a2","tinyid"],Ts=["a2","tinyid"],Ss=s((function e(t){o(this,e),this._n="PHandler",this._sessionM=t,this._map=new Map,this._fillMap()}),[{key:"_fillMap",value:function(){this._map.clear();var e=this._sessionM.genCommonHead(),t=this._sessionM.genCosSpecifiedHead(),n=this._sessionM.genSSOReportHead();this._map.set(jn.LOGIN,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.LOGIN)}),body:{state:"Online",isWebUniapp:0,deviceBrand:0,customInfo:""},keyMap:{req:{deviceBrand:"InstType"},res:{InstId:"instanceID",HelloInterval:"helloInterval",RichMsgAuthKey:"authKey"}}}),this._map.set(jn.LOGOUT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.LOGOUT)}),body:{type:0,isWebUniapp:0},keyMap:{req:{type:"wslogout_type"}}}),this._map.set(jn.HELLO,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.HELLO)}),body:{isWebUniapp:0},keyMap:{res:{NewInstInfo:"newInstanceInfo"}}}),this._map.set(jn.KICK_OTHER,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.STAT_SERVICE,".").concat(jn.KICK_OTHER)}),body:{}}),this._map.set(jn.COS_SIGN,{head:g(g({},t),{},{servcmd:"".concat(P.NAME.IM_COS_SIGN,".").concat(jn.COS_SIGN)}),body:{cmd:"open_im_cos_svc",subCmd:"get_cos_token",duration:300,version:2},keyMap:{req:{userSig:"usersig",subCmd:"sub_cmd",cmd:"cmd",duration:"duration",version:"version"},res:{expired_time:"expiredTime",bucket_name:"bucketName",session_token:"sessionToken",tmp_secret_id:"secretId",tmp_secret_key:"secretKey"}}}),this._map.set(jn.COS_PRE_SIG,{head:g(g({},t),{},{servcmd:"".concat(P.NAME.CUSTOM_UPLOAD,".").concat(jn.COS_PRE_SIG)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{req:{userSig:"usersig",fileType:"file_type",fileName:"file_name",uploadMethod:"upload_method"},res:{expired_time:"expiredTime",request_id:"requestId",head_url:"headUrl",upload_url:"uploadUrl",download_url:"downloadUrl",ci_url:"ciUrl",snapshot_url:"requestSnapshotUrl"}}}),this._map.set(jn.SIMPLE_COS_PRE_SIG,{head:g(g({},t),{},{servcmd:"".concat(P.NAME.CUSTOM_UPLOAD,".").concat(jn.SIMPLE_COS_PRE_SIG)}),body:{uploadMethod:0,platform:2,SDKAppID:0,userID:"",conversationType:1,uploadConfig:[{fileID:1,fileType:1,fileName:""}]},keyMap:{req:{platform:"uint32_platform",SDKAppID:"uint32_sdkappid",userID:"str_user_id",uploadMethod:"uint32_upload_method",conversationType:"uint32_scene",uploadConfig:"rpt_upload_object",fileID:"uint32_file_id",fileType:"uint32_file_type",fileName:"str_file_name"},res:{str_final_ip:"uploadIP",rpt_pre_sig:"preSig",uint32_file_id:"fileID",uint32_exist_flag:"existFlag",str_download_url:"downloadUrl",str_upload_url:"uploadUrl",str_snapshot_url:"requestSnapshotUrl",str_file_key:"fileKey"}}}),this._map.set(jn.GET_IMAGE_INFO,{head:g(g({},t),{},{servcmd:"".concat(P.NAME.CUSTOM_UPLOAD,".").concat(jn.GET_IMAGE_INFO)}),body:{imageUrl:""},keyMap:{req:{imageUrl:"str_image_url"},res:{rpt_msg_image_info:"imageInfoArray",uint32_image_type:"type",str_url:"url",uint32_width:"width",uint32_height:"height",str_image_format:"imageFormat"}}}),this._map.set(jn.GET_IP,{head:g(g({},t),{},{servcmd:"".concat(P.NAME.CUSTOM_UPLOAD,".").concat(jn.GET_IP)}),body:{domainName:""},keyMap:{req:{domainName:"str_domain"},res:{str_final_ip:"ip"}}}),this._map.set(jn.VIDEO_COVER,{head:g(g({},t),{},{servcmd:"".concat(P.NAME.CUSTOM_UPLOAD,".").concat(jn.VIDEO_COVER)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{req:{version:"version",platform:"platform",coverName:"cover_name",requestSnapshotUrl:"snapshot_url"},res:{error_code:"errorCode",error_msg:"errorInfo",download_url:"snapshotUrl"}}}),this._map.set(jn.FETCH_COMMERCIAL_CONFIG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_CONFIG_MANAGER,".").concat(jn.FETCH_COMMERCIAL_CONFIG)}),body:{SDKAppID:0},keyMap:{req:{SDKAppID:"uint32_sdkappid"},res:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}),this._map.set(jn.PUSHED_COMMERCIAL_CONFIG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_CONFIG_MANAGER,".").concat(jn.PUSHED_COMMERCIAL_CONFIG)}),body:{},keyMap:{res:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}),this._map.set(jn.FETCH_CLOUD_CTRL_CONFIG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_CONFIG_MANAGER,".").concat(jn.FETCH_CLOUD_CTRL_CONFIG)}),body:{SDKAppID:0,version:0},keyMap:{req:{SDKAppID:"uint32_sdkappid",version:"uint64_version"},res:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}),this._map.set(jn.PUSHED_CLOUD_CTRL_CONFIG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_CONFIG_MANAGER,".").concat(jn.PUSHED_CLOUD_CTRL_CONFIG)}),body:{},keyMap:{res:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}),this._map.set(jn.OVERLOAD_NOTIFY,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OVERLOAD_PUSH,".").concat(jn.OVERLOAD_NOTIFY)}),body:{},keyMap:{res:{OverLoadServCmd:"overloadCommand",DelaySecs:"waitingTime"}}}),this._map.set(jn.SYNC_UNREAD_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.SYNC_UNREAD_MSG)}),body:{cookie:"",syncFlag:0,needAbstract:1,isOnlineSync:0,needSignaling:1,needCachedMsg:1},keyMap:{req:{fromAccount:"From_Account",toAccount:"To_Account",from:"From_Account",to:"To_Account",time:"MsgTimeStamp",sequence:"MsgSeq",random:"MsgRandom",elements:"MsgBody"},res:{MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",ClientSeq:"clientSequence",MsgSeq:"sequence",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgRandom:"random",MsgTimeStamp:"time",MsgContent:"content",ToGroupId:"to",MsgKey:"messageKey",GroupTips:"groupTips",MsgBody:"elements",MsgType:"type",C2CRemainingUnreadCount:"C2CRemainingUnreadList",C2CPairUnreadCount:"C2CPairUnreadList"}}}),this._map.set(jn.GET_PROFANITY_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_MSG_AUDIT_MGR,".").concat(jn.GET_PROFANITY_LIST)}),body:{version:0,deviceID:"",startIndex:void 0},keyMap:{req:{version:"uint64_version",deviceID:"str_device_id",startIndex:"uint64_start_index"},res:{msg_cmd_error_code:"errorInfo",str_err_msg:"errorMessage",uint32_code:"errorCode",msg_scene_ctl_config:"filterConfig",uint64_c2c_custom_msg_flag:"c2c_custom_message",uint64_c2c_text_msg_flag:"c2c_text_message",uint64_group_custom_msg_flag:"group_custom_message",uint64_group_text_msg_flag:"group_text_message",uint64_group_info_flag:"group_profile",uint64_group_member_info_flag:"group_member_profile",uint64_relation_chain_flag:"sns",uint64_user_info_flag:"user_profile",rpt_msg_dirty_word:"lexicon",str_dirty_word:"profanity",str_replaced_content:"replacement",uint64_filter_type:"filterType",uint64_id:"id",uint64_word_type:"profanityType",uint64_complete_flag:"completeFlag",uint64_next_start_index:"nextStartIndex",uint64_version:"version",uint64_expired_time:"expiredTime"}}}),this._map.set(jn.SEND_C2C_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.SEND_C2C_MSG)}),body:{fromAccount:"",toAccount:"",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:"",avatar:"",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{sound:"",badgeMode:0,isVoipPush:void 0,image:"",interruptionLevel:"active",contentAvailable:0},androidInfo:{sound:"",XiaoMiChannelID:"",OPPOChannelID:"",GoogleChannelID:"",VIVOClassification:1,VIVOCategory:"",HuaWeiCategory:"",OPPOCategory:"",HuaWeiImage:"",HonorImage:"",GoogleImage:"",HonorImportance:"",MeizuNotifyType:void 0}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,isSupportExtension:0,isRelayMessage:0,cmConfigID:void 0,forbidCallbackControl:void 0},keyMap:{req:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",count:"MaxCnt",lastMessageTime:"LastMsgTime",messageKey:"MsgKey",peerAccount:"Peer_Account",data:"Data",description:"Desc",extension:"Ext",type:"MsgType",content:"MsgContent",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",nick:"From_AccountNick",avatar:"From_AccountHeadurl",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"IsNeedReadReceipt",GoogleChannelID:"GoogleChannelID",XiaoMiChannelID:"XiaoMiChannelID",OPPOChannelID:"OPPOChannelID",OPPOCategory:"OPPOCategory",VIVOClassification:"VIVOClassification",VIVOCategory:"VIVOCategory",HonorImportance:"HonorImportance",MeizuNotifyType:"MeiZuNoticeMsgType"}}}),this._map.set(jn.SEND_GRP_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.SEND_GRP_MSG)}),body:{fromAccount:"",groupID:"",random:0,clientSequence:0,priority:"",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{sound:"",badgeMode:0,isVoipPush:void 0,image:"",interruptionLevel:"active",contentAvailable:0},androidInfo:{sound:"",XiaoMiChannelID:"",OPPOChannelID:"",GoogleChannelID:"",VIVOClassification:1,VIVOCategory:"",HuaWeiCategory:"",OPPOCategory:"",HuaWeiImage:"",HonorImage:"",GoogleImage:"",HonorImportance:"",MeizuNotifyType:void 0}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0,receiverList:void 0,isSupportExtension:0,isRelayMessage:0,cmConfigID:void 0,forbidCallbackControl:void 0},keyMap:{req:{to:"GroupId",extension:"Ext",data:"Data",description:"Desc",random:"Random",sequence:"ReqMsgSeq",count:"ReqMsgNumber",type:"MsgType",priority:"MsgPriority",content:"MsgContent",elements:"MsgBody",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",clientSequence:"ClientSeq",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"NeedReadReceipt",receiverList:"To_Account",GoogleChannelID:"GoogleChannelID",XiaoMiChannelID:"XiaoMiChannelID",OPPOChannelID:"OPPOChannelID",OPPOCategory:"OPPOCategory",VIVOClassification:"VIVOClassification",VIVOCategory:"VIVOCategory",HonorImportance:"HonorImportance",MeizuNotifyType:"MeiZuNoticeMsgType"},res:{MsgTime:"time",MsgSeq:"sequence"}}}),this._map.set(jn.REVOKE_C2C_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.REVOKE_C2C_MSG)}),body:{msgInfo:{fromAccount:"",toAccount:"",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{req:{msgInfo:"MsgInfo",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom"}}}),this._map.set(jn.REVOKE_GRP_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.REVOKE_GRP_MSG)}),body:{groupID:"",msgSeqList:void 0,topicID:""},keyMap:{req:{msgSeqList:"MsgSeqList",msgSeq:"MsgSeq"}}}),this._map.set(jn.GET_C2C_ROAMING_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.GET_C2C_ROAMING_MSG)}),body:{peerAccount:"",count:15,lastMessageTime:0,messageKey:"",withRecalledMessage:1,direction:0},keyMap:{req:{messageKey:"MsgKey",peerAccount:"Peer_Account",count:"MaxCnt",lastMessageTime:"LastMsgTime",withRecalledMessage:"WithRecalledMsg",direction:"GetDirection"},res:{LastMsgTime:"lastMessageTime",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer"}}}),this._map.set(jn.MODIFY_C2C_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.MODIFY_C2C_MSG)}),body:{from:"",to:"",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{req:{sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}),this._map.set(jn.GET_GRP_ROAMING_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_ROAMING_MSG)}),body:{withRecalledMsg:1,groupID:"",count:15,sequence:"",topicID:void 0},keyMap:{req:{sequence:"ReqMsgSeq",count:"ReqMsgNumber",withRecalledMessage:"WithRecalledMsg"},res:{Random:"random",MsgTime:"time",MsgSeq:"sequence",ReqMsgSeq:"sequence",RspMsgList:"messageList",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgPriority:"priority",MsgBody:"elements",MsgType:"type",MsgContent:"content",IsFinished:"complete",Download_Flag:"downloadFlag",ClientSeq:"clientSequence",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",ToTopicId:"topicID",InvisibleMsgSeq:"invisibleSequenceList",NextReqMsgSeq:"nextSequence"}}}),this._map.set(jn.SET_C2C_MSG_READ,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.SET_C2C_MSG_READ)}),body:{C2CMsgReaded:void 0},keyMap:{req:{lastMessageTime:"LastedMsgTime"}}}),this._map.set(jn.SET_C2C_PEER_MUTE_NOTIFICATIONS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.SET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{userIDList:void 0,muteFlag:0},keyMap:{req:{userIDList:"Peer_Account",muteFlag:"Mute_Notifications"}}}),this._map.set(jn.GET_C2C_PEER_MUTE_NOTIFICATIONS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.GET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{toAccount:void 0,userIDList:void 0},keyMap:{req:{userIDList:"Peer_Account"},res:{MuteNotificationsList:"muteFlagList"}}}),this._map.set(jn.SET_GRP_MSG_READ,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.SET_GRP_MSG_READ)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{req:{messageReadSeq:"MsgReadedSeq"}}}),this._map.set(jn.SET_ALL_MSG_READ,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.SET_ALL_MSG_READ)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{req:{readAllC2CMessage:"C2CReadAllMsg",groupMessageReadInfoList:"GroupReadInfo",messageSequence:"MsgSeq"},res:{C2CReadAllMsg:"readAllC2CMessage",GroupReadInfoArray:"groupMessageReadInfoList"}}}),this._map.set(jn.DEL_C2C_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.DEL_C2C_MSG)}),body:{fromAccount:"",to:"",keyList:void 0},keyMap:{req:{keyList:"MsgKeyList"}}}),this._map.set(jn.DEL_GRP_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.DEL_GRP_MSG)}),body:{groupID:"",deleter:"",keyList:void 0,topicID:void 0},keyMap:{req:{deleter:"Deleter_Account",keyList:"Seqs"}}}),this._map.set(jn.TRANSLATE_TEXT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_TRANSLATE,".").concat(jn.TRANSLATE_TEXT)}),body:{sourceTextList:void 0,SDKAppID:0,from:0,source:"",target:""},keyMap:{req:{sourceTextList:"SourceText",SDKAppID:"SdkAppId",from:"FromAccount"},res:{TargetText:"translatedTextList",RequestId:"requestID",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}),this._map.set(jn.VOICE_TO_TEXT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_SPEECH,".").concat(jn.VOICE_TO_TEXT)}),body:{url:"",SDKAppID:0,format:"",sourceType:0,language:""},keyMap:{req:{url:"BytesUrl",SDKAppID:"Uint32Sdkappid",format:"BytesVoiceFormat",sourceType:"Uint64SourceType",language:"BytesEngServiceType"},res:{BytesRequestid:"requestID",BytesResult:"result",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}),this._map.set(jn.MODIFY_GRP_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.MODIFY_GRP_MSG)}),body:{groupID:"",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{req:{sequence:"MsgSeq",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}),this._map.set(jn.GET_READ_RECEIPT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{req:{sequence:"MsgSeq"}}}),this._map.set(jn.SEND_C2C_READ_RECEIPT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.SEND_C2C_READ_RECEIPT)}),body:{peerAccount:"",messageInfoList:void 0},keyMap:{req:{peerAccount:"Peer_Account",messageInfoList:"C2CMsgInfo",fromAccount:"From_Account",toAccount:"To_Account",sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",clientTime:"MsgClientTime"}}}),this._map.set(jn.SEND_READ_RECEIPT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.SEND_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{req:{sequenceList:"MsgSeqList",sequence:"MsgSeq"}}}),this._map.set(jn.GET_READ_RECEIPT_DETAIL,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_READ_RECEIPT_DETAIL)}),body:{groupID:"",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{req:{sequence:"MsgSeq",count:"Num"},res:{ReadList:"readUserIDList",Read_Account:"userID",UnreadList:"unreadUserIDList",Unread_Account:"userID",IsFinish:"isCompleted"}}}),this._map.set(jn.GET_GRP_RECEIPTS_BY_USERS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_RECEIPTS_BY_USERS)}),body:{groupID:"",dataList:void 0},keyMap:{req:{dataList:"MemberReadMsgList",sequence:"MsgSeq",userIDList:"MemberList_Account"},res:{MsgReadList:"dataList",Read_Account:"userID",Read_Time:"readTime"}}}),this._map.set(jn.MODIFY_C2C_MSG_EXT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.MODIFY_C2C_MSG_EXT)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}),this._map.set(jn.GET_C2C_MSG_EXT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.GET_C2C_MSG_EXT)}),body:{from:void 0,to:void 0,messageKey:void 0,startSequence:void 0}}),this._map.set(jn.MODIFY_GRP_MSG_EXT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.MODIFY_GRP_MSG_EXT)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,operateType:void 0,extensionList:void 0}}),this._map.set(jn.GET_GRP_MSG_EXT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.GET_GRP_MSG_EXT)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,startSequence:void 0}}),this._map.set(jn.ADD_C2C_MSG_REACTION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.ADD_C2C_MSG_REACTION)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,userIDList:void 0},keyMap:{req:{userIDList:"Add_Account"}}}),this._map.set(jn.RM_C2C_MSG_REACTION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.RM_C2C_MSG_REACTION)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,userIDList:void 0},keyMap:{req:{userIDList:"Del_Account"}}}),this._map.set(jn.GET_C2C_MSG_REACTIONS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.GET_C2C_MSG_REACTIONS)}),body:{from:void 0,to:void 0,messageKeyList:void 0,count:void 0}}),this._map.set(jn.GET_C2C_MSG_REACTION_USER_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.GET_C2C_MSG_REACTION_USER_LIST)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,count:void 0}}),this._map.set(jn.ADD_GRP_MSG_REACTION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.ADD_GRP_MSG_REACTION)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,userIDList:void 0},keyMap:{req:{userIDList:"Add_Account"}}}),this._map.set(jn.RM_GRP_MSG_REACTION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.RM_GRP_MSG_REACTION)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,userIDList:void 0},keyMap:{req:{userIDList:"Del_Account"}}}),this._map.set(jn.GET_GRP_MSG_REACTIONS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.GET_GRP_MSG_REACTIONS)}),body:{groupID:void 0,topicID:void 0,messageSequenceList:void 0,count:void 0},keyMap:{res:{MsgSeq:"messageSequence"}}}),this._map.set(jn.GET_GRP_MSG_REACTION_USER_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM_MSG_EXT,".").concat(jn.GET_GRP_MSG_REACTION_USER_LIST)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,nextSeq:void 0,count:void 0}}),this._map.set(jn.GET_C2C_PEER_READ_TIME,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.GET_C2C_PEER_READ_TIME)}),body:{userIDList:void 0},keyMap:{req:{userIDList:"To_Account"},res:{ReadTime:"peerReadTimeList"}}}),this._map.set(jn.PAGING_GET_CONV_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.PAGING_GET_CONV_LIST)}),body:{fromAccount:void 0,timeStamp:void 0,startIndex:void 0,pinnedTimeStamp:void 0,pinnedStartIndex:void 0,orderType:void 0,messageAssistFlag:15,assistFlag:31},keyMap:{req:{messageAssistFlag:"MsgAssistFlags",assistFlag:"AssistFlags",pinnedTimeStamp:"TopTimeStamp",pinnedStartIndex:"TopStartIndex"},res:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime",LastMsgFlags:"lastMessageFlag",TopFlags:"isPinned",TopTimeStamp:"pinnedTimeStamp",TopStartIndex:"pinnedStartIndex",GroupId:"convGroupID",C2cRemark:"friendRemark",MsgRecvOption:"messageRemindType",GroupIgnoredUnreadSeqCount:"noUnreadCount",GroupNextMsgSeq:"nextMessageSeq"}}}),this._map.set(jn.DEL_CONV,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.DEL_CONV)}),body:{fromAccount:"",conversationList:void 0,clearHistoryMessage:void 0},keyMap:{req:{toGroupID:"ToGroupid",clearHistoryMessage:"ClearRamble",conversationList:"ContactItem"},res:{ResultItem:"resultList",ToGroupid:"groupID",ResultCode:"code",ResultInfo:"info"}}}),this._map.set(jn.CLEAR_HISTORY_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.CLEAR_HISTORY_MSG)}),body:{fromAccount:"",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{req:{toGroupID:"ToGroupid"}}}),this._map.set(jn.PIN_CONV,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.PIN_CONV)}),body:{fromAccount:"",operationType:1,itemList:void 0},keyMap:{req:{itemList:"RecentContactItem"}}}),this._map.set(jn.DEL_GROUP_AT_TIPS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.DEL_GROUP_AT_TIPS)}),body:{messageListToDelete:void 0},keyMap:{req:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}),this._map.set(jn.SET_CONV_CUSTOM_DATA,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.MARK_CONV)}),body:{fromAccount:"",itemList:void 0},keyMap:{req:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},res:{ToGroupId:"groupID",OptType:"operationType"}}}),this._map.set(jn.MARK_CONV,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.MARK_CONV)}),body:{fromAccount:"",itemList:void 0},keyMap:{req:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},res:{ToGroupId:"groupID",OptType:"operationType"}}}),this._map.set(jn.CREATE_CONV_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.CREATE_CONV_GRP)}),body:{fromAccount:"",itemList:void 0},keyMap:{req:{itemList:"GroupContactItem",groupID:"ToGroupId"},res:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType"}}}),this._map.set(jn.DEL_CONV_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.DEL_CONV_GRP)}),body:{fromAccount:"",groupName:void 0},keyMap:{res:{GroupId:"convGroupID"}}}),this._map.set(jn.RENAME_CONV_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.RENAME_CONV_GRP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{req:{oldName:"OldGroupName",newName:"NewGroupName",groupID:"ToGroupId",operationType:"ContactOptType",groupName:"OldGroupName",updateItem:"ContactUpdateItem"},res:{ContactOptType:"operationType",ToGroupId:"groupID",GroupId:"convGroupID"}}}),this._map.set(jn.ADD_CONV_TO_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.RENAME_CONV_GRP)}),body:{fromAccount:"",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}}}),this._map.set(jn.DEL_CONV_FROM_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.RENAME_CONV_GRP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0}}),this._map.set(jn.GET_CONV_GRP_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.GET_CONV_GRP_LIST)}),body:{fromAccount:"",startIndex:void 0},keyMap:{res:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType",CustomMark:"customData",ContactGroupId:"convGroupIDList"}}}),this._map.set(jn.SEARCH_CONV_GRP_MARK,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.RECENT_CONTACT,".").concat(jn.SEARCH_CONV_GRP_MARK)}),body:{fromAccount:"",contactItem:void 0},keyMap:{req:{groupID:"ToGroupId"},res:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType",CustomMark:"customData",ContactGroupId:"convGroupIDList",ContactResultItem:"contactItem"}}}),this._map.set(jn.GET_USER_PROFILE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.PROFILE,".").concat(jn.GET_USER_PROFILE)}),body:{fromAccount:"",userItem:[]},keyMap:{req:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}),this._map.set(jn.UPDATE_MY_PROFILE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.PROFILE,".").concat(jn.UPDATE_MY_PROFILE)}),body:{fromAccount:"",profileItem:[{tag:be.NICK,value:""},{tag:be.GENDER,value:""},{tag:be.ALLOWTYPE,value:""},{tag:be.AVATAR,value:""}]},keyMap:{req:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}),this._map.set(jn.GET_BL,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.GET_BL)}),body:{fromAccount:"",startIndex:0,maxLimited:30}}),this._map.set(jn.ADD_TO_BL,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.ADD_TO_BL)}),body:{fromAccount:"",toAccount:[]}}),this._map.set(jn.RM_FROM_BL,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.RM_FROM_BL)}),body:{fromAccount:"",toAccount:[]}}),this._map.set(jn.SET_SELF_STATUS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.SET_SELF_STATUS)}),body:{customStatus:""}}),this._map.set(jn.GET_USER_STATUS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.GET_USER_STATUS)}),body:{userIDList:void 0},keyMap:{res:{UserStatusList:"successUserList",ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID",Status:"statusType"}}}),this._map.set(jn.SUB_USER_STATUS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.SUB_USER_STATUS)}),body:{userIDList:void 0},keyMap:{res:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}),this._map.set(jn.UNSUB_USER_STATUS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.UNSUB_USER_STATUS)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{res:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}),this._map.set(jn.GET_FD_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.GET_FD_LIST)}),body:{fromAccount:"",startIndex:0,standardSequence:0,customSequence:0},keyMap:{res:{FriendNum:"friendCount",UserDataItem:"resultList",ValueItem:"tagValueList"}}}),this._map.set(jn.ADD_FD,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.ADD_FD)}),body:{fromAccount:"",addFriendItem:[],type:""},keyMap:{req:{source:"AddSource",wording:"AddWording",type:"AddType"},res:{ResultItem:"resultList"}}}),this._map.set(jn.UPDATE_FD,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.UPDATE_FD)}),body:{fromAccount:"",updateItem:void 0},keyMap:{req:{snsItem:"SnsItem"},res:{ResultItem:"resultList"}}}),this._map.set(jn.DEL_FD,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.DEL_FD)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{req:{type:"DeleteType"},res:{ResultItem:"resultList"}}}),this._map.set(jn.GET_FD_PROFILE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.GET_FD_PROFILE)}),body:{fromAccount:"",userIDList:void 0},keyMap:{res:{InfoItem:"resultList",SnsProfileItem:"tagValueList"}}}),this._map.set(jn.CHECK_FD,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.CHECK_FD)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{req:{type:"CheckType"},res:{InfoItem:"resultList"}}}),this._map.set(jn.GET_FD_APPLICATION_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.GET_FD_APPLICATION_LIST)}),body:{fromAccount:"",applicationType:"",startTime:0,maxLimited:0,lastSequence:0},keyMap:{res:{PendencyItem:"resultList",AddSource:"source",AddTime:"time",AddWording:"wording",Image:"avatar",UnreadPendencyCount:"unreadCount",To_Account:"userID",PendencyType:"type"}}}),this._map.set(jn.RESPOND_FD_APPLICATION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.RESPOND_FD_APPLICATION)}),body:{fromAccount:"",responseFriendItem:[]},keyMap:{req:{tag:"TagName",action:"ResponseAction"},res:{ResultItem:"resultList"}}}),this._map.set(jn.DEL_FD_APPLICATION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.DEL_FD_APPLICATION)}),body:{fromAccount:"",type:"",userIDList:void 0},keyMap:{req:{type:"PendencyType",userIDList:"To_Account"},res:{ResultItem:"resultList"}}}),this._map.set(jn.REPORT_FD_APPLICATION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.REPORT_FD_APPLICATION)}),body:{fromAccount:"",latestTimeStamp:""},keyMap:{req:{latestTimeStamp:"LatestPendencyTimeStamp"}}}),this._map.set(jn.CREATE_FD_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.CREATE_FD_GRP)}),body:{fromAccount:"",groupName:void 0,userIDList:void 0},keyMap:{req:{groupName:"GroupName",userIDList:"To_Account"},res:{ResultItem:"resultList"}}}),this._map.set(jn.DEL_FD_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.DEL_FD_GRP)}),body:{fromAccount:"",nameList:void 0},keyMap:{req:{nameList:"GroupName"}}}),this._map.set(jn.GET_FD_GRP_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.GET_FD_GRP_LIST)}),body:{fromAccount:"",lastSequence:0,needFriend:"Need_Friend_Type_Yes"},keyMap:{res:{ResultItem:"resultList",GroupName:"name",FriendNumber:"friendCount",To_Account:"userIDList"}}}),this._map.set(jn.UPDATE_FD_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FD,".").concat(jn.UPDATE_FD_GRP)}),body:{fromAccount:"",oldName:"",newName:void 0,updateGroupItem:void 0},keyMap:{req:{oldName:"GroupOldName",newName:"GroupNewName"},res:{UpdateType:"type",ResultItem:"resultList"}}}),this._map.set(jn.GET_GRP_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_LIST)}),body:{memberAccount:"",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0,needAppDefineData:1},keyMap:{req:{memberAccount:"Member_Account"},res:{GroupIdList:"groups",MsgSeq:"readedSequence",LastRecallTime:"_lastRevokedTime",AppDefinedData:"groupCustomField"}}}),this._map.set(jn.GET_GRP_PROFILE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_PROFILE)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:void 0,groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{req:{groupIDList:"GroupIdList",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",groupCustomFieldFilter:"AppDefinedDataFilter_Group",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},res:{GroupIdList:"groups",AppDefinedData:"groupCustomField",AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_Group:"groupCustomFieldFilter",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",InfoSeq:"infoSequence",MemberList:"members",GroupInfo:"groups",ShutUpUntil:"muteUntil",ShutUpAllMember:"muteAllMembers"}}}),this._map.set(jn.CREATE_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.CREATE_GRP)}),body:{type:void 0,name:void 0,groupID:void 0,ownerID:void 0,introduction:void 0,notification:void 0,maxMemberNum:void 0,joinOption:void 0,memberList:void 0,groupCustomField:void 0,memberCustomField:void 0,webPushFlag:1,avatar:"",isSupportTopic:void 0,inviteOption:void 0},keyMap:{req:{ownerID:"Owner_Account",userID:"Member_Account",avatar:"FaceUrl",maxMemberNum:"MaxMemberCount",joinOption:"ApplyJoinOption",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",inviteOption:"InviteJoinOption"},res:{HugeGroupFlag:"avChatRoomFlag",OverJoinedGroupLimit_Account:"overLimitUserIDList"}}}),this._map.set(jn.DISMISS_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.DISMISS_GRP)}),body:{groupID:void 0}}),this._map.set(jn.UPDATE_GRP_PROFILE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.UPDATE_GRP_PROFILE)}),body:{groupID:void 0,name:void 0,introduction:void 0,notification:void 0,avatar:void 0,joinOption:void 0,groupCustomField:void 0,muteAllMembers:void 0,inviteOption:void 0},keyMap:{req:{groupCustomField:"AppDefinedData",muteAllMembers:"ShutUpAllMember",joinOption:"ApplyJoinOption",avatar:"FaceUrl",inviteOption:"InviteJoinOption"},res:{AppDefinedData:"groupCustomField",ShutUpAllMember:"muteAllMembers"}}}),this._map.set(jn.APPLY_JOIN_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.APPLY_JOIN_GRP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{req:{applyMessage:"ApplyMsg",historyMessageFlag:"HugeGroupHistoryMsgFlag"},res:{HugeGroupFlag:"avChatRoomFlag",AVChatRoomKey:"avChatRoomKey",RspMsgList:"messageList",ToGroupId:"to"}}}),this._map.set(jn.APPLY_JOIN_GRP_NOAUTH,(e.a2,e.tinyid,{head:g(g({},f(e,Cs)),{},{servcmd:"".concat(P.NAME.BIG_GRP_NO_AUTH,".").concat(jn.APPLY_JOIN_GRP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{req:{applyMessage:"ApplyMsg"},res:{HugeGroupFlag:"avChatRoomFlag"}}})),this._map.set(jn.QUIT_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.QUIT_GRP)}),body:{groupID:void 0}}),this._map.set(jn.SEARCH_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.SEARCH_GRP)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","CreateTime","Owner_Account","LastInfoTime","LastMsgTime","NextMsgSeq","MemberNum","MaxMemberNum","ApplyJoinOption","InviteJoinOption"]}}}),this._map.set(jn.CHANGE_GRP_OWNER,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.CHANGE_GRP_OWNER)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{req:{newOwnerID:"NewOwner_Account"}}}),this._map.set(jn.HANDLE_GRP_APPLICATION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.HANDLE_GRP_APPLICATION)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{req:{applicant:"Applicant_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}),this._map.set(jn.HANDLE_INVITE_JOIN_GRP,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.HANDLE_INVITE_JOIN_GRP)}),body:{groupID:void 0,applicant:void 0,invitee:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,userDefinedField:void 0},keyMap:{req:{applicant:"Applicant_Account",invitee:"Invited_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg"}}}),this._map.set(jn.HANDLE_GRP_INVITATION,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.HANDLE_GRP_INVITATION)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{req:{inviter:"Inviter_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}),this._map.set(jn.GET_GRP_PENDENCY,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_PENDENCY)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{req:{handleAccount:"Handle_Account"},res:{To_Account:"userID",ApplyInviteMsg:"note"}}}),this._map.set(jn.DEL_GRP_SYSTEM_NOTICE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.DEL_GRP_SYSTEM_NOTICE)}),body:{messageListToDelete:void 0},keyMap:{req:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}),this._map.set(jn.AV_POLLING,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.BIG_GRP_POLLING,".").concat(jn.AV_POLLING)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{req:{USP:"USP"},res:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}),this._map.set(jn.AV_NOAUTH_POLLING,(e.a2,e.tinyid,{head:g(g({},f(e,Ts)),{},{servcmd:"".concat(P.NAME.BIG_GRP_POLLING_NO_AUTH,".").concat(jn.AV_POLLING)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{req:{USP:"USP"},res:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}})),this._map.set(jn.GET_ONLINE_MBR_NUM,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_ONLINE_MBR_NUM)}),body:{groupID:void 0},keyMap:{res:{OnlineMemberNum:"memberCount"}}}),this._map.set(jn.SET_GRP_ATTR,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.SET_GRP_ATTR)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{req:{key:"key",value:"value"}}}),this._map.set(jn.MODIFY_GRP_ATTR,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.MODIFY_GRP_ATTR)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{req:{key:"key",value:"value"}}}),this._map.set(jn.DEL_GRP_ATTR,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.DEL_GRP_ATTR)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{req:{key:"key"}}}),this._map.set(jn.CLEAR_GRP_ATTR,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.CLEAR_GRP_ATTR)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]}}),this._map.set(jn.GET_GRP_ATTR,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_ATTR,".").concat(jn.GET_GRP_ATTR)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{req:{avChatRoomKey:"Key",groupType:"GroupType"}}}),this._map.set(jn.GET_GRP_NOTIFY,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_NOTIFY)}),body:{notifyReqList:[]},keyMap:{req:{notifyReqList:"NotifyReqList"},res:{NextMsgTime:"nextRevokedTime",NotifyMsgList:"notifyList",NotifyRspList:"notifyRspList"}}}),this._map.set(jn.UPDATE_GRP_COUNTER,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.UPDATE_GRP_COUNTER)}),body:{groupID:void 0,counterList:void 0,avChatRoomKey:void 0,mode:void 0},keyMap:{req:{counterList:"GroupCounter"}}}),this._map.set(jn.GET_GRP_COUNTER,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_COUNTER)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{req:{keyList:"GroupCounterKeys"}}}),this._map.set(jn.CREATE_TOPIC,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_COMMUNITY,".").concat(jn.CREATE_TOPIC)}),body:{groupID:void 0,topicName:void 0,avatar:void 0,customData:void 0,topicID:void 0,notification:void 0,introduction:void 0},keyMap:{req:{avatar:"FaceUrl"}}}),this._map.set(jn.DEL_TOPIC,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_COMMUNITY,".").concat(jn.DEL_TOPIC)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{req:{topicIDList:"TopicIdList"},res:{DestroyResultItem:"resultList"}}}),this._map.set(jn.UPDATE_TOPIC_PROFILE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_COMMUNITY,".").concat(jn.UPDATE_TOPIC_PROFILE)}),body:{groupID:void 0,topicID:void 0,avatar:void 0,customData:void 0,notification:void 0,introduction:void 0,muteAllMembers:void 0,topicName:void 0},keyMap:{req:{avatar:"FaceUrl",muteAllMembers:"ShutUpAllMember"}}}),this._map.set(jn.GET_TOPIC_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_COMMUNITY,".").concat(jn.GET_TOPIC_LIST)}),body:{groupID:void 0,topicIDList:void 0,MemberInfoFilter:["NoUnreadSeqList"]},keyMap:{req:{topicIDList:"TopicIdList"},res:{TopicAndSelfInfo:"topicInfoList",TopicInfo:"topic",GroupID:"groupID",ShutUpTime:"muteTime",ShutUpAllFlag:"muteAllMembers",LastMsgTime:"lastMessageTime",MsgSeq:"readedSequence",LastMsgSeq:"sequence"}}}),this._map.set(jn.GET_GRP_MBR_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_MBR_LIST)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{req:{memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},res:{AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",MemberList:"members",ShutUpUntil:"muteUntil"}}}),this._map.set(jn.GET_AV_MBR_LIST,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_AV,".").concat(jn.GET_AV_MBR_LIST)}),body:{groupID:void 0,offset:void 0,filter:void 0},keyMap:{req:{offset:"Timestamp",filter:"Mark"},res:{NextTimestamp:"offset"}}}),this._map.set(jn.GET_GRP_MBR_PROFILE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.GET_GRP_MBR_PROFILE)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{req:{userIDList:"Member_List_Account",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},res:{MemberList:"members",ShutUpUntil:"muteUntil",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",AppMemberDefinedData:"memberCustomField"}}}),this._map.set(jn.ADD_GRP_MBR,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.ADD_GRP_MBR)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{req:{userID:"Member_Account",userIDList:"MemberList"},res:{MemberList:"members"}}}),this._map.set(jn.DEL_GRP_MBR,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.DEL_GRP_MBR)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{req:{userIDList:"MemberToDel_Account"}}}),this._map.set(jn.BAN_AV_MBR,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.BAN_AV_MBR)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:""},keyMap:{req:{userIDList:"Members_Account",duration:"Duration",reason:"Description"}}}),this._map.set(jn.MODIFY_GRP_MBR_INFO,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP,".").concat(jn.MODIFY_GRP_MBR_INFO)}),body:{groupID:void 0,topicID:void 0,userID:void 0,messageRemindType:void 0,nameCard:void 0,role:void 0,memberCustomField:void 0,muteTime:void 0},keyMap:{req:{userID:"Member_Account",memberCustomField:"AppMemberDefinedData",muteTime:"ShutUpTime",messageRemindType:"MsgFlag"}}}),this._map.set(jn.MARK_AV_MBR_INFO,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_AV,".").concat(jn.MARK_AV_MBR_INFO)}),body:{groupID:void 0,operationType:1,memberList:[]},keyMap:{req:{operationType:"CommandType",memberList:"MemberList",markType:"Marks",userID:"Member_Account"},res:{CommandType:"operationType",Marks:"markType",Member_Account:"userID"}}}),this._map.set(jn.CS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.MSG_SEARCH,".").concat(jn.CS)}),body:{keywordList:void 0,keywordListMatchType:"or",account:void 0,groupID:void 0,count:100,cursor:void 0,messageTypeList:void 0,senderUserIDList:void 0,startTime:void 0,endTime:void 0},keyMap:{req:{keywordListMatchType:"MatchType",account:"PeerAccount",groupID:"GroupID",messageTypeList:"MsgTypeList",senderUserIDList:"SendUserIDList",keywords:"Keywords",keywordMatchType:"KeywordMatchType",count:"Count",miniBirthday:"UserBirthStart",maxBirthday:"UserBirthEnd",gender:"UserGenderType",groupTypeList:"GroupType",groupIDList:"GroupIdList"},res:{GroupID:"groupID",UserID:"userID",ErrorCode:"code",ErrorInfo:"message",TotalCount:"totalCount",Count:"messageCount",LastMsgTime:"lastMessageTime",ConversationMsgs:"searchResult",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer",MsgSeq:"sequence",ReqMsgSeq:"sequence",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgContent:"content",ClientSeq:"clientSequence",ToTopicId:"topicID",InvisibleMsgSeq:"invisibleSequenceList",Users:"userList",ProfileItems:"profileItems",StrValue:"value",IntValue:"value",Groups:"groupList",GroupFaceUrl:"avatar",GroupIntroduction:"introduction",GroupOwnerUserID:"ownerID",GroupOwnerUserName:"ownerNick",GroupOwnerTinyID:"ownerTinyID",GroupMemberNum:"memberNum",GroupName:"name",GroupType:"type",GroupMembers:"groupMemberList",GroupMemberUserID:"userID",GroupMemberTinyID:"userTinyID",GroupMemberUserName:"nick",GroupMemberNameCard:"nameCard"}}}),this._map.set(jn.USER_CS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.USER_SEARCH,".").concat(jn.CS)}),body:{keywords:void 0,keywordMatchType:0,miniBirthday:void 0,maxBirthday:void 0,gender:void 0,count:20,cursor:void 0}}),this._map.set(jn.GRP_CS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_SEARCH,".").concat(jn.CS)}),body:{keywords:void 0,keywordMatchType:0,groupType:void 0,count:20,cursor:void 0}}),this._map.set(jn.MBR_CS,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.GRP_MEMBER_SEARCH,".").concat(jn.CS)}),body:{keywords:void 0,keywordMatchType:0,groupType:void 0,groupIDList:void 0,count:20,cursor:void 0}}),this._map.set(jn.SSO_STAT,{head:g(g({},n),{},{servcmd:"".concat(P.NAME.IM_OPEN_STAT,".").concat(jn.SSO_STAT)}),body:{header:{},event:[],quality:[]},keyMap:{req:{SDKType:"sdk_type",SDKVersion:"sdk_version",deviceType:"device_type",platform:"platform",instanceID:"instance_id",traceID:"trace_id",SDKAppID:"sdk_app_id",userID:"user_id",tinyID:"tiny_id",extension:"extension",timestamp:"timestamp",networkType:"network_type",eventType:"event_type",code:"error_code",message:"error_message",moreMessage:"more_message",duplicate:"duplicate",costTime:"cost_time",level:"level",qualityType:"quality_type",reportIndex:"report_index",wholePeriod:"whole_period",totalCount:"total_count",rttCount:"success_count_business",successRateOfRequest:"percent_business",countLessThan1Second:"success_count_business",percentOfCountLessThan1Second:"percent_business",countLessThan3Second:"success_count_platform",percentOfCountLessThan3Second:"percent_platform",successCountOfBusiness:"success_count_business",successRateOfBusiness:"percent_business",successCountOfPlatform:"success_count_platform",successRateOfPlatform:"percent_platform",successCountOfMessageReceived:"success_count_business",successRateOfMessageReceived:"percent_business",avgRTT:"average_value",avgDelay:"average_value",avgValue:"average_value",uiPlatform:"ui_platform"}}}),this._map.set(jn.PING,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.HEARTBEAT,".").concat(jn.PING)}),body:{}}),this._map.set(jn.MSG_PUSH,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_PUSH,".").concat(jn.MSG_PUSH)}),body:{},keyMap:{res:{C2cMsgArray:"C2CMessageArray",GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",C2cNotifyMsgArray:"C2CNotifyMessageArray",C2cMsgInfo:"C2CReadReceiptArray",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyAdd_Account:"userID",ProfileImNick:"nick",PendencyType:"applicationType",C2CReadAllMsg:"readAllC2CMessage",IsNeedReadReceipt:"needReadReceipt",Status:"statusType"}}}),this._map.set(jn.MULTI_MSG_PUSH,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_PUSH,".").concat(jn.MULTI_MSG_PUSH)}),body:{},keyMap:{res:{GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyType:"applicationType"}}}),this._map.set(jn.MSG_PUSH_ACK,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OPEN_IM,".").concat(jn.MSG_PUSH_ACK)}),body:{sessionData:void 0},keyMap:{req:{sessionData:"SessionData"}}}),this._map.set(jn.STATUS_FORCE_OFFLINE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.STATUS_FORCE_OFFLINE)}),body:{},keyMap:{res:{C2cNotifyMsgArray:"C2CNotifyMessageArray",NoticeSeq:"noticeSequence",KickoutMsgNotify:"kickoutMsgNotify",NewInstInfo:"newInstanceInfo"}}}),this._map.set(jn.DOWNLOAD_MERGER_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_LONG_MSG,".").concat(jn.DOWNLOAD_MERGER_MSG)}),body:{downloadKey:""},keyMap:{res:{Data:"data",Desc:"description",Ext:"extension",Download_Flag:"downloadFlag",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID"}}}),this._map.set(jn.UPLOAD_MERGER_MSG,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_LONG_MSG,".").concat(jn.UPLOAD_MERGER_MSG)}),body:{messageList:[]},keyMap:{req:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",type:"MsgType",content:"MsgContent",data:"Data",description:"Desc",extension:"Ext",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody"}}}),this._map.set(jn.FOLLOW,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FOLLOW,".").concat(jn.FOLLOW)}),body:{fromAccount:"",userIDList:[]},keyMap:{req:{userIDList:"FollowItem"},res:{ResultItem:"resultList",To_Account:"userID"}}}),this._map.set(jn.UNFOLLOW,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FOLLOW,".").concat(jn.UNFOLLOW)}),body:{fromAccount:"",userIDList:[]},keyMap:{req:{userIDList:"To_Account"},res:{ResultItem:"resultList",To_Account:"userID"}}}),this._map.set(jn.GET_FOLLOW_INFO,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FOLLOW,".").concat(jn.GET_FOLLOW_INFO)}),body:{fromAccount:"",userIDList:[]},keyMap:{req:{userIDList:"To_Account"},res:{FollowInfo:"followInfoList",To_Account:"userID",FollowerCount:"followersCount",FollowingCount:"followingCount",MutualFollowingCount:"mutualFollowersCount"}}}),this._map.set(jn.GET_FOLLOW,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FOLLOW,".").concat(jn.GET_FOLLOW)}),body:{fromAccount:"",type:1,nextCursor:"",count:500},keyMap:{req:{type:"FollowType",nextCursor:"StartCursor",count:"WantNum"},res:{FollowItem:"resultList",To_Account:"userID",ProfileItem:"profileList"}}}),this._map.set(jn.CHECK_FOLLOW_TYPE,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.FOLLOW,".").concat(jn.CHECK_FOLLOW_TYPE)}),body:{fromAccount:"",userIDList:[]},keyMap:{req:{userIDList:"To_Account"},res:{ResultItem:"resultList",To_Account:"userID"}}}),this._map.set(jn.SET_TOKEN,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.SET_TOKEN)}),body:{tokenID:"",pushMsg:0,sdkAppID:0,businessID:"",deviceBrand:"",deviceToken:"",isTpns:0,isWebUniapp:0,notificationStatus:0,deviceModel:"",systemVersion:"",pushVersion:""},keyMap:{req:{tokenID:"TokenID",pushMsg:"PushMsg",sdkAppID:"EnterVersion",businessID:"BusiID",deviceBrand:"InstType",deviceToken:"VarToken",isTpns:"IsTpns",notificationStatus:"NotificationStatus",deviceModel:"DeviceModel",systemVersion:"SystemVersion",pushVersion:"PushPluginVersion"}}}),this._map.set(jn.STAT_FOREGROUND,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.STAT_FOREGROUND)}),body:{isWebUniapp:0}}),this._map.set(jn.STAT_BACKGROUND,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_OPEN_STATUS,".").concat(jn.STAT_BACKGROUND)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{req:{c2cUnreadCount:"C2cUnread",groupUnreadCount:"GrpUnread"}}}),this._map.set(jn.PUSH_REPORT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.OFFLINE_PUSH_REPORT,".").concat(jn.PUSH_REPORT)}),body:{eventList:[]},keyMap:{req:{eventList:"UinappPushEvents",type:"EventType",time:"EventTime",pushId:"ClickExt"}}}),this._map.set(jn.SET_ALL_RECEIVE_MSG_OPT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_MSG_LOGIC,".").concat(jn.SET_ALL_RECEIVE_MSG_OPT)}),body:{startTime:0,endTime:0,isRepeated:0,messageRemindType:0},keyMap:{req:{messageRemindType:"Level"}}}),this._map.set(jn.GET_ALL_RECEIVE_MSG_OPT,{head:g(g({},e),{},{servcmd:"".concat(P.NAME.IM_MSG_LOGIC,".").concat(jn.GET_ALL_RECEIVE_MSG_OPT)}),body:{toAccount:void 0}})}},{key:"has",value:function(e){return this._map.has(e)}},{key:"get",value:function(e){return this._map.get(e)}},{key:"update",value:function(){this._fillMap()}},{key:"getKeyMap",value:function(e){return this.has(e)?this.get(e).keyMap||{}:(Oe.w("".concat(this._n,".getKeyMap unknown P:").concat(e)),{})}},{key:"getProtocolData",value:function(e){var t=e.P,n=e.data;if(e=this.get(t),t=null,n){var o,i=this._simpleDeepCopy(e),s=(i=this._updateService(n,i)).body,r=Object.create(null);for(o in s)if(Object.prototype.hasOwnProperty.call(s,o)){if(r[o]=s[o],void 0===n[o])continue;r[o]=n[o]}i.body=r,t=this._getUplinkData(i)}else t=this._getUplinkData(e);return t}},{key:"_getUplinkData",value:function(e){var t=Nt((e=this._dataCleaner(e)).head);return t=us(e.body,this._getReqKeyMap(t)),e.body=t,e}},{key:"_updateService",value:function(e,t){var n,o,i=Nt(t.head);return this._isFromGroupRequest(t)&&(n=e.type,o=e.groupID,e=void 0===(e=e.groupIDList)?[]:e,lt(o=void 0===o?void 0:o)&&(o=e[0]||""),Ct({type:n,groupID:o}))&&(t.head.servcmd="".concat(P.NAME.GRP_COMMUNITY,".").concat(i)),t}},{key:"_isFromGroupRequest",value:function(e){return e.head.servcmd.includes(P.NAME.GRP)||e.head.servcmd.includes(P.NAME.GRP_ATTR)}},{key:"_getReqKeyMap",value:function(e){return e=this.getKeyMap(e),g(g({},es.req),e.req)}},{key:"_dataCleaner",value:function(e){var t,n=Array.isArray(e)?[]:Object.create(null);for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&Ze(t)&&null!==e[t]&&void 0!==e[t]&&("object"!==I(e[t])?n[t]=e[t]:n[t]=this._dataCleaner.bind(this)(e[t]));return n}},{key:"_simpleDeepCopy",value:function(e){for(var t,n=Object.keys(e),o={},i=0,s=n.length;i<s;i++)Ye(e[t=n[i]])?o[t]=Array.from(e[t]):$e(e[t])?o[t]=this._simpleDeepCopy(e[t]):o[t]=e[t];return o}}]),Es=[jn.MSG_PUSH_ACK],ks=s((function e(t){o(this,e),this._sessionM=t,this._n="MsgDispatcher",this._eventHandlerMap=new Map,this._eventHandlerMap.set("C2CMessageArray",this._onC2CMsgArray.bind(this)),this._eventHandlerMap.set("groupMessageArray",this._onGroupMsgArray.bind(this)),this._eventHandlerMap.set("groupTips",this._onGroupTips.bind(this)),this._eventHandlerMap.set("C2CNotifyMessageArray",this._onC2CNotifyMsgArray.bind(this)),this._eventHandlerMap.set("C2CReadReceiptArray",this._onC2CReadReceiptArray.bind(this)),this._eventHandlerMap.set("profileModify",this._onProfileModified.bind(this)),this._eventHandlerMap.set("friendListMod",this._onRelationChainModified.bind(this)),this._eventHandlerMap.set("recentContactMod",this._onRecentContact.bind(this)),this._eventHandlerMap.set("readAllC2CMessage",this._onAllMsgRead.bind(this)),this._eventHandlerMap.set("c2cMessageModified",this._onC2CMsgModified.bind(this)),this._eventHandlerMap.set("groupMessageModified",this._onGroupMsgModified.bind(this)),this._eventHandlerMap.set("userStatusList",this._onUserStatusList.bind(this)),this._eventHandlerMap.set("messageExtensionNotify",this._onMsgExtNotify.bind(this)),this._eventHandlerMap.set("messageReactionNotifyList",this._onMsgReactionNotifyList.bind(this)),this._eventHandlerMap.set("messageReactionNotify",this._onMsgReactionNotify.bind(this)),this._eventHandlerMap.set("followChangeList",this._onFollowNotify.bind(this)),this._keys=v(this._eventHandlerMap.keys())}),[{key:"_onC2CMsgArray",value:function(e){var t=this._sessionM.get(6);e.dataList.forEach((function(e){var t;1===e.isSyncMessage&&(t=e.from,e.from=e.to,e.to=t)})),1===e.needSync&&this._sessionM.get(19).syncOnNeed(),t.onNewMessage({dataList:e.dataList,isInstantMessage:!0})}},{key:"_onC2CMsgModified",value:function(e){this._sessionM.get(6).onMsgModified(e)}},{key:"_onGroupMsgArray",value:function(e){var t=this._sessionM.get(7);t&&t.onNewMessage({event:e.event,dataList:e.dataList,isInstantMessage:!0})}},{key:"_onGroupMsgModified",value:function(e){var t=this._sessionM.get(7);t&&t.onMsgModified(e)}},{key:"_onGroupTips",value:function(e){var t=this._sessionM.get(7);if(t){var n=e.event,o=e.dataList,i=e.isInstantMessage,s=void 0===i||i,r=e.isSyncingEnded;switch(n){case 4:case 6:t.onNewGroupTips({event:n,dataList:o});break;case 5:for(var a=0;a<o.length;a++)if(Ye(o[a].elements.revokedInfos))t.onMsgRevoked({dataList:o});else if(Ye(o[a].elements.groupMessageReadNotice))t.onMsgReadNotice({dataList:o});else{if(!Ye(o[a].elements.readReceiptList)){t.onNewGroupSystemNotice({dataList:o,isInstantMessage:s,isSyncingEnded:r});break}t.onReadReceiptList({dataList:o})}break;case 12:this._sessionM.get(11).onNewGroupAtTips({dataList:o});break;default:Oe.l("".concat(this._n,"._onGroupTips unknown event:").concat(n," dataList:"),o)}}}},{key:"_onC2CNotifyMsgArray",value:function(e){var t,n=this,o=e.dataList;Ye(o)&&(t=this._sessionM.get(6),o.forEach((function(e){var i,s;ze(e)&&(e.hasOwnProperty("kickoutMsgNotify")?(i=(s=e.kickoutMsgNotify).kickType,s=void 0===(s=s.newInstanceInfo)?{}:s,1===i?n._sessionM.onMultipleAccountKickedOut(s):2===i?n._sessionM.onMultipleDeviceKickedOut(s):3===i&&n._sessionM.onRestApiKickedOut(s)):e.hasOwnProperty("c2cMessageRevokedNotify")?t&&t.onMsgRevoked({dataList:o},!0):e.hasOwnProperty("c2cMessageReadReceipt")?t&&t.onMsgReadReceipt({dataList:o}):e.hasOwnProperty("c2cMessageReadNotice")?t&&t.onMsgReadNotice({dataList:o}):e.hasOwnProperty("muteNotificationsSync")&&n._sessionM.get(11).onC2CMsgRemindTypeSynced({dataList:o}))})))}},{key:"_onC2CReadReceiptArray",value:function(e){this._sessionM.get(6).onReadReceiptList(e)}},{key:"_onProfileModified",value:function(e){this._sessionM.get(4).onProfileModified({dataList:e.dataList});var t=this._sessionM.get(8);t&&t.onFriendProfileModified({dataList:e.dataList})}},{key:"_onRelationChainModified",value:function(e){this._sessionM.get(4).onRelationChainModified({dataList:e.dataList});var t=this._sessionM.get(8);t&&t.onRelationChainModified({dataList:e.dataList})}},{key:"_onRecentContact",value:function(e){var t;Ye(e=e.dataList)&&(t=this._sessionM.get(11))&&e.forEach((function(e){var n,o,i=e.pushType;1===i?(n=e.recentContactDeleteItem,t.onConvDeleted(n.recentContactList)):2===i?(n=e.recentContactTopItem,t.onConvPinnedStatus(n.recentContactList,!0)):3===i?(n=e.recentContactTopItem,t.onConvPinnedStatus(n.recentContactList,!1)):4===i?(n=e.recentContactMarkContact,t.onConvMarkUpdated(n.recentContactMarkContactItem)):5===i?(n=e.recentContactCreateContactGroup,t.onConvGroupCreated(n.msgContactGroupContactItem)):6===i?(n=e.recentContactDelContactGroup,t.onConvGroupDeleted(n.msgGroupItem)):7===i&&(i=(n=e.recentContactUpdateContactGroup).updateType,e=n.msgUpdateGroup,n=n.msgUpdateContact,1===i?1===(o=e.updateGroupType)?t.onConvGroupNameUpdated(e):2===o&&t.onConvInGroupUpdated(e):2===i&&t.onConvAddedToOrDeletedFromGroup(n))}))}},{key:"_onAllMsgRead",value:function(e){e=e.dataList;var t=this._sessionM.get(11);t&&t.onPushedAllMessageRead(e)}},{key:"_onUserStatusList",value:function(e){this._sessionM.get(4).onUserStatusUpdated(e)}},{key:"_onMsgExtNotify",value:function(e){this._sessionM.get(3).onMsgExtNotify(e)}},{key:"_onMsgReactionNotifyList",value:function(e){this._sessionM.get(34).onReactionNotifyList(e)}},{key:"_onMsgReactionNotify",value:function(e){this._sessionM.get(34).onReactionNotify(e)}},{key:"_onFollowNotify",value:function(e){this._sessionM.get(35).onFollowNotify(e)}},{key:"_onTopicLatestMsg",value:function(e){this._sessionM.get(10).onTopicLatestMsg(e)}},{key:"onMessage",value:function(e){var t=this,n=e.body;if(this._filterMsgFromIMOpenPush(e)){var o,i=n.eventArray,s=n.isInstantMessage,r=n.isSyncingEnded,a=n.needSync;if(Ye(i))for(var c,u,l,p=0,d=i.length;p<d;p++)100!==(l=(c=i[p]).event)?24!==l?26!==l?(o=Object.keys(c).find((function(e){return-1!==t._keys.indexOf(e)})))?(u=14===l?{readAllC2CMessage:c[o],groupMessageReadInfoList:c.groupMessageReadNotice||[]}:16===l?{userID:c.userID,timestamp:c.timestamp,readReceiptList:c[o]}:c[o],this._eventHandlerMap.get(o)({event:l,dataList:u,isInstantMessage:s,isSyncingEnded:r,needSync:a})):Oe.l("".concat(this._n,".onMessage unknown eventItem:"),c):this._onTopicLatestMsg(c):this._onAllRcvMsgOptNotify(c):this._onRoomCustomData(c.content)}}},{key:"_onRoomCustomData",value:function(e){this._sessionM.get(30).onRoomCustomDataReceived(e),Oe.l("".concat(this._n,"._onRoomCustomData data:").concat(e))}},{key:"_onAllRcvMsgOptNotify",value:function(e){this._sessionM.get(11).onAllRcvMsgOptNotify(e)}},{key:"_filterMsgFromIMOpenPush",value:function(e){var t=e.head,n=(e=e.body,t=t.servcmd,!1);return!(n=lt(t)?n:t.includes(P.NAME.IM_CONFIG_MANAGER)||t.includes(P.NAME.OVERLOAD_PUSH)||t.includes(P.NAME.STAT_SERVICE))||(t.includes(jn.PUSHED_CLOUD_CTRL_CONFIG)?this._sessionM.get(23).onPushedConfig(e):t.includes(jn.PUSHED_COMMERCIAL_CONFIG)?this._sessionM.get(27).onPushedConfig(e):t.includes(jn.OVERLOAD_NOTIFY)?this._sessionM.onPushedServerOverload(e):t.includes(jn.KICK_OTHER)&&(n=Date.now(),this._sessionM.reLoginOnKickOther(),e=new io("kickOther"),n-=t=this._sessionM.get(1).getLastWsHelloTs(),e.setMessage("last wshello time:".concat(t," diff:").concat(n,"ms")).end()),!1)}}]),Ds=[{cmd:jn.GET_GRP_PROFILE,interval:1,count:8},{cmd:jn.UPDATE_GRP_PROFILE,interval:1,count:8},{cmd:jn.GET_AV_MBR_LIST,interval:3,count:1},{cmd:jn.GET_GRP_PENDENCY,interval:1,count:15},{cmd:jn.GET_TOPIC_LIST,interval:1,count:10},{cmd:jn.SET_GRP_ATTR,interval:5,count:10},{cmd:jn.MODIFY_GRP_ATTR,interval:5,count:10},{cmd:jn.DEL_GRP_ATTR,interval:5,count:10},{cmd:jn.CLEAR_GRP_ATTR,interval:5,count:10},{cmd:jn.GET_GRP_ATTR,interval:5,count:20},{cmd:jn.UPDATE_GRP_COUNTER,interval:5,count:20},{cmd:jn.GET_GRP_COUNTER,interval:5,count:20},{cmd:jn.SET_ALL_MSG_READ,interval:1,count:1},{cmd:jn.GET_USER_STATUS,interval:5,count:20},{cmd:jn.SUB_USER_STATUS,interval:5,count:20},{cmd:jn.UNSUB_USER_STATUS,interval:5,count:20},{cmd:jn.CS,interval:5,count:20},{cmd:jn.GRP_CS,interval:5,count:20},{cmd:jn.MBR_CS,interval:5,count:20},{cmd:jn.USER_CS,interval:5,count:20},{cmd:jn.CHECK_FOLLOW_TYPE,interval:5,count:20},{cmd:jn.GET_GRP_ROAMING_MSG,interval:1,count:20},{cmd:jn.GET_C2C_ROAMING_MSG,interval:1,count:20}],Ls=new Map,Rs=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],Os=0,As=Rs.length;Os<As;Os++)Ls.set(Os,Rs[Os]);function bs(e){return o(this,bs),(e=n(this,bs,[e]))._n="ChannelModule",e._socketHandler=new ys(e),e._probing=!1,e._isAppShowing=!0,e._previousState=S.NET_STATE_CONNECTED,e._timerForNotLoggedIn=-1,e._timerForNotLoggedIn=setInterval(e.onCheckTimer.bind(e),1e3),e._fatalErrorFlag=!1,e._disconnectedTS=0,e._lastDiagnoseTS=0,e}function Ps(e){for(var t,n,o=e,i="",s=0,r=(o=e.length%8!=0?"0".repeat(8-e.length%8)+e:o).length;s<r;s+=8)t=parseInt(o.slice(s,s+4),2),n=parseInt(o.slice(s+4,s+8),2),i+=Ls.get(t)+Ls.get(n);return i}function Ns(e){var t;return e<0||53<e?NaN:(t=0|1073741824*Math.random(),30<e?t+1073741824*(0|Math.random()*(1<<e-30)):t>>>30-e)}function xs(e,t){for(var n=e.toString(16),o=t-n.length,i="0";0<o;o>>>=1,i+=i)1&o&&(n=i+n);return n}u(Dr,Pn);var ws=s(Dr,[{key:"_init",value:function(){this._updateCmdFreqLimitMap(Ds)}},{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("cmd_frequency_limit");lt(e)||(e=JSON.parse(e),this._updateCmdFreqLimitMap(e))}},{key:"_updateCmdFreqLimitMap",value:function(e){var t=this;e.forEach((function(e){t._cmdFreqLimitMap.set(e.cmd,{interval:e.interval,count:e.count})}))}},{key:"updateProtocolConfig",value:function(){this._pHandler.update()}},{key:"req",value:function(e){Oe.d("".concat(this._n,".req options:"),e);var t,n,o=e.P;return this._pHandler.has(o)?(t=(e=this.getProtocolData(e)).head.servcmd,this._isFreqOverLimit(t)?Sn({code:n=qn.OVER_FREQUENCY_LIMIT,message:this.getErrMsg(n,this._getCmd(t))}):this._isServerOverload(t)?Sn({code:n=qn.OPEN_SERVICE_OVERLOAD_ERROR,message:this.getErrMsg(n,this._getCmd(t))}):(n=this.get(21),Es.includes(o)?n.simplySend(e):n.send(e))):(Oe.w("".concat(this._n,".req unknown P:").concat(o)),Sn({code:qn.NO_PROTOCOL}))}},{key:"getKeyMap",value:function(e){return this._pHandler.getKeyMap(e)}},{key:"genCommonHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:A,websdkversion:O,a2:e.getA2Key()||void 0,tinyid:e.getTinyID()||void 0,status_instid:e.getStatusInstanceID(),sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getA2Key()?void 0:e.getUserID(),usersig:e.getA2Key()?void 0:e.getUserSig(),sdkability:75689843,sdkability_ext:Ps(""),cappid:e.getApplicationID(),cs:0}}},{key:"genCosSpecifiedHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:A,websdkversion:O,sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getUserID(),usersig:e.getUserSig(),status_instid:e.getStatusInstanceID(),sdkability:75689843,sdkability_ext:Ps(""),cappid:e.getApplicationID(),cs:0}}},{key:"genSSOReportHead",value:function(){var e=this.get(12);return{ver:"v4",platform:this._platform,websdkappid:A,websdkversion:O,sdkappid:e.getSDKAppID(),contenttype:"",reqtime:0,identifier:"",usersig:"",status_instid:e.getStatusInstanceID(),sdkability:75689843,sdkability_ext:Ps(""),cappid:e.getApplicationID(),cs:0}}},{key:"getProtocolData",value:function(e){return this._pHandler.getProtocolData(e)}},{key:"trans",value:function(e){var t=e.servcmd;return e=e.data,t={head:g(g({},this.genCommonHead()),{},{servcmd:t}),body:e},this.get(21).send(t)}},{key:"sendComboMessage",value:function(e){var t=e.servcmd;return e=e.data,t={head:g(g({},this.genCommonHead()),{},{servcmd:t}),body:e},this.get(21).send(t)}},{key:"onErrorCodeNotZero",value:function(e){var t,n=e.errorCode;n===qn.HELLO_ANSWER_KICKED_OUT&&(t=e.kickType,e=void 0===(e=e.newInstanceInfo)?{}:e,1===t?this.onMultipleAccountKickedOut(e):2===t?this.onMultipleDeviceKickedOut(e):3===t&&this.onRestApiKickedOut(e)),n!==qn.MSG_A2KEY_EXPIRED&&n!==qn.ACCOUNT_A2KEY_EXPIRED||(this._onUserSigExpired(),this.get(21).reConnect())}},{key:"onMessage",value:function(e){var t=(n=e.body).needAck,n=n.sessionData;1===(void 0===t?0:t)&&this._sendACK(n),this._msgDispatcher.onMessage(e)}},{key:"onReconnected",value:function(e){this._incrementalPullContactFlag=e<=300,this._reLoginOnReconnected()}},{key:"reLoginOnKickOther",value:function(){Oe.l("".concat(this._n,".reLoginOnKickOther")),this._reLogin()}},{key:"_reLoginOnReconnected",value:function(){Oe.l("".concat(this._n,"._reLoginOnReconnected")),this._reLogin()}},{key:"_reLogin",value:function(){var e,t,n,o=this,i="".concat(this._n,"._reLogin");this.isLoggedIn()&&(e=0,(t=this.get(1).getPushModule())&&(e=t.getUniAppPlatform()),n=new io("reLogin"),this.req({P:jn.LOGIN,data:{isWebUniapp:e,customInfo:this.get(12).getCustomLoginInfo()}}).then((function(e){var t=(e=e.data).instanceID,s=(e=e.customStatus,o.get(12)),r=qo(e),a=(s.setStatusInstanceID(t),o.get(21)),c=a.getSocketID();c="socketID:".concat(c," instanceID:").concat(t," customStatus:").concat(r),n.setMessage(c).end(!0),Oe.l("".concat(i," ok. ").concat(c)),s.getCustomStatus()!==r&&o.get(4).onUserStatusUpdated({dataList:[{to:o.getMyUserID(),statusType:S.USER_STATUS_ONLINE,customStatus:e}]}),a.diagnose(),o.get(11).syncConvList(o._incrementalPullContactFlag).then((function(){Oe.l("".concat(i,", sync conv list ok.")),o.get(25).start()})),((t=o.get(7))&&t.updateLocalMainSequenceOnReconnected(),c=o.get(10)).resetGetTopicTime(),c.getTopicListOnReconnected(),(s=o.get(35))&&s.clearCacheOnReconnected(),(r=o.get(8))&&r.updateCacheOnReconnected()})))}},{key:"onMultipleAccountKickedOut",value:function(e){this.get(1).onMultipleAccountKickedOut(e)}},{key:"onMultipleDeviceKickedOut",value:function(e){this.get(1).onMultipleDeviceKickedOut(e)}},{key:"_onUserSigExpired",value:function(){this.get(1).onUserSigExpired()}},{key:"onRestApiKickedOut",value:function(e){this.get(1).onRestApiKickedOut(e)}},{key:"_sendACK",value:function(e){this.req({P:jn.MSG_PUSH_ACK,data:{sessionData:e}})}},{key:"_isFreqOverLimit",value:function(e){var t,n,o,i;return e=e.split(".")[1],!!this._cmdFreqLimitMap.has(e)&&(!this._cmdReqInfoMap.has(e)||(t=(n=this._cmdFreqLimitMap.get(e)).count,n=n.interval,o=(i=this._cmdReqInfoMap.get(e)).startTime,i=i.requestCount,Date.now()-o>1e3*n)?(this._cmdReqInfoMap.set(e,{startTime:Date.now(),requestCount:1}),!1):(this._cmdReqInfoMap.set(e,{startTime:o,requestCount:i+=1}),t<i))}},{key:"_isServerOverload",value:function(e){var t,n;return!!this._serverOverloadInfoMap.has(e)&&(t=(n=this._serverOverloadInfoMap.get(e)).overloadTime,n=n.waitingTime,Date.now()-t<=1e3*n||(this._serverOverloadInfoMap.delete(e),!1))}},{key:"_getCmd",value:function(e){var t="";if(e.includes(".")){var n,o=e.split(".")[1];for(n in jn)if(jn[n]===o){t=n;break}}return t}},{key:"onPushedServerOverload",value:function(e){var t=e.overloadCommand;e=e.waitingTime,this._serverOverloadInfoMap.set(t,{overloadTime:Date.now(),waitingTime:e}),Oe.w("".concat(this._n,".onPushedServerOverload waitingTime:").concat(e,"s cmd:").concat(this._getCmd(t)))}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._updateCmdFreqLimitMap(Ds),this._cmdReqInfoMap.clear(),this._serverOverloadInfoMap.clear(),this._incrementalPullContactFlag=!0}}]),Us=(u(kr,Pn),s(kr,[{key:"getCloudConfig",value:function(e){return lt(e)?this._cloudConfig:this._cloudConfig.has(e)?this._cloudConfig.get(e):void 0}},{key:"getServerConfig",value:function(e){var t={code:0,data:""};return!lt(e)&&this._cloudConfig.has(e)&&(t.data=this._cloudConfig.get(e)),Promise.resolve(t)}},{key:"_canFetch",value:function(){return this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime}},{key:"fetchConfig",value:function(){var e,t=this,n="".concat(this._n,".fetchConfig"),o=this._canFetch();Oe.l("".concat(n," canFetch:").concat(o)),o&&(e=new io("fetchCloudCtrlConfig"),o=this.get(12).getSDKAppID(),this._isFetching=!0,this.req({P:jn.FETCH_CLOUD_CTRL_CONFIG,data:{SDKAppID:o,version:this._version}}).then((function(o){t._isFetching=!1;var i=(s=o.data).version,s=s.cloudControlConfig;e.setMessage("version:".concat(t._version," newVersion:").concat(i," config:").concat(s)).end(),Oe.l("".concat(n," ok")),t._parse(o.data)})).catch((function(o){t._isFetching=!1,e.setError(o).end(),Oe.l("".concat(n," failed. error:"),o),t._setExpiredTime(12e4)})))}},{key:"onPushedConfig",value:function(e){Oe.l("".concat(this._n,".onPushedConfig config:"),e),new io("pushedCloudCtrlConfig").setMessage("newVersion:".concat(e.version," config:").concat(e.cloudControlConfig)).end(),this._parse(e)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"_parse",value:function(e){var t=this,n="".concat(this._n,"._parse"),o=e.errorCode,i=e.errorMessage,s=e.cloudControlConfig,r=e.version,a=e.expiredTime;if(0===o){if(this._version!==r){var c=null;try{c=JSON.parse(s)}catch(u){this.isPrivateNetWork()||Oe.e("".concat(n," failed. config:"),s)}c&&(this._cloudConfig.clear(),Object.keys(c).forEach((function(e){t._cloudConfig.set(e,c[e])})),this._version=r,this.emitIEvt(xo.CLOUD_CONFIG),this.emitOEvt(T.SERVER_CONFIG_UPDATED,{config:c}))}this._setExpiredTime(1e3*a)}else lt(o)?(Oe.l("".concat(n," failed. Invalid message format:"),e),this._setExpiredTime(36e5)):(Oe.e("".concat(n," errorCode:").concat(o," errorMessage:").concat(i)),this._setExpiredTime(12e4))}},{key:"_setExpiredTime",value:function(e){this._expiredTime=Date.now()+e}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}])),Gs=(u(Er,Pn),s(Er,[{key:"start",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:"_recoverGroupChat",value:function(){var e,t,n,o,i=this,s=this._getLocalConvList().filter((function(e){return e.type===S.CONV_GROUP&&e.groupProfile.type!==S.GRP_AVCHATROOM})),r=this.get(11),a=[];s.forEach((function(s){var c=s.conversationID;s=s.lastMessage,e=c.replace(S.CONV_GROUP,""),t=r.getLocalLastMessage(c),s&&0!==s.lastSequence&&t&&(n=s.lastSequence,t=t.sequence,o=n-t,0<t)&&1<=o&&o<300?i._recoverGroupMsg({groupID:e,localLastMessageSequence:t,remoteLastMessageSequence:n}):a.push(e)})),this._getGroupNotice(a)}},{key:"_recoverC2CChat",value:function(){var e,t,n,o=this,i=this._getLocalConvList().filter((function(e){return e.type===S.CONV_C2C})),s=this.get(11),r=[Promise.resolve()],a=[];i.forEach((function(i){var c=i.conversationID;i=i.lastMessage,e=s.getLocalLastMessage(c),i&&0!==i.lastTime&&e&&(t=i.lastTime,e=e.time,n=t-e,0<e)&&1<=n&&n<=600&&(r.push(o._recoverC2CMsg({conversationID:c,localLastMessageTime:e,remoteLastMessageTime:t})),a.push(c))})),Promise.all(r).then((function(){Oe.l("".concat(o._n,"._recoverC2CChat all done, convIDList:"),a),o.get(19).syncOnReconnected()}))}},{key:"_getLocalConvList",value:function(){return this.get(11).getLocalConvList()}},{key:"_recoverGroupMsg",value:function(e){var t=this,n="".concat(this._n,".").concat("_recoverGroupMsg"),o=(Oe.l("".concat(n," options:"),e),e.groupID),i=e.localLastMessageSequence,s=e.remoteLastMessageSequence,r=JSON.stringify(e),a=new io("_recoverGroupMsg");a.setMessage(r),this._getGroupRoamingMsg({groupID:o,sequence:i}).then((function(e){var c=(e=e.data).complete,u=e.messageList;if(!lt(u)){e=u[0].sequence;var l=u.map((function(e){return e.sequence})),p=(l="".concat(r," complete:").concat(c," sequenceList:").concat(l),Oe.l("".concat(n," ").concat(l)),e!==i&&e<s&&2!==c&&t._recoverGroupMsg({groupID:o,localLastMessageSequence:e,remoteLastMessageSequence:s}),a.setMessage(l).end(),t.get(7));1<u.length&&u.sort((function(e,t){return e.sequence-t.sequence}));for(var d=!1,h=0,g=u.length;h<g;h++)if(u[h].from===S.CONV_SYSTEM){d=!0;break}if(d)for(var f=0,m=u.length;f<m;f++){var _=u[f];_.from!==S.CONV_SYSTEM?p.onNewMessage({dataList:[_],isInstantMessage:!1,updateUnreadCount:!1}):p.onNewGroupTips({event:_.event,dataList:[_]})}else p.onNewMessage({dataList:u,isInstantMessage:!1,updateUnreadCount:!1})}})).catch((function(e){a.setError(e).end(),Oe.w("".concat(n," failed. error:"),e)}))}},{key:"_getGroupNotice",value:function(e){var t=e.length;if(Oe.l("".concat(this._n,"._getGroupNotice length:").concat(t)),0!==t){var n=this.get(7);if(t<=10)n.getNotice(e);else{var o=Math.floor(t/10);5<=o&&(o=5);for(var i=0;i<=o;i++)n.getNotice(e.slice(10*i,10*(i+1)))}}}},{key:"_getGroupRoamingMsg",value:function(e){var t=e.groupID;return e=e.sequence,this.req({P:jn.GET_GRP_ROAMING_MSG,data:{groupID:t,count:this.PULL_LIMIT_COUNT,sequence:e+this.PULL_LIMIT_COUNT-1}})}},{key:"_recoverC2CMsg",value:function(e){var t=this,n="".concat(this._n,".").concat("_recoverC2CMsg"),o=(Oe.l("".concat(n," options:"),e),e.conversationID),i=e.localLastMessageTime,s=e.remoteLastMessageTime,r=JSON.stringify(e),a=new io("_recoverC2CMsg");return a.setMessage(r),this._getC2CRoamingMsg({conversationID:o,time:i}).then((function(e){var i=(e=e.data).complete;if(e=e.messageList,!lt(e)){var c=e.length;if(t.get(6).onNewMessage({dataList:e,isInstantMessage:!0}),c=e[c-1].time,e=e.map((function(e){return e.random})),e="".concat(r," complete:").concat(i," randomList:").concat(e),Oe.l("".concat(n," ").concat(e)),a.setMessage(e).end(),c<s&&1!==i)return t._recoverC2CMsg({conversationID:o,localLastMessageTime:c,remoteLastMessageTime:s})}})).catch((function(e){a.setError(e).end(),Oe.w("".concat(n," failed. error:"),e)}))}},{key:"_getC2CRoamingMsg",value:function(e){var t=e.conversationID;return e=e.time,this.req({P:jn.GET_C2C_ROAMING_MSG,data:{peerAccount:t.replace(S.CONV_C2C,""),count:this.PULL_LIMIT_COUNT+1,lastMessageTime:e,direction:1}})}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset"))}}])),Fs=s((function e(){o(this,e),this._n="AvgE2EDelay",this._e2eDelayArray=[]}),[{key:"addMessageDelay",value:function(e){0<=(e=Te()-e)&&this._e2eDelayArray.push(e)}},{key:"_calcAvg",value:function(e,t){var n;return 0===t?0:(n=0,e.forEach((function(e){n+=e})),xt(n/t,1))}},{key:"_calcCountWithLimit",value:function(e){var t=e.e2eDelayArray,n=e.min,o=e.max;return t.filter((function(e){return n<=e&&e<o})).length}},{key:"_calcPercent",value:function(e,t){return 100<(e=xt(e/t*100,2))?100:e}},{key:"_checkE2EDelayException",value:function(e,t){var n,o,i,s=e.filter((function(e){return t<e}));0<s.length&&(n=s.length,o=Math.min.apply(Math,v(s)),i=Math.max.apply(Math,v(s)),s=this._calcAvg(s,n),50<(e=xt(n/e.length*100,2)))&&new io("messageE2EDelayException").setMessage("count:".concat(n," min:").concat(o," max:").concat(i," avg:").concat(s," percent:").concat(e)).setLevel("warning").end()}},{key:"getStatResult",value:function(){var e,t,n,o,i,s,r=this._e2eDelayArray.length;return 0===r?null:(e=v(this._e2eDelayArray),t=this._calcCountWithLimit({e2eDelayArray:e,min:0,max:1}),n=this._calcCountWithLimit({e2eDelayArray:e,min:1,max:3}),o=this._calcPercent(t,r),i=this._calcPercent(n,r),s=this._calcAvg(e,r),this._checkE2EDelayException(e,3),e.length=0,this.reset(),{totalCount:r,countLessThan1Second:t,percentOfCountLessThan1Second:o,countLessThan3Second:n,percentOfCountLessThan3Second:i,avgDelay:s})}},{key:"reset",value:function(){this._e2eDelayArray.length=0}}]),Bs=s((function e(){o(this,e),this._n="AvgRTT",this._requestCount=0,this._rttArray=[]}),[{key:"addRequestCount",value:function(){this._requestCount+=1}},{key:"addRTT",value:function(e){this._rttArray.push(e)}},{key:"_calcTotalCount",value:function(){return this._requestCount}},{key:"_calcRTTCount",value:function(e){return e.length}},{key:"_calcSuccessRateOfRequest",value:function(e,t){return 0===t?0:100<(e=xt(e/t*100,2))?100:e}},{key:"_calcAvg",value:function(e,t){var n;return 0===t?0:(n=0,e.forEach((function(e){n+=e})),parseInt(n/t))}},{key:"_calcMax",value:function(){return Math.max.apply(Math,v(this._rttArray))}},{key:"_calcMin",value:function(){return Math.min.apply(Math,v(this._rttArray))}},{key:"getStatResult",value:function(){var e,t,n=this._calcTotalCount(),o=v(this._rttArray);return 0===n?null:(e=this._calcRTTCount(o),t=this._calcSuccessRateOfRequest(e,n),o=this._calcAvg(o,e),Oe.l("".concat(this._n,".getStatResult max:").concat(this._calcMax()," min:").concat(this._calcMin()," avg:").concat(o)),this.reset(),{totalCount:n,rttCount:e,successRateOfRequest:t,avgRTT:o})}},{key:"reset",value:function(){this._requestCount=0,this._rttArray.length=0}}]),qs=s((function e(){o(this,e),this._map=new Map}),[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}))}},{key:"addTotalCount",value:function(e){return!(lt(e)||!this._map.has(e)||(this._map.get(e).totalCount+=1,0))}},{key:"addSuccessCount",value:function(e){return!(lt(e)||!this._map.has(e)||(this._map.get(e).successCount+=1,0))}},{key:"addFailedCountOfUserSide",value:function(e){return!(lt(e)||!this._map.has(e)||(this._map.get(e).failedCountOfUserSide+=1,0))}},{key:"addCost",value:function(e,t){return!(lt(e)||!this._map.has(e)||(this._map.get(e).costArray.push(t),0))}},{key:"addFileSize",value:function(e,t){return!(lt(e)||!this._map.has(e)||(this._map.get(e).fileSizeArray.push(t),0))}},{key:"_calcSuccessRateOfBusiness",value:function(e){return lt(e)||!this._map.has(e)?-1:100<(e=xt((e=this._map.get(e)).successCount/e.totalCount*100,2))?100:e}},{key:"_calcSuccessRateOfPlatform",value:function(e){var t;return lt(e)||!this._map.has(e)?-1:(t=this._map.get(e),100<(e=xt(e=this._calcSuccessCountOfPlatform(e)/t.totalCount*100,2))?100:e)}},{key:"_calcTotalCount",value:function(e){return lt(e)||!this._map.has(e)?-1:this._map.get(e).totalCount}},{key:"_calcSuccessCountOfBusiness",value:function(e){return lt(e)||!this._map.has(e)?-1:this._map.get(e).successCount}},{key:"_calcSuccessCountOfPlatform",value:function(e){return lt(e)||!this._map.has(e)?-1:(e=this._map.get(e)).successCount+e.failedCountOfUserSide}},{key:"_calcAvg",value:function(e){return lt(e)||!this._map.has(e)?-1:e===Jn?this._calcAvgSpeed(e):this._calcAvgCost(e)}},{key:"_calcAvgCost",value:function(e){var t,n=this._map.get(e).costArray.length;return 0===n?0:(t=0,this._map.get(e).costArray.forEach((function(e){t+=e})),parseInt(t/n))}},{key:"_calcAvgSpeed",value:function(e){var t=0,n=0;return this._map.get(e).costArray.forEach((function(e){t+=e})),this._map.get(e).fileSizeArray.forEach((function(e){n+=e})),parseInt(1e3*n/t)}},{key:"getStatResult",value:function(e){var t,n,o,i,s,r=this._calcTotalCount(e);return 0===r?null:(t=this._calcSuccessCountOfBusiness(e),n=this._calcSuccessRateOfBusiness(e),o=this._calcSuccessCountOfPlatform(e),i=this._calcSuccessRateOfPlatform(e),s=this._calcAvg(e),this.reset(e),{totalCount:r,successCountOfBusiness:t,successRateOfBusiness:n,successCountOfPlatform:o,successRateOfPlatform:i,avgValue:s})}},{key:"reset",value:function(e){lt(e)?this._map.clear():this._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),Vs=s((function e(){o(this,e),this._lastMap=new Map,this._currentMap=new Map}),[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._lastMap.set(e,new Map),t._currentMap.set(e,new Map)}))}},{key:"addMessageSequence",value:function(e){var t,n,o,i=e.key,s=e.message;return!(lt(i)||!this._lastMap.has(i)||!this._currentMap.has(i)||(t=s.conversationID,s=s.sequence,t=t.replace(S.CONV_GROUP,""),0!==this._lastMap.get(i).size&&this._lastMap.get(i).has(t)&&(o=(n=this._lastMap.get(i).get(t)).length-1,s>n[0])&&s<n[o]?(n.push(s),n.sort(),this._lastMap.get(i).set(t,n)):this._addCurrentMap(e),0))}},{key:"_addCurrentMap",value:function(e){var t=e.key,n=(e=e.message).conversationID;e=e.sequence,n=n.replace(S.CONV_GROUP,""),this._currentMap.get(t).has(n)||this._currentMap.get(t).set(n,[]),this._currentMap.get(t).get(n).push(e)}},{key:"_copyData",value:function(e){if(!lt(e)){this._lastMap.set(e,new Map);var t,n=this._lastMap.get(e),o=r(this._currentMap.get(e));try{for(o.s();!(t=o.n()).done;){var i=_(t.value,2),s=i[0],a=i[1];n.set(s,a)}}catch(c){o.e(c)}finally{o.f()}n=null,this._currentMap.set(e,new Map)}}},{key:"getStatResult",value:function(e){var t,n,o;return lt(this._currentMap.get(e))||lt(this._lastMap.get(e))?null:0===this._lastMap.get(e).size?(this._copyData(e),null):(n=t=0,this._lastMap.get(e).forEach((function(e,o){var i=(e=v(e.values())).length;e=e[i-1]-e[0]+1,t+=e,n+=i})),0===t?null:(100<(o=xt(n/t*100,2))&&(o=100),this._copyData(e),{totalCount:t,successCountOfMessageReceived:n,successRateOfMessageReceived:o}))}},{key:"reset",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),js=(u(Sr,Pn),s(Sr,[{key:"_onLoginSuccess",value:function(){var e=this,t=(this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems),this.get(13)),n=t.getItem(this.TAG,!1);!qe(n)&&Je(n.forEach)&&(Oe.l("".concat(this._n,"._onLoginSuccess. logs count:").concat(n.length)),n.forEach((function(t){e._statInfoArr.push(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("q_rpt_interval"),t=this.getCloudConfig("q_rpt_sdkappid_bl"),n=this.getCloudConfig("q_rpt_tinyid_wl");lt(e)||(this.REPORT_INTERVAL=Number(e)),lt(t)||(this.REPORT_SDKAPPID_BLACKLIST=t.split(",").map((function(e){return Number(e)}))),lt(n)||(this.REPORT_TINYID_WHITELIST=n.split(","))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:"addRequestCount",value:function(){this._avgRTT.addRequestCount()}},{key:"addRTT",value:function(e){this._avgRTT.addRTT(e)}},{key:"addMessageDelay",value:function(e){this._avgE2EDelay.addMessageDelay(e)}},{key:"addTotalCount",value:function(e){this._rateMessageSent.addTotalCount(e)||Oe.w("".concat(this._n,".addTotalCount invalid key:"),e)}},{key:"addSuccessCount",value:function(e){this._rateMessageSent.addSuccessCount(e)||Oe.w("".concat(this._n,".addSuccessCount invalid key:"),e)}},{key:"addFailedCountOfUserSide",value:function(e){this._rateMessageSent.addFailedCountOfUserSide(e)||Oe.w("".concat(this._n,".addFailedCountOfUserSide invalid key:"),e)}},{key:"addCost",value:function(e,t){this._rateMessageSent.addCost(e,t)||Oe.w("".concat(this._n,".addCost invalid key or cost:"),e,t)}},{key:"addFileSize",value:function(e,t){this._rateMessageSent.addFileSize(e,t)||Oe.w("".concat(this._n,".addFileSize invalid key or size:"),e,t)}},{key:"addMessageSequence",value:function(e){this._rateMessageReceived.addMessageSequence(e)||Oe.w("".concat(this._n,".addMessageSequence invalid key:"),e.key)}},{key:"_getQualityItem",value:function(e){var t={},n=no[this.get(15).getNetworkType()];switch(lt(n)&&(n=8),n={qualityType:eo[e],timestamp:ke(),networkType:n,extension:""},e){case Hn:t=this._avgRTT.getStatResult();break;case Kn:t=this._avgE2EDelay.getStatResult();break;case $n:case zn:case Yn:case Wn:case Jn:t=this._rateMessageSent.getStatResult(e);break;case Xn:case Zn:case Qn:t=this._rateMessageReceived.getStatResult(e)}return null===t?null:g(g({},n),t)}},{key:"_report",value:function(e){var t=this,n=[],o=null,i=(lt(e)?this._qualityItems.forEach((function(e){null!==(o=t._getQualityItem(e))&&(o.reportIndex=t.reportIndex,o.wholePeriod=t.wholePeriod,n.push(o))})):null!==(o=this._getQualityItem(e))&&(o.reportIndex=this.reportIndex,o.wholePeriod=this.wholePeriod,n.push(o)),Oe.d("".concat(this._n,"._report"),n),0<this._statInfoArr.length&&(n=n.concat(this._statInfoArr),this._statInfoArr=[]),e=this.get(12)).getSDKAppID();e=e.getTinyID(),0<(n=wt(this.REPORT_SDKAPPID_BLACKLIST,i)&&!Ut(this.REPORT_TINYID_WHITELIST,e)?[]:n).length&&this._doReport(n)}},{key:"_doReport",value:function(e){var t=this,n={header:Ri(this),quality:e};this.req({P:jn.SSO_STAT,data:g({},n)}).then((function(){t.reportIndex++,t.wholePeriod=!1})).catch((function(n){Oe.w("".concat(t._n,"._doReport failed. error:"),n),t._statInfoArr=t._statInfoArr.concat(e),t._flushAtOnce()}))}},{key:"_flushAtOnce",value:function(){var e=this.get(13),t=e.getItem(this.TAG,!1),n=this._statInfoArr,o="".concat(this._n,"._flushAtOnce");qe(t)?(Oe.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1)):(10<(n=n.concat(t)).length&&(n=n.slice(0,10)),Oe.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1)),this._statInfoArr=[]}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}])),Hs=s((function e(t){o(this,e),qe(t)||(this.userID=t.userID||"",this.nick=t.nick||"",this.avatar=t.avatar||"",this.time=t.time||0,this.source=t.source||"",this.wording=t.wording||"",this.type=t.type||"")})),Ks=s((function e(t){o(this,e),this._snsM=t,this._n="FriendApplicationHandler",this._startTime=0,this._maxLimited=100,this._currentSeq=0,this._map=new Map,this._unreadCount=0}),[{key:"updateCacheOnReconnected",value:function(){this._startTime=0,this._currentSeq=0,this.getApplicationList()}},{key:"getLocalApplicationList",value:function(){return{friendApplicationList:v(this._map.values()),unreadCount:this._unreadCount}}},{key:"_onApplicationListUpdated",value:function(){this._snsM.emitOEvt(T.FRIEND_APPLICATION_LIST_UPDATED,{friendApplicationList:v(this._map.values()),unreadCount:this._unreadCount})}},{key:"onApplicationRead",value:function(){this._unreadCount=0,this._onApplicationListUpdated()}},{key:"onApplicationAdded",value:function(e,t){var n,o,i=this;qe(e)||(n="",n=t===this._snsM.getMyUserID()?S.SNS_APPLICATION_SENT_BY_ME:S.SNS_APPLICATION_SENT_TO_ME,o=!1,e.forEach((function(e){var t="".concat(e.userID,"_").concat(n);n!==S.SNS_APPLICATION_SENT_TO_ME||i._map.has(t)||(i._unreadCount+=1),i._map.set(t,new Hs(g(g({},e),{},{type:n}))),o=!0})),o&&this._onApplicationListUpdated())}},{key:"onApplicationDeleted",value:function(e){qe(e)||(this._startTime=0,this._currentSeq=0,this.getApplicationList())}},{key:"getApplicationList",value:function(){var e=this,t="".concat(this._n,".").concat("getApplicationList"),n=new io("getApplicationList");return this._snsM.req({P:jn.GET_FD_APPLICATION_LIST,data:{applicationType:S.SNS_APPLICATION_TYPE_BOTH,fromAccount:this._snsM.getMyUserID(),maxLimited:this._maxLimited,startTime:this._startTime,lastSequence:this._currentSeq}}).then((function(o){var i=(o=o.data).resultList,s=o.unreadCount,r=o.startTime,a=(o=o.currentSequence,e._startTime=r,e._currentSeq=o,e._unreadCount=s,Ye(i)?i.length:0);a="applicationCount:".concat(a," unreadCount:").concat(s," startTime:").concat(r," currentSequence:").concat(o),n.setMessage(a).end(),Oe.i("".concat(t," ok. ").concat(a)),e._map.clear(),Ye(i)&&i.forEach((function(t){var n=t.userID,o=t.type;t=new Hs(t),e._map.set("".concat(n,"_").concat(o),t)})),e._onApplicationListUpdated()})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"deleteApplication",value:function(e){var t,n="".concat(this._n,".").concat("deleteApplication"),o=e.userID,i=e.type;return i&&(i===S.SNS_APPLICATION_SENT_BY_ME||i===S.SNS_APPLICATION_SENT_TO_ME)||(i=S.SNS_APPLICATION_SENT_TO_ME),this._map.has("".concat(o,"_").concat(i))?((t=new io("deleteApplication")).setMessage("userID:".concat(o," type:").concat(i)),this._snsM.req({P:jn.DEL_FD_APPLICATION,data:{fromAccount:this._snsM.getMyUserID(),userIDList:[o],type:i}}).then((function(e){var s=(a=(e=e.data.resultList)[0]).to,r=a.resultCode,a=a.resultInfo;return t.setMoreMessage("resultList:".concat(JSON.stringify(e))).end(),Oe.i("".concat(n," ok. userID:").concat(o," type:").concat(i)),0===r?Cn():Sn({userID:s,code:r,message:a})})).catch((function(e){return t.setError(e).end(),Oe.w("".concat(n," failed. error:"),e),Sn(e)}))):Sn({code:qn.FRIEND_APPLICATION_NOT_EXIST})}},{key:"acceptApplication",value:function(e){var t="".concat(this._n,".").concat("acceptApplication"),n=e.userID,o=e.remark,i=e.tag,s=e.type,r=(s&&(s===S.SNS_APPLICATION_AGREE||s===S.SNS_APPLICATION_AGREE_AND_ADD)||(s=S.SNS_APPLICATION_AGREE_AND_ADD),new io("acceptApplication"));return r.setMessage("userID:".concat(n," type:").concat(s)),this._snsM.req({P:jn.RESPOND_FD_APPLICATION,data:{fromAccount:this._snsM.getMyUserID(),responseFriendItem:[{userID:n,remark:o,tag:i,action:s}]}}).then((function(e){r.end();var o=(e=e.data.resultList[0]).resultCode;if(e=e.resultInfo,0!==o)return Sn({code:o,message:e});Oe.i("".concat(t," ok. userID:").concat(n," type:").concat(s))})).catch((function(e){return r.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"refuseApplication",value:function(e){var t="".concat(this._n,".").concat("refuseApplication"),n=e.userID,o=new io("refuseApplication");return o.setMessage("userID:".concat(n)),this._snsM.req({P:jn.RESPOND_FD_APPLICATION,data:{fromAccount:this._snsM.getMyUserID(),responseFriendItem:[{userID:n,action:"Response_Action_Reject"}]}}).then((function(e){o.end();var i=(e=e.data.resultList[0]).resultCode;if(e=e.resultInfo,0!==i)return Sn({code:i,message:e});Oe.i("".concat(t," ok. userID:").concat(n))})).catch((function(e){return o.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"setApplicationRead",value:function(){var e=this,t="".concat(this._n,".").concat("setApplicationRead"),n=new io("setApplicationRead");return this._snsM.req({P:jn.REPORT_FD_APPLICATION,data:{fromAccount:this._snsM.getMyUserID(),latestTimeStamp:xt(ke()/1e3,0)}}).then((function(o){n.end(),Oe.i("".concat(t," ok")),e._unreadCount=0})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"reset",value:function(){this._maxLimited=100,this._startTime=0,this._currentSeq=0,this._unreadCount=0,this._map.clear()}}]),$s=s((function e(t,n){o(this,e),this.userID=t,this.remark="",this.groupList=[],this.source="",this.addTime=0,this.friendCustomField=[],this.timestamp=0;var i={},s=[];if(i.userID=t,!qe(n))for(var r,a="",c=0,u=n.length;c<u;c++)if(a=n[c].tag,r=n[c].value,-1<a.indexOf("Tag_SNS_Custom"))this.friendCustomField.push({key:a,value:r});else if(-1<a.indexOf("Tag_Profile_Custom"))s.push({key:a,value:r});else switch(a){case be.NICK:i.nick=r;break;case be.GENDER:i.gender=r;break;case be.BIRTHDAY:i.birthday=r;break;case be.LOCATION:i.location=r;break;case be.SELFSIGNATURE:i.selfSignature=r;break;case be.ALLOWTYPE:i.allowType=r;break;case be.LANGUAGE:i.language=r;break;case be.AVATAR:i.avatar=r;break;case be.MESSAGESETTINGS:i.messageSettings=r;break;case be.ADMINFORBIDTYPE:i.adminForbidType=r;break;case be.LEVEL:i.level=r;break;case be.ROLE:i.role=r;break;case Pe.REMARK:this.remark=r;break;case Pe.ADDTIME:this.addTime=r;break;case Pe.GROUP:this.groupList=JSON.parse(JSON.stringify(r));break;case Pe.ADDSOURCE:this.source=r;break;case Pe.ADDWORDING:break;default:Oe.l("snsProfileItem unknown tag->",n[c].tag)}this.profile=new Ho(g(g({},i),{},{profileCustomField:s}))}),[{key:"validate",value:function(e){var t,n=!0,o="";if(qe(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var i=e.profileCustomField.length,s=null,r=0;r<i;r++){if(s=e.profileCustomField[r],!ut(s.key)||-1===s.key.indexOf("Tag_Profile_Custom"))return{valid:!1,tips:"The prefix of keys of the custom profile key-value pairs (which is profileCustomField) must be Tag_Profile_Custom"};if(!ut(s.value))return{valid:!1,tips:"The type of values of the custom profile key-value pairs (which is profileCustomField) must be String"}}for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if("profileCustomField"===t)continue;if(qe(e[t])&&!ut(e[t])&&!Ke(e[t])){o="key:"+t+", invalid value:"+e[t],n=!1;continue}switch(t){case"nick":ut(e[t])||(n=!(o="nick must be a string")),500<nt(e[t])&&(o="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(nt(e[t])," bytes"),n=!1);break;case"gender":st(Ne,e.gender)||(o="key:gender, invalid value:"+e.gender,n=!1);break;case"birthday":Ke(e.birthday)||(n=!(o="birthday must be a number"));break;case"location":ut(e.location)||(n=!(o="location must be a string"));break;case"selfSignature":ut(e.selfSignature)||(n=!(o="selfSignature must be a string"));break;case"allowType":st(we,e.allowType)||(o="key:allowType, invalid value:"+e.allowType,n=!1);break;case"language":Ke(e.language)||(n=!(o="language must be a number"));break;case"avatar":ut(e.avatar)||(n=!(o="avatar must be a string"));break;case"messageSettings":0!==e.messageSettings&&1!==e.messageSettings&&(n=!(o="messageSettings must be 0 or 1"));break;case"adminForbidType":st(xe,e.adminForbidType)||(o="key:adminForbidType, invalid value:"+e.adminForbidType,n=!1);break;case"level":Ke(e.level)||(n=!(o="level must be a number"));break;case"role":Ke(e.role)||(n=!(o="role must be a number"));break;default:o="unknown key:"+t+" "+e[t],n=!1}}return{valid:n,tips:o}}},{key:"update",value:function(e){var t=this,n="",o="",i=[];this.friendCustomField.forEach((function(e){i.push(e.key)}));for(var s=0,r=e.length;s<r;s++)!function(){if(n=e[s].tag,o=e[s].value,-1<n.indexOf("Tag_SNS_Custom"))-1<i.indexOf(n)?t.friendCustomField.forEach((function(e){e.key===n&&(e.value=o)})):t.friendCustomField.push({key:n,value:o});else if(-1<n.indexOf("Tag_Profile_Custom")){var r=!1;t.profile.profileCustomField.forEach((function(e){e.key===n&&(e.value=o,r=!0)})),r||t.profile.profileCustomField.push({key:n,value:o})}else switch(n){case be.NICK:t.profile.nick=o;break;case be.GENDER:t.profile.gender=o;break;case be.BIRTHDAY:t.profile.birthday=o;break;case be.LOCATION:t.profile.location=o;break;case be.SELFSIGNATURE:t.profile.selfSignature=o;break;case be.ALLOWTYPE:t.profile.allowType=o;break;case be.LANGUAGE:t.profile.language=o;break;case be.AVATAR:t.profile.avatar=o;break;case be.MESSAGESETTINGS:t.profile.messageSettings=o;break;case be.ADMINFORBIDTYPE:t.profile.adminForbidType=o;break;case be.LEVEL:t.profile.level=o;break;case be.ROLE:t.profile.role=o;break;case Pe.REMARK:t.remark=o;break;case Pe.ADDTIME:t.addTime=o;break;case Pe.GROUP:t.groupList=JSON.parse(JSON.stringify(o));break;case Pe.ADDSOURCE:t.source=o;break;case Pe.ADDWORDING:break;default:Oe.d("snsProfileItem unkown tag->",e[s].tag)}}();this.timestamp=Date.now(),i.length=0}},{key:"updateProfile",value:function(e){this.profile=JSON.parse(JSON.stringify(e)),this.timestamp=Date.now()}},{key:"addToGroupList",value:function(e){-1===this.groupList.indexOf(e)&&(this.groupList.push(e),this.count=this.groupList.length)}},{key:"removeFromGroupList",value:function(e){-1<(e=this.groupList.indexOf(e))&&(this.groupList.splice(e,1),this.count=this.groupList.length)}}]),zs=s((function e(t){o(this,e),this._snsM=t,this._n="FriendHandler",this._map=new Map,this._startIdx=0,this._standardSeq=0,this._customSeq=0,this._expirationTime=18e4}),[{key:"updateCacheOnReconnected",value:function(){this._startIdx=0,this._standardSeq=0,this._customSeq=0,this.pagingGetFriendList()}},{key:"getLocalFriendList",value:function(){return v(this._map.values())}},{key:"getFriendRemark",value:function(e){return this._map.has(e)?this._map.get(e).remark:""}},{key:"onFriendProfileModified",value:function(e){var t,n=this;qe(e=e.dataList)||(t=this._snsM.get(11),e.forEach((function(e){var o,i=e.userID;e=e.profileList,n.isMyFriend(i)&&(Oe.l("".concat(n._n,".onFriendProfileModified. friend account:").concat(i,", profileList:").concat(JSON.stringify(e))),(o=n._map.get(i)).update(e),t.modifyMessageSentByPeer({conversationID:"".concat(S.CONV_C2C).concat(i),latestNick:o.profile.nick,latestAvatar:o.profile.avatar}))})),this._onFriendListUpdated())}},{key:"onFriendAdded",value:function(e){var t=this;0!==e.length&&(Oe.l("".concat(this._n,".onFriendAdded userIDList:").concat(e)),e.forEach((function(e){t._map.set(e,new $s(e))})),this.getFriendProfile({userIDList:e}).then((function(n){e.forEach((function(e){var n=t._map.get(e);0<n.groupList.length&&t._snsM.updateWhenFriendAdded({nameList:n.groupList,userID:e})})),t._onFriendListUpdated()})))}},{key:"onFriendDeleted",value:function(e){var t=this;0!==e.length&&(Oe.l("".concat(this._n,".onFriendDeleted userIDList:").concat(e)),e.forEach((function(e){var n=t._map.get(e);0<n.groupList.length&&t._snsM.updateWhenFriendDeleted({nameList:n.groupList,userID:e}),t._map.delete(e)})),this._onFriendListUpdated())}},{key:"_onFriendListUpdated",value:function(){this._snsM.emitOEvt(T.FRIEND_LIST_UPDATED),this._snsM.get(11).checkAndPatchRemark()}},{key:"getFriendProfile",value:function(e){var t,n=this,o="".concat(this._n,".").concat("getFriendProfile"),i=(e=e.userIDList,[]),s=[],r=[];return e.forEach((function(e){var t;n._map.has(e)?(t=n._map.get(e),Date.now()-t.timestamp<n._expirationTime?s.push(t):r.push(e)):i.push({userID:e,code:qn.NOT_MY_FRIEND,message:n._snsM.getErrMsg(qn.NOT_MY_FRIEND)})})),0===r.length?(Oe.i("".concat(o," newUserIDList is empty")),Tn({friendList:s,failureUserIDList:i})):((t=new io("getFriendProfile")).setMessage("userIDList:".concat(r)),Oe.i("".concat(o," userIDList:").concat(r)),this._snsM.req({P:jn.GET_FD_PROFILE,data:{fromAccount:this._snsM.getMyUserID(),userIDList:r}}).then((function(e){return t.end(),Oe.i("".concat(o," ok")),e.data.resultList.forEach((function(e){var t,o=e.to,r=e.resultCode,a=e.resultInfo;e=e.tagValueList,lt(r)||0===r?(n._map.has(o)?(t=n._map.get(o)).update(e):(t=new $s(o,e),n._map.set(o,t)),s.push(t)):i.push({userID:o,code:r,message:a})})),Cn({friendList:s,failureUserIDList:i})})).catch((function(e){return t.setError(e).end(),Oe.w("".concat(o," failed. error:"),e),Sn(e)})))}},{key:"isMyFriend",value:function(e){return this._map.has(e)}},{key:"pagingGetFriendList",value:function(){var e=this,t="".concat(this._n,".").concat("getFriendList"),n=new io("getFriendList"),o=Date.now();this._snsM.req({P:jn.GET_FD_LIST,data:{fromAccount:this._snsM.getMyUserID(),startIndex:this._startIdx,standardSequence:this._standardSeq,customSequence:this._customSeq}}).then((function(i){var s=(i=i.data).friendCount,r=i.resultList,a=i.nextStartIndex,c=i.standardSequence,u=i.customSequence;i=i.completeFlag,e._startIdx=a,e._standardSeq=c,e._customSeq=u,s="friendCount:".concat(s," nextStartIndex:").concat(a," standardSequence:").concat(c," ")+"customSequence:".concat(u," completeFlag:").concat(i," cost:").concat($t(o)),n.setMessage(s).end(),Oe.i("".concat(t," ok."),s),qe(r)||r.forEach((function(t){var n=t.to;t=t.tagValueList,e._map.set(n,new $s(n,t))})),0===i?e.pagingGetFriendList():(e._snsM.emitOEvt(T.FRIEND_LIST_UPDATED),e._pagingGetFriendProfile())})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"_pagingGetFriendProfile",value:function(){var e=this,t=v(this._map.keys()),n=this._snsM.get(4),o=t.length,i=o<=100?1:Math.ceil(o/100);Oe.l("".concat(this._n,"._pagingGetFriendProfile friendCount:").concat(o," pageCount:").concat(i));for(var s=0;s<i;s++)n.getUserProfile({userIDList:t.slice(100*s,100*(s+1))}).then((function(t){t.data.forEach((function(t){var n=e._map.get(t.userID);n&&n.updateProfile(t)})),e._onFriendListUpdated()}))}},{key:"addFriend",value:function(e){var t,n,o,i,s,r,a,c=this,u="".concat(this._n,".").concat("addFriend");return e.wording&&!1===this._snsM.filterProfanity("wording",e)?Sn({code:qn.PROFANITY_FOUND}):(t=e.to,n=e.source,o=e.type,i=e.wording,s=e.remark,e=e.groupName,(r=o)&&(r===S.SNS_ADD_TYPE_SINGLE||r===S.SNS_ADD_TYPE_BOTH)||(r=S.SNS_ADD_TYPE_BOTH),(a=new io("addFriend")).setMessage("to:".concat(t," source:").concat(n," type:").concat(r)),this._snsM.req({P:jn.ADD_FD,data:{fromAccount:this._snsM.getMyUserID(),addFriendItem:[{to:t,source:n,wording:i,remark:s,groupName:e}],type:r}}).then((function(e){e=e.data.resultList;var t=(a.setMoreMessage("resultList:".concat(JSON.stringify(e))).end(),e=e[0]).to,n=e.resultCode;return e=e.resultInfo,Oe.i("".concat(u," ok. to:").concat(t," type:").concat(r," code:").concat(n)),lt(n)||0===n?Cn({userID:t,code:0}):30539===n?Cn({userID:t,code:n,message:c._snsM.getErrMsg(n)}):Sn({userID:t,code:n,message:c._snsM.getErrMsg(n)||e})})).catch((function(e){return a.setError(e).end(),Oe.w("".concat(u," failed. error:"),e),Sn(e)})))}},{key:"deleteFriend",value:function(e){var t,n=this,o="".concat(this._n,".").concat("deleteFriend"),i=e.userIDList,s=(e=e.type,1e3<i.length&&(Oe.w("".concat(o," ").concat(jt(1e3))),i.length=1e3),[]),r=[],a=[];return i.forEach((function(e){n._map.has(e)?a.push(e):s.push({userID:e,code:qn.NOT_MY_FRIEND,message:n._snsM.getErrMsg(qn.NOT_MY_FRIEND)})})),0===a.length?Tn({successUserIDList:r,failureUserIDList:s}):((i=e)&&(i===S.SNS_DELETE_TYPE_SINGLE||i===S.SNS_DELETE_TYPE_BOTH)||(i=S.SNS_DELETE_TYPE_BOTH),(t=new io("deleteFriend")).setMessage("userIDList:".concat(a," type:").concat(i)),this._snsM.req({P:jn.DEL_FD,data:{fromAccount:this._snsM.getMyUserID(),userIDList:a,type:i}}).then((function(e){return t.end(),Oe.i("".concat(o," ok")),qe(e=e.data.resultList)||e.forEach((function(e){var t=e.to,n=e.resultCode;e=e.resultInfo,lt(n)||0===n?r.push({userID:t}):s.push({userID:t,code:n,message:e})})),Cn({successUserIDList:r,failureUserIDList:s})})).catch((function(e){return t.setError(e).end(),Oe.w("".concat(o," error:"),e),Sn(e)})))}},{key:"updateFriend",value:function(e){var t,n,o,i=this,s=e.userID,r=e.remark,a=e.friendCustomField;return this._map.has(s)?(t="".concat(this._n,".").concat("updateFriend"),(n=new io("updateFriend")).setMessage("userID:".concat(s," remark:").concat(r," friendCustomField:").concat(a)),o=[],lt(r)||o.push({tag:Pe.REMARK,value:r}),Ye(a)&&0<a.length&&a.forEach((function(e){o.push({tag:e.key,value:e.value})})),this._snsM.req({P:jn.UPDATE_FD,data:{fromAccount:this._snsM.getMyUserID(),updateItem:[{to:s,snsItem:o}]}}).then((function(e){n.end(),Oe.i("".concat(t," ok"));var o=(e=e.data.resultList[0]).to,s=e.resultCode;return e=e.resultInfo,lt(s)||0===s?((o=i._map.get(o))&&(lt(r)||(o.remark=r),Ye(a)&&0<a.length&&_t(o.friendCustomField,a),i._onFriendListUpdated()),Cn(o)):Sn({code:s,message:e})})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))):Sn({code:qn.NOT_MY_FRIEND})}},{key:"checkFriend",value:function(e){var t="".concat(this._n,".").concat("checkFriend"),n=e.userIDList,o=e.type,i=(o&&(o===S.SNS_CHECK_TYPE_SINGLE||o===S.SNS_CHECK_TYPE_BOTH)||(o=S.SNS_CHECK_TYPE_BOTH),new io("checkFriend"));return i.setMessage("userIDList:".concat(n," type:").concat(o)),this._snsM.req({P:jn.CHECK_FD,data:{fromAccount:this._snsM.getMyUserID(),userIDList:n,type:o}}).then((function(e){i.end(),Oe.i("".concat(t," ok. userIDList:").concat(n," type:").concat(o));var s=[],r=[];return Ye(e=e.data.resultList)&&e.forEach((function(e){var t=e.to,n=e.relation,o=e.resultCode;e=e.resultInfo,lt(o)||0===o?s.push({userID:t,code:0,relation:n}):r.push({userID:t,code:o,message:e})})),Cn({successUserIDList:s,failureUserIDList:r})})).catch((function(e){return i.setError(e).end(),Oe.w("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"onAddedToFriendGroup",value:function(e){var t=this,n=e.name;e=e.userIDList,Oe.l("".concat(this._n,".onAddedToFriendGroup groupName:").concat(n," userIDList:").concat(e)),n&&!qe(e)&&e.forEach((function(e){t._map.has(e)&&t._map.get(e).addToGroupList(n)}))}},{key:"onRemovedFromFriendGroup",value:function(e){var t=this,n=e.name;e=e.userIDList,Oe.l("".concat(this._n,".onRemovedFromFriendGroup groupName:").concat(n," userIDList:").concat(e)),n&&!qe(e)&&e.forEach((function(e){t._map.has(e)&&t._map.get(e).removeFromGroupList(n)}))}},{key:"reset",value:function(){this._map.clear(),this._startIdx=0,this._standardSeq=0,this._customSeq=0}}]),Ys=s((function e(t){o(this,e),qe(t)||(this.name=t.name||"",this.userIDList=t.userIDList||[],this.count=this.userIDList.length||0)}),[{key:"addToUserIDList",value:function(e){-1===this.userIDList.indexOf(e)&&(this.userIDList.push(e),this.count=this.userIDList.length)}},{key:"removeFromUserIDList",value:function(e){-1<(e=this.userIDList.indexOf(e))&&(this.userIDList.splice(e,1),this.count=this.userIDList.length)}}]),Ws=s((function e(t){o(this,e),this._snsM=t,this._n="FriendGroupHandler",this._map=new Map}),[{key:"updateCacheOnReconnected",value:function(){this.getGroupList()}},{key:"getLocalGroupList",value:function(){return v(this._map.values())}},{key:"_onGroupListUpdated",value:function(){var e=v(this._map.values());this._snsM.emitOEvt(T.FRIEND_GROUP_LIST_UPDATED,e)}},{key:"getGroupList",value:function(){var e=this,t="".concat(this._n,".").concat("getGroupList"),n=new io("getGroupList");return this._snsM.req({P:jn.GET_FD_GRP_LIST,data:{fromAccount:this._snsM.getMyUserID()}}).then((function(o){n.end(),qe(o=o.data.resultList)?Oe.i("".concat(t," ok. count:0")):(Oe.i("".concat(t," ok. count:").concat(o.length)),e._map.clear(),o.forEach((function(t){var n=new Ys(t);e._map.set(t.name,n)})),e._onGroupListUpdated())})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(t," error:"),e),Sn(e)}))}},{key:"createGroup",value:function(e){var t,n,o=this,i="".concat(this._n,".").concat("createGroup"),s=e.name;return e=e.userIDList,this._map.has(s)?Sn({code:qn.FRIEND_GRP_EXISTED}):(t="name:".concat(s," userIDList:").concat(e),(n=new io("createGroup")).setMessage(t),this._snsM.req({P:jn.CREATE_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),groupName:[s],userIDList:Ye(e)?e:void 0}}).then((function(e){n.end(),Oe.l("".concat(i," ok. ").concat(t)),e=e.data.resultList;var r=[],a=[];return e&&e.forEach((function(e){var t=e.to,n=e.resultCode,o=e.resultInfo;lt(n)||0===n?r.push(t):(t={userID:e.to,code:n,message:o},a.push(t))})),e=new Ys({name:s,userIDList:r}),o._map.set(s,e),o._snsM.onAddedToFriendGroup({name:s,userIDList:r}),o._onGroupListUpdated(),Cn({friendGroup:e,failureUserIDList:a})})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(i," failed. error:"),e),Sn(e)})))}},{key:"deleteGroup",value:function(e){var t,n,o=this,i="".concat(this._n,".").concat("deleteGroup"),s=e.name;return this._map.has(s)?(t="name:".concat(s),(n=new io("deleteGroup")).setMessage(t),this._snsM.req({P:jn.DEL_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),nameList:[s]}}).then((function(e){n.end(),Oe.l("".concat(i," ok. ").concat(t));var r=o._map.get(s);return r&&(o._snsM.onRemovedFromFriendGroup({name:s,userIDList:r.userIDList}),o._map.delete(s),r.userIDList.length=0),o._onGroupListUpdated(),Cn(r)})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(i," failed. error:"),e),Sn(e)}))):this._onGroupNotExist()}},{key:"renameGroup",value:function(e){var t,n,o=this,i="".concat(this._n,".").concat("renameGroup"),s=e.oldName,r=e.newName;return this._map.has(s)?(t="oldName:".concat(s," newName:").concat(r),(n=new io("renameGroup")).setMessage(t),this._snsM.req({P:jn.UPDATE_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),oldName:s,newName:r}}).then((function(){var e;return n.end(),Oe.l("".concat(i," ok. ").concat(t)),o._map.has(s)?((e=o._map.get(s)).name=r,o._map.delete(s),o._map.set(r,e),o._snsM.onRemovedFromFriendGroup({name:s,userIDList:e.userIDList}),o._snsM.onAddedToFriendGroup({name:r,userIDList:e.userIDList}),o._onGroupListUpdated(),Cn(e)):Cn()})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(i," failed. error:"),e),Sn(e)}))):this._onGroupNotExist()}},{key:"addToGroup",value:function(e){var t,n,o=this,i="".concat(this._n,".").concat("addToGroup"),s=e.name;return e=e.userIDList,this._map.has(s)?(t="name:".concat(s," userIDList:").concat(e),(n=new io("addToGroup")).setMessage(t),this._snsM.req({P:jn.UPDATE_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),oldName:s,updateGroupItem:e.filter((function(e){return o._snsM.isMyFriend(e)})).map((function(e){return{to:e,updateType:"Update_Type_Add"}}))}}).then((function(e){return n.end(),Oe.l("".concat(i," ok. ").concat(t)),o._onGroupUpdated(s,e)})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(i," failed. error:"),e),Sn(e)}))):this._onGroupNotExist()}},{key:"removeFromGroup",value:function(e){var t,n,o=this,i="".concat(this._n,".").concat("removeFromGroup"),s=e.name;return e=e.userIDList,this._map.has(s)?(t="name:".concat(s," userIDList:").concat(e),(n=new io("removeFromGroup")).setMessage(t),this._snsM.req({P:jn.UPDATE_FD_GRP,data:{fromAccount:this._snsM.getMyUserID(),oldName:s,updateGroupItem:e.filter((function(e){return o._snsM.isMyFriend(e)})).map((function(e){return{to:e,updateType:"Update_Type_Delete"}}))}}).then((function(e){return n.end(),Oe.l("".concat(i," ok. ").concat(t)),o._onGroupUpdated(s,e)})).catch((function(e){return n.setError(e).end(),Oe.w("".concat(i," failed. error:"),e),Sn(e)}))):this._onGroupNotExist()}},{key:"_onGroupUpdated",value:function(e,t){t=t.data.resultList;var n=this._map.get(e),o=[],i=[],s=[];return Ye(t)&&t.forEach((function(e){var t=e.to,r=e.resultCode,a=e.resultInfo,c=e.type;0===r?"Update_Type_Add"===c?n&&(n.addToUserIDList(t),i.push(t)):"Update_Type_Delete"===c&&n&&(n.removeFromUserIDList(t),s.push(t)):o.push({to:e.to,code:r,message:a})})),Oe.l("".concat(this._n,"._onGroupUpdated name:").concat(e," userIDList:").concat(n.userIDList)),0<i.length&&this._snsM.onAddedToFriendGroup({name:e,userIDList:i}),0<s.length&&this._snsM.onRemovedFromFriendGroup({name:e,userIDList:s}),Cn({friendGroup:n,failureUserIDList:o})}},{key:"updateWhenFriendAdded",value:function(e){var t=this,n=e.nameList,o=e.userID;Oe.l("".concat(this._n,".updateWhenFriendAdded userID:").concat(o," nameList:").concat(n)),qe(n)||n.forEach((function(e){t._map.has(e)&&t._map.get(e).addToUserIDList(o)}))}},{key:"updateWhenFriendDeleted",value:function(e){var t=this,n=e.nameList,o=e.userID;Oe.l("".concat(this._n,".updateWhenFriendDeleted userID:").concat(o," nameList:").concat(n)),qe(n)||n.forEach((function(e){t._map.has(e)&&t._map.get(e).removeFromUserIDList(o)}))}},{key:"_onGroupNotExist",value:function(e){return Sn({code:qn.FRIEND_GRP_NOT_EXIST})}},{key:"reset",value:function(){this._map.clear()}}]),Js=(u(Tr,Pn),s(Tr,[{key:"onContextUpdated",value:function(e){this._friendHandler.pagingGetFriendList(),this._friendGroupHandler.getGroupList(),this._friendApplicationHandler.getApplicationList()}},{key:"onRelationChainModified",value:function(e){var t,n,o,i,s,r,a=this;qe(e=e.dataList)||(t=[],n=[],o=[],s=!(i=[]),r="",e.forEach((function(e){var c;3!==e.pushType&&4!==e.pushType||!e.from||(r=e.from),e.friendAddAccount&&(t.push.apply(t,v(e.friendAddAccount)),i.push.apply(i,v(e.friendAddAccount))),e.friendDelAccount&&n.push.apply(n,v(e.friendDelAccount)),e.friendApplicationAdded&&o.push.apply(o,v(e.friendApplicationAdded)),e.friendApplicationDeletedUserIDList&&i.push.apply(i,v(e.friendApplicationDeletedUserIDList)),e.reportTime&&7===e.pushType&&(s=!0),e.friendUpInfo&&(c={dataList:[]},e.friendUpInfo.forEach((function(e){c.dataList.push({userID:e.friendAccount,profileList:v(e.sns)})})),a.onFriendProfileModified(c))})),s&&this._friendApplicationHandler.onApplicationRead(),this._friendApplicationHandler.onApplicationAdded(o,r),this._friendApplicationHandler.onApplicationDeleted(i),this._friendHandler.onFriendAdded(t),this._friendHandler.onFriendDeleted(n))}},{key:"isMyFriend",value:function(e){return this._friendHandler.isMyFriend(e)}},{key:"filterProfanity",value:function(e,t){var n,o=this.get(29);return!o||(n=(o=o.filterText(t[e],"sns")).isAllowedToSend,o=o.modifiedText,!0===n&&(t[e]=o,!0))}},{key:"onFriendProfileModified",value:function(e){this._friendHandler.onFriendProfileModified(e)}},{key:"getLocalFriendList",value:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],t=this._friendHandler.getLocalFriendList();return e?Tn(t):t}},{key:"getFriendRemark",value:function(e){return this._friendHandler.getFriendRemark(e)}},{key:"getFriendList",value:function(){return this._friendHandler.pagingGetFriendList()}},{key:"addFriend",value:function(e){return this._friendHandler.addFriend(e)}},{key:"deleteFriend",value:function(e){return this._friendHandler.deleteFriend(e)}},{key:"checkFriend",value:function(e){return this._friendHandler.checkFriend(e)}},{key:"getFriendProfile",value:function(e){return this._friendHandler.getFriendProfile(e)}},{key:"updateFriend",value:function(e){return this._friendHandler.updateFriend(e)}},{key:"onAddedToFriendGroup",value:function(e){this._friendHandler.onAddedToFriendGroup(e)}},{key:"onRemovedFromFriendGroup",value:function(e){this._friendHandler.onRemovedFromFriendGroup(e)}},{key:"getLocalFriendApplicationList",value:function(){return Tn(this._friendApplicationHandler.getLocalApplicationList())}},{key:"deleteFriendApplication",value:function(e){return this._friendApplicationHandler.deleteApplication(e)}},{key:"refuseFriendApplication",value:function(e){return this._friendApplicationHandler.refuseApplication(e)}},{key:"acceptFriendApplication",value:function(e){return this._friendApplicationHandler.acceptApplication(e)}},{key:"setFriendApplicationRead",value:function(e){return this._friendApplicationHandler.setApplicationRead(e)}},{key:"getLocalFriendGroupList",value:function(){return Tn(this._friendGroupHandler.getLocalGroupList())}},{key:"createFriendGroup",value:function(e){return this._friendGroupHandler.createGroup(e)}},{key:"deleteFriendGroup",value:function(e){return this._friendGroupHandler.deleteGroup(e)}},{key:"addToFriendGroup",value:function(e){return this._friendGroupHandler.addToGroup(e)}},{key:"removeFromFriendGroup",value:function(e){return this._friendGroupHandler.removeFromGroup(e)}},{key:"renameFriendGroup",value:function(e){return this._friendGroupHandler.renameGroup(e)}},{key:"updateWhenFriendAdded",value:function(e){this._friendGroupHandler.updateWhenFriendAdded(e)}},{key:"updateWhenFriendDeleted",value:function(e){this._friendGroupHandler.updateWhenFriendDeleted(e)}},{key:"updateCacheOnReconnected",value:function(){Oe.l("".concat(this._n,".updateCacheOnReconnected")),this._friendHandler.updateCacheOnReconnected(),this._friendGroupHandler.updateCacheOnReconnected(),this._friendApplicationHandler.updateCacheOnReconnected()}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._friendHandler.reset(),this._friendGroupHandler.reset(),this._friendApplicationHandler.reset()}}])),Xs=(u(Cr,Pn),s(Cr,[{key:"isWorkerEnabled",value:function(){return this._isWorkerEnabled&&he}},{key:"startWorkerTimer",value:function(){Oe.l("".concat(this._n,".startWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("start")}},{key:"stopWorkerTimer",value:function(){Oe.l("".concat(this._n,".stopWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("stop")}},{key:"_init",value:function(){var e,t;he&&(e=URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) { if (event.data === "start") { if (interval > 0) { clearInterval(interval); } interval = setInterval(() => { postMessage(""); }, 1000); postMessage(interval); } else if (event.data === "stop") { clearInterval(interval); interval = -1; }};'],{type:"application/javascript; charset=utf-8"})),this._workerTimer=new Worker(e),(t=this)._workerTimer.onmessage=function(e){e.data?(t._timerID=e.data,Oe.l("".concat(t._n,"._init seed:").concat(t._timerID))):t._m.onCheckTimer()})}},{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("enable_worker");Oe.l("".concat(this._n,"._onCloudConfig enableWorker:").concat(e)),lt(e)||"1"===e?!this._isWorkerEnabled&&he&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&he&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:"terminate",value:function(){Oe.l("".concat(this._n,".terminate")),this._workerTimer&&(this._workerTimer.terminate(),this._workerTimer=null,this._timerID=-1)}},{key:"getTimerID",value:function(){return this._timerID}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset"))}}])),Zs=s((function e(t){o(this,e),this._commercialConfigM=t,this._n="PurchasedFeatureHandler",this._isCSPluginReported=!1,this._featureMap=new Map}),[{key:"isValidPurchaseBits",value:function(e){return e&&"string"==typeof e&&1<=e.length&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:"parsePurchaseBits",value:function(e){if(this.isValidPurchaseBits(e)){this._featureMap.clear();for(var t,n=e.length-1,o=0;0<=n;n--,o++)t=(o<32?new D(0,Math.pow(2,o)):new D(Math.pow(2,o-32),0)).toString(),"1"===e[n]?this._featureMap.set(t,!0):this._featureMap.set(t,!1)}else Oe.w("".concat(this._n,".parsePurchaseBits invalid purchasebits:").concat(e))}},{key:"hasPurchasedFeature",value:function(e){return!!this._featureMap.get(e)}},{key:"isFeatureEnabled",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,i=t.length-1,s=0;0<=i;i--,s++)if("1"===t.charAt(i)&&(n=(s<32?new D(0,Math.pow(2,s)):new D(Math.pow(2,s-32),0)).toString(),!this._featureMap.get(n))){o=!1;break}return Oe.l("".concat(this._n,".isFeatureEnabled decimalNumber:").concat(e," key:").concat(n," ret:").concat(o)),Tn({enabled:o})}},{key:"isFeatureEnabledForStat",value:function(e){for(var t=parseInt(e).toString(2),n=t.length-1,o=0;0<=n;n--,o++)if("1"===t.charAt(n)){if(i=(o<32?new D(0,Math.pow(2,o)):new D(Math.pow(2,o-32),0)).toString(),!this._featureMap.get(i))break;var i,s="",r=0;i===N.PLUGIN_TRANSLATE?(s="plugin_translate",r=16):i===N.PLUGIN_VOICE_TO_TEXT?(s="plugin_voice_to_text",r=17):i===N.PLUGIN_CS?(s="plugin_cs",r=14):i===N.PLUGIN_PUSH?(s="plugin_push",r=13):i===N.PLUGIN_BOT?(s="plugin_bot",r=15):i===N.MSG_REACTION&&(s="plugin_emoji_reaction",r=18),""!==s&&(i=this._commercialConfigM.get(12).getUIPlatform(),new io(s).setCode(r).setUIPlatform(i).end(),Oe.l("".concat(this._n,".isFeatureEnabledForStat ").concat(s," code:").concat(r," uiPlatform:").concat(i)))}}},{key:"isCSPluginEnabled",value:function(){var e;this._isCSPluginReported||(e=this._commercialConfigM.get(12).getUIPlatform(),new io("plugin_search").setCode(6).setUIPlatform(e).end(),this._isCSPluginReported=!0)}},{key:"clear",value:function(){this._featureMap.clear(),this._isCSPluginReported=!1}}]),Qs=s((function e(t){o(this,e),this._m=t,this._n="CommercialConfigModule",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new Zs(this)}),[{key:"_canFetch",value:function(){return this.get(12).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"fetchConfig",value:function(){var e,t,n=this,o=this._canFetch(),i="".concat(this._n,".fetchConfig");Oe.l("".concat(i," canFetch:").concat(o)),o&&(e=new io("fetchCommercialConfig"),o=this.get(12).getSDKAppID(),t=this.get(20),this._isFetching=!0,t.req({P:jn.FETCH_COMMERCIAL_CONFIG,data:{SDKAppID:o}}).then((function(t){e.setMessage("purchaseBits:".concat(t.data.purchaseBits)).end(),Oe.l("".concat(i," ok.")),n._parseConfig(t.data),n._isFetching=!1})).catch((function(t){e.setError(t).end(),n._isFetching=!1})))}},{key:"onPushedConfig",value:function(e){var t="".concat(this._n,".onPushedConfig data:").concat(JSON.stringify(e));Oe.l("".concat(t)),new io("pushedCommercialConfig").setMessage("purchaseBits:".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:"_parseConfig",value:function(e){var t="".concat(this._n,"._parseConfig"),n=e.errorCode,o=e.errorMessage,i=e.purchaseBits,s=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(i),this._expiredTime=Date.now()+1e3*s):lt(n)?(Oe.l("".concat(t," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(Oe.e("".concat(t," errorCode:").concat(n," errorMessage:").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"canIUse",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:"isFeatureEnabled",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:"isFeatureEnabledForStat",value:function(e){this._purchasedFeatureHandler.isFeatureEnabledForStat(e)}},{key:"isCSPluginEnabled",value:function(){this._purchasedFeatureHandler.isCSPluginEnabled()}},{key:"get",value:function(e){return this._m.get(e)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),er=(u(Mr,Pn),s(Mr,[{key:"registerPlugin",value:function(e){var t,n,o,i,s,r,a,c,u,l,p,d,h;W?(this._offlinePushPlugin=e["tim-offline-push-plugin"],t=(h=e.offlinePushConfig||{}).huaweiBusinessID,n=h.xiaomiBusinessID,o=h.xiaomiAppID,i=h.xiaomiAppKey,s=h.meizuBusinessID,r=h.meizuAppID,a=h.meizuAppKey,c=h.vivoBusinessID,u=h.oppoBusinessID,l=h.oppoAppKey,p=h.oppoAppSecret,d=h.honorBusinessID,h=h.iosBusinessID,this._androidPushConfig.huaweiPushBussinessId=t,this._androidPushConfig.xiaomiPushBussinessId=n,this._androidPushConfig.xiaomiPushAppId=o,this._androidPushConfig.xiaomiPushAppKey=i,this._androidPushConfig.meizuPushBussinessId=s,this._androidPushConfig.meizuPushAppId=r,this._androidPushConfig.meizuPushAppKey=a,this._androidPushConfig.vivoPushBussinessId=c,this._androidPushConfig.oppoPushBussinessId=u,this._androidPushConfig.oppoPushAppKey=l,this._androidPushConfig.oppoPushAppSecret=p,this._androidPushConfig.honorPushBussinessId=d,new io("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!lt(this._offlinePushPlugin))).end(!0),Oe.l("".concat(this._n,".").concat("registerPlugin"," ok. offlinePushConfig:").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=h,this._setAppShowListener()):this.warn("OfflinePushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:"_getDeviceToken",value:function(){var e,t=this,n="".concat(this._n,".").concat("_getDeviceToken");Je(this._offlinePushPlugin.getDeviceToken)?(e="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig),", iosBusinessID:").concat(this._iosBusinessID),Oe.l("".concat(n," start. ").concat(e)),new io("_getDeviceToken").setMessage("".concat(e)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,(function(o){var i,s,r,a,c=new io("getDeviceTokenRes"),u=o.code,l=o.msg;0===u?(i=(a=o.data).deviceToken,s=a.deviceBrand,r=a.deviceType,a=a.bussinessId,t._deviceToken=i,t._businessID=a||t._iosBusinessID,e="deviceToken:".concat(i,", deviceBrand:").concat(s||r,", businessID:").concat(t._businessID),Oe.l("".concat(n," ok. ").concat(e)),c.setMessage(e).end(!0),t._setToken()):(c.setMessage("code:".concat(u,", msg:").concat(l)).end(!0),Oe.e("".concat(n," failed. error:"),o))}))):Oe.e("".concat(n," getDeviceToken is not a function"))}},{key:"canIUseOfflinePush",value:function(){return W&&!lt(this._offlinePushPlugin)}},{key:"_setAppShowListener",value:function(){var e=this,t="".concat(this._n,".").concat("_setAppShowListener");lt(this._offlinePushPlugin)?Oe.e("".concat(t," offlinePushPlugin is undefined")):Je(this._offlinePushPlugin.setAppShowListener)?(new io("_setAppShowListener").end(!0),Oe.l("".concat(t," start")),this._offlinePushPlugin.setAppShowListener((function(n){n=(n||{}).appShow,new io("setAppShowListenerRes").setMessage("appShow:".concat(n)).end(!0),Oe.l("".concat(t," ok. appShow:").concat(n)),e._m.isReady()&&(0===n?(e._getConvUnreadCount(),e._onBackground()):1===n&&e._onForeground())}))):Oe.e("".concat(t," setAppShowListener is not a function"))}},{key:"getDeviceBrand",value:function(){var e;if(!lt(this._offlinePushPlugin)&&Je(this._offlinePushPlugin.getDeviceType))return e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType,Oe.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(e)),e}},{key:"_setToken",value:function(){var e="".concat(this._n,"._setToken"),t=this.get(12),n=1,o="",i="",s=(qe(this._deviceToken)&&(n=0),this.getUniAppPlatform()),r=this.getDeviceBrand(),a=(s===R.IOS||s===R.IPAD||s===R.MAC?i=this._deviceToken:s===R.ANDROID&&(o=this._deviceToken),new io("offlinePushSetToken"));return s="deviceToken:".concat(i||o,", businessID:").concat(this._businessID,", ")+"deviceBrand:".concat(r,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(n,", platform:").concat(s),a.setMessage("".concat(s)),Oe.l("".concat(e," ").concat(s)),this.req({P:jn.SET_TOKEN,data:{tokenID:o,pushMsg:n,sdkAppID:t.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:r,deviceToken:i,isWebUniapp:this._isWebUniapp}}).then((function(t){return a.end(),Oe.l("".concat(e," ok")),t})).catch((function(t){return a.setError(t).end(),Oe.e("".concat(e," failed. error:"),t),Sn(t)}))}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.get(11).getLocalConvList().forEach((function(t){t.type===S.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===S.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:"_onBackground",value:function(){var e=this,t="".concat(this._n,".").concat("_onBackground"),n=new io("_onBackground");this.req({P:jn.STAT_BACKGROUND,data:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(o){return n.setMessage("c2cUnreadCount: ".concat(e._c2cUnreadCount,", groupUnreadCount: ").concat(e._groupUnreadCount)).end(),Oe.l("".concat(t," ok")),o})).catch((function(e){n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e)}))}},{key:"_onForeground",value:function(){var e="".concat(this._n,".").concat("_onForeground"),t=new io("_onForeground");this.req({P:jn.STAT_FOREGROUND,data:{isWebUniapp:this._isWebUniapp}}).then((function(n){return t.end(),Oe.l("".concat(e," ok")),n})).catch((function(n){t.setError(n).end(),Oe.e("".concat(e," failed. error:"),n)}))}},{key:"getUniAppPlatform",value:function(){var e=Gn.getSystemInfoSync().platform,t=this.getDeviceBrand();return"ios"===e?R.IOS:"android"===e?R.ANDROID:1002===t?R.IPAD:1001===t?R.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,Oe.l("".concat(this._n,".reset"))}}])),tr=(u(Ir,Pn),s(Ir,[{key:"registerPlugin",value:function(e){var t,n,o;W?(t="".concat(this._n,".").concat("registerPlugin"),this._pushPlugin=e["tim-push"],this._getDeviceInfo(),n=(o=e.pushConfig||{}).androidConfig,o=o.iOSConfig,$e(n)&&(this._androidPushConfig=n[this._deviceInfo.packageName]),n=(o||{}).iOSBusinessID,this._iOSBusinessID=n,o=!lt(this._pushPlugin),new io("registerPlugin").setMessage(this._pluginName).setMoreMessage("isExisted:".concat(o)).end(!0),Oe.l("".concat(t," ok. pushConfig:").concat(JSON.stringify(e.pushConfig))),o?(this._setAppShowListener(),this._setPushEventReportListener()):Oe.e("".concat(t," ").concat(this._pluginName," is undefined"))):this.warn("TIMPushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._reportEventCacheList(),this._getDeviceToken(),this.get(27).isFeatureEnabledForStat(Math.pow(2,41))}},{key:"_reportEventCacheList",value:function(){var e=this,t="".concat(this._n,".").concat("_reportEventCacheList");Je(this._pushPlugin.getPushEventCacheList)?(new io("_reportEventCacheList").end(!0),this._pushPlugin.getPushEventCacheList((function(n){var o=n.code,i=n.data.eventList,s=new io("getPushEventCacheListRes");if(s.setCode(o),0!==o)s.setMessage("res:".concat(JSON.stringify(n))).end(!0),Oe.e("".concat(t," failed. error:").concat(JSON.stringify(n)));else{o=i.length<10?"eventList:".concat(JSON.stringify(i)):"eventList.length:".concat(i.length),Oe.l("".concat(t," ok. ").concat(o)),s.setMessage(o).end(!0);for(var r=g(g({},n.data),{},{eventList:[]});0<i.length;)r.eventList=i.splice(0,40),e._pushReport(r)}}))):Oe.e("".concat(this._pluginName,".getPushEventCacheList is not a function"))}},{key:"_getDeviceToken",value:function(){var e,t=this,n="".concat(this._n,".").concat("_getDeviceToken");Je(this._pushPlugin.getDeviceToken)?(e="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig)," iOSBusinessID:").concat(this._iOSBusinessID),Oe.l("".concat(n," start. ").concat(e)),new io("_getDeviceToken").setMessage("".concat(e)).end(!0),this._pushPlugin.getDeviceToken(this._androidPushConfig,(function(o){var i,s,r,a=o.code,c=o.msg,u=new io("getDeviceTokenRes");u.setCode(a),0===a?(i=(a=o.data).deviceToken,s=a.deviceBrand,r=a.deviceType,a=a.bussinessId,t._deviceToken=i,t._businessID=a||t._iOSBusinessID,e="deviceToken:".concat(i," deviceBrand:").concat(s||r," businessID:").concat(t._businessID),Oe.l("".concat(n," ok. ").concat(e)),u.setMessage(e).end(!0),t._setToken()):(u.setMessage(c).end(!0),Oe.e("".concat(n," failed. error:").concat(JSON.stringify(o))))}))):Oe.e("".concat(this._pluginName,".getDeviceToken is not a function"))}},{key:"_getDeviceInfo",value:function(){var e,t,n,o,i="".concat(this._n,".").concat("_getDeviceInfo");Je(this._pushPlugin.getDeviceInfo)?(o=(e=this._pushPlugin.getDeviceInfo()).code,t=e.data,(n=new io("_getDeviceInfo")).setCode(o),0===o?(this._deviceInfo=g(g({},this._deviceInfo),t),this._deviceInfo.pushVersion||(this._deviceInfo.pushVersion="1.0.1"),o="deviceInfo:".concat(JSON.stringify(this._deviceInfo)),Oe.l("".concat(i," ok. ").concat(o)),n.setMessage(o).end(!0)):(n.setMessage("deviceInfoRes:".concat(JSON.stringify(e))).end(!0),Oe.e("".concat(i," failed. error:").concat(JSON.stringify(e))))):Oe.e("".concat(this._pluginName,".getDeviceInfo is not a function"))}},{key:"canIUseTIMPush",value:function(){return W&&!lt(this._pushPlugin)}},{key:"_setAppShowListener",value:function(){var e=this,t="".concat(this._n,".").concat("_setAppShowListener");Je(this._pushPlugin.setAppShowListener)?(new io("_setAppShowListener").end(!0),Oe.l("".concat(t," start")),this._pushPlugin.setAppShowListener((function(n){n=(n||{}).appShow,new io("setAppShowListenerRes").setMessage("appShow:".concat(n)).end(!0),Oe.l("".concat(t," ok. appShow:").concat(n)),e._m.isReady()&&(0===n?(e._getConvUnreadCount(),e._onBackground()):1===n&&e._onForeground())}))):Oe.e("".concat(this._pluginName,".setAppShowListener is not a function"))}},{key:"_setPushEventReportListener",value:function(){var e=this,t="".concat(this._n,".").concat("_setPushEventReportListener");Je(this._pushPlugin.setPushEventReportListener)?(new io("_setPushEventReportListener").end(!0),this._pushPlugin.setPushEventReportListener((function(n){var o=n.code,i=n.data,s=i.eventList,r=new io("setPushEventReportListenerRes");r.setCode(o),0===o?(o="eventList:".concat(JSON.stringify(s)),Oe.l("".concat(t," ok. ").concat(o)),r.setMessage(o).end(!0),e._m.isReady()&&Ye(s)&&0<s.length&&e._pushReport(i)):(r.setMessage("res:".concat(JSON.stringify(n))).end(!0),Oe.e("".concat(t," failed. error:").concat(JSON.stringify(n))))}))):Oe.e("".concat(this._pluginName,".setPushEventReportListener is not a function"))}},{key:"getDeviceBrand",value:function(){var e;if(!lt(this._pushPlugin)&&Je(this._pushPlugin.getDeviceType))return e=(this._pushPlugin.getDeviceType()||{}).deviceType,Oe.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(e)),e}},{key:"_setToken",value:function(){var e="".concat(this._n,".").concat("_setToken"),t=this.get(12),n=1,o="",i="",s=(qe(this._deviceToken)&&(n=0),this.getUniAppPlatform()),r=this.getDeviceBrand(),a=(s===R.IOS||s===R.IPAD||s===R.MAC?i=this._deviceToken:s===R.ANDROID&&(o=this._deviceToken),s=g({tokenID:o,pushMsg:n,sdkAppID:t.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:r,deviceToken:i,isWebUniapp:this._isWebUniapp},this._deviceInfo),new io("_setToken"));o="data:".concat(JSON.stringify(s)),a.setMessage("".concat(o)),Oe.l("".concat(e," ").concat(o)),this.req({P:jn.SET_TOKEN,data:s}).then((function(){a.end(),Oe.w("".concat(e," ok"))})).catch((function(t){a.setError(t).end(),Oe.e("".concat(e," failed. error:"),t),Sn(t)}))}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.get(11).getLocalConvList().forEach((function(t){t.type===S.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===S.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:"_onBackground",value:function(){var e=this,t="".concat(this._n,".").concat("_onBackground"),n=new io("_onBackground");this.req({P:jn.STAT_BACKGROUND,data:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(){n.setMessage("c2cUnreadCount:".concat(e._c2cUnreadCount," groupUnreadCount:").concat(e._groupUnreadCount)).end(),Oe.l("".concat(t," ok"))})).catch((function(e){n.setError(e).end(),Oe.e("".concat(t," failed. error:"),e)}))}},{key:"_onForeground",value:function(){var e="".concat(this._n,".").concat("_onForeground"),t=new io("_onForeground");this.req({P:jn.STAT_FOREGROUND,data:{isWebUniapp:this._isWebUniapp}}).then((function(){t.end(),Oe.l("".concat(e," ok"))})).catch((function(n){t.setError(n).end(),Oe.e("".concat(e," failed. error:"),n)}))}},{key:"_pushReport",value:function(e){var t=this,n="".concat(this._n,".").concat("_pushReport"),o=new io("_pushReport");this.req({P:jn.PUSH_REPORT,data:{eventList:e.eventList}}).then((function(){o.end(),t._notifyReportSuccess(e)})).catch((function(e){o.setError(e).end(),Oe.e("".concat(n," failed. error:"),e)}))}},{key:"_notifyReportSuccess",value:function(e){!lt(this._pushPlugin)&&Je(this._pushPlugin.notifyReportSuccess)&&(this._pushPlugin.notifyReportSuccess(e),Oe.l("".concat(this._n,"._notifyReportSuccess ok")))}},{key:"getUniAppPlatform",value:function(){var e=Gn.getSystemInfoSync().platform,t=this.getDeviceBrand();return"ios"===e?R.IOS:"android"===e?R.ANDROID:1002===t?R.IPAD:1001===t?R.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,Oe.l("".concat(this._n,".reset"))}}])),nr=(u(yr,Pn),s(yr,[{key:"init",value:function(){var e=this.get(18).getPlugin("tim-profanity-filter-plugin");e&&(this._plugin=new e({logger:Oe,isArray:Ye,isMap:Ve,isDevMode:this.isDevMode()}),this._getLexicon())}},{key:"onCheckTimer",value:function(){this._plugin&&this._canIUseLexicon&&this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime&&this._getLexicon()}},{key:"filterMessage",value:function(e,t){var n=!0;if(this._plugin&&this._canIUseLexicon&&(!t||!t.messageControlInfo||!0!==t.messageControlInfo.excludedFromContentModeration)){t=e.type;var o=e.conversationType;if(t===S.MSG_TEXT||t===S.MSG_CUSTOM){var i,s="".concat(this._n,".filterMessage");if(Oe.l("".concat(s)),t===S.MSG_TEXT){if(o===S.CONV_C2C?i="c2c_text_message":o===S.CONV_GROUP&&(i="group_text_message"),!this._isConfigOn(i))return n;var r=(a=this._plugin.filter(e.payload.text)).type,a=a.modifiedText;1===r?n=!1:2===r&&(e.payload.text=a)}else if(t===S.MSG_CUSTOM){if(o===S.CONV_C2C?i="c2c_custom_message":o===S.CONV_GROUP&&(i="group_custom_message"),!this._isConfigOn(i))return n;r=this._plugin.filter(e.payload.data),a=this._plugin.filter(e.payload.description),t=this._plugin.filter(e.payload.extension),1===r.type||1===a.type||1===t.type?n=!1:(2===r.type&&(e.payload.data=r.modifiedText),2===a.type&&(e.payload.description=a.modifiedText),2===t.type&&(e.payload.extension=t.modifiedText))}Oe.l("".concat(s," done. isAllowedToSend:").concat(n))}}return n}},{key:"filterText",value:function(e,t){var n="".concat(this._n,".filterText"),o={isAllowedToSend:!0,modifiedText:e};return this._plugin&&this._canIUseLexicon&&this._isConfigOn(t)&&(Oe.l("".concat(n)),e=(t=this._plugin.filter(e)).type,t=t.modifiedText,1===e?o.isAllowedToSend=!1:2===e&&(o.modifiedText=t),Oe.l("".concat(n," done. ret:"),o)),o}},{key:"_getLexicon",value:function(){var e=this,t=new io("profanityFilter"),n="".concat(this._n,"._getLexicon");this._isFetching=!0,this.req({P:jn.GET_PROFANITY_LIST,data:{startIndex:this._startIndex,version:this._version}}).then((function(o){var i=(o=o.data).errorInfo,s=o.filterConfig,r=o.lexicon,a=o.strToken,c=o.completeFlag,u=o.nextStartIndex,l=o.version,p=(o=o.expiredTime,i.errorCode),d=i.errorMessage;return 0!==p?(e._isFetching=!1,Oe.w("".concat(n," failed. error:"),i),void t.setCode(p).setMessage(d).end()):(e._onFilterConfig(s),e._getToken(a),1===c?(Oe.l("".concat(n," done. version:").concat(l," expiredTime:").concat(o)),e._version=l,e._canIUseLexicon=!0,e._isFetching=!1,e._expiredTime=Date.now()+1e3*o,void e._plugin.onLexiconCompleted(r)):(e._startIndex=u,e._plugin.onLexiconSliced(r),void e._getLexicon()))})).catch((function(o){t.setError(o).end(),e._isFetching=!1,Oe.l("".concat(n," failed. error:"),o)}))}},{key:"_onFilterConfig",value:function(e){var t=this;qe(e)||(this._filterConfigMap.clear(),Object.keys(e).forEach((function(n){t._filterConfigMap.set(n,e[n])})),Oe.l("".concat(this._n,"._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys())," values:").concat(Array.from(this._filterConfigMap.values()))))}},{key:"_isConfigOn",value:function(e){return 1===this._filterConfigMap.get(e)}},{key:"_getToken",value:function(e){if(ut(e)){var t=e.length,n="";if(t%2==0)for(var o=0;o<=t-1;o+=2)n=(n+=e[o+1])+e[o];else{for(var i=0;i<t-1;i+=2)n=(n+=e[i+1])+e[i];n+=e[t-1]}this._plugin.onToken(n)}}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._plugin&&(this._plugin.reset(),this._plugin=null),this._filterConfigMap.clear(),this._startIndex=0,this._version=0,this._canIUseLexicon=!1,this._isFetching=!1,this._expiredTime=0}}])),or=s((function e(t){o(this,e),this._m=t,this._n="TransCmdModule",this._TRTCCommandList=["tui_room_svr.*","callkit_records_svr.*","room_engine_srv.*","room_engine_http_srv.*","room_engine_mic.*","live_engine_srv.*","live_engine_http_srv.*","live_engine_pk.*","trtc_ai_service.*","call_engine_srv.*"],this._TRTCCommandMap=new Map,this._setTRTCCommandMap(),this._m.getIEmitInst().on(xo.CLOUD_CONFIG,this._onCloudConfig,this)}),[{key:"_onCloudConfig",value:function(){var e=this,t=this._m.get(23).getCloudConfig("rtc_cmd");lt(t)||((t=JSON.parse(t)).forEach((function(t){e._TRTCCommandList.includes(t)||e._TRTCCommandList.push(t)})),this._setTRTCCommandMap())}},{key:"_setTRTCCommandMap",value:function(){for(var e,t=0,n=this._TRTCCommandList.length;t<n;t++)e=this._TRTCCommandList[t].split(".")[0],this._TRTCCommandMap.set(e,1)}},{key:"onRoomCustomDataReceived",value:function(e){this._m.getOEmitInst().emit(T.ROOM_CUSTOM_DATA_RECEIVED,e)}},{key:"sendTRTCCustomData",value:function(e){var t=e.serviceCommand,n=(e=e.data,"".concat(P.NAME.TUIROOM_SVR,".*"));return lt(t)||(n=t),this._isValidServiceCommand(n)?this._trans({servcmd:n,data:e}):Sn({code:qn.INVALID_TRTC_CMD})}},{key:"_trans",value:function(e){Oe.d("".concat(this._n,"._trans. options:").concat(JSON.stringify(e)));var t=e.servcmd;return e=e.data,this._m.get(20).trans({servcmd:t,data:ut(e)?JSON.parse(e):e})}},{key:"_isValidServiceCommand",value:function(e){return e.endsWith(".*")?this._TRTCCommandList.includes(e):(e=e.split(".")[0],this._TRTCCommandMap.has(e))}},{key:"isTRTCCommand",value:function(e){return e=e.split(".")[0],this._TRTCCommandMap.has(e)}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset"))}}]),ir=s((function e(t){o(this,e),this._m=t,this._n="ErrMsgModule",this.TIM_ERROR_ASSISTANCE="tim_error_assistance",this.STORAGE_EXPIRES_TIME=6048e5,this.CURRENT_DOMAIN=G,this._map=new Map,this._init()}),[{key:"_init",value:function(){var e,t=this._getStorageModule().getItem(this.TIM_ERROR_ASSISTANCE,!1);if(t){try{e=JSON.parse(t)}catch(n){this._getStorageModule().removeItem(this.TIM_ERROR_ASSISTANCE,!1),Oe.w("".concat(this._n,"._init error:"),n)}e&&(this._needToUpdate(e)?this._fetch():this._fillMap(e.message))}else this._fetch()}},{key:"_needToUpdate",value:function(e){var t=e.localSavedTime;return e=e.localSavedVersion,t=t&&(new Date).getTime()-t>=this.STORAGE_EXPIRES_TIME,e=!e||"3.5.5"!==e,Oe.l("".concat(this._n,"._needToUpdate isTimeout:").concat(t," isDifferentVersion:").concat(e)),t||e}},{key:"_fetch",value:function(){this._m.get(12).isPrivateNetWork()||this._fetchWithRetry()}},{key:"_fetchWithRetry",value:function(){var e=this;this._fetchAdapter().catch((function(){e.CURRENT_DOMAIN!==B&&(e._generateCurrentDomain(),e._fetchWithRetry())}))}},{key:"_generateCurrentDomain",value:function(){this.CURRENT_DOMAIN===G?this.CURRENT_DOMAIN=F:this.CURRENT_DOMAIN===F&&(this.CURRENT_DOMAIN=B)}},{key:"_fetchAdapter",value:function(){var e="https://".concat(this.CURRENT_DOMAIN,"/im/download/error-message/v3/0.0.7/tim-error-message.txt"),t="application/x-www-form-urlencoded;charset=UTF-8",n="".concat(this._n,"._fetchAdapter ok in"),o=this;return new Promise((function(i,s){var r,a;Z?ne.request({url:e,method:"GET",timeout:3e3,header:{"content-type":t},dataType:"text",success:function(e){o._fillAndSave(e.data),Oe.l("".concat(n," mini program.")),i()},fail:function(e){s(e)}}):(r=new XMLHttpRequest,a=setTimeout((function(){r.abort()}),3e3),r.onreadystatechange=function(){4===r.readyState&&(a&&clearTimeout(a),200===r.status||304===r.status?(Oe.l("".concat(n," browser.")),o._fillAndSave(r.responseText),i()):s(r.status))},r.onerror=function(e){s(e)},r.open("GET",e,!0),r.setRequestHeader("Content-type",t),r.send())}))}},{key:"_fillAndSave",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:(new Date).getTime(),localSavedVersion:"3.5.5"}),!0,!1)}},{key:"_getStorageModule",value:function(){return this._m.get(13)}},{key:"_fillMap",value:function(e){this._map.clear();for(var t,n,o=e.split(";\n"),i=o.length,s=new RegExp(/'/g),r=0;r<i;r++)if(n=o[r].indexOf(":"),t=o[r].slice(0,n),n=o[r].slice(n+1,o[r].length),!t.startsWith("//")){if(lt(n))continue;this._map.set(t,n.replace(s,""))}}},{key:"get",value:function(e){var t=e.isIntl,n=e.key,o=e.replacement1;return e=e.replacement2,t="".concat(n,t?"_en":"_cn"),!this._map.has(t)&&this._map.has(n)&&(t=n),n="",this._map.has(t)&&(n=this._map.get(t),lt(o)||(n=n.replace("$replacement1",o)),lt(e)||(n=n.replace("$replacement2",e))),n}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset"))}}]),sr=s((function e(t){o(this,e),this._n="RemoteSignalingHandler",this._sigM=t}),[{key:"onNewMessageList",value:function(e){var t=this;e.forEach((function(e){var n=t.getPayloadData(e);n&&t._handleActionType(n,e)}))}},{key:"onMessageModified",value:function(e){var t=this;e.forEach((function(e){var n=t.getPayloadData(e);n&&t._onInvitationModified(n,e)}))}},{key:"getPayloadData",value:function(e){var t="".concat(this._n,".getPayloadData");e=e.payload.data;try{return JSON.parse(e)}catch(n){return Oe.e("".concat(t," JSON parse error. signalingData:").concat(e)),null}}},{key:"_handleActionType",value:function(e,t){switch(e.actionType){case E.ACTION_TYPE_INVITE:this._onNewInvitationReceived(e,t);break;case E.ACTION_TYPE_REJECT_INVITE:this._onInviteeRejected(e);break;case E.ACTION_TYPE_ACCEPT_INVITE:this._onInviteeAccepted(e);break;case E.ACTION_TYPE_CANCEL_INVITE:this._onInvitationCancelled(e);break;case E.ACTION_TYPE_INVITE_TIMEOUT:this._onInvitationTimeout(e)}}},{key:"_genBaseEmitData",value:function(e){return{inviteID:e.inviteID,inviter:e.inviter,groupID:e.groupID,data:e.data||""}}},{key:"_onNewInvitationReceived",value:function(e,t){var n="".concat(this._n,"._onNewInvitationReceived"),o=e.inviteID,i=e.inviteeList,s=e.groupID,r=e.inviter,a=this._sigM.getMyUserID(),c=i.includes(a),u=e.timeout,l=(Me().getTime()-1e3*t.time)/1e3;0<u&&0<l&&l<u&&(u-=l),n="".concat(n," myselfIncluded:").concat(c," groupID:").concat(s," signalObj:").concat(JSON.stringify(e)),Oe.l("".concat(n," timeout:").concat(u,"s delta:").concat(l,"s")),!(s&&c||!s)||(n=this._sigM.getInviteInfo(o))&&n===e||(n||this._sigM.setInviteInfo(o,g(g({},e),{},{message:t})),this._sigM.emitEvent(E.NEW_INVITATION_RECEIVED,g(g({},this._genBaseEmitData(e)),{},{inviteeList:i})),r!==a&&this._sigM.startTimer(g(g({},e),{},{timeout:u})))}},{key:"_onInviteeRejected",value:function(e){var t="".concat(this._n,"._onInviteeRejected"),n=e.inviteID,o=e.inviter,i=e.groupID,s=this._sigM.hasInviteInfo(n);Oe.l("".concat(t," inviteID:").concat(n," hasInviteID:").concat(s," inviter:").concat(o," groupID:").concat(i)),s&&(this._sigM.updateInviteInfo(e),this._sigM.emitEvent(E.INVITEE_REJECTED,g(g({},this._genBaseEmitData(e)),{},{invitee:e.inviteeList[0]})))}},{key:"_onInviteeAccepted",value:function(e){var t="".concat(this._n,"._onInviteeAccepted"),n=e.inviteID,o=e.inviter,i=e.groupID,s=this._sigM.hasInviteInfo(n);Oe.l("".concat(t," inviteID:").concat(n," hasInviteID:").concat(s," inviter:").concat(o," groupID:").concat(i)),s&&(this._sigM.updateInviteInfo(e),this._sigM.emitEvent(E.INVITEE_ACCEPTED,g(g({},this._genBaseEmitData(e)),{},{invitee:e.inviteeList[0]})))}},{key:"_onInvitationCancelled",value:function(e){var t="".concat(this._n,"._onInvitationCancelled"),n=e.inviteID,o=e.inviter,i=e.groupID,s=this._sigM.hasInviteInfo(n);Oe.l("".concat(t," inviteID:").concat(n," hasInviteID:").concat(s," inviter:").concat(o," groupID:").concat(i)),s&&(this._sigM.deleteInviteInfo(n),this._sigM.emitEvent(E.INVITATION_CANCELLED,this._genBaseEmitData(e)))}},{key:"_onInvitationTimeout",value:function(e){var t="".concat(this._n,"._onInvitationTimeout"),n=e.inviteID,o=e.inviter,i=e.groupID,s=e.inviteeList,r=this._sigM.hasInviteInfo(n);Oe.l("".concat(t," inviteID:").concat(n," hasInviteID:").concat(r," inviter:").concat(o," groupID:").concat(i," data:").concat(e.data)),r&&(this._sigM.updateInviteInfo(e),this._sigM.emitEvent(E.INVITATION_TIMEOUT,g(g({},this._genBaseEmitData(e)),{},{inviteeList:s,isSelfTimeout:!1})))}},{key:"_onInvitationModified",value:function(e,t){var n="".concat(this._n,"._onInvitationModified"),o=e.inviteID,i=e.data,s=this._sigM.hasInviteInfo(o);Oe.l("".concat(n," inviteID:").concat(o," hasInviteID:").concat(s," data:").concat(i)),s&&(this._sigM.setInviteInfo(o,g(g({},e),{},{message:t})),this._sigM.emitEvent(E.INVITATION_MODIFIED,{inviteID:o,data:i}))}}]),rr=s((function e(t){o(this,e),this._n="LocalSignalingHandler",this._sigM=t}),[{key:"generateInviteID",value:function(){var e,t=(t=xs)((e=Ns)(32),8)+"-"+t(e(16),4)+"-"+t(16384|e(12),4)+"-"+t(32768|e(14),4)+"-"+t(e(48),12);return Oe.l("".concat(this._n,".generateInviteID inviteID:").concat(t)),t}},{key:"createInviteInfo",value:function(e){var t=this.generateInviteID(),n=(e=this.createInviteCustomData(g(g({},e),{},{inviteID:t}))).groupID,o=e.inviteeList;return n=n||o[0],{customData:e,message:this._sigM.createSignaling(e,n),inviteID:t}}},{key:"_genBaseCustomData",value:function(e){var t=e.data,n=e.inviteID;return{businessID:1,timeout:0,data:void 0===t?"":t,inviteID:void 0===n?"":n,groupID:void 0===(e=e.groupID)?"":e}}},{key:"createInviteCustomData",value:function(e){var t=e.userID,n=void 0===(n=e.timeout)?0:n,o=void 0===(o=e.groupID)?"":o,i=this._sigM.getMyUserID();return i=g(g({},this._genBaseCustomData(e)),{},{actionType:E.ACTION_TYPE_INVITE,inviter:i,inviteeList:o?e.inviteeList:[t],timeout:n}),Oe.l("".concat(this._n,".createInviteCustomData customData:"),i),i}},{key:"createCancelCustomData",value:function(e){var t,n="".concat(this._n,".createCancelCustomData"),o=e.inviteID,i=this._sigM.getMyUserID(),s=(o=this._sigM.getInviteInfo(o)).inviteeList,r=o.groupID;return(o=o.inviter)===i?t=g(g({},this._genBaseCustomData(e)),{},{actionType:E.ACTION_TYPE_CANCEL_INVITE,groupID:r,inviter:i,inviteeList:s}):Oe.e("".concat(n," unmatched inviter:").concat(o," and my userID:").concat(i)),Oe.l("".concat(n," customData:"),t),t}},{key:"createAcceptCustomData",value:function(e){var t,n="".concat(this._n,".createAcceptCustomData"),o=e.inviteID,i=this._sigM.getMyUserID(),s=this._sigM.getInviteInfo(o),r=s.inviter,a=s.groupID;return s.inviteeList.includes(i)?t=g(g({},this._genBaseCustomData(e)),{},{actionType:E.ACTION_TYPE_ACCEPT_INVITE,groupID:a,inviter:r,inviteeList:[i]}):Oe.e("".concat(n," userID:").concat(i," not in inviteeList. inviteID:").concat(o," groupID:").concat(a)),Oe.l("".concat(n," customData:"),t),t}},{key:"createRejectCustomData",value:function(e){var t,n="".concat(this._n,".createRejectCustomData"),o=e.inviteID,i=this._sigM.getMyUserID(),s=this._sigM.getInviteInfo(o),r=s.inviter,a=s.groupID;return s.inviteeList.includes(i)?t=g(g({},this._genBaseCustomData(e)),{},{actionType:E.ACTION_TYPE_REJECT_INVITE,groupID:a,inviter:r,inviteeList:[i]}):Oe.e("".concat(n," userID:").concat(i," not in inviteeList. inviteID:").concat(o," groupID:").concat(a)),Oe.l("".concat(n," customData:"),t),t}},{key:"createTimeoutCustomData",value:function(e){var t="".concat(this._n,".createTimeoutCustomData"),n=e.inviteeList,o=e.inviter,i=void 0!==(i=e.isInviter)&&i,s=this._sigM.getMyUserID();return e=g(g({},this._genBaseCustomData(e)),{},{actionType:E.ACTION_TYPE_INVITE_TIMEOUT,inviter:o,inviteeList:i?n:[s]}),Oe.l("".concat(t," customData:"),e),e}}]),ar=s((function e(t){o(this,e),this._n="HistorySignalingHandler",this._sigM=t,this.COUNT=20,this.EXPIRED_TIME=300,this._map=new Map,this._relatedToMeMap=new Map}),[{key:"setCloudConfig",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:20,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:300;this.COUNT=e,this.EXPIRED_TIME=t,Oe.l("".concat(this._n,".setCloudConfig count:").concat(e,", time:").concat(t))}},{key:"getHistorySignaling",value:function(){var e=this,t=this._sigM.get(11).getLocalConvList();qe(t)||(this._getC2CSignalingList(),t=this._getValidGroupConvList(t),this._getGroupSignalingList(t).then((function(t){e._handleSignalingList(t)})))}},{key:"_getC2CSignalingList",value:function(){var e=this._sigM.get(6).getMessageListFromUnreadDB();e=this._sigM.filterMessageList(e),this._getRelatedToMeMap(e)}},{key:"_getGroupSignalingList",value:function(e){var t=this;return 0===(e=this._createPromiseList(e)).length?Promise.resolve(this._sortSignaling(this._relatedToMeMap)):this._concurrentGetMessageList(e).then((function(e){var n=new Map;return e.forEach((function(e){e=e.list,e=t._getRelatedToMeMap(e),n=new Map([].concat(v(n),v(e)))})),t._sortSignaling(n)}))}},{key:"_handleSignalingList",value:function(e){qe(e)||this._sigM.onNewMessageList(e)}},{key:"_getValidGroupConvList",value:function(e){for(var t=[],n=0,o=e.length;n<o;n++){var i=(r=e[n]).type,s=r.unreadCount,r=r.lastMessage;i=i===S.CONV_GROUP,r=this._isNotExpired(r),i&&s&&r&&t.push(e[n])}return t}},{key:"_isNotExpired",value:function(e){return!(!e||!e.lastTime)&&e.lastTime>Te()-this.EXPIRED_TIME}},{key:"_createPromiseList",value:function(e){for(var t=[],n=0;n<e.length;n++){var o=(i=e[n]).conversationID,i=(i=i.unreadCount)<this.COUNT?i:this.COUNT;this._map.set(o,{msgCount:i,list:[]}),i=this._sigM.get(11).getMessageList({conversationID:o}),t.push(i)}return t}},{key:"_concurrentGetMessageList",value:function(e){var t=this,n=[];return Promise.all(e).then((function(e){for(var o=0;o<e.length;o++){var i=(s=e[o]).code,s=s.data;0===i&&0!==s.messageList.length&&(t._handleMessageList(s.messageList),i=t._relayGetMessageList(s))&&n.push(i)}return 0<n.length?t._concurrentGetMessageList(n):t._map}))}},{key:"_relayGetMessageList",value:function(e){var t,n=e.messageList,o=e.nextReqMessageID;return e=e.isCompleted,0===n.length||(n=n[0].conversationID,0===(t=this._map.get(n).msgCount))||e?null:this._sigM.get(11).getMessageList({conversationID:n,nextReqMessageID:o,count:t})}},{key:"_handleMessageList",value:function(e){var t=e.length,n=e[0].conversationID,o=(i=this._map.get(n)).msgCount,i=i.list;this._map.set(n,{msgCount:0<o-t?o-t:0,list:i.concat(this._sigM.filterMessageList(e))})}},{key:"_getRelatedToMeMap",value:function(e){for(var t=0;t<e.length;t++){var n=e[t];this._saveRelatedToMe(n)}return this._relatedToMeMap}},{key:"_saveRelatedToMe",value:function(e){var t,n=(t=this._sigM.getPayloadData(e)||{}).actionType,o=void 0===(t=t.inviteID)?"":t;switch(void 0===n?"":n){case E.ACTION_TYPE_INVITE:this._setHistoryInvite(e);break;case E.ACTION_TYPE_REJECT_INVITE:case E.ACTION_TYPE_ACCEPT_INVITE:this._updateHistoryInvite(e);break;case E.ACTION_TYPE_CANCEL_INVITE:this._delHistoryInvite(o);break;case E.ACTION_TYPE_INVITE_TIMEOUT:this._updateHistoryInvite(e)}}},{key:"_setHistoryInvite",value:function(e){var t=this._sigM.getPayloadData(e)||{},n=void 0===(n=t.inviteID)?"":n,o=void 0===(o=t.inviteeList)?[]:o,i=void 0===(i=t.timeout)?0:i,s=this._sigM.getMyUserID();o.includes(s)&&(o=Te()-e.time,0<i&&i<o&&0!==i||this._relatedToMeMap.set(n,g(g({},t),{},{messageList:[e]})))}},{key:"_delHistoryInvite",value:function(e){this._relatedToMeMap.has(e)&&this._relatedToMeMap.delete(e)}},{key:"_updateHistoryInvite",value:function(e){var t=void 0===(t=(i=this._sigM.getPayloadData(e)||{}).inviteID)?"":t,n=void 0===(i=i.inviteeList)?[]:i;if(this._relatedToMeMap.has(t)){for(var o=(i=this._relatedToMeMap.get(t)).inviteeList,i=i.messageList,s=0;s<n.length;s++){var r=n[s];o.includes(r)&&o.splice(o.indexOf(r),1)}0===o.length?this._delHistoryInvite(t):i.push(e)}else this._delHistoryInvite(t)}},{key:"_sortSignaling",value:function(e){var t=[];return e.forEach((function(e){t=[].concat(v(t),v(e.messageList))})),t.sort((function(e,t){return e.time-t.time}))}},{key:"reset",value:function(){this._map.clear(),this._relatedToMeMap.clear()}}]),cr=s((function e(t,n){o(this,e),this.businessID=t.businessID||1,this.inviteID=t.inviteID,this.groupID=t.groupID||"",this.inviter=t.inviter||"",this.inviteeList=t.inviteeList||[],this.data=t.data||"",this.actionType=t.actionType||E.ACTION_TYPE_INVITE,this.timeout=t.timeout||0})),ur=["message"],lr=["message"],pr=(u(vr,Pn),s(vr,[{key:"onC2CUnreadHandleCompleted",value:function(){this._isC2CUnreadHandleCompleted=!0,this._isCloudConfigCompleted&&this._isConvSyncCompleted&&!this._isSyncCompleted&&this.onReady()}},{key:"onConvSyncCompleted",value:function(){this._isConvSyncCompleted=!0,this._isC2CUnreadHandleCompleted&&this._isCloudConfigCompleted&&!this._isSyncCompleted&&this.onReady()}},{key:"onCloudConfig",value:function(){this._isCloudConfigCompleted=!0;var e=this.getCloudConfig("history_s_count"),t=this.getCloudConfig("history_s_time");lt(e)||(e=Number(e)),lt(t)||(t=Number(t)),this._historySignalingHandler.setCloudConfig(e,t),this._isC2CUnreadHandleCompleted&&this._isConvSyncCompleted&&!this._isSyncCompleted&&this.onReady()}},{key:"_isListenerExisted",value:function(){return-1<this._m.getOEmitInst().eventNames().indexOf(E.NEW_INVITATION_RECEIVED)}},{key:"onReady",value:function(){this._isSyncCompleted=!0;var e=this._isListenerExisted();Oe.l("".concat(this._n,".onReady. isListenerExisted: ").concat(e)),e&&this._historySignalingHandler.getHistorySignaling()}},{key:"onNewMessageList",value:function(e){if(0<(e=this.filterMessageList(e)).length)return this._remoteSignalingHandler.onNewMessageList(e)}},{key:"onMessageModified",value:function(e){if(0<(e=this.filterMessageList(e)).length)return this._remoteSignalingHandler.onMessageModified(e)}},{key:"hasInviteInfo",value:function(e){return this._inviteInfoMap.has(e)}},{key:"getInviteInfo",value:function(e){return this._inviteInfoMap.get(e)}},{key:"setInviteInfo",value:function(e,t){var n=t.message;t=f(t,ur),Oe.l("".concat(this._n,".setInviteInfo inviteID:").concat(e," data:"),t),this._inviteInfoMap.set(e,g(g({},t),{},{message:n}))}},{key:"deleteInviteInfo",value:function(e){this.hasInviteInfo(e)&&(Oe.l("".concat(this._n,".deleteInviteInfo inviteID:").concat(e,".")),this._inviteInfoMap.delete(e))}},{key:"updateInviteInfo",value:function(e){var t="".concat(this._n,".updateInviteInfo"),n=e.inviteID,o=e.inviter,i=e.inviteeList;e=e.groupID,Oe.l("".concat(t," inviteID:").concat(n," inviter:").concat(o," groupID:").concat(e)),e&&this.hasInviteInfo(n)&&(o=i[0],(e=this.getInviteInfo(n).inviteeList).includes(o)&&(e.splice(e.indexOf(o),1),Oe.l("".concat(t," remove ").concat(o,". localInviteeList.length:").concat(e.length))),0!==e.length)||this.deleteInviteInfo(n)}},{key:"canIUseSignaling",value:function(){return this._canIUseSignaling}},{key:"emitEvent",value:function(e,t){this.emitOEvt(e,t)}},{key:"addSignalingListener",value:function(e,t,n){this._canIUseSignaling||(this._canIUseSignaling=!0),this._m.getOEmitInst().on(e,t,n)}},{key:"removeSignalingListener",value:function(e,t,n){this._m.getOEmitInst().off(e,t,n),this._isListenerExisted()||(this._canIUseSignaling=!1)}},{key:"invite",value:function(e){var t=this,n="".concat(this._n,".").concat("invite"),o=this._localSignalingHandler.createInviteInfo(e),i=o.message,s=o.customData,r=o.inviteID;return Oe.l("".concat(n," options:").concat(JSON.stringify(e)," inviteID:").concat(r)),this.sendSignaling(i,e).then((function(e){return e&&0===e.code?(t.setInviteInfo(r,g(g({},s),{},{message:i})),t.startTimer(g(g({},s),{},{inviteID:r})),g(g({},e),{},{inviteID:r})):e})).catch((function(e){return Sn(e)}))}},{key:"inviteSync",value:function(e,t,n){var o=this,i="".concat(this._n,".").concat("inviteSync"),s=this._localSignalingHandler.createInviteInfo(e),r=s.message,a=s.customData,c=s.inviteID;return Oe.l("".concat(i," options:").concat(JSON.stringify(e)," inviteID:").concat(c)),this.sendSignaling(r,e).then((function(e){if(e&&0===e.code)return o.setInviteInfo(c,g(g({},a),{},{message:r})),o.startTimer(g(g({},a),{},{inviteID:c})),t&&t({inviteID:c}),{inviteID:c};n&&n(0===e.code,e.message||"")})).catch((function(e){return n&&n(e.code,e.message),Sn(e)})),c}},{key:"_handleImResponse",value:function(e,t,n){t&&0===t.code&&(this._isHandling=!1,n?this.deleteInviteInfo(e.inviteID):this.updateInviteInfo(e))}},{key:"cancel",value:function(e){var t=this,n="".concat(this._n,".").concat("cancel");if(Oe.l("".concat(n," options:").concat(JSON.stringify(e))),!this.hasInviteInfo(e.inviteID)||this._isHandling)return Sn({code:qn.INVALID_CANCEL_MESSAGE});this._isHandling=!0;var o,i=this._localSignalingHandler.createCancelCustomData(e);return i?(n=i.groupID,o=i.inviteeList,n=n||o[0],o=this.createSignaling(i,n),this.sendSignaling(o,e).then((function(n){return t._handleImResponse(i,n,!0),0===n.code?g(g({},n),{},{inviteID:e.inviteID}):n})).catch((function(e){return Sn(e)}))):(this._isHandling=!1,Sn({code:qn.SIGNALING_NO_PERMISSION}))}},{key:"accept",value:function(e){var t=this,n="".concat(this._n,".").concat("accept");if(Oe.l("".concat(n," options:").concat(JSON.stringify(e))),!this.hasInviteInfo(e.inviteID)||this._isHandling)return Sn({code:qn.SIGNALING_INVALID_INVITE_ID});this._isHandling=!0;var o=this._localSignalingHandler.createAcceptCustomData(e);return o?(n=this.createSignaling(o),this.sendSignaling(n,e).then((function(n){return t._handleImResponse(o,n),0===n.code?g(g({},n),{},{inviteID:e.inviteID}):n})).catch((function(e){return Sn(e)}))):(this._isHandling=!1,Sn({code:qn.SIGNALING_NO_PERMISSION}))}},{key:"reject",value:function(e){var t=this,n="".concat(this._n,".").concat("reject");if(Oe.l("".concat(n," options:").concat(JSON.stringify(e))),!this.hasInviteInfo(e.inviteID)||this._isHandling)return Sn({code:qn.SIGNALING_INVALID_INVITE_ID});this._isHandling=!0;var o=this._localSignalingHandler.createRejectCustomData(e);return o?(n=this.createSignaling(o),this.sendSignaling(n,e).then((function(n){return t._handleImResponse(o,n,!0),0===n.code?g(g({},n),{},{inviteID:e.inviteID}):n})).catch((function(e){return Sn(e)}))):(this._isHandling=!1,Sn({code:qn.SIGNALING_NO_PERMISSION}))}},{key:"getSignalingInfo",value:function(e){var t="".concat(this._n,".getSignalingInfo"),n=e.ID,o=e.from,i=e.to,s=this._filterSignaling(e),r=null;return s&&(e=this.getPayloadData(e),r=new cr(e)),e=s?"actionType:".concat(r.actionType):"",Oe.l("".concat(t," messageID:").concat(n," from:").concat(o," to:").concat(i," ")+"".concat(e," isSignaling:").concat(s)),r}},{key:"modifyInvitation",value:function(e){var t,n,o,i,s=this,r=e.inviteID;return e=e.data,this.hasInviteInfo(r)?(t=this.getInviteInfo(r),n=t.message,o=f(t,lr),i=n.payload.data,o.data=e,n.payload.data=JSON.stringify(o),this.get(2).modifyRemoteMessage(n).then((function(e){return s.hasInviteInfo(r)&&s.setInviteInfo(r,g(g({},o),{},{message:n})),e})).catch((function(e){return n.payload.data=i,Sn(e)}))):Sn({code:qn.SIGNALING_INVALID_INVITE_ID})}},{key:"_genMsgCtrlInfo",value:function(){var e=void 0===(e=(i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).data)?"":e,t=i.onlineUserOnly,n=void 0===(n=i.inviteID)?"":n,o=i.offlinePushInfo,i=i.actionType,s={_onlineOnlyFlag:!1};return n={onlineUserOnly:(s=n&&this.getInviteInfo(n)?this.getInviteInfo(n).message:s)._onlineOnlyFlag||t||!1,offlinePushInfo:o,messageControlInfo:{excludedFromContentModeration:!0,excludedFromUnreadCount:!1,excludedFromLastMessage:!1}},i===E.ACTION_TYPE_INVITE_TIMEOUT?(s=!!e.match(/excludeTimeoutSignalingFromHistoryMessage/),n.messageControlInfo.excludedFromUnreadCount=s,n.messageControlInfo.excludedFromLastMessage=s):(t=!!e.match(/excludeFromHistoryMessage/),o=!!e.match(/excludeOriginalSignalingFromHistoryMessage/),n.messageControlInfo.excludedFromUnreadCount=t||o,n.messageControlInfo.excludedFromLastMessage=t||o),n}},{key:"sendSignaling",value:function(e,t){var n=this;return this.get(2).sendMessageInstance(e,this._genMsgCtrlInfo(t)).catch((function(e){return n._isHandling=!1,Sn(e)}))}},{key:"filterMessageList",value:function(e){var t=this;return e.filter((function(e){return t._filterSignaling(e)}))}},{key:"getPayloadData",value:function(e){return this._remoteSignalingHandler.getPayloadData(e)}},{key:"createSignaling",value:function(e,t){var n=e.groupID,o=e.inviter;return t={to:t||n||o,conversationType:n?S.CONV_GROUP:S.CONV_C2C,priority:S.MSG_PRIORITY_HIGH,payload:{data:JSON.stringify(e)}},o=this.get(2).createCustomMessage(t),Oe.l("".concat(this._n,".createSignaling. message:"),o),o}},{key:"_filterSignaling",value:function(e){var t,n,o=!1;return e.type&&e.type===S.MSG_CUSTOM&&(t=e.cloudCustomData,e=void 0===(e=e.payload.data)?"":e,t=(void 0===t?"":t).match(/"type":"tsignaling"/),n=e.match(/inviteID/),e=e.match(/actionType/),o=t||n&&e),!!o}},{key:"startTimer",value:function(e){var t,n,o,i=this,s="".concat(this._n,".startTimer"),r=e.timeout,a=e.inviteID,c=e.inviter,u=e.groupID,l=c===this.getMyUserID();Oe.l("".concat(s," timeout:").concat(r," isInviter:").concat(l," groupID:").concat(u)),r<=0||(t=l?r+5:r,n=1,o=setInterval((function(){var r=i._hasLocalInviteInfo(e,l);n<t&&r?++n:(r&&i._sendTimeoutNotice(a,l),Oe.l("".concat(s," end.")),clearInterval(o))}),1e3))}},{key:"_hasLocalInviteInfo",value:function(e,t){var n,o,i=e.inviteID;return e=e.groupID,!!this.hasInviteInfo(i)&&(n="".concat(this._n,"._hasLocalInviteInfo"),o=this.getInviteInfo(i).inviteeList,Oe.l("".concat(n," inviteID:").concat(i," inviteeList:").concat(o," groupID:").concat(e)),!e||(t?0<o.length:0<o.length&&o.includes(this.getMyUserID())))}},{key:"_getReceiver",value:function(e,t){var n=t.groupID,o=t.inviteeList;return t=t.inviter,e?n||o[0]:n||t}},{key:"_sendTimeoutNotice",value:function(e,t){var n=this,o=this.getInviteInfo(e),i=this._getReceiver(t,o),s=(Oe.l("".concat(this._n,"._sendTimeoutNotice inviteID:").concat(e," to:").concat(i," isInviter:").concat(t)),this._localSignalingHandler.createTimeoutCustomData(g(g({},o),{},{isInviter:t}))),r=this.createSignaling(s,i);return this.sendSignaling(r,s).then((function(o){var i,a,c;o&&0===o.code&&(o=s.data,i=s.groupID,a=s.inviteeList,c=s.inviter,n.emitEvent(E.INVITATION_TIMEOUT,{data:o,groupID:i,inviteID:e,inviteeList:a,inviter:c,isSelfTimeout:!0,message:r}),t?n.deleteInviteInfo(e):n.updateInviteInfo(s))}))}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._inviteInfoMap.clear(),this._canIUseSignaling=!1,this._isHandling=!1,this._historySignalingHandler.reset(),this._isC2CUnreadHandleCompleted=!1,this._isConvSyncCompleted=!1,this._isSyncCompleted=!1,this._isCloudConfigCompleted=!1}}])),dr=["followDiffList"],hr=["from"],gr={NONE:0,FOLLOWERS:1,FOLLOWING:2,MUTUAL:3},fr=(u(_r,Pn),s(_r,[{key:"_onCloudConfig",value:function(){var e=this.getCloudConfig("follow_req_count");lt(e)||(e=Number(e),this.DEFAULT_COUNT=e>this.MAX_COUNT?this.MAX_COUNT:e,this._clearFollowList())}},{key:"clearCacheOnReconnected",value:function(){this._clearFollowList()}},{key:"onFollowNotify",value:function(e){var t=this;e=e.dataList||[],Oe.l("".concat(this._n,".onFollowNotify followChangeList:").concat(e.length)),e.forEach((function(e){var n=void 0===(n=e.followDiffList)?[]:n,o=(e=f(e,dr)).from,i=f(e,hr);n.forEach((function(e){var n=e.isAdd,s=(e=void 0===(e=e.followType)?0:e,t._initFollowInfo());1===n?(i.userID=o,s[e].userInfoList.push(i),s[e].isAdd=!0):(s[e].userInfoList.push(o),s[e].isAdd=!1),t._emitEvent(s)}))}))}},{key:"_initFollowInfo",value:function(){var e={};return Object.values(gr).forEach((function(t){t!==gr.NONE&&(e[t]={userInfoList:[],isAdd:!1})})),e}},{key:"_emitEvent",value:function(e){var t=this;Object.keys(e).forEach((function(n){n=Number(n);var o=e[n];0<o.userInfoList.length&&(n===gr.FOLLOWERS&&(t._clearFollowList(gr.FOLLOWERS),t.emitOEvt(T.MY_FOLLOWERS_LIST_UPDATED,o)),n===gr.FOLLOWING&&(t._clearFollowList(gr.FOLLOWING),t.emitOEvt(T.MY_FOLLOWING_LIST_UPDATED,o)),n===gr.MUTUAL)&&(t._clearFollowList(gr.MUTUAL),t.emitOEvt(T.MUTUAL_FOLLOWERS_LIST_UPDATED,o))}))}},{key:"followUser",value:function(e){var t,n,o;return this.canIUse(N.FOLLOW)?(t="".concat(this._n,".").concat("followUser"),n="userIDList:".concat(e.length),(o=new io("followUser")).setMessage(n),Oe.l("".concat(t," ").concat(n)),this.req({P:jn.FOLLOW,data:{fromAccount:this.getMyUserID(),userIDList:e.map((function(e){return{userID:e}}))}}).then((function(e){return o.end(),Oe.l("".concat(t," ok.")),Cn(e.data.resultList)})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this.noUse("followUser")}},{key:"unfollowUser",value:function(e){var t,n,o;return this.canIUse(N.FOLLOW)?(t="".concat(this._n,".").concat("unfollowUser"),n="userIDList:".concat(e.length),(o=new io("unfollowUser")).setMessage(n),Oe.l("".concat(t," ").concat(n)),this.req({P:jn.UNFOLLOW,data:{fromAccount:this.getMyUserID(),userIDList:e}}).then((function(e){return o.end(),Oe.l("".concat(t," ok.")),Cn(e.data.resultList)})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this.noUse("unfollowUser")}},{key:"getMyFollowersList",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",n="getMyFollowersList";if(!this.canIUse(N.FOLLOW))return this.noUse(n);var o=t||this.FIRST_PAGE_INDEX;if(this._myFollowersList.has(o)){var i=(r=this._myFollowersList.get(o)).resultList,s=r.nextCursor,r=r.lastUpdateTime;if(Date.now()-r<this.MAX_CATCH_TIME&&0<i.length)return Oe.l("".concat(this._n,".").concat(n," nextCursor:").concat(t," from local.")),Tn({resultList:i,nextCursor:s})}return this._getFollowList(t,gr.FOLLOWERS).then((function(i){return e._myFollowersList.set(o,g(g({},i),{},{lastUpdateTime:Date.now()})),Oe.l("".concat(e._n,".").concat(n," nextCursor:").concat(t," from remote.")),Cn(i)}))}},{key:"getMyFollowingList",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",n="getMyFollowingList";if(!this.canIUse(N.FOLLOW))return this.noUse(n);var o=t||this.FIRST_PAGE_INDEX;if(this._myFollowingList.has(o)){var i=(r=this._myFollowingList.get(o)).resultList,s=r.nextCursor,r=r.lastUpdateTime;if(Date.now()-r<this.MAX_CATCH_TIME&&0<i.length)return Oe.l("".concat(this._n,".").concat(n," nextCursor:").concat(t," from local.")),Tn({resultList:i,nextCursor:s})}return this._getFollowList(t,gr.FOLLOWING).then((function(i){return e._myFollowingList.set(o,g(g({},i),{},{lastUpdateTime:Date.now()})),Oe.l("".concat(e._n,".").concat(n," nextCursor:").concat(t," from remote.")),Cn(i)}))}},{key:"getMutualFollowersList",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",n="getMutualFollowersList";if(!this.canIUse(N.FOLLOW))return this.noUse(n);var o=t||this.FIRST_PAGE_INDEX;if(this._myMutualFollowersList.has(o)){var i=(r=this._myMutualFollowersList.get(o)).resultList,s=r.nextCursor,r=r.lastUpdateTime;if(Date.now()-r<this.MAX_CATCH_TIME&&0<i.length)return Oe.l("".concat(this._n,".").concat(n," nextCursor:").concat(t," from local.")),Tn({resultList:i,nextCursor:s})}return this._getFollowList(t,gr.MUTUAL).then((function(i){return e._myMutualFollowersList.set(o,g(g({},i),{},{lastUpdateTime:Date.now()})),Oe.l("".concat(e._n,".").concat(n," nextCursor:").concat(t," from remote.")),Cn(i)}))}},{key:"_getFollowList",value:function(e,t){var n=this,o=new io("_getFollowList");return o.setMessage("nextCursor:".concat(e," type:").concat(t)),this.req({P:jn.GET_FOLLOW,data:{fromAccount:this.getMyUserID(),count:this.DEFAULT_COUNT,nextCursor:e,type:t}}).then((function(e){o.end();var t=void 0===(t=(e=e.data).resultList)?[]:t,i=(e=void 0===(e=e.nextCursor)?"":e,[]);return t.forEach((function(e){var t=e.userID,o=e.followTime;e=e.profileList,i.push(g({userID:t,followTime:o},n._handleProfileItem(void 0===e?[]:e)))})),{resultList:i,nextCursor:e}})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(n._n,"._getFollowList failed. error:"),e),Sn(e)}))}},{key:"_handleProfileItem",value:function(e){var t={};return e.forEach((function(e){switch(e.tag){case be.NICK:t.nick=e.value;break;case be.GENDER:t.gender=e.value;break;case be.BIRTHDAY:t.birthday=e.value;break;case be.LOCATION:t.location=e.value;break;case be.SELFSIGNATURE:t.selfSignature=e.value;break;case be.ALLOWTYPE:t.allowType=e.value;break;case be.LANGUAGE:t.language=e.value;break;case be.AVATAR:t.avatar=e.value;break;case be.MESSAGESETTINGS:t.messageSettings=e.value;break;case be.ADMINFORBIDTYPE:t.adminForbidType=e.value;break;case be.LEVEL:t.level=e.value;break;case be.ROLE:t.role=e.value;break;default:t[e.tag]=e.value}})),t}},{key:"getUserFollowInfo",value:function(e){var t,n,o;return this.canIUse(N.FOLLOW)?(n=!1,lt(e)&&(e=[this.getMyUserID()],n=!0),t="".concat(this._n,".").concat("getUserFollowInfo"),n="userIDList:".concat(e.length," isGetMyFollowInfo:").concat(n),(o=new io("getUserFollowInfo")).setMessage(n),Oe.l("".concat(t," ").concat(n)),this.req({P:jn.GET_FOLLOW_INFO,data:{fromAccount:this.getMyUserID(),userIDList:e}}).then((function(e){o.end(),Oe.l("".concat(t," ok.")),e=e.data.followInfoList;var n=[];return(void 0===e?[]:e).forEach((function(e){var t=e.followersCount,o=e.followingCount;e=e.mutualFollowersCount,n.push({followersCount:t,followingCount:o,mutualFollowersCount:e})})),Cn(n)})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))):this.noUse("getUserFollowInfo")}},{key:"checkFollowType",value:function(e){if(!this.canIUse(N.FOLLOW))return this.noUse("checkFollowType");100<e.length&&(e=e.slice(0,100),Oe.w("".concat(t," ").concat(jt(100))));var t="".concat(this._n,".").concat("checkFollowType"),n="userIDList length:".concat(e.length," "),o=new io("checkFollowType");return o.setMessage(n),Oe.l("".concat(t," ").concat(n)),this.req({P:jn.CHECK_FOLLOW_TYPE,data:{fromAccount:this.getMyUserID(),userIDList:e}}).then((function(e){o.end(),Oe.l("".concat(t," ok.")),e=e.data.resultList;var n=[];return(void 0===e?[]:e).forEach((function(e){var t=e.userID;e=e.followType,n.push({userID:t,followType:e})})),Cn(n)})).catch((function(e){return o.setError(e).end(),Oe.e("".concat(t," failed. error:"),e),Sn(e)}))}},{key:"_clearFollowList",value:function(e){lt(e)?(this._myFollowersList.clear(),this._myFollowingList.clear(),this._myMutualFollowersList.clear()):e!==gr.FOLLOWERS?e!==gr.FOLLOWING?e===gr.MUTUAL&&this._myMutualFollowersList.clear():this._myFollowingList.clear():this._myFollowersList.clear()}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._clearFollowList()}}])),mr=Ui((function(e,t){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(e){for(var t,n,o=Array.prototype.slice.call(arguments,1);o.length;){var i=o.shift();if(i){if("object"!==I(i))throw new TypeError(i+"must be non-object");for(var s in i)t=i,n=s,Object.prototype.hasOwnProperty.call(t,n)&&(e[s]=i[s])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,n,o,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+o),i);else for(var s=0;s<o;s++)e[i+s]=t[n+s]},flattenChunks:function(e){for(var t,n,o,i=0,s=0,r=e.length;s<r;s++)i+=e[s].length;for(o=new Uint8Array(i),s=t=0,r=e.length;s<r;s++)n=e[s],o.set(n,t),t+=n.length;return o}},i={arraySet:function(e,t,n,o,i){for(var s=0;s<o;s++)e[i+s]=t[n+s]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,o)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,i))},t.setTyped(n)}));function _r(e){return o(this,_r),(e=n(this,_r,[e]))._n="FollowModule",e._myFollowersList=new Map,e._myFollowingList=new Map,e._myMutualFollowersList=new Map,e.MAX_CATCH_TIME=6e5,e.FIRST_PAGE_INDEX=it(),e.DEFAULT_COUNT=500,e.MAX_COUNT=1e3,e.getIEmitInst().on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function vr(e){o(this,vr),(e=n(this,vr,[e]))._n="SignalingModule",e._inviteInfoMap=new Map,e._canIUseSignaling=!1,e._isHandling=!1,e._remoteSignalingHandler=new sr(e),e._localSignalingHandler=new rr(e),e._historySignalingHandler=new ar(e),e._isC2CUnreadHandleCompleted=!1,e._isConvSyncCompleted=!1,e._isSyncCompleted=!1,e._isCloudConfigCompleted=!1;var t=e.getIEmitInst();return t.on(xo.C2C_UNREAD_HANDLE_COMPLETED,e.onC2CUnreadHandleCompleted,e),t.on(xo.CONV_SYNC_COMPLETED,e.onConvSyncCompleted,e),t.on(xo.CLOUD_CONFIG,e.onCloudConfig,e),e}function yr(e){return o(this,yr),(e=n(this,yr,[e]))._n="ProfanityFilterModule",e._plugin=null,e._filterConfigMap=new Map,e._startIndex=0,e._version=0,e._canIUseLexicon=!1,e._isFetching=!1,e._expiredTime=0,e}function Ir(e){var t;return o(this,Ir),(t=n(this,Ir,[e]))._m=e,t._n="TIMPushModule",t._pluginName="TIMPush",t._pushPlugin=void 0,t._androidPushConfig={},t._deviceToken="",t._businessID=0,t._iOSBusinessID=0,t._c2cUnreadCount=0,t._groupUnreadCount=0,t._isWebUniapp=0,t._deviceInfo={notificationStatus:0,deviceModel:"",systemVersion:"",pushVersion:"1.0.1",packageName:""},t}function Mr(e){var t;return o(this,Mr),(t=n(this,Mr,[e]))._m=e,t._n="OfflinePushModule",t._offlinePushPlugin=void 0,t._androidPushConfig={huaweiPushBussinessId:"",xiaomiPushBussinessId:"",xiaomiPushAppId:"",xiaomiPushAppKey:"",meizuPushBussinessId:"",meizuPushAppId:"",meizuPushAppKey:"",vivoPushBussinessId:"",fcmPushBussinessId:"",oppoPushBussinessId:"",oppoPushAppKey:"",oppoPushAppSecret:"",honorPushBussinessId:""},t._deviceToken="",t._businessID=0,t._iosBusinessID=0,t._c2cUnreadCount=0,t._groupUnreadCount=0,t._isWebUniapp=0,t}function Cr(e){return o(this,Cr),(e=n(this,Cr,[e]))._n="WorkerTimerModule",e._isWorkerEnabled=!0,e._workerTimer=null,e._timerID=-1,e._init(),e.getIEmitInst().on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function Tr(e){return o(this,Tr),(e=n(this,Tr,[e]))._n="SnsModule",e._friendHandler=new zs(e),e._friendApplicationHandler=new Ks(e),e._friendGroupHandler=new Ws(e),e.getIEmitInst().on(xo.A2KEY_AND_TINYID_UPDATED,e.onContextUpdated,e),e}function Sr(e){o(this,Sr),(e=n(this,Sr,[e]))._n="QualityStatModule",e.TAG="im-ssolog-quality-stat",e.reportIndex=0,e.wholePeriod=!1,e._qualityItems=[Hn,Kn,$n,zn,Yn,Wn,Jn,Xn,Zn,Qn],e._messageSentItems=[$n,zn,Yn,Wn,Jn],e._messageReceivedItems=[Xn,Zn,Qn],e.REPORT_INTERVAL=120,e.REPORT_SDKAPPID_BLACKLIST=[],e.REPORT_TINYID_WHITELIST=[],e._statInfoArr=[],e._avgRTT=new Bs,e._avgE2EDelay=new Fs,e._rateMessageSent=new qs,e._rateMessageReceived=new Vs;var t=e.getIEmitInst();return t.on(xo.A2KEY_AND_TINYID_UPDATED,e._onLoginSuccess,e),t.on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function Er(e){return o(this,Er),(e=n(this,Er,[e]))._n="RecoverMsgModule",e.PULL_LIMIT_COUNT=15,e}function kr(e){return o(this,kr),(e=n(this,kr,[e]))._n="CloudControlModule",e._cloudConfig=new Map,e._expiredTime=0,e._version=0,e._isFetching=!1,e}function Dr(e){return o(this,Dr),(e=n(this,Dr,[e]))._n="SessionModule",e._platform=e.getPlatform(),e._pHandler=new Ss(e),e._msgDispatcher=new ks(e),e._cmdFreqLimitMap=new Map,e._cmdReqInfoMap=new Map,e._serverOverloadInfoMap=new Map,e._incrementalPullContactFlag=!0,e._init(),e.getIEmitInst().on(xo.CLOUD_CONFIG,e._onCloudConfig,e),e}function Lr(e,t,n,o){for(var i=65535&e,s=e>>>16&65535,r=0;0!==n;){for(n-=r=2e3<n?2e3:n;s=s+(i=i+t[o++]|0)|0,--r;);i%=65521,s%=65521}return i|s<<16}function Rr(e,t,n,o){var i=Ar,s=o+n;e^=-1;for(var r=o;r<s;r++)e=e>>>8^i[255&(e^t[r])];return~e}function Or(e,t,n,o,i,s,r,a){var c,u,l,p,d,h,g,f,m,_=a.bits,v=0,y=0,I=0,M=0,C=0,T=0,S=0,E=0,k=0,D=0,L=null,R=0,O=new mr.Buf16(16),A=new mr.Buf16(16),b=null,P=0;for(v=0;v<=15;v++)O[v]=0;for(y=0;y<o;y++)O[t[n+y]]++;for(C=_,M=15;1<=M&&0===O[M];M--);if(M<C&&(C=M),0===M)i[s++]=20971520,i[s++]=20971520,a.bits=1;else{for(I=1;I<M&&0===O[I];I++);for(C<I&&(C=I),v=E=1;v<=15;v++)if((E=(E<<1)-O[v])<0)return-1;if(0<E&&(0===e||1!==M))return-1;for(A[1]=0,v=1;v<15;v++)A[v+1]=A[v]+O[v];for(y=0;y<o;y++)0!==t[n+y]&&(r[A[t[n+y]]++]=y);if(h=0===e?(L=b=r,19):1===e?(L=br,R-=257,b=Pr,P-=257,256):(L=Nr,b=xr,-1),v=I,d=s,S=y=D=0,l=-1,p=(k=1<<(T=C))-1,1===e&&852<k||2===e&&592<k)return 1;for(;;){for(m=r[y]<h?(f=0,r[y]):r[y]>h?(f=b[P+r[y]],L[R+r[y]]):(f=96,0),c=1<<(g=v-S),I=u=1<<T;i[d+(D>>S)+(u-=c)]=g<<24|f<<16|m,0!==u;);for(c=1<<v-1;D&c;)c>>=1;if(D=0!==c?(D&c-1)+c:0,y++,0==--O[v]){if(v===M)break;v=t[n+r[y]]}if(C<v&&(D&p)!==l){for(d+=I,E=1<<(T=v-(S=0===S?C:S));T+S<M&&!((E-=O[T+S])<=0);)T++,E<<=1;if(k+=1<<T,1===e&&852<k||2===e&&592<k)return 1;i[l=D&p]=C<<24|T<<16|d-s}}0!==D&&(i[d+D]=v-S<<24|64<<16),a.bits=C}return 0}mr.assign,mr.shrinkBuf,mr.setTyped,mr.Buf8,mr.Buf16,mr.Buf32;var Ar=function(){for(var e=[],t=0;t<256;t++){for(var n=t,o=0;o<8;o++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e}(),br=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Pr=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Nr=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],xr=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];function wr(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function Ur(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new mr.Buf16(320),this.work=new mr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Gr(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new mr.Buf32(852),t.distcode=t.distdyn=new mr.Buf32(592),t.sane=1,t.back=-1,0):-2}function Fr(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,Gr(e)):-2}function Br(e,t){var n,o;return!e||!e.state||(o=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t))?-2:(null!==o.window&&o.wbits!==t&&(o.window=null),o.wrap=n,o.wbits=t,Fr(e))}function qr(e,t){var n;return e?(n=new Ur,(e.state=n).window=null,0!==(n=Br(e,t))&&(e.state=null),n):-2}var Vr,jr,Hr=!0;function Kr(e,t,n,o){var i;return null===(e=e.state).window&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0,e.window=new mr.Buf8(e.wsize)),o>=e.wsize?(mr.arraySet(e.window,t,n-e.wsize,e.wsize,0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>o&&(i=o),mr.arraySet(e.window,t,n-o,i,e.wnext),(o-=i)?(mr.arraySet(e.window,t,n-o,o,0),e.wnext=o,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=i))),0}var $r={inflateReset:Fr,inflateReset2:Br,inflateResetKeep:Gr,inflateInit:function(e){return qr(e,15)},inflateInit2:qr,inflate:function(e,t){var n,o,i,s,r,a,c,u,l,p,d,h,g,f,m,_,v,y,I,M,C,T,S,E,k=0,D=new mr.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(n=e.state).mode&&(n.mode=13),r=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,o=e.input,a=e.avail_in,u=n.hold,l=n.bits,p=a,d=c,T=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap)n.mode=13;else{for(;l<16;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(2&n.wrap&&35615===u)D[n.check=0]=255&u,D[1]=u>>>8&255,n.check=Rr(n.check,D,2,0),l=u=0,n.mode=2;else if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&u)<<8)+(u>>8))%31)e.msg="incorrect header check",n.mode=30;else if(8!=(15&u))e.msg="unknown compression method",n.mode=30;else{if(l-=4,C=8+(15&(u>>>=4)),0===n.wbits)n.wbits=C;else if(C>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<C,e.adler=n.check=1,n.mode=512&u?10:12,l=u=0}}break;case 2:for(;l<16;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(n.flags=u,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=u>>8&1),512&n.flags&&(D[0]=255&u,D[1]=u>>>8&255,n.check=Rr(n.check,D,2,0)),l=u=0,n.mode=3;case 3:for(;l<32;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}n.head&&(n.head.time=u),512&n.flags&&(D[0]=255&u,D[1]=u>>>8&255,D[2]=u>>>16&255,D[3]=u>>>24&255,n.check=Rr(n.check,D,4,0)),l=u=0,n.mode=4;case 4:for(;l<16;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}n.head&&(n.head.xflags=255&u,n.head.os=u>>8),512&n.flags&&(D[0]=255&u,D[1]=u>>>8&255,n.check=Rr(n.check,D,2,0)),l=u=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}n.length=u,n.head&&(n.head.extra_len=u),512&n.flags&&(D[0]=255&u,D[1]=u>>>8&255,n.check=Rr(n.check,D,2,0)),l=u=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((h=(h=n.length)>a?a:h)&&(n.head&&(C=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),mr.arraySet(n.head.extra,o,s,h,C)),512&n.flags&&(n.check=Rr(n.check,o,h,s)),a-=h,s+=h,n.length-=h),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===a)break e;for(h=0;C=o[s+h++],n.head&&C&&n.length<65536&&(n.head.name+=String.fromCharCode(C)),C&&h<a;);if(512&n.flags&&(n.check=Rr(n.check,o,h,s)),a-=h,s+=h,C)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===a)break e;for(h=0;C=o[s+h++],n.head&&C&&n.length<65536&&(n.head.comment+=String.fromCharCode(C)),C&&h<a;);if(512&n.flags&&(n.check=Rr(n.check,o,h,s)),a-=h,s+=h,C)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;l<16;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(u!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}l=u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;l<32;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}e.adler=n.check=wr(u),l=u=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=r,e.avail_out=c,e.next_in=s,e.avail_in=a,n.hold=u,n.bits=l,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last)u>>>=7&l,l-=7&l,n.mode=27;else{for(;l<3;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}switch(n.last=1&u,--l,3&(u>>>=1)){case 0:n.mode=14;break;case 1:R=O=void 0;var R,O=n;if(Hr){for(Vr=new mr.Buf32(512),jr=new mr.Buf32(32),R=0;R<144;)O.lens[R++]=8;for(;R<256;)O.lens[R++]=9;for(;R<280;)O.lens[R++]=7;for(;R<288;)O.lens[R++]=8;for(Or(1,O.lens,0,288,Vr,0,O.work,{bits:9}),R=0;R<32;)O.lens[R++]=5;Or(2,O.lens,0,32,jr,0,O.work,{bits:5}),Hr=!1}if(O.lencode=Vr,O.lenbits=9,O.distcode=jr,O.distbits=5,n.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}u>>>=2,l-=2}break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if((65535&u)!=(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&u,l=u=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(h=n.length){if(0===(h=c<(h=a<h?a:h)?c:h))break e;mr.arraySet(i,o,s,h,r),a-=h,s+=h,c-=h,r+=h,n.length-=h}else n.mode=12;break;case 17:for(;l<14;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(n.nlen=257+(31&u),u>>>=5,l-=5,n.ndist=1+(31&u),u>>>=5,l-=5,n.ncode=4+(15&u),u>>>=4,l-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;l<3;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}n.lens[L[n.have++]]=7&u,u>>>=3,l-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},T=Or(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,T){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;_=(k=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,v=65535&k,!((m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(v<16)u>>>=m,l-=m,n.lens[n.have++]=v;else{if(16===v){for(E=m+2;l<E;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(u>>>=m,l-=m,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}C=n.lens[n.have-1],h=3+(3&u),u>>>=2,l-=2}else if(17===v){for(E=m+3;l<E;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}C=0,h=3+(7&(u>>>=m)),u>>>=3,l=l-m-3}else{for(E=m+7;l<E;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}C=0,h=11+(127&(u>>>=m)),u>>>=7,l=l-m-7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;h--;)n.lens[n.have++]=C}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,S={bits:n.lenbits},T=Or(1,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,T){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},T=Or(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,T){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=a&&258<=c){e.next_out=r,e.avail_out=c,e.next_in=s,e.avail_in=a,n.hold=u,n.bits=l,H=q=w=x=N=P=b=A=oe=ne=te=ee=Q=Z=X=J=W=Y=z=$=K=j=V=B=F=void 0;var A,b,P,N,x,w,U=e,G=d,F=U.state,B=U.next_in,q=U.input,V=B+(U.avail_in-5),j=U.next_out,H=U.output,K=j-(G-U.avail_out),$=j+(U.avail_out-257),z=F.dmax,Y=F.wsize,W=F.whave,J=F.wnext,X=F.window,Z=F.hold,Q=F.bits,ee=F.lencode,te=F.distcode,ne=(1<<F.lenbits)-1,oe=(1<<F.distbits)-1;t:do{for(Q<15&&(Z+=q[B++]<<Q,Q+=8,Z+=q[B++]<<Q,Q+=8),A=ee[Z&ne];;){if(Z>>>=b=A>>>24,Q-=b,0==(b=A>>>16&255))H[j++]=65535&A;else{if(!(16&b)){if(!(64&b)){A=ee[(65535&A)+(Z&(1<<b)-1)];continue}if(32&b){F.mode=12;break t}U.msg="invalid literal/length code",F.mode=30;break t}for(P=65535&A,(b&=15)&&(Q<b&&(Z+=q[B++]<<Q,Q+=8),P+=Z&(1<<b)-1,Z>>>=b,Q-=b),Q<15&&(Z+=q[B++]<<Q,Q+=8,Z+=q[B++]<<Q,Q+=8),A=te[Z&oe];;){if(Z>>>=b=A>>>24,Q-=b,!(16&(b=A>>>16&255))){if(!(64&b)){A=te[(65535&A)+(Z&(1<<b)-1)];continue}U.msg="invalid distance code",F.mode=30;break t}if(N=65535&A,Q<(b&=15)&&(Z+=q[B++]<<Q,(Q+=8)<b)&&(Z+=q[B++]<<Q,Q+=8),(N+=Z&(1<<b)-1)>z){U.msg="invalid distance too far back",F.mode=30;break t}if(Z>>>=b,Q-=b,N>(b=j-K)){if((b=N-b)>W&&F.sane){U.msg="invalid distance too far back",F.mode=30;break t}if(w=X,(x=0)===J){if(x+=Y-b,b<P){for(P-=b;H[j++]=X[x++],--b;);x=j-N,w=H}}else if(J<b){if(x+=Y+J-b,(b-=J)<P){for(P-=b;H[j++]=X[x++],--b;);if(x=0,J<P){for(P-=b=J;H[j++]=X[x++],--b;);x=j-N,w=H}}}else if(x+=J-b,b<P){for(P-=b;H[j++]=X[x++],--b;);x=j-N,w=H}for(;2<P;)H[j++]=w[x++],H[j++]=w[x++],H[j++]=w[x++],P-=3;P&&(H[j++]=w[x++],1<P)&&(H[j++]=w[x++])}else{for(x=j-N;H[j++]=H[x++],H[j++]=H[x++],H[j++]=H[x++],2<(P-=3););P&&(H[j++]=H[x++],1<P)&&(H[j++]=H[x++])}break}}break}}while(B<V&&j<$);B-=P=Q>>3,Z&=(1<<(Q-=P<<3))-1,U.next_in=B,U.next_out=j,U.avail_in=B<V?V-B+5:5-(B-V),U.avail_out=j<$?$-j+257:257-(j-$),F.hold=Z,F.bits=Q,r=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,o=e.input,a=e.avail_in,u=n.hold,l=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;_=(k=n.lencode[u&(1<<n.lenbits)-1])>>>16&255,v=65535&k,!((m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(_&&!(240&_)){for(y=m,I=_,M=v;_=(k=n.lencode[M+((u&(1<<y+I)-1)>>y)])>>>16&255,v=65535&k,!(y+(m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}u>>>=y,l-=y,n.back+=y}if(u>>>=m,l-=m,n.back+=m,n.length=v,0===_){n.mode=26;break}if(32&_){n.back=-1,n.mode=12;break}if(64&_){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&_,n.mode=22;case 22:if(n.extra){for(E=n.extra;l<E;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;_=(k=n.distcode[u&(1<<n.distbits)-1])>>>16&255,v=65535&k,!((m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(!(240&_)){for(y=m,I=_,M=v;_=(k=n.distcode[M+((u&(1<<y+I)-1)>>y)])>>>16&255,v=65535&k,!(y+(m=k>>>24)<=l);){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}u>>>=y,l-=y,n.back+=y}if(u>>>=m,l-=m,n.back+=m,64&_){e.msg="invalid distance code",n.mode=30;break}n.offset=v,n.extra=15&_,n.mode=24;case 24:if(n.extra){for(E=n.extra;l<E;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===c)break e;if(n.offset>(h=d-c)){if((h=n.offset-h)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}g=h>n.wnext?(h-=n.wnext,n.wsize-h):n.wnext-h,h>n.length&&(h=n.length),f=n.window}else f=i,g=r-n.offset,h=n.length;for(c-=h=c<h?c:h,n.length-=h;i[r++]=f[g++],--h;);0===n.length&&(n.mode=21);break;case 26:if(0===c)break e;i[r++]=n.length,c--,n.mode=21;break;case 27:if(n.wrap){for(;l<32;){if(0===a)break e;a--,u|=o[s++]<<l,l+=8}if(d-=c,e.total_out+=d,n.total+=d,d&&(e.adler=n.check=(n.flags?Rr:Lr)(n.check,i,d,r-d)),d=c,(n.flags?u:wr(u))!==n.check){e.msg="incorrect data check",n.mode=30;break}l=u=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;l<32;){if(0===a)break e;a--,u+=o[s++]<<l,l+=8}if(u!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}l=u=0}n.mode=29;case 29:T=1;break e;case 30:T=-3;break e;case 31:return-4;default:return-2}return e.next_out=r,e.avail_out=c,e.next_in=s,e.avail_in=a,n.hold=u,n.bits=l,(n.wsize||d!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&Kr(e,e.output,e.next_out,d-e.avail_out),p-=e.avail_in,d-=e.avail_out,e.total_in+=p,e.total_out+=d,n.total+=d,n.wrap&&d&&(e.adler=n.check=(n.flags?Rr:Lr)(n.check,i,d,e.next_out-d)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==p&&0===d||4===t)&&0===T?-5:T},inflateEnd:function(e){var t;return e&&e.state?((t=e.state).window&&(t.window=null),e.state=null,0):-2},inflateGetHeader:function(e,t){return e&&e.state&&2&(e=e.state).wrap?((e.head=t).done=!1,0):-2},inflateSetDictionary:function(e,t){var n,o=t.length;return!e||!e.state||0!==(n=e.state).wrap&&11!==n.mode?-2:11===n.mode&&Lr(1,t,o,0)!==n.check?-3:Kr(e,t,o,o)?(n.mode=31,-4):(n.havedict=1,0)},inflateInfo:"pako inflate (from Nodeca project)"},zr=!0,Yr=!0;try{String.fromCharCode.apply(null,[0])}catch(Ca){zr=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Ca){Yr=!1}for(var Wr=new mr.Buf8(256),Jr=0;Jr<256;Jr++)Wr[Jr]=252<=Jr?6:248<=Jr?5:240<=Jr?4:224<=Jr?3:192<=Jr?2:1;function Xr(e,t){for(var n,o,i=t||e.length,s=new Array(2*i),r=0,a=0;a<i;)if((n=e[a++])<128)s[r++]=n;else if(4<(o=Wr[n]))s[r++]=65533,a+=o-1;else{for(n&=2===o?31:3===o?15:7;1<o&&a<i;)n=n<<6|63&e[a++],o--;1<o?s[r++]=65533:n<65536?s[r++]=n:(n-=65536,s[r++]=55296|n>>10&1023,s[r++]=56320|1023&n)}var c=s,u=r;if(u<65534&&(c.subarray&&Yr||!c.subarray&&zr))return String.fromCharCode.apply(null,mr.shrinkBuf(c,u));for(var l="",p=0;p<u;p++)l+=String.fromCharCode(c[p]);return l}function Zr(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function Qr(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Wr[254]=Wr[254]=1;var ea={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},ta={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},na=Object.prototype.toString;function oa(e){if(!(this instanceof oa))return new oa(e);this.options=mr.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;if(t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits)&&(t.windowBits=-15),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zr,this.strm.avail_out=0,(e=$r.inflateInit2(this.strm,t.windowBits))!==ea.Z_OK)throw new Error(ta[e]);if(this.header=new Qr,$r.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=function(e){for(var t,n,o,i,s=e.length,r=0,a=0;a<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(o=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(o-56320),a++),r+=n<128?1:n<2048?2:n<65536?3:4;for(t=new mr.Buf8(r),a=i=0;i<r;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(o=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(o-56320),a++),n<128?t[i++]=n:(n<2048?t[i++]=192|n>>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}(t.dictionary):"[object ArrayBuffer]"===na.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw)&&(e=$r.inflateSetDictionary(this.strm,t.dictionary))!==ea.Z_OK)throw new Error(ta[e])}function ia(e,t){if((t=new oa(t)).push(e,!0),t.err)throw t.msg||ta[t.err];return t.result}oa.prototype.push=function(e,t){var n,o,i,s,r,a=this.strm,c=this.options.chunkSize,u=this.options.dictionary,l=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?ea.Z_FINISH:ea.Z_NO_FLUSH,"string"==typeof e?a.input=function(e){for(var t=new mr.Buf8(e.length),n=0,o=t.length;n<o;n++)t[n]=e.charCodeAt(n);return t}(e):"[object ArrayBuffer]"===na.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new mr.Buf8(c),a.next_out=0,a.avail_out=c),(n=(n=$r.inflate(a,ea.Z_NO_FLUSH))===ea.Z_NEED_DICT&&u?$r.inflateSetDictionary(this.strm,u):n)===ea.Z_BUF_ERROR&&!0===l&&(n=ea.Z_OK,l=!1),n!==ea.Z_STREAM_END&&n!==ea.Z_OK)return this.onEnd(n),!(this.ended=!0);!a.next_out||0!==a.avail_out&&n!==ea.Z_STREAM_END&&(0!==a.avail_in||o!==ea.Z_FINISH&&o!==ea.Z_SYNC_FLUSH)||("string"===this.options.to?(i=function(e,t){for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0||0===n)&&n+Wr[e[n]]>t?n:t}(a.output,a.next_out),s=a.next_out-i,r=Xr(a.output,i),a.next_out=s,a.avail_out=c-s,s&&mr.arraySet(a.output,a.output,i,s,0),this.onData(r)):this.onData(mr.shrinkBuf(a.output,a.next_out))),0===a.avail_in&&0===a.avail_out&&(l=!0)}while((0<a.avail_in||0===a.avail_out)&&n!==ea.Z_STREAM_END);return(o=n===ea.Z_STREAM_END?ea.Z_FINISH:o)===ea.Z_FINISH?(n=$r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ea.Z_OK):o!==ea.Z_SYNC_FLUSH||(this.onEnd(ea.Z_OK),!(a.avail_out=0))},oa.prototype.onData=function(e){this.chunks.push(e)},oa.prototype.onEnd=function(e){e===ea.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=mr.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},bn={};var sa=((0,mr.assign)(bn,{Inflate:oa,inflate:ia,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ia(e,t)},ungzip:ia},ea),bn),ra=s((function e(t){o(this,e),this._m=t,this._n="InflateModule",this._bLogForInflateOK=!1,this._bLogForInflateError=!1}),[{key:"inflate",value:function(e){e=new Uint8Array(e).slice(4);var t,n=Date.now();try{t=sa.inflate(e,{to:"string"}),this._bLogForInflateOK||(this._bLogForInflateOK=!0,new io("inflateOK").end())}catch(i){return this._bLogForInflateError?void 0:(this._bLogForInflateError=!0,void new io("inflateError").setMessage(i).end())}e=e.length+4;var o=t.length;return Oe.d("inflate ok. zipped:".concat(e," unzipped:").concat(o)+" compression ratio:".concat(Math.round(100*(o-e)/o),"% cost:").concat(Date.now()-n)),t}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._bLogForInflateOK=!1,this._bLogForInflateError=!1}}]),aa="Message",ca="User",ua="Group",la="GroupMember",pa=["count"],da=["conversationID","timePosition","timePeriod"],ha=["miniBirthday","maxBirthday"],ga=a(a(a(a({},aa,jn.CS),ca,jn.USER_CS),ua,jn.GRP_CS),la,jn.MBR_CS),fa=(u(Ia,Pn),s(Ia,[{key:"searchCloudMessages",value:function(e){return this.search(aa,e)}},{key:"searchCloudUsers",value:function(e){return this.search(ca,e)}},{key:"searchCloudGroups",value:function(e){return this.search(ua,e)}},{key:"searchCloudGroupMembers",value:function(e){return this.search(la,e)}},{key:"search",value:function(e,t){var n=this,o="searchCloud".concat(e,"s"),i="".concat(this._n,".").concat(o);if(!t)return Sn({code:qn.OPTIONS_IS_EMPTY,message:this.getErrMsg(qn.OPTIONS_IS_EMPTY,o)});var s=t.keywordList,r=We(s),a=t.count;if(t.count&&(a=parseInt(a)),e===aa&&!r&&!We(t.senderUserIDList)&&!We(t.messageTypeList)||e!==aa&&!r)throw Oe.e("[".concat(o,'] Missing required params: "keywordList".')),new Error("Params validate failed.");var c=Date.now(),u=new io(o),l="keywordList:".concat(s," keywordListMatchType:").concat(t.keywordListMatchType," cursor:").concat(t.cursor," count:").concat(a);return Oe.l("".concat(i," ").concat(l)),this.req({P:ga[e],data:this._genParams(e,t)}).then((function(o){var s=(r=o.data).code,r=r.message;if(0!==s)return 60020===(a=s)?a="SearchUnable":e!==aa&&27003===s?a="SearchParamsError":e!==aa&&60018===s&&(a="SearchOverLimit"),a=n.getErrMsg(a)||r,r=new Bn({code:s,message:a}),u.setMessage(l).setError(r).end(),Sn(r);n.get(27).isCSPluginEnabled(),r=void 0===(a=(s=o.data).cursor)?"":a;var a=s.totalCount;return s="totalCount:".concat(a," cost:").concat($t(c)),Cn({searchResultList:(Oe.l("".concat(i," ok. cursor:").concat(r," ").concat(s)),u.setMessage("".concat(l," ").concat(s)).end(),s=n._genRes(e,t,o.data)),cursor:r,totalCount:a})})).catch((function(e){return u.setMessage(l).setError(e).end(),Sn(e)}))}},{key:"_genParams",value:function(e,t){var n=t.count,o=f(t,pa);return n&&(o.count=parseInt(n)),e===aa?this._genMsgParams(o):(n=t.keywordList,t=t.keywordListMatchType,o.keywords=n,o.keywordMatchType="and"===t?1:0,e===ca?this._genUserParams(o):o)}},{key:"_genMsgParams",value:function(e){var t=e.conversationID,n=e.timePosition,o=e.timePeriod;return e=f(e,da),lt(t)||(St(t)&&(e.account=t.replace(S.CONV_C2C,"")),Et(t)&&(e.groupID=t.replace(S.CONV_GROUP,""))),Ke(o)&&0<o&&(Ke(n)&&0<n?e.startTime=n-o:e.startTime=Te()-o),e.startTime&&e.startTime<0&&(e.startTime=void 0),Ke(n)&&0<n&&(e.endTime=n),e}},{key:"_genUserParams",value:function(e){var t=e.miniBirthday,n=e.maxBirthday;return e=f(e,ha),Ke(t)&&(e.miniBirthday=parseInt(t),Ke(n)||(e.maxBirthday=4294967295)),Ke(n)&&(e.maxBirthday=parseInt(n)),e}},{key:"_genRes",value:function(e,t,n){switch(e){case aa:return this._genMsgRes(n.searchResult,!t.conversationID);case ca:return this._genUserRes(n.userList);case ua:return this._genGrpRes(n.groupList);case la:return this._genMemberRes(n.groupMemberList);default:return[]}}},{key:"_genMsgRes",value:function(e,t){var n=this.get(11);return Ye(e)&&0!==e.length?e.map((function(e){var o=e.groupID,i=e.userID,s=e.messageCount,r=(e=void 0===(e=e.messageList)?[]:e,{conversationID:i=o?"".concat(S.CONV_GROUP).concat(o):"".concat(S.CONV_C2C).concat(i),messageCount:s,messageList:[]});return t&&1<s||0<(s=e.filter((function(e){return!!e}))).length&&(e=n.onRoamingMessage(s,i,!1),o&&e.reverse(),r.messageList=e,r.messageCount=e.length),r})):[]}},{key:"_genUserRes",value:function(e){var t=this.get(4)._profileHandler;if(!Ye(e))return[];for(var n=[],o=0,i=e.length;o<i;o++){var s=(r=e[o]).userID,r=r.profileItems;"@TLS#NOT_FOUND"!==s&&""!==s&&(s=t._update(s,t._getLatestProfileFromResponse(s,r)).latestProfile,n.push(s))}return n}},{key:"_genGrpRes",value:function(e){if(!Ye(e))return[];for(var t=[],n=0,o=e.length;n<o;n++)e[n]&&e[n].groupID&&t.push(new zo(e[n]));return t}},{key:"_genMemberRes",value:function(e){if(!Ye(e))return[];for(var t,n,o,i,s,r,a=new Map,c=0,u=e.length;c<u;c++)e[c]&&e[c].userID&&e[c].groupID&&(n=(t=e[c]).groupID,i=t.name,s=t.type,r=t.avatar,o=t.nick,i={groupID:n,name:i,type:s,avatar:r},s={userID:t.userID,nick:o,nameCard:t.nameCard},a.has(n)?((r=a.get(n)).memberList.push(s),a.set(n,r)):a.set(n,{groupInfo:i,memberList:[s]}));return v(a.values())}}])),ma=s((function e(t){var n=this;o(this,e);var i,s=new io("sdkConstruct"),r=(this._n="ModuleManager",this._isReady=!1,this._reason=qn.USER_NOT_LOGGED_IN,this._startLoginTs=0,this._map=new Map,this._optionalModuleMap=new Map,this._codeMsgForTUIMap=new Map,this._iEmitter=null,this._oEmitter=null,this._checkCount=0,this._checkTimer=-1,this._map.set(12,new Ii(this,t)),this._map.set(37,new ra(this)),this._map.set(15,new xi(this)),this._map.set(27,new Qs(this)),this._map.set(23,new Us(this)),this._map.set(24,new Xs(this)),this._map.set(26,new js(this)),this._map.set(21,new Ms(this)),this._map.set(20,new ws(this)),this._map.set(1,new Ci(this)),this._map.set(2,new Yi(this)),this._map.set(3,new Wi(this)),this._map.set(34,new Ji(this)),this._map.set(31,new Xi(this)),this._map.set(4,new yi(this)),this._map.set(6,new No(this)),this._map.set(11,new Zo(this)),this._map.set(7,new pi(this)),this._map.set(10,new gi(this)),this._map.set(13,new Oi(this)),this._map.set(32,new ir(this)),this._map.set(14,new bi(this)),this._map.set(17,new qi(this)),this._map.set(18,new Zi(this)),this._map.set(19,new Qi(this)),this._map.set(25,new Gs(this)),this._map.set(8,new Js(this)),this._map.set(28,new er(this)),this._map.set(36,new tr(this)),this._map.set(29,new nr(this)),this._map.set(30,new or(this)),this._map.set(33,new pr(this)),this._map.set(35,new fr(this)),this._map.set(38,new fa(this)),this._eventThrottleMap=new Map,this._eventThrottling=t.eventThrottling,this._map.get(12).isPartialUpdatedConvs()&&(this._eventThrottling=!1),ze(t.modules)?(Object.keys(t.modules).forEach((function(e){i=t.modules[e],"group-module"===e?n._map.set(7,new i(n)):"relationship-module"===e?n._map.set(8,new i(n)):"signaling-module"===e?n._map.set(33,new i(n)):"follow-module"===e?n._map.set(35,new i(n)):"cloud-search-module"===e&&n._map.set(38,new i(n)),n._optionalModuleMap.set(e,1)})),this._map.get(12).setUsingChatCore(!0)):this._map.has(7)||this._map.get(12).setUsingChatCore(!0),t.instanceID),a=t.SDKAppID,c=this._map.get(12).isIntl(),u=this._map.get(12).isUsingChatCore();r="instanceID:".concat(r," SDKAppID:").concat(a," isIntl:").concat(c," isUsingChatCore:").concat(u," host:").concat(Ot())+" isIOSWebView:".concat(me," platform:").concat(ie," canIUseInflate:").concat(this.canIUseInflate())+" workerAvailable:".concat(he," eventThrottling:").concat(this._eventThrottling," UserAgent:").concat(oe),io.bindEventStatModule(this._map.get(14)),io.bindNetMonitorModule(this._map.get(15)),s.setMessage("".concat(r," ").concat(function(){var e="";if(Z)try{var t=ne.getSystemInfoSync(),n=t.model,o=t.version,i=t.system,s=t.platform,r=t.SDKVersion;e="model:".concat(n," version:").concat(o," system:").concat(i," platform:").concat(s," SDKVersion:").concat(r)}catch(a){e=""}return e}())).end(),Oe.i("SDK ".concat(r)),Bn.prototype._getErrMsg=this.getErrMsg.bind(this),this._readyList=void 0,this._ssoLogForReady=null,this._initReadyList()}),[{key:"_startTimer",value:function(){var e=this._map.get(24),t=e.isWorkerEnabled();Oe.l("".concat(this._n,".startTimer isWorkerEnabled:").concat(t," seed:").concat(this._checkTimer)),t?e.startWorkerTimer():this._startMainThreadTimer()}},{key:"_startMainThreadTimer",value:function(){this._checkTimer<0&&(this._checkTimer=setInterval(this.onCheckTimer.bind(this),1e3)),Oe.l("".concat(this._n,"._startMainThreadTimer seed:").concat(this._checkTimer))}},{key:"stopTimer",value:function(){var e=this._map.get(24),t=e.isWorkerEnabled();Oe.l("".concat(this._n,".stopTimer isWorkerEnabled:").concat(t," seed:").concat(this._checkTimer)),t?e.stopWorkerTimer():this._stopMainThreadTimer()}},{key:"_stopMainThreadTimer",value:function(){Oe.l("".concat(this._n,"._stopMainThreadTimer")),0<this._checkTimer&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{key:"_stopMainThreadSocket",value:function(){Oe.l("".concat(this._n,"._stopMainThreadSocket"));var e=this._map.get(21);e.setIsWorkerEnabled(!0),e.reConnect()}},{key:"_startMainThreadSocket",value:function(){Oe.l("".concat(this._n,"._startMainThreadSocket"));var e=this._map.get(21);e.setIsWorkerEnabled(!1),e.reConnect()}},{key:"onWorkerTimerEnabled",value:function(){Oe.l("".concat(this._n,".onWorkerTimerEnabled, disable main thread timer and socket")),this._stopMainThreadTimer(),this._stopMainThreadSocket()}},{key:"onWorkerTimerDisabled",value:function(){Oe.l("".concat(this._n,".onWorkerTimerDisabled, enable main thread timer and socket")),this._startMainThreadTimer(),this._startMainThreadSocket()}},{key:"onCheckTimer",value:function(){this._checkCount+=1;var e,t=r(this._map);try{for(t.s();!(e=t.n()).done;){var n=_(e.value,2)[1];n.onCheckTimer&&n.onCheckTimer(this._checkCount)}}catch(o){t.e(o)}finally{t.f()}}},{key:"_initReadyList",value:function(){var e=this;this._readyList=[this._map.get(1)],this._readyList.forEach((function(t){t.ready((function(){return e._onModuleReady()}))}))}},{key:"_onModuleReady",value:function(){var e,t,n=!0;this._readyList.forEach((function(e){e.isReady()||(n=!1)})),n&&!this._isReady&&(this._isReady=!0,this._oEmitter.emit(T.SDK_READY),e=Date.now()-this._startLoginTs,Oe.w("SDK is ready. cost ".concat(e," ms")),this._startLoginTs=Date.now(),t=this._ssoLogForReady.getStartTs()+Ee,this._ssoLogForReady.setMessage(e).start(t).end())}},{key:"login",value:function(){0===this._startLoginTs&&(Ce(),this._startLoginTs=Date.now(),this._startTimer(),this._map.get(15).start(),this._ssoLogForReady=new io("sdkReady"),this._reason=qn.LOGGING_IN)}},{key:"onLoginFailed",value:function(){this._startLoginTs=0}},{key:"getOEmitInst",value:function(){return null===this._oEmitter&&(this._oEmitter=new Gi,e=this._oEmitter,Vn=e,this._oEmitter._emit=this._oEmitter.emit,this._oEmitter.emit=function(e,t){var n,o,i=this;this._canIUseSignaling()&&(e===T.MESSAGE_RECEIVED&&this.get(33).onNewMessageList(t),e===T.MESSAGE_MODIFIED)&&this.get(33).onMessageModified(t),e===T.CONVERSATION_LIST_UPDATED||e===T.FRIEND_LIST_UPDATED||e===T.GROUP_LIST_UPDATED||e===T.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?!1!==this._eventThrottling?this._eventThrottleMap.has(e)?(n=Date.now())-(o=this._eventThrottleMap.get(e)).last<=1e3?(-1<o.timeoutID&&clearTimeout(o.timeoutID),o.timeoutID=setTimeout((function(){o.last=Date.now(),i._oEmitter._emit.apply(i._oEmitter,[e,{name:e,data:i._getEventData(e)}])}),1e3)):(o.last=n,this._oEmitter._emit.apply(this._oEmitter,[e,{name:e,data:this._getEventData(e)}])):(this._eventThrottleMap.set(e,{last:Date.now(),timeoutID:-1}),this._oEmitter._emit.apply(this._oEmitter,[e,{name:e,data:this._getEventData(e)}])):this._oEmitter._emit.apply(this._oEmitter,[e,{name:e,data:this._getEventData(e)}]):this._oEmitter._emit.apply(this._oEmitter,[e,{name:e,data:t}])}.bind(this)),this._oEmitter;var e}},{key:"_canIUseSignaling",value:function(){var e=this.get(33);return!!e&&e.canIUseSignaling()}},{key:"_getEventData",value:function(e){return e===T.CONVERSATION_LIST_UPDATED?this._map.get(12).isPartialUpdatedConvs()?this._map.get(11).getPartialUpdatedConvs():this._map.get(11).getLocalConvList():e===T.FRIEND_LIST_UPDATED?this._map.get(8).getLocalFriendList(!1):e===T.GROUP_LIST_UPDATED?this._map.get(7).getLocalGroupList():e===T.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?this._map.get(11).getTotalUnreadCount():e===T.CONVERSATION_ID_LIST_UPDATED?this._map.get(11).getUpdatedConvIDList():void 0}},{key:"getIEmitInst",value:function(){return null===this._iEmitter&&(this._iEmitter=new Gi,this._iEmitter._emit=this._iEmitter.emit,this._iEmitter.emit=function(e,t){e=ze(t)&&t.data?[e,{name:e,data:t.data}]:[e,{name:e,data:t}],this._iEmitter._emit.apply(this._iEmitter,e)}.bind(this)),this._iEmitter}},{key:"hasModule",value:function(e){return this._map.has(e)}},{key:"get",value:function(e){return this._map.get(e)}},{key:"canIUseModule",value:function(e){return!this._map.get(12).isUsingChatCore()||this._optionalModuleMap.has(e)}},{key:"canIUseInflate",value:function(){return!!this._map.get(37)}},{key:"isReady",value:function(){return this._isReady}},{key:"isIntl",value:function(){return this.get(12).isIntl()}},{key:"getNotReadyReason",value:function(){return this._reason}},{key:"setNotReadyReason",value:function(e){this._reason=e}},{key:"getErrMsg",value:function(e,t,n){return this._map.get(32).get({key:e,replacement1:t,replacement2:n,isIntl:this.isIntl()})}},{key:"warn",value:function(e,t,n){(e=this.getErrMsg(e,t,n))&&Oe.w(e)}},{key:"onError",value:function(e){var t="code:".concat(e.code," message:").concat(e.message);Oe.w("Oops! ".concat(t)),new io("error").setMessage(t).setLevel("error").end(),this.getOEmitInst().emit(T.ERROR,e)}},{key:"restartTimer",value:function(){Oe.l("".concat(this._n,".restartTimer")),this.stopTimer(),this._startTimer();var e=this.get(7);e&&e.restartPolling()}},{key:"getTimerID",value:function(){var e=this._map.get(24);return e.isWorkerEnabled()?e.getTimerID():this._checkTimer}},{key:"getPollingTimerID",value:function(e){return this._map.get(7).getPollingTimerID(e)}},{key:"statTUIKeyFeatures",value:function(e){var t=e.code,n=t+(e=void 0===(e=e.msg)?"":e);this._codeMsgForTUIMap.has(n)||(this._codeMsgForTUIMap.set(n,1),n=this.get(12).getUIPlatform(),new io("tui_key_features").setCode(t).setMessage(e).setUIPlatform(n).end())}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),Ce();var e,t=r(this._map);try{for(t.s();!(e=t.n()).done;){var n=_(e.value,2)[1];n.reset&&n.reset()}}catch(a){t.e(a)}finally{t.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._oEmitter.emit(T.SDK_NOT_READY);var o,i=r(this._eventThrottleMap);try{for(i.s();!(o=i.n()).done;){var s=_(o.value,2)[1];-1<s.timeoutID&&clearTimeout(s.timeoutID)}}catch(a){i.e(a)}finally{i.f()}this._eventThrottleMap.clear(),this._codeMsgForTUIMap.clear()}}]),_a=s((function e(t){o(this,e),this._funcMap=new Map,this._m=t,this._n="SafetyCallback",this._reportCount=0}),[{key:"defense",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0;if("string"!=typeof e)return null;if(0===e.length)return null;if("function"!=typeof t)return null;if(this._funcMap.has(e)&&this._funcMap.get(e).has(t))return this._funcMap.get(e).get(t);this._funcMap.has(e)||this._funcMap.set(e,new Map);var o=null;return this._funcMap.get(e).has(t)?o=this._funcMap.get(e).get(t):(o=this._pack(e,t,n),this._funcMap.get(e).set(t,o)),o}},{key:"defenseOnce",value:function(e,t){return"function"!=typeof t?null:this._pack(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0)}},{key:"find",value:function(e,t){return"string"!=typeof e||0===e.length||"function"!=typeof t?null:this._funcMap.has(e)&&this._funcMap.get(e).has(t)?this._funcMap.get(e).get(t):(this._m.warn("ListenerFnNotFound",e),null)}},{key:"delete",value:function(e,t){return"function"==typeof t&&!!this._funcMap.has(e)&&!!this._funcMap.get(e).has(t)&&(this._funcMap.get(e).delete(t),0===this._funcMap.get(e).size&&this._funcMap.delete(e),!0)}},{key:"_pack",value:function(e,t,n){var o=this;return function(){try{t.apply(n,Array.from(arguments))}catch(r){var i=Object.values(T).indexOf(e),s="CallbackError";-1!==i&&(i=Object.keys(T)[i],o._m.warn(s,i,r)),o._reportCount<5&&(new io(s).setMessage("eventName:".concat(e)).setMoreMessage(r.message).end(),o._reportCount+=1)}}}},{key:"destroy",value:function(){this._funcMap.clear()}},{key:"reset",value:function(){Oe.l("".concat(this._n,".reset")),this._reportCount=0}}]),va=s((function e(t){o(this,e),t={SDKAppID:t.SDKAppID,unlimitedAVChatRoom:t.unlimitedAVChatRoom||!1,scene:t.scene||"",oversea:t.oversea||!1,instanceID:Rt(),devMode:t.devMode||!1,testEnv:t.testEnv||!1,proxyServer:t.proxyServer||void 0,fileUploadProxy:t.fileUploadProxy||void 0,fileDownloadProxy:t.fileDownloadProxy||t.fileUploadProxy||void 0,eventThrottling:!1!==t.eventThrottling,partialUpdatedConversations:!0===t.partialUpdatedConversations,disableIndependentDomain:!0===t.disableIndependentDomain,modules:t.modules||void 0},this._m=new ma(t),this._safetyCallbackFactory=new _a(this._m)}),[{key:"onError",value:function(e){this._m.onError(e)}},{key:"login",value:function(e){return this._m.login(),this._get(1).login(e)}},{key:"logout",value:function(){var e=this;return this._get(1).logout().then((function(t){return e._safetyCallbackFactory.reset(),e._m.reset(),t}))}},{key:"getLoginUser",value:function(){return this._get(1).getLoginUser()}},{key:"getServerTime",value:function(){return ke()}},{key:"isReady",value:function(){return this._m.isReady()}},{key:"isIntl",value:function(){return this._m.isIntl()}},{key:"getNotReadyReason",value:function(){return this._m.getNotReadyReason()}},{key:"getErrMsg",value:function(e,t,n){return this._m.getErrMsg(e,t,n)}},{key:"_get",value:function(e){return this._m.get(e)}},{key:"destroy",value:function(){var e=this,t=this._get(12),n=t.getSDKAppID();return Oe.w("destroy ".concat(n," ").concat(t.getInstanceID())),this.logout().finally((function(){e._safetyCallbackFactory.destroy(),e._m.stopTimer(),e._get(24).terminate(),e._get(21).dealloc(),e._m.getOEmitInst().emit(T.SDK_DESTROY,{SDKAppID:n})}))}},{key:"on",value:function(e,t,n){Oe.d("on","eventName:".concat(e)),this._m.getOEmitInst().on(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:"once",value:function(e,t,n){Oe.d("once","eventName:".concat(e)),this._m.getOEmitInst().once(e,this._safetyCallbackFactory.defenseOnce(e,t,n),n||this)}},{key:"off",value:function(e,t,n,o){Oe.d("off","eventName:".concat(e));var i=this._safetyCallbackFactory.find(e,t);null!==i&&(this._m.getOEmitInst().off(e,i,n,o),this._safetyCallbackFactory.delete(e,t))}},{key:"registerPlugin",value:function(e){(lt(e["tim-push"])?lt(e["tim-offline-push-plugin"])?this._get(18):this._get(28):this._get(36)).registerPlugin(e)}},{key:"setLogLevel",value:function(e){var t;e<=0&&((t=this.getErrMsg("TIM_ASCII_ART"))&&console.log(t),(t=this.getErrMsg("API_REFER"))&&(Vt()?console.log("%c ".concat("IM SDK API ->"," %c"),"background:#ff9d00; padding:1px; border-radius:3px; color: #fff","background:transparent",t):console.log("IM SDK API ->",t)),(t=this.getErrMsg("DOCS_GUIDE"))&&console.log(t),t=this.getErrMsg("IOS_WEBVIEW_WARNING"),me)&&t&&console.warn(t),Oe.setLevel(e)}},{key:"createTextMessage",value:function(e){return this._get(2).createTextMessage(e)}},{key:"createTextAtMessage",value:function(e){return this._get(2).createTextMessage(e)}},{key:"createImageMessage",value:function(e){return this._get(2).createImageMessage(e)}},{key:"createAudioMessage",value:function(e){return this._get(2).createAudioMessage(e)}},{key:"createVideoMessage",value:function(e){return this._get(2).createVideoMessage(e)}},{key:"createCustomMessage",value:function(e){return this._get(2).createCustomMessage(e)}},{key:"createFaceMessage",value:function(e){return this._get(2).createFaceMessage(e)}},{key:"createFileMessage",value:function(e){return this._get(2).createFileMessage(e)}},{key:"createLocationMessage",value:function(e){return this._get(2).createLocationMessage(e)}},{key:"createMergerMessage",value:function(e){return this._get(2).createMergerMessage(e)}},{key:"downloadMergerMessage",value:function(e){return e.type!==S.MSG_MERGER?Sn({code:qn.MSG_MERGER_TYPE_INVALID}):qe(e.payload.downloadKey)?Sn({code:qn.MSG_MERGER_KEY_INVALID}):this._get(2).downloadMergerMessage(e).catch((function(e){return Sn({code:qn.MSG_MERGER_DOWNLOAD_FAIL})}))}},{key:"createForwardMessage",value:function(e){return this._get(2).createForwardMessage(e)}},{key:"sendMessage",value:function(e,t){return e instanceof Do?this._get(2).sendMessageInstance(e,t):Sn({code:qn.MSG_INSTANCE_REQUIRED})}},{key:"callExperimentalAPI",value:function(e,t){return"sendComboMessage"===e?this._get(31).sendMessage(t):"handleGroupInvitation"===e?this._get(7).handleGroupInvitation(t):"isCommercialAbilityEnabled"===e?this._get(27).isFeatureEnabled(t):"isFeatureEnabledForStat"===e?this._get(27).isFeatureEnabledForStat(t):"isIntl"===e?this.isIntl():"sendTRTCCustomData"===e||"sendRoomCustomData"===e?this._get(30).sendTRTCCustomData(t):"getTimerID"===e?this._m.getTimerID():"getPollingTimerID"===e?this._m.getPollingTimerID(t):"setApplicationID"===e?(this._get(12).setApplicationID(t),void this._get(20).updateProtocolConfig()):"getServerConfig"===e?this._get(23).getServerConfig(t):"canIUseModule"===e?this._m.canIUseModule(t):"startMessageLongPolling"===e?this._get(7).startMessageLongPolling(t):"stopMessageLongPolling"===e?this._get(7).stopMessageLongPolling(t):"disableMessagePullOnInvite"===e?this._get(11).disableMsgPullOnInvite(t):"clearLocalMessage"===e?this._get(11).clearMemMsg(t,!1):"setCustomLoginInfo"===e?this._get(12).setCustomLoginInfo(t):"statTUIKeyFeatures"===e?this._m.statTUIKeyFeatures(t):"getGroupReceiptsByUsers"===e?this._get(7).getGroupReceiptsByUsers(t):Sn({code:qn.INVALID_OPERATION})}},{key:"revokeMessage",value:function(e){return this._get(2).revokeMessage(e)}},{key:"resendMessage",value:function(e,t){return e instanceof Do?this._get(2).resendMessage(e,t):Sn({code:qn.MSG_INSTANCE_REQUIRED})}},{key:"deleteMessage",value:function(e){return this._get(2).deleteMessage(e)}},{key:"translateText",value:function(e){return this._get(2).translateText(e)}},{key:"convertVoiceToText",value:function(e){return this._get(2).convertVoiceToText(e)}},{key:"setMessageExtensions",value:function(e,t){return this._get(3).setMessageExtensions(e,t)}},{key:"getMessageExtensions",value:function(e){return this._get(3).getMessageExtensions(e)}},{key:"deleteMessageExtensions",value:function(e,t){return this._get(3).deleteMessageExtensions(e,t)}},{key:"addMessageReaction",value:function(e,t){return this._get(34).addMessageReaction(e,t)}},{key:"removeMessageReaction",value:function(e,t){return this._get(34).removeMessageReaction(e,t)}},{key:"getMessageReactions",value:function(e){return this._get(34).getMessageReactions(e)}},{key:"getAllUserListOfMessageReaction",value:function(e){return this._get(34).getAllUserListOfMessageReaction(e)}},{key:"modifyMessage",value:function(e){return this._get(2).modifyRemoteMessage(e)}},{key:"getMessageList",value:function(e){return this._get(11).getMessageList(e)}},{key:"getMessageListHopping",value:function(e){return this._get(11).getMessageListHopping(e)}},{key:"sendMessageReadReceipt",value:function(e){return this._get(11).sendReadReceipt(e)}},{key:"getMessageReadReceiptList",value:function(e){return this._get(11).getReadReceiptList(e)}},{key:"getGroupMessageReadMemberList",value:function(e){var t=this._get(7);return t?t.getReadReceiptDetail(e):Sn({code:qn.NO_MODULE})}},{key:"findMessage",value:function(e){return this._get(11).findMessage(e)}},{key:"setMessageRead",value:function(e){return this._get(11).setMessageRead(e)}},{key:"getConversationList",value:function(e){return this._get(11).getConvList(e)}},{key:"getConversationProfile",value:function(e){return this._get(11).getConversationProfile(e)}},{key:"deleteConversation",value:function(e){return this._get(11).deleteConversation(e)}},{key:"setConversationDraft",value:function(e){return this._get(11).setConvDraft(e)}},{key:"clearHistoryMessage",value:function(e){return this._get(11).clearHistoryMessage(e)}},{key:"pinConversation",value:function(e){return this._get(11).pinConversation(e)}},{key:"setAllMessageRead",value:function(e){return this._get(11).setAllMessageRead(e)}},{key:"setMessageRemindType",value:function(e){return this._get(11).setMessageRemindType(e)}},{key:"setAllReceiveMessageOpt",value:function(e){return this._get(11).setAllRcvMsgOpt(e)}},{key:"getAllReceiveMessageOpt",value:function(){return this._get(11).getAllRcvMsgOpt()}},{key:"getTotalUnreadMessageCount",value:function(){return this._get(11).getTotalUnreadCount()}},{key:"setConversationCustomData",value:function(e){return this._get(11).setConvCustomData(e)}},{key:"markConversation",value:function(e){return this._get(11).markConv(e)}},{key:"getConversationGroupList",value:function(){return this._get(11).getConvGroupList()}},{key:"createConversationGroup",value:function(e){return this._get(11).createConvGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._get(11).deleteConvGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._get(11).renameConvGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._get(11).addConvsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._get(11).deleteConvsFromGroup(e)}},{key:"searchCloudMessages",value:function(e){var t=this._get(38);return t?t.searchCloudMessages(e):Sn({code:qn.NO_MODULE})}},{key:"searchCloudUsers",value:function(e){var t=this._get(38);return t?t.searchCloudUsers(e):Sn({code:qn.NO_MODULE})}},{key:"searchCloudGroups",value:function(e){var t=this._get(38);return t?t.searchCloudGroups(e):Sn({code:qn.NO_MODULE})}},{key:"searchCloudGroupMembers",value:function(e){var t=this._get(38);return t?t.searchCloudGroupMembers(e):Sn({code:qn.NO_MODULE})}},{key:"getMyProfile",value:function(){return this._get(4).getMyProfile()}},{key:"getUserProfile",value:function(e){return this._get(4).getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._get(4).updateMyProfile(e)}},{key:"getBlacklist",value:function(){return this._get(4).getLocalBlacklist()}},{key:"addToBlacklist",value:function(e){return this._get(4).addBlacklist(e)}},{key:"removeFromBlacklist",value:function(e){return this._get(4).deleteBlacklist(e)}},{key:"setSelfStatus",value:function(e){return this._get(4).setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._get(4).getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._get(4).subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._get(4).unsubscribeUserStatus(e)}},{key:"getFriendList",value:function(){var e=this._get(8);return e?e.getLocalFriendList():Sn({code:qn.NO_MODULE})}},{key:"addFriend",value:function(e){var t=this._get(8);return t?t.addFriend(e):Sn({code:qn.NO_MODULE})}},{key:"deleteFriend",value:function(e){var t=this._get(8);return t?t.deleteFriend(e):Sn({code:qn.NO_MODULE})}},{key:"checkFriend",value:function(e){var t=this._get(8);return t?t.checkFriend(e):Sn({code:qn.NO_MODULE})}},{key:"getFriendProfile",value:function(e){var t=this._get(8);return t?t.getFriendProfile(e):Sn({code:qn.NO_MODULE})}},{key:"updateFriend",value:function(e){var t=this._get(8);return t?t.updateFriend(e):Sn({code:qn.NO_MODULE})}},{key:"getFriendApplicationList",value:function(){var e=this._get(8);return e?e.getLocalFriendApplicationList():Sn({code:qn.NO_MODULE})}},{key:"acceptFriendApplication",value:function(e){var t=this._get(8);return t?t.acceptFriendApplication(e):Sn({code:qn.NO_MODULE})}},{key:"refuseFriendApplication",value:function(e){var t=this._get(8);return t?t.refuseFriendApplication(e):Sn({code:qn.NO_MODULE})}},{key:"deleteFriendApplication",value:function(e){var t=this._get(8);return t?t.deleteFriendApplication(e):Sn({code:qn.NO_MODULE})}},{key:"setFriendApplicationRead",value:function(){var e=this._get(8);return e?e.setFriendApplicationRead():Sn({code:qn.NO_MODULE})}},{key:"getFriendGroupList",value:function(){var e=this._get(8);return e?e.getLocalFriendGroupList():Sn({code:qn.NO_MODULE})}},{key:"createFriendGroup",value:function(e){var t=this._get(8);return t?t.createFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"deleteFriendGroup",value:function(e){var t=this._get(8);return t?t.deleteFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"addToFriendGroup",value:function(e){var t=this._get(8);return t?t.addToFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"removeFromFriendGroup",value:function(e){var t=this._get(8);return t?t.removeFromFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"renameFriendGroup",value:function(e){var t=this._get(8);return t?t.renameFriendGroup(e):Sn({code:qn.NO_MODULE})}},{key:"followUser",value:function(e){var t=this._get(35);return t?t.followUser(e):Sn({code:qn.NO_MODULE})}},{key:"unfollowUser",value:function(e){var t=this._get(35);return t?t.unfollowUser(e):Sn({code:qn.NO_MODULE})}},{key:"getMyFollowersList",value:function(e){var t=this._get(35);return t?t.getMyFollowersList(e):Sn({code:qn.NO_MODULE})}},{key:"getMyFollowingList",value:function(e){var t=this._get(35);return t?t.getMyFollowingList(e):Sn({code:qn.NO_MODULE})}},{key:"getMutualFollowersList",value:function(e){var t=this._get(35);return t?t.getMutualFollowersList(e):Sn({code:qn.NO_MODULE})}},{key:"getUserFollowInfo",value:function(e){var t=this._get(35);return t?t.getUserFollowInfo(e):Sn({code:qn.NO_MODULE})}},{key:"checkFollowType",value:function(e){var t=this._get(35);return t?t.checkFollowType(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupList",value:function(){var e=this._get(7);return e?e.getGroupList():Sn({code:qn.NO_MODULE})}},{key:"getGroupProfile",value:function(e){var t=this._get(7);return t?t.getGroupProfile(e):Sn({code:qn.NO_MODULE})}},{key:"createGroup",value:function(e){var t=this._get(7);return t?t.createGroup(e):Sn({code:qn.NO_MODULE})}},{key:"dismissGroup",value:function(e){var t=this._get(7);return t?t.dismissGroup(e):Sn({code:qn.NO_MODULE})}},{key:"updateGroupProfile",value:function(e){var t=this._get(7);return t?t.updateGroupProfile(e):Sn({code:qn.NO_MODULE})}},{key:"joinGroup",value:function(e){var t=this._get(7);return t?t.joinGroup(e):Sn({code:qn.NO_MODULE})}},{key:"quitGroup",value:function(e){var t=this._get(7);return t?t.quitGroup(e):Sn({code:qn.NO_MODULE})}},{key:"searchGroupByID",value:function(e){var t=this._get(7);return t?t.searchGroupByID(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this._get(7);return t?t.getGroupOnlineMemberCount(e):Sn({code:qn.NO_MODULE})}},{key:"changeGroupOwner",value:function(e){var t=this._get(7);return t?t.changeGroupOwner(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupApplicationList",value:function(){var e=this._get(7);return e?e.getGroupApplicationList():Sn({code:qn.NO_MODULE})}},{key:"handleGroupApplication",value:function(e){var t=this._get(7);return t?t.handleGroupApplication(e):Sn({code:qn.NO_MODULE})}},{key:"initGroupAttributes",value:function(e){var t=this._get(7);return t?t.initGroupAttributes(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupAttributes",value:function(e){var t=this._get(7);return t?t.setGroupAttributes(e):Sn({code:qn.NO_MODULE})}},{key:"deleteGroupAttributes",value:function(e){var t=this._get(7);return t?t.deleteGroupAttributes(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupAttributes",value:function(e){var t=this._get(7);return t?t.getGroupAttributes(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupCounters",value:function(e){var t=this._get(7);return t?t.setGroupCounters(e):Sn({code:qn.NO_MODULE})}},{key:"increaseGroupCounter",value:function(e){var t=this._get(7);return t?t.increaseGroupCounter(e):Sn({code:qn.NO_MODULE})}},{key:"decreaseGroupCounter",value:function(e){var t=this._get(7);return t?t.decreaseGroupCounter(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupCounters",value:function(e){var t=this._get(7);return t?t.getGroupCounters(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupMemberList",value:function(e){var t=this._get(7);return t?t.getGroupMemberList(e):Sn({code:qn.NO_MODULE})}},{key:"getGroupMemberProfile",value:function(e){var t=this._get(7);return t?t.getGroupMemberProfile(e):Sn({code:qn.NO_MODULE})}},{key:"addGroupMember",value:function(e){var t=this._get(7);return t?t.addGroupMember(e):Sn({code:qn.NO_MODULE})}},{key:"deleteGroupMember",value:function(e){var t=this._get(7);return t?t.deleteGroupMember(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupMemberMuteTime",value:function(e){var t=this._get(7);return t?t.setGroupMemberMuteTime(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupMemberRole",value:function(e){var t=this._get(7);return t?t.setGroupMemberRole(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupMemberNameCard",value:function(e){var t=this._get(7);return t?t.setGroupMemberNameCard(e):Sn({code:qn.NO_MODULE})}},{key:"setGroupMemberCustomField",value:function(e){var t=this._get(7);return t?t.setGroupMemberCustomField(e):Sn({code:qn.NO_MODULE})}},{key:"markGroupMemberList",value:function(e){var t=this._get(7);return t?t.markGroupMemberList(e):Sn({code:qn.NO_MODULE})}},{key:"getJoinedCommunityList",value:function(){return this._get(10).getJoinedCommunityList()}},{key:"createTopicInCommunity",value:function(e){return this._get(10).createTopicInCommunity(e)}},{key:"deleteTopicFromCommunity",value:function(e){return this._get(10).deleteTopicFromCommunity(e)}},{key:"updateTopicProfile",value:function(e){return this._get(10).updateTopicProfile(e)}},{key:"getTopicList",value:function(e){return this._get(10).getTopicList(e)}},{key:"addSignalingListener",value:function(e,t,n){var o=this._get(33);o&&o.addSignalingListener(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:"removeSignalingListener",value:function(e,t,n){var o,i=this._safetyCallbackFactory.find(e,t);null!==i&&(o=this._get(33))&&(o.removeSignalingListener(e,i,n),this._safetyCallbackFactory.delete(e,t))}},{key:"invite",value:function(e){var t=this._get(33);return t?t.invite(e):Sn({code:qn.NO_MODULE})}},{key:"inviteSync",value:function(e,t,n){var o=this._get(33);return o?o.inviteSync(e,t,n):""}},{key:"inviteInGroup",value:function(e){var t=this._get(33);return t?t.invite(e):Sn({code:qn.NO_MODULE})}},{key:"inviteInGroupSync",value:function(e,t,n){var o=this._get(33);return o?o.inviteSync(e,t,n):""}},{key:"cancel",value:function(e){var t=this._get(33);return t?t.cancel(e):Sn({code:qn.NO_MODULE})}},{key:"accept",value:function(e){var t=this._get(33);return t?t.accept(e):Sn({code:qn.NO_MODULE})}},{key:"reject",value:function(e){var t=this._get(33);return t?t.reject(e):Sn({code:qn.NO_MODULE})}},{key:"getSignalingInfo",value:function(e){var t=this._get(33);return t?t.getSignalingInfo(e):null}},{key:"modifyInvitation",value:function(e){var t=this._get(33);return t?t.modifyInvitation(e):Sn({code:qn.NO_MODULE})}}]),ya={login:1,logout:1,getLoginUser:1,destroy:1,on:1,off:1,ready:1,setLogLevel:1,joinGroup:1,quitGroup:1,registerPlugin:1,getGroupOnlineMemberCount:1,isReady:1,addSignalingListener:1,removeSignalingListener:1,callExperimentalAPI:1};function Ia(e){return o(this,Ia),(e=n(this,Ia,[e]))._n="CSModule",e}var Ma={};return(Nn={}).create=function(e){var t,n,o,i="TencentCloudChat.create",s=0;if(Ke(o=e.SDKAppID))s=o;else if(s=parseInt(o),isNaN(o))return Oe.e("".concat(i," failed. Failed to parse the SDKAppID, please check the arguments")),null;return s&&Ma[s]?Ma[s]:(Oe.l("".concat(i)),(o=new va(g(g({},e),{},{SDKAppID:s}))).on(T.SDK_DESTROY,(function(e){Ma[e.data.SDKAppID]=null,delete Ma[e.data.SDKAppID]})),t=o,n=Object.create(null),Object.keys(Fn).forEach((function(e){var o;t[e]&&(o=new k,n[e]=function(){var n=Array.from(arguments);return o.use((function(n,o){r=e;var i,s,r=!(!(i=t).isReady()&&1!==ya[r])||(s={code:s=i.getNotReadyReason(),message:"".concat(i.getErrMsg(s)," | ").concat(r," | ").concat(i.getErrMsg(qn.SDK_IS_NOT_READY))},i.onError(s),s);return!0===r?o():Sn(r)})).use((function(t,n){if(!0===function(e,t,n){if(void 0===t)return!0;var o=!0;if(ze(t))Object.keys(t).forEach((function(i){var s=1===e.length?e[0][i]:void 0;o=!!Yt(s,t[i],n,i)&&o}));else if(Ye(t))for(var i=0;i<t.length;i++)o=!!Yt(e[i],t[i],n,t[i].name)&&o;if(o)return o;throw new Error("Params validate failed.")}(t,wn[e],e))return n()})).use((function(n,o){return t[e].apply(t,n)})),o.run(n)})})),e=n,Ma[s]=e,wn.hookGetAPITips(o.getErrMsg.bind(o)),Oe.l("".concat(i," ok")),e)},Nn.TYPES=S,Nn.EVENT=T,Nn.TSignaling=E,Nn.VERSION="3.5.5",Oe.l("TencentCloudChat.VERSION:".concat(Nn.VERSION)),Nn}();const Nu=bu(Pu.exports);var xu={exports:{}};xu.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){r(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(null==e)return{};var n,o,i=function(e,t){if(null==e)return{};var n,o,i={},s=Object.keys(e);for(o=0;o<s.length;o++)n=s[o],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)n=s[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=void 0!==Au?Au:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},u=void 0!==Un&&"function"==typeof Un.getSystemInfoSync&&Boolean(Un.getSystemInfoSync().fontSizeSetting),l="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),p="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),d="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),h="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),g=void 0!==Gn&&"undefined"==typeof window&&"function"==typeof Gn.requireNativePlugin,f=g&&"ios"===Gn.getDeviceInfo().platform.toLocaleLowerCase(),m=(g&&Gn.getDeviceInfo().platform.toLocaleLowerCase(),u||l||p||d||h||g),_=void 0!==c&&(void 0!==c.nativeModuleProxy||void 0!==c.ReactNative),v=l?qq:p?tt:d?swan:h?my:u?Un:g?Gn:{},y=function(e){if("object"!==n(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var o=t;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return t===o};function I(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(y(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}var M=function(){function e(){o(this,e),this._n="WebRequest"}return s(e,[{key:"request",value:function(e,n){var o=this,i="".concat(this._n,".request"),s=e.downloadUrl||"",r=(e.method||"PUT").toUpperCase(),a=e.url;if(console.log("%c tim-upload-plugin %c","background:#0abf5b; padding:1px; border-radius:3px; color: #fff","background:transparent","".concat(i," URL:").concat(a)),e.qs){var c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=";return I(e)?"":y(e)?Object.keys(e).map((function(o){var i=encodeURIComponent(o)+n;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(e)})).join(t):i+encodeURIComponent(e[o])})).filter(Boolean).join(t):void 0}(e.qs);c&&(a+="".concat(-1===a.indexOf("?")?"?":"&").concat(c))}var u=new XMLHttpRequest;u.open(r,a,!0),u.responseType=e.dataType||"text";var l=e.headers||{};if(e.uploadByIP&&(l=t(t({},l),{},{host:e.uploadIP})),!I(l))for(var p in l)l.hasOwnProperty(p)&&"content-length"!==p.toLowerCase()&&"user-agent"!==p.toLowerCase()&&"origin"!==p.toLowerCase()&&"host"!==p.toLowerCase()&&u.setRequestHeader(p,l[p]);return u.onload=function(){if(200===u.status)n(null,o._xhrRes(u,o._xhrBody(u,s,e.uploadByIP&&e.uploadIP),l));else{if(e.uploadIP&&-1===e.url.indexOf(e.uploadIP))return e.url=(i=e.url,r=e.uploadIP,i.replace(/^http(s)?:\/\/(.*?)\//,"https://".concat(r,"/"))),e.uploadByIP=!0,o.request(e,n);var t={code:u.status,message:JSON.stringify(u.responseText)};n(t,o._xhrRes(u,o._xhrBody(u,s,e.uploadByIP&&e.uploadIP),l))}var i,r},u.onerror=function(t){var i=o._xhrBody(u,s,e.uploadByIP&&e.uploadIP),r={code:u.status,message:JSON.stringify(u.responseText)};i||u.statusText||0!==u.status||(t.message="CORS blocked or network error"),n(r,o._xhrRes(u,i)),r=null},e.onProgress&&u.upload&&(u.upload.onprogress=function(t){var n=t.total,o=t.loaded,i=Math.floor(100*o/n);e.onProgress({total:n,loaded:o,percent:(i>=100?100:i)/100})}),u.send(e.resources),u}},{key:"_xhrRes",value:function(e,t){var n={};return e.getAllResponseHeaders().trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),o=e.substr(0,t).trim().toLowerCase(),i=e.substr(t+1).trim();n[o]=i}})),{statusCode:e.status,statusMessage:e.statusText,headers:n,data:t}}},{key:"_xhrBody",value:function(e,t,n){return 200===e.status&&t?{location:t,uploadIP:n}:{response:e.responseText,uploadIP:n}}}]),e}(),C=["unknown","image","video","audio","log"],T=["name"],S=function(){function e(){o(this,e)}return s(e,[{key:"request",value:function(e,n){var o=this,i=e.resources,s=void 0===i?"":i,r=e.headers,c=void 0===r?{}:r,u=e.url,l=e.downloadUrl,p=void 0===l?"":l,d=u,g=null,m=p.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/),_=decodeURIComponent(m[3]),y=_.indexOf("?")>-1?_.split("?")[0]:_,I={key:e.fileKey?e.fileKey:y,success_action_status:200,"Content-Type":""},M={};if(f){var S=u.split("?sign=");if(S.length>1){var E=S[1];d="".concat(S[0],"?sign=").concat(encodeURIComponent("".concat(E))),M.sign=decodeURIComponent(E),M.signature=decodeURIComponent(E)}}var k={url:d,header:c,name:"file",filePath:s,formData:t(t({},I),M),timeout:e.timeout||3e5};if(h){var D=k;D.name,k=t(t({},a(D,T)),{},{fileName:"file",fileType:C[e.fileType]})}return(g=v.uploadFile(t(t({},k),{},{success:function(e){o._handleResponse({response:e,downloadUrl:p,callback:n})},fail:function(e){o._handleResponse({response:e,downloadUrl:p,callback:n})}}))).onProgressUpdate&&g.onProgressUpdate((function(t){e.onProgress&&e.onProgress({total:t.totalBytesExpectedToSend,loaded:t.totalBytesSent,percent:Math.floor(t.progress)/100})})),g}},{key:"_handleResponse",value:function(e){var n=e.downloadUrl,o=e.response,i=e.callback,s=o.header,r={};if(s)for(var a in s)s.hasOwnProperty(a)&&(r[a.toLowerCase()]=s[a]);var c=+o.statusCode;200===c?i(null,{statusCode:c,headers:r,data:t(t({},o.data),{},{location:n})}):i({code:c,message:JSON.stringify(o.data)},{statusCode:c,headers:r,data:void 0})}}]),e}(),E=function(){function e(){o(this,e)}return s(e,[{key:"request",value:function(e,t){var n=this,o=e.resources,i=void 0===o?"":o,s=e.fileKey,r=void 0===s?"":s,a=e.url,c=e.downloadUrl,u=void 0===c?"":c,l=new FormData;l.append("key",r),l.append("success_action_status",200),l.append("file",{uri:i,type:"application/octet-stream",name:"uploaded_file"}),fetch(a,{method:"POST",headers:{"Content-Type":"multipart/form-data"},body:l}).then((function(e){n._handleResponse({response:e,downloadUrl:u,callback:t})})).catch((function(e){n._handleResponse({response:e,downloadUrl:u,callback:t})}))}},{key:"_handleResponse",value:function(e){var t=e.downloadUrl,n=e.response,o=e.callback,i=n.headers,s=n.status,r=i&&i.map||{};200===s?o(null,{statusCode:200,headers:r,data:{location:t}}):o({code:s,message:JSON.stringify(n)},{statusCode:s,headers:r,data:void 0})}}]),e}();return function(){function e(){o(this,e),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=m?new S:_?new E:new M,console.log("TIMUploadPlugin.VERSION: ".concat("1.4.2"))}return s(e,[{key:"uploadFile",value:function(e,t){var n=this;return this.httpRequest.request(e,(function(o,i){o&&n.tryCount<n.retry&&n.allowRetry(o)?(n.tryCount++,n.uploadFile(e,t)):(n.tryCount=0,t(o,i))}))}},{key:"allowRetry",value:function(e){var t=!1,n=!1;if(e){var o=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var i=e.error&&e.error.Code,s=e.error&&e.error.Message;("RequestTimeTooSkewed"===i||"AccessDenied"===i&&"Request has expired"===s)&&(n=!0)}catch(c){}if(n&&o){var r=Date.now(),a=Date.parse(o);Math.abs(r+this.systemClockOffset-a)>=3e4&&(this.systemClockOffset=a-r,t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0)}return t}}],[{key:"getVersion",value:function(){return"1.4.2"}}]),e}()}();const wu=bu(xu.exports);var Uu={exports:{}};Uu.exports=function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(i=void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o.key,"string"))?i:String(i)),o)}var i}function n(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,s,r,a=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=s.call(n)).done)&&(a.push(o.value),a.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(u)throw i}}return a}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=s(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw r}}}}var c,u,l=function(){for(var e=" \t\r\n~!@#$%^&*()_+-=【】、{}|;':\",。、《》?αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠=≤≥<>≮≯∷±+-×÷/∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°#&@\︿_ ̄―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄",t=new Map,n=0,o=e.length;n<o;n++)t.set(e.charCodeAt(0),!0);return t}(),p=function(){function t(n){e(this,t);var o,s=n.input,r=n.isArray,a=n.isMap;this._trieTree={},r(s)?o=s:a(s)&&(o=i(s.keys()),this._map=s);for(var c=0,u=o.length;c<u;c++)if(o[c]){for(var l=this._trieTree,p=o[c],d=0,h=p.length;d<h;d++)l[p[d]]||(l[p[d]]={}),l=l[p[d]];l.isEnd=!0}}return n(t,[{key:"filter",value:function(e){var t=e.text,n=e.replacingEnabled;if(0===Object.keys(this._trieTree).length)return{isMatched:!1,modifiedText:t};for(var o=this._trieTree,i=t.toLowerCase(),s="",r=!1,a=i.length,c=0;c<a;c++)if(!0!==l.get(i.charCodeAt(c))){for(var u=0,p="",d=!1,h=c;h<a;h++){if(!o[i[h]]){o=this._trieTree;break}if(p+=i[h],o[i[h]].isEnd){d=!0,u=h-c,o=this._trieTree;break}o=o[i[h]]}if(u>1&&(c+=u),d){if(r=!0,!n)break;var g=this._map.get(p)||"*";s=t.replace(new RegExp(p,"gi"),g)}}return{isMatched:r,modifiedText:s}}},{key:"reset",value:function(){this._trieTree={},this._map=null}}]),t}(),d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Au?Au:"undefined"!=typeof self?self:{},h={},g=(c=function(e,t){var n,o,i,s,r,a,c,u,l,p,g,f,m;e.exports=(a=a||function(e){var t;if("undefined"!=typeof window&&window.crypto&&(t=window.crypto),!t&&"undefined"!=typeof window&&window.msCrypto&&(t=window.msCrypto),!t&&void 0!==d&&d.crypto&&(t=d.crypto),!t)try{t=h}catch(m){}var n=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(m){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(m){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},s=i.lib={},r=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=s.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,o=this.sigBytes,i=e.sigBytes;if(this.clamp(),o%4)for(var s=0;s<i;s++){var r=n[s>>>2]>>>24-s%4*8&255;t[o+s>>>2]|=r<<24-(o+s)%4*8}else for(s=0;s<i;s+=4)t[o+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=r.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],o=0;o<e;o+=4)t.push(n());return new a.init(t,e)}}),c=i.enc={},u=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],i=0;i<n;i++){var s=t[i>>>2]>>>24-i%4*8&255;o.push((s>>>4).toString(16)),o.push((15&s).toString(16))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o+=2)n[o>>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new a.init(n,t/2)}},l=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],i=0;i<n;i++){var s=t[i>>>2]>>>24-i%4*8&255;o.push(String.fromCharCode(s))}return o.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o++)n[o>>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new a.init(n,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},g=s.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,o=this._data,i=o.words,s=o.sigBytes,r=this.blockSize,c=s/(4*r),u=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*r,l=e.min(4*u,s);if(u){for(var p=0;p<u;p+=r)this._doProcessBlock(i,p);n=i.splice(0,u),o.sigBytes-=l}return new a.init(n,l)},clone:function(){var e=r.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(s.Hasher=g.extend({cfg:r.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new f.HMAC.init(e,n).finalize(t)}}}),i.algo={});return i}(Math),r=(s=a).lib.WordArray,s.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,o=this._map;e.clamp();for(var i=[],s=0;s<n;s+=3)for(var r=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<n;a++)i.push(o.charAt(r>>>6*(3-a)&63));var c=o.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<n.length;i++)o[n.charCodeAt(i)]=i}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return function(e,t,n){for(var o=[],i=0,s=0;s<t;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;o[i>>>2]|=a<<24-i%4*8,i++}return r.create(o,i)}(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(e){var t=a,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,r=[];!function(){for(var t=0;t<64;t++)r[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var o=t+n,i=e[o];e[o]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var s=this._hash.words,a=e[t+0],c=e[t+1],h=e[t+2],g=e[t+3],f=e[t+4],m=e[t+5],_=e[t+6],v=e[t+7],y=e[t+8],I=e[t+9],M=e[t+10],C=e[t+11],T=e[t+12],S=e[t+13],E=e[t+14],k=e[t+15],D=s[0],L=s[1],R=s[2],O=s[3];D=u(D,L,R,O,a,7,r[0]),O=u(O,D,L,R,c,12,r[1]),R=u(R,O,D,L,h,17,r[2]),L=u(L,R,O,D,g,22,r[3]),D=u(D,L,R,O,f,7,r[4]),O=u(O,D,L,R,m,12,r[5]),R=u(R,O,D,L,_,17,r[6]),L=u(L,R,O,D,v,22,r[7]),D=u(D,L,R,O,y,7,r[8]),O=u(O,D,L,R,I,12,r[9]),R=u(R,O,D,L,M,17,r[10]),L=u(L,R,O,D,C,22,r[11]),D=u(D,L,R,O,T,7,r[12]),O=u(O,D,L,R,S,12,r[13]),R=u(R,O,D,L,E,17,r[14]),D=l(D,L=u(L,R,O,D,k,22,r[15]),R,O,c,5,r[16]),O=l(O,D,L,R,_,9,r[17]),R=l(R,O,D,L,C,14,r[18]),L=l(L,R,O,D,a,20,r[19]),D=l(D,L,R,O,m,5,r[20]),O=l(O,D,L,R,M,9,r[21]),R=l(R,O,D,L,k,14,r[22]),L=l(L,R,O,D,f,20,r[23]),D=l(D,L,R,O,I,5,r[24]),O=l(O,D,L,R,E,9,r[25]),R=l(R,O,D,L,g,14,r[26]),L=l(L,R,O,D,y,20,r[27]),D=l(D,L,R,O,S,5,r[28]),O=l(O,D,L,R,h,9,r[29]),R=l(R,O,D,L,v,14,r[30]),D=p(D,L=l(L,R,O,D,T,20,r[31]),R,O,m,4,r[32]),O=p(O,D,L,R,y,11,r[33]),R=p(R,O,D,L,C,16,r[34]),L=p(L,R,O,D,E,23,r[35]),D=p(D,L,R,O,c,4,r[36]),O=p(O,D,L,R,f,11,r[37]),R=p(R,O,D,L,v,16,r[38]),L=p(L,R,O,D,M,23,r[39]),D=p(D,L,R,O,S,4,r[40]),O=p(O,D,L,R,a,11,r[41]),R=p(R,O,D,L,g,16,r[42]),L=p(L,R,O,D,_,23,r[43]),D=p(D,L,R,O,I,4,r[44]),O=p(O,D,L,R,T,11,r[45]),R=p(R,O,D,L,k,16,r[46]),D=d(D,L=p(L,R,O,D,h,23,r[47]),R,O,a,6,r[48]),O=d(O,D,L,R,v,10,r[49]),R=d(R,O,D,L,E,15,r[50]),L=d(L,R,O,D,m,21,r[51]),D=d(D,L,R,O,T,6,r[52]),O=d(O,D,L,R,g,10,r[53]),R=d(R,O,D,L,M,15,r[54]),L=d(L,R,O,D,c,21,r[55]),D=d(D,L,R,O,y,6,r[56]),O=d(O,D,L,R,k,10,r[57]),R=d(R,O,D,L,_,15,r[58]),L=d(L,R,O,D,S,21,r[59]),D=d(D,L,R,O,f,6,r[60]),O=d(O,D,L,R,C,10,r[61]),R=d(R,O,D,L,h,15,r[62]),L=d(L,R,O,D,I,21,r[63]),s[0]=s[0]+D|0,s[1]=s[1]+L|0,s[2]=s[2]+R|0,s[3]=s[3]+O|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var s=e.floor(o/4294967296),r=o;n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,o,i,s,r){var a=e+(t&n|~t&o)+i+r;return(a<<s|a>>>32-s)+t}function l(e,t,n,o,i,s,r){var a=e+(t&o|n&~o)+i+r;return(a<<s|a>>>32-s)+t}function p(e,t,n,o,i,s,r){var a=e+(t^n^o)+i+r;return(a<<s|a>>>32-s)+t}function d(e,t,n,o,i,s,r){var a=e+(n^(t|~o))+i+r;return(a<<s|a>>>32-s)+t}t.MD5=i._createHelper(c),t.HmacMD5=i._createHmacHelper(c)}(Math),u=(c=a).lib,l=u.WordArray,p=u.Hasher,g=c.algo,f=[],m=g.SHA1=p.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,o=n[0],i=n[1],s=n[2],r=n[3],a=n[4],c=0;c<80;c++){if(c<16)f[c]=0|e[t+c];else{var u=f[c-3]^f[c-8]^f[c-14]^f[c-16];f[c]=u<<1|u>>>31}var l=(o<<5|o>>>27)+a+f[c];l+=c<20?1518500249+(i&s|~i&r):c<40?1859775393+(i^s^r):c<60?(i&s|i&r|s&r)-1894007588:(i^s^r)-899497514,a=r,r=s,s=i<<30|i>>>2,i=o,o=l}n[0]=n[0]+o|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+r|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(o+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=p.clone.call(this);return e._hash=this._hash.clone(),e}}),c.SHA1=p._createHelper(m),c.HmacSHA1=p._createHmacHelper(m),function(e){var t=a,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,r=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),o=2;o<=n;o++)if(!(t%o))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var o=2,i=0;i<64;)t(o)&&(i<8&&(r[i]=n(e.pow(o,.5))),c[i]=n(e.pow(o,1/3)),i++),o++}();var u=[],l=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(r.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,o=n[0],i=n[1],s=n[2],r=n[3],a=n[4],l=n[5],p=n[6],d=n[7],h=0;h<64;h++){if(h<16)u[h]=0|e[t+h];else{var g=u[h-15],f=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,m=u[h-2],_=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[h]=f+u[h-7]+_+u[h-16]}var v=o&i^o&s^i&s,y=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),I=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&p)+c[h]+u[h];d=p,p=l,l=a,a=r+I|0,r=s,s=i,i=o,o=I+(y+v)|0}n[0]=n[0]+o|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+r|0,n[4]=n[4]+a|0,n[5]=n[5]+l|0,n[6]=n[6]+p|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(o/4294967296),n[15+(i+64>>>9<<4)]=o,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),function(){var e=a,t=e.lib.WordArray,n=e.enc;function o(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,o=[],i=0;i<n;i+=2){var s=t[i>>>2]>>>16-i%4*8&65535;o.push(String.fromCharCode(s))}return o.join("")},parse:function(e){for(var n=e.length,o=[],i=0;i<n;i++)o[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(o,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],s=0;s<n;s+=2){var r=o(t[s>>>2]>>>16-s%4*8&65535);i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var n=e.length,i=[],s=0;s<n;s++)i[s>>>1]|=o(e.charCodeAt(s)<<16-s%2*16);return t.create(i,2*n)}}}(),function(){if("function"==typeof ArrayBuffer){var e=a.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var n=e.byteLength,o=[],i=0;i<n;i++)o[i>>>2]|=e[i]<<24-i%4*8;t.call(this,o,n)}else t.apply(this,arguments)}).prototype=e}}(),
/** @preserve
(c) 2012 by C<><43>dric Mesnil. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function(){var e=a,t=e.lib,n=t.WordArray,o=t.Hasher,i=e.algo,s=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),r=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=n.create([0,1518500249,1859775393,2400959708,2840853838]),p=n.create([1352829926,1548603684,1836072691,2053994217,0]),d=i.RIPEMD160=o.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var o=t+n,i=e[o];e[o]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a,d,y,I,M,C,T,S,E,k,D,L=this._hash.words,R=l.words,O=p.words,A=s.words,b=r.words,P=c.words,N=u.words;for(C=a=L[0],T=d=L[1],S=y=L[2],E=I=L[3],k=M=L[4],n=0;n<80;n+=1)D=a+e[t+A[n]]|0,D+=n<16?h(d,y,I)+R[0]:n<32?g(d,y,I)+R[1]:n<48?f(d,y,I)+R[2]:n<64?m(d,y,I)+R[3]:_(d,y,I)+R[4],D=(D=v(D|=0,P[n]))+M|0,a=M,M=I,I=v(y,10),y=d,d=D,D=C+e[t+b[n]]|0,D+=n<16?_(T,S,E)+O[0]:n<32?m(T,S,E)+O[1]:n<48?f(T,S,E)+O[2]:n<64?g(T,S,E)+O[3]:h(T,S,E)+O[4],D=(D=v(D|=0,N[n]))+k|0,C=k,k=E,E=v(S,10),S=T,T=D;D=L[1]+y+E|0,L[1]=L[2]+I+k|0,L[2]=L[3]+M+C|0,L[3]=L[4]+a+T|0,L[4]=L[0]+d+S|0,L[0]=D},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,s=i.words,r=0;r<5;r++){var a=s[r];s[r]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function h(e,t,n){return e^t^n}function g(e,t,n){return e&t|~e&n}function f(e,t,n){return(e|~t)^n}function m(e,t,n){return e&n|t&~n}function _(e,t,n){return e^(t|~n)}function v(e,t){return e<<t|e>>>32-t}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(),function(){var e=a,t=e.lib.Base,n=e.enc.Utf8;e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var o=e.blockSize,i=4*o;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),r=this._iKey=t.clone(),a=s.words,c=r.words,u=0;u<o;u++)a[u]^=1549556828,c[u]^=909522486;s.sigBytes=r.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}(),function(){var e=a,t=e.lib,n=t.Base,o=t.WordArray,i=e.algo,s=i.SHA1,r=i.HMAC,c=i.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,i=r.create(n.hasher,e),s=o.create(),a=o.create([1]),c=s.words,u=a.words,l=n.keySize,p=n.iterations;c.length<l;){var d=i.update(t).finalize(a);i.reset();for(var h=d.words,g=h.length,f=d,m=1;m<p;m++){f=i.finalize(f),i.reset();for(var _=f.words,v=0;v<g;v++)h[v]^=_[v]}s.concat(d),u[0]++}return s.sigBytes=4*l,s}});e.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)}}(),function(){var e=a,t=e.lib,n=t.Base,o=t.WordArray,i=e.algo,s=i.MD5,r=i.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,i=this.cfg,s=i.hasher.create(),r=o.create(),a=r.words,c=i.keySize,u=i.iterations;a.length<c;){n&&s.update(n),n=s.update(e).finalize(t),s.reset();for(var l=1;l<u;l++)n=s.finalize(n),s.reset();r.concat(n)}return r.sigBytes=4*c,r}});e.EvpKDF=function(e,t,n){return r.create(n).compute(e,t)}}(),function(){var e=a,t=e.lib.WordArray,n=e.algo,o=n.SHA256,i=n.SHA224=o.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=o._createHelper(i),e.HmacSHA224=o._createHmacHelper(i)}(),function(){var e=a,t=e.lib,n=t.Base,o=t.WordArray,i=e.x64={};i.Word=n.extend({init:function(e,t){this.high=e,this.low=t}}),i.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],i=0;i<t;i++){var s=e[i];n.push(s.high),n.push(s.low)}return o.create(n,this.sigBytes)},clone:function(){for(var e=n.clone.call(this),t=e.words=this.words.slice(0),o=t.length,i=0;i<o;i++)t[i]=t[i].clone();return e}})}(),function(e){var t=a,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.x64.Word,r=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var o=(2*e+3*t)%5;e=t%5,t=o}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,r=0;r<24;r++){for(var a=0,p=0,d=0;d<7;d++){if(1&i){var h=(1<<d)-1;h<32?p^=1<<h:a^=1<<h-32}128&i?i=i<<1^113:i<<=1}l[r]=s.create(a,p)}}();var p=[];!function(){for(var e=0;e<25;e++)p[e]=s.create()}();var d=r.SHA3=i.extend({cfg:i.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new s.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,o=this.blockSize/2,i=0;i<o;i++){var s=e[t+2*i],r=e[t+2*i+1];s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),(L=n[i]).high^=r,L.low^=s}for(var a=0;a<24;a++){for(var d=0;d<5;d++){for(var h=0,g=0,f=0;f<5;f++)h^=(L=n[d+5*f]).high,g^=L.low;var m=p[d];m.high=h,m.low=g}for(d=0;d<5;d++){var _=p[(d+4)%5],v=p[(d+1)%5],y=v.high,I=v.low;for(h=_.high^(y<<1|I>>>31),g=_.low^(I<<1|y>>>31),f=0;f<5;f++)(L=n[d+5*f]).high^=h,L.low^=g}for(var M=1;M<25;M++){var C=(L=n[M]).high,T=L.low,S=c[M];S<32?(h=C<<S|T>>>32-S,g=T<<S|C>>>32-S):(h=T<<S-32|C>>>64-S,g=C<<S-32|T>>>64-S);var E=p[u[M]];E.high=h,E.low=g}var k=p[0],D=n[0];for(k.high=D.high,k.low=D.low,d=0;d<5;d++)for(f=0;f<5;f++){var L=n[M=d+5*f],R=p[M],O=p[(d+1)%5+5*f],A=p[(d+2)%5+5*f];L.high=R.high^~O.high&A.high,L.low=R.low^~O.low&A.low}L=n[0];var b=l[a];L.high^=b.high,L.low^=b.low}},_doFinalize:function(){var t=this._data,n=t.words,i=(this._nDataBytes,8*t.sigBytes),s=32*this.blockSize;n[i>>>5]|=1<<24-i%32,n[(e.ceil((i+1)/s)*s>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var r=this._state,a=this.cfg.outputLength/8,c=a/8,u=[],l=0;l<c;l++){var p=r[l],d=p.high,h=p.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),u.push(h),u.push(d)}return new o.init(u,a)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=i._createHelper(d),t.HmacSHA3=i._createHmacHelper(d)}(Math),function(){var e=a,t=e.lib.Hasher,n=e.x64,o=n.Word,i=n.WordArray,s=e.algo;function r(){return o.create.apply(o,arguments)}var c=[r(1116352408,3609767458),r(1899447441,602891725),r(3049323471,3964484399),r(3921009573,2173295548),r(961987163,4081628472),r(1508970993,3053834265),r(2453635748,2937671579),r(2870763221,3664609560),r(3624381080,2734883394),r(310598401,1164996542),r(607225278,1323610764),r(1426881987,3590304994),r(1925078388,4068182383),r(2162078206,991336113),r(2614888103,633803317),r(3248222580,3479774868),r(3835390401,2666613458),r(4022224774,944711139),r(264347078,2341262773),r(604807628,2007800933),r(770255983,1495990901),r(1249150122,1856431235),r(1555081692,3175218132),r(1996064986,2198950837),r(2554220882,3999719339),r(2821834349,766784016),r(2952996808,2566594879),r(3210313671,3203337956),r(3336571891,1034457026),r(3584528711,2466948901),r(113926993,3758326383),r(338241895,168717936),r(666307205,1188179964),r(773529912,1546045734),r(1294757372,1522805485),r(1396182291,2643833823),r(1695183700,2343527390),r(1986661051,1014477480),r(2177026350,1206759142),r(2456956037,344077627),r(2730485921,1290863460),r(2820302411,3158454273),r(3259730800,3505952657),r(3345764771,106217008),r(3516065817,3606008344),r(3600352804,1432725776),r(4094571909,1467031594),r(275423344,851169720),r(430227734,3100823752),r(506948616,1363258195),r(659060556,3750685593),r(883997877,3785050280),r(958139571,3318307427),r(1322822218,3812723403),r(1537002063,2003034995),r(1747873779,3602036899),r(1955562222,1575990012),r(2024104815,1125592928),r(2227730452,2716904306),r(2361852424,442776044),r(2428436474,593698344),r(2756734187,3733110249),r(3204031479,2999351573),r(3329325298,3815920427),r(3391569614,3928383900),r(3515267271,566280711),r(3940187606,3454069534),r(4118630271,4000239992),r(116418474,1914138554),r(174292421,2731055270),r(289380356,3203993006),r(460393269,320620315),r(685471733,587496836),r(852142971,1086792851),r(1017036298,365543100),r(1126000580,2618297676),r(1288033470,3409855158),r(1501505948,4234509866),r(1607167915,987167468),r(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=r()}();var l=s.SHA512=t.extend({_doReset:function(){this._hash=new i.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,o=n[0],i=n[1],s=n[2],r=n[3],a=n[4],l=n[5],p=n[6],d=n[7],h=o.high,g=o.low,f=i.high,m=i.low,_=s.high,v=s.low,y=r.high,I=r.low,M=a.high,C=a.low,T=l.high,S=l.low,E=p.high,k=p.low,D=d.high,L=d.low,R=h,O=g,A=f,b=m,P=_,N=v,x=y,w=I,U=M,G=C,F=T,B=S,q=E,V=k,j=D,H=L,K=0;K<80;K++){var $,z,Y=u[K];if(K<16)z=Y.high=0|e[t+2*K],$=Y.low=0|e[t+2*K+1];else{var W=u[K-15],J=W.high,X=W.low,Z=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),ee=u[K-2],te=ee.high,ne=ee.low,oe=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),se=u[K-7],re=se.high,ae=se.low,ce=u[K-16],ue=ce.high,le=ce.low;z=(z=(z=Z+re+(($=Q+ae)>>>0<Q>>>0?1:0))+oe+(($+=ie)>>>0<ie>>>0?1:0))+ue+(($+=le)>>>0<le>>>0?1:0),Y.high=z,Y.low=$}var pe,de=U&F^~U&q,he=G&B^~G&V,ge=R&A^R&P^A&P,fe=O&b^O&N^b&N,me=(R>>>28|O<<4)^(R<<30|O>>>2)^(R<<25|O>>>7),_e=(O>>>28|R<<4)^(O<<30|R>>>2)^(O<<25|R>>>7),ve=(U>>>14|G<<18)^(U>>>18|G<<14)^(U<<23|G>>>9),ye=(G>>>14|U<<18)^(G>>>18|U<<14)^(G<<23|U>>>9),Ie=c[K],Me=Ie.high,Ce=Ie.low,Te=j+ve+((pe=H+ye)>>>0<H>>>0?1:0),Se=_e+fe;j=q,H=V,q=F,V=B,F=U,B=G,U=x+(Te=(Te=(Te=Te+de+((pe+=he)>>>0<he>>>0?1:0))+Me+((pe+=Ce)>>>0<Ce>>>0?1:0))+z+((pe+=$)>>>0<$>>>0?1:0))+((G=w+pe|0)>>>0<w>>>0?1:0)|0,x=P,w=N,P=A,N=b,A=R,b=O,R=Te+(me+ge+(Se>>>0<_e>>>0?1:0))+((O=pe+Se|0)>>>0<pe>>>0?1:0)|0}g=o.low=g+O,o.high=h+R+(g>>>0<O>>>0?1:0),m=i.low=m+b,i.high=f+A+(m>>>0<b>>>0?1:0),v=s.low=v+N,s.high=_+P+(v>>>0<N>>>0?1:0),I=r.low=I+w,r.high=y+x+(I>>>0<w>>>0?1:0),C=a.low=C+G,a.high=M+U+(C>>>0<G>>>0?1:0),S=l.low=S+B,l.high=T+F+(S>>>0<B>>>0?1:0),k=p.low=k+V,p.high=E+q+(k>>>0<V>>>0?1:0),L=d.low=L+H,d.high=D+j+(L>>>0<H>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[30+(o+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(o+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),function(){var e=a,t=e.x64,n=t.Word,o=t.WordArray,i=e.algo,s=i.SHA512,r=i.SHA384=s.extend({_doReset:function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=s._createHelper(r),e.HmacSHA384=s._createHmacHelper(r)}(),a.lib.Cipher||function(){var e=a,t=e.lib,n=t.Base,o=t.WordArray,i=t.BufferedBlockAlgorithm,s=e.enc,r=(s.Utf8,s.Base64),c=e.algo.EvpKDF,u=t.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:m}return function(t){return{encrypt:function(n,o,i){return e(o).encrypt(t,n,o,i)},decrypt:function(n,o,i){return e(o).decrypt(t,n,o,i)}}}}()}),l=(t.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),p=t.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=l.CBC=function(){var e=p.extend();function t(e,t,n){var o,i=this._iv;i?(o=i,this._iv=void 0):o=this._prevBlock;for(var s=0;s<n;s++)e[t+s]^=o[s]}return e.Encryptor=e.extend({processBlock:function(e,n){var o=this._cipher,i=o.blockSize;t.call(this,e,n,i),o.encryptBlock(e,n),this._prevBlock=e.slice(n,n+i)}}),e.Decryptor=e.extend({processBlock:function(e,n){var o=this._cipher,i=o.blockSize,s=e.slice(n,n+i);o.decryptBlock(e,n),t.call(this,e,n,i),this._prevBlock=s}}),e}(),h=(e.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,i=n-e.sigBytes%n,s=i<<24|i<<16|i<<8|i,r=[],a=0;a<i;a+=4)r.push(s);var c=o.create(r,i);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},g=(t.BlockCipher=u.extend({cfg:u.cfg.extend({mode:d,padding:h}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,o=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=o.createEncryptor:(e=o.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(o,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),t.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),f=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(t):t).toString(r)},parse:function(e){var t,n=r.parse(e),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=o.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},m=t.SerializableCipher=n.extend({cfg:n.extend({format:f}),encrypt:function(e,t,n,o){o=this.cfg.extend(o);var i=e.createEncryptor(n,o),s=i.finalize(t),r=i.cfg;return g.create({ciphertext:s,key:n,iv:r.iv,algorithm:e,mode:r.mode,padding:r.padding,blockSize:e.blockSize,formatter:o.format})},decrypt:function(e,t,n,o){return o=this.cfg.extend(o),t=this._parse(t,o.format),e.createDecryptor(n,o).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),_=(e.kdf={}).OpenSSL={execute:function(e,t,n,i){i||(i=o.random(8));var s=c.create({keySize:t+n}).compute(e,i),r=o.create(s.words.slice(t),4*n);return s.sigBytes=4*t,g.create({key:s,iv:r,salt:i})}},v=t.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:_}),encrypt:function(e,t,n,o){var i=(o=this.cfg.extend(o)).kdf.execute(n,e.keySize,e.ivSize);o.iv=i.iv;var s=m.encrypt.call(this,e,t,i.key,o);return s.mixIn(i),s},decrypt:function(e,t,n,o){o=this.cfg.extend(o),t=this._parse(t,o.format);var i=o.kdf.execute(n,e.keySize,e.ivSize,t.salt);return o.iv=i.iv,m.decrypt.call(this,e,t,i.key,o)}})}(),a.mode.CFB=function(){var e=a.lib.BlockCipherMode.extend();function t(e,t,n,o){var i,s=this._iv;s?(i=s.slice(0),this._iv=void 0):i=this._prevBlock,o.encryptBlock(i,0);for(var r=0;r<n;r++)e[t+r]^=i[r]}return e.Encryptor=e.extend({processBlock:function(e,n){var o=this._cipher,i=o.blockSize;t.call(this,e,n,i,o),this._prevBlock=e.slice(n,n+i)}}),e.Decryptor=e.extend({processBlock:function(e,n){var o=this._cipher,i=o.blockSize,s=e.slice(n,n+i);t.call(this,e,n,i,o),this._prevBlock=s}}),e}(),a.mode.ECB=((i=a.lib.BlockCipherMode.extend()).Encryptor=i.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),i.Decryptor=i.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),i),a.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,o=4*t,i=o-n%o,s=n+i-1;e.clamp(),e.words[s>>>2]|=i<<24-s%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},a.pad.Iso10126={pad:function(e,t){var n=4*t,o=n-e.sigBytes%n;e.concat(a.lib.WordArray.random(o-1)).concat(a.lib.WordArray.create([o<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},a.pad.Iso97971={pad:function(e,t){e.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(e,t)},unpad:function(e){a.pad.ZeroPadding.unpad(e),e.sigBytes--}},a.mode.OFB=(o=(n=a.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,o=n.blockSize,i=this._iv,s=this._keystream;i&&(s=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(s,0);for(var r=0;r<o;r++)e[t+r]^=s[r]}}),n.Decryptor=o,n),a.pad.NoPadding={pad:function(){},unpad:function(){}},function(){var e=a,t=e.lib.CipherParams,n=e.enc.Hex;e.format.Hex={stringify:function(e){return e.ciphertext.toString(n)},parse:function(e){var o=n.parse(e);return t.create({ciphertext:o})}}}(),function(){var e=a,t=e.lib.BlockCipher,n=e.algo,o=[],i=[],s=[],r=[],c=[],u=[],l=[],p=[],d=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,a=0;for(t=0;t<256;t++){var g=a^a<<1^a<<2^a<<3^a<<4;g=g>>>8^255&g^99,o[n]=g,i[g]=n;var f=e[n],m=e[f],_=e[m],v=257*e[g]^16843008*g;s[n]=v<<24|v>>>8,r[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,u[n]=v,v=16843009*_^65537*m^257*f^16843008*n,l[g]=v<<24|v>>>8,p[g]=v<<16|v>>>16,d[g]=v<<8|v>>>24,h[g]=v,n?(n=f^e[e[e[_^f]]],a^=e[e[a]]):n=a=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],f=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,i=4*((this._nRounds=n+6)+1),s=this._keySchedule=[],r=0;r<i;r++)r<n?s[r]=t[r]:(u=s[r-1],r%n?n>6&&r%n==4&&(u=o[u>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u]):(u=o[(u=u<<8|u>>>24)>>>24]<<24|o[u>>>16&255]<<16|o[u>>>8&255]<<8|o[255&u],u^=g[r/n|0]<<24),s[r]=s[r-n]^u);for(var a=this._invKeySchedule=[],c=0;c<i;c++){if(r=i-c,c%4)var u=s[r];else u=s[r-4];a[c]=c<4||r<=4?u:l[o[u>>>24]]^p[o[u>>>16&255]]^d[o[u>>>8&255]]^h[o[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,r,c,u,o)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,p,d,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,o,i,s,r,a){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],p=e[t+2]^n[2],d=e[t+3]^n[3],h=4,g=1;g<c;g++){var f=o[u>>>24]^i[l>>>16&255]^s[p>>>8&255]^r[255&d]^n[h++],m=o[l>>>24]^i[p>>>16&255]^s[d>>>8&255]^r[255&u]^n[h++],_=o[p>>>24]^i[d>>>16&255]^s[u>>>8&255]^r[255&l]^n[h++],v=o[d>>>24]^i[u>>>16&255]^s[l>>>8&255]^r[255&p]^n[h++];u=f,l=m,p=_,d=v}f=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^n[h++],m=(a[l>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^n[h++],_=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^n[h++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&p])^n[h++],e[t]=f,e[t+1]=m,e[t+2]=_,e[t+3]=v},keySize:8});e.AES=t._createHelper(f)}(),function(){var e=a,t=e.lib,n=t.WordArray,o=t.BlockCipher,i=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],r=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],p=i.DES=o.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var o=s[n]-1;t[n]=e[o>>>5]>>>31-o%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){var u=i[a]=[],l=c[a];for(n=0;n<24;n++)u[n/6|0]|=t[(r[n]-1+l)%28]<<31-n%6,u[4+(n/6|0)]|=t[28+(r[n+24]-1+l)%28]<<31-n%6;for(u[0]=u[0]<<1|u[0]>>>31,n=1;n<7;n++)u[n]=u[n]>>>4*(n-1)+3;u[7]=u[7]<<5|u[7]>>>27}var p=this._invSubKeys=[];for(n=0;n<16;n++)p[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],d.call(this,4,252645135),d.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),d.call(this,1,1431655765);for(var o=0;o<16;o++){for(var i=n[o],s=this._lBlock,r=this._rBlock,a=0,c=0;c<8;c++)a|=u[c][((r^i[c])&l[c])>>>0];this._lBlock=r,this._rBlock=s^a}var p=this._lBlock;this._lBlock=this._rBlock,this._rBlock=p,d.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function h(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}e.DES=o._createHelper(p);var g=i.TripleDES=o.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),o=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=p.createEncryptor(n.create(t)),this._des2=p.createEncryptor(n.create(o)),this._des3=p.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=o._createHelper(g)}(),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,o=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,o=this._S=[],i=0;i<256;i++)o[i]=i;i=0;for(var s=0;i<256;i++){var r=i%n,a=t[r>>>2]>>>24-r%4*8&255;s=(s+o[i]+a)%256;var c=o[i];o[i]=o[s],o[s]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,n=this._j,o=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var s=e[t];e[t]=e[n],e[n]=s,o|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,o}e.RC4=t._createHelper(o);var s=n.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});e.RC4Drop=t._createHelper(s)}(),
/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby jhruby.web@gmail.com
*/
a.mode.CTRGladman=function(){var e=a.lib.BlockCipherMode.extend();function t(e){if(255&~(e>>24))e+=1<<24;else{var t=e>>16&255,n=e>>8&255,o=255&e;255===t?(t=0,255===n?(n=0,255===o?o=0:++o):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=o}return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var o,i=this._cipher,s=i.blockSize,r=this._iv,a=this._counter;r&&(a=this._counter=r.slice(0),this._iv=void 0),0===((o=a)[0]=t(o[0]))&&(o[1]=t(o[1]));var c=a.slice(0);i.encryptBlock(c,0);for(var u=0;u<s;u++)e[n+u]^=c[u]}});return e.Decryptor=n,e}(),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],s=[],r=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var o=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=o[n+4&7];if(t){var s=t.words,r=s[0],a=s[1],u=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),p=u>>>16|4294901760&l,d=l<<16|65535&u;for(i[0]^=u,i[1]^=p,i[2]^=l,i[3]^=d,i[4]^=u,i[5]^=p,i[6]^=l,i[7]^=d,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[t+i]^=o[i]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,n=0;n<8;n++){var o=e[n]+t[n],r=65535&o,a=o>>>16,c=((r*r>>>17)+r*a>>>15)+a*a,u=((4294901760&o)*o|0)+((65535&o)*o|0);s[n]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=t._createHelper(r)}(),a.mode.CTR=function(){var e=a.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,o=n.blockSize,i=this._iv,s=this._counter;i&&(s=this._counter=i.slice(0),this._iv=void 0);var r=s.slice(0);n.encryptBlock(r,0),s[o-1]=s[o-1]+1|0;for(var a=0;a<o;a++)e[t+a]^=r[a]}});return e.Decryptor=t,e}(),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,o=[],i=[],s=[],r=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)o[i]^=n[i+4&7];if(t){var s=t.words,r=s[0],a=s[1],u=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),p=u>>>16|4294901760&l,d=l<<16|65535&u;for(o[0]^=u,o[1]^=p,o[2]^=l,o[3]^=d,o[4]^=u,o[5]^=p,o[6]^=l,o[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),o[0]=n[0]^n[5]>>>16^n[3]<<16,o[1]=n[2]^n[7]>>>16^n[5]<<16,o[2]=n[4]^n[1]>>>16^n[7]<<16,o[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[t+i]^=o[i]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)i[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<i[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<i[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<i[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<i[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<i[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<i[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<i[6]>>>0?1:0)|0,this._b=t[7]>>>0<i[7]>>>0?1:0,n=0;n<8;n++){var o=e[n]+t[n],r=65535&o,a=o>>>16,c=((r*r>>>17)+r*a>>>15)+a*a,u=((4294901760&o)*o|0)+((65535&o)*o|0);s[n]=c^u}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=t._createHelper(r)}(),a.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},a)},c(u={exports:{}},u.exports),u.exports);return function(){function t(n){e(this,t);var o=n.isArray,i=n.isMap,s=n.isDevMode;this._isArray=o,this._isMap=i,this._isDevMode=s,this._interceptProfanityList=[],this._interceptFilter=null,this._interceptRegExpList=[],this._replacingProfanityMap=new Map,this._replacingFilter=null,this._replacingRegExpMap=new Map,this._key="",this._iv="",this._decryptOptions=void 0,this._n="TIMProfanityFilterPlugin",!0===s&&console.log("".concat(this._n,".VERSION:").concat("1.1.0"))}return n(t,[{key:"onToken",value:function(e){this._key=g.enc.Utf8.parse(e.slice(0,32)),this._iv=this._key,this._decryptOptions={iv:this._iv,mode:g.mode.CBC,padding:g.pad.Pkcs7}}},{key:"onLexiconSliced",value:function(e){if(this._isArray(e)&&0!==e.length){var t,n,o,i=a(e);try{for(i.s();!(o=i.n()).done;){var s=o.value,r=s.filterType,c=s.profanityType,u=s.profanity,l=s.replacement;t=this._getDecryptedString(u),n=this._getDecryptedString(l),1===r?1===c?this._interceptProfanityList.push(t):2===c&&this._interceptRegExpList.push(t):2===r&&(1===c?this._replacingProfanityMap.set(t,n):2===c&&this._replacingRegExpMap.set(t,n))}}catch(p){i.e(p)}finally{i.f()}}}},{key:"_getDecryptedString",value:function(e){var t=g.AES.decrypt(e,this._key,this._decryptOptions);return g.enc.Utf8.stringify(t).toLowerCase()}},{key:"onLexiconCompleted",value:function(e){this.onLexiconSliced(e),this._interceptFilter=new p({input:this._interceptProfanityList,isArray:this._isArray,isMap:this._isMap}),this._replacingFilter=new p({input:this._replacingProfanityMap,isArray:this._isArray,isMap:this._isMap}),!0===this._isDevMode&&(console.log("".concat(this._n," _interceptProfanityList ->"),this._interceptProfanityList),console.log("".concat(this._n," _interceptRegExpList ->"),this._interceptRegExpList),console.log("".concat(this._n," _replacingProfanityMap ->"),this._replacingProfanityMap),console.log("".concat(this._n," _replacingRegExpMap ->"),this._replacingRegExpMap))}},{key:"filter",value:function(e){var t={type:0,modifiedText:e};if("string"!=typeof e)return!0===this._isDevMode&&console.warn("".concat(this._n,".filter invalid params, string required!")),t;if(!0===this._interceptFilter.filter({text:e,replacingEnabled:!1}).isMatched)return t.type=1,t;for(var n=!1,i=0,s=this._interceptRegExpList.length;i<s;i++)if(new RegExp(this._interceptRegExpList[i],"gi").test(e.toLowerCase())){n=!0;break}if(n)return t.type=1,t;var r=this._replacingFilter.filter({text:e,replacingEnabled:!0});!0===r.isMatched&&(t.type=2,t.modifiedText=r.modifiedText);var c,u=t.modifiedText,l=null,p=a(this._replacingRegExpMap);try{for(p.s();!(c=p.n()).done;){var d=o(c.value,2),h=d[0],g=d[1];l=new RegExp(h,"gi"),u=u.replace(l,g)}}catch(f){p.e(f)}finally{p.f()}return u!==e&&(t.type=2,t.modifiedText=u),t}},{key:"reset",value:function(){this._isArray=null,this._isMap=null,this._interceptProfanityList.length=0,this._interceptRegExpList.length=0,this._replacingProfanityMap.clear(),this._replacingRegExpMap.clear(),this._key="",this._iv="",this._decryptOptions={},this._interceptFilter&&this._interceptFilter.reset(),this._replacingFilter&&this._replacingFilter.reset()}}]),t}()}();const Gu=bu(Uu.exports);let Fu=class{constructor(){this.serviceMap=new Map}registerService(e,t){this.serviceMap.has(e)||(console.log(`TUIServiceManager.registerService serviceName:${e}`),this.serviceMap.set(e,t))}unregisterService(e){this.serviceMap.has(e)&&(console.log(`TUIServiceManager.unregisterService serviceName:${e}`),this.serviceMap.delete(e))}getService(e){return this.serviceMap.get(e)}callService(e){const{serviceName:t,method:n,params:o,callback:i}=e,s=this.getService(t);if(console.log(`TUIServiceManager.callService serviceName:${t}, service:`,s),s)return s.onCall(n,o,i)}},Bu=class{constructor(){this.extensionMap=new Map}registerExtension(e,t){if(console.log(`TUIExtensionManager.registerExtension extensionID:${e}`),!this.extensionMap.has(e)){const t=[];this.extensionMap.set(e,t)}const n=this.extensionMap.get(e);-1===n.indexOf(t)&&n.push(t)}unregisterExtension(e,t){if(console.log(`TUIExtensionManager.unregisterExtension extensionID:${e}`),this.extensionMap.has(e)){const n=this.extensionMap.get(e),o=n.indexOf(t);o>-1&&n.splice(o,1)}}getExtensionList(e,t){const n=t?`params:${JSON.stringify(t)}`:"";console.log(`TUIExtensionManager.getExtensionList extensionID:${e} ${n}`);let o=[],i=[];if(this.extensionMap.has(e)){o=this.extensionMap.get(e);for(let n=0;n<o.length;n++){const s=o[n].onGetExtension(e,t);i=i.concat(s)}}return i}};const qu=["vue2","vue3","rn"],Vu={TUILogin:{EVENT:{LOGIN_STATE_CHANGED:"loginStateChanged"},EVENT_SUB_KEY:{USER_LOGIN_SUCCESS:"userLoginSuccess",USER_LOGOUT_SUCCESS:"userLogoutSuccess",USER_KICKED_OFFLINE:"userKickedOffline",USER_SIG_EXPIRED:"userSigExpired"}},TUIConversation:{SERVICE:{NAME:"TUIConversationService",METHOD:{CREATE_CONVERSATION:"createConversation",HIDE_CONVERSATION_HEADER:"hideConversationHeader"}},EXTENSION:{CONV_POP_MENU:{EXT_ID:"conversationPopMenu"},CONV_GROUP:{EXT_ID:"conversationGroup"}}},TUIChat:{SERVICE:{NAME:"TUIChatService",METHOD:{UPDATE_MESSAGE_LIST:"updateMessageList",CLOSE_MESSAGE_POP_MENU:"closeMessagePopMenu",SEND_CUSTOM_MESSAGE:"sendCustomMessage",SEND_TEXT_MESSAGE:"sendTextMessage",SET_CHAT_TYPE:"setChatType",UPDATE_MESSAGE_INFO:"updateMessageInfo"}},EXTENSION:{INPUT_MORE:{EXT_ID:"inputToolBarMore"},MSG_POP_MENU:{EXT_ID:"messagePopMenu"},CHAT_HEADER:{EXT_ID:"chatHeader"}},TYPE:{C2C:"C2C",GROUP:"GROUP",CUSTOMER_SERVICE:"customerService",ROOM:"room"},EVENT:{CHAT_STATE_CHANGED:"chatStateChanged",CHAT_TYPE_CHANGED:"chatTypeChanged"},EVENT_SUB_KEY:{CHAT_OPENED:"chatOpened",CHANGE_SUCCESS:"changeSuccess"},FEATURE:{DownloadFile:"DownloadFile",CopyMessage:"CopyMessage",DeleteMessage:"DeleteMessage",RevokeMessage:"RevokeMessage",QuoteMessage:"QuoteMessage",ForwardMessage:"ForwardMessage",TranslateMessage:"TranslateMessage",VoiceToText:"VoiceToText",MultiSelection:"MultiSelection",EmojiReaction:"EmojiReaction",InputEmoji:"InputEmoji",InputStickers:"InputStickers",InputImage:"InputImage",InputVoice:"InputVoice",InputVideo:"InputVideo",InputFile:"InputFile",InputEvaluation:"InputEvaluation",InputQuickReplies:"InputQuickReplies",InputMention:"InputMention",MessageSearch:"MessageSearch",ReadStatus:"ReadStatus"}},TUIGroup:{SERVICE:{NAME:"TUIGroupService",METHOD:{CREATE_GROUP:"createGroup",OPEN_GROUP_MANAGEMENT:"openGroupManagement",SELECT_GROUP_MEMBER:"selectGroupMember"}}},TUIContact:{SERVICE:{NAME:"TUIContactService",METHOD:{SELECT_FRIEND:"selectFriend"}},EXTENSION:{CONTACT_LIST:{EXT_ID:"contactList"}}},TUISearch:{SERVICE:{NAME:"TUISearchService",METHOD:{SEARCH_GROUP:"searchGroup",SEARCH_USER:"searchUser",SEARCH_FRIEND:"searchFriend",SEARCH_GROUP_MEMBER:"searchGroupMember"}},EXTENSION:{SEARCH_MORE:{EXT_ID:"searchMore"}}},TUICalling:{SERVICE:{NAME:"TUICallingService",METHOD:{START_CALL:"startCall"}}},TUIRoom:{SERVICE:{NAME:"TUIRoomService"}},TUIEmojiPlugin:{SERVICE:{NAME:"TUIEmojiPluginService",METHOD:{CLOSE_EMOJI_DETAIL:"closeEmojiDetail"}}},TUITranslate:{EVENT:{LANGUAGE_CHANGED:"languageChanged"},EVENT_SUB_KEY:{CHANGE_SUCCESS:"changeSuccess"}},TUITranslatePlugin:{SERVICE:{NAME:"TUITranslatePluginService"}},TUIVoiceToTextPlugin:{SERVICE:{NAME:"TUIVoiceToTextPluginService"}},TUICustomerServicePlugin:{SERVICE:{NAME:"TUICustomerServicePlugin",METHOD:{ACTIVE_CONVERSATION:"activeConversation",FILTER_MESSAGE:"filterMessage"}},EXTENSION:{}},TUIPushPlugin:{SERVICE:{NAME:"TUIPushPluginService"}},TUIChatbotPlugin:{SERVICE:{NAME:"TUIChatbotPluginService"}},TUITheme:{EVENT:{THEME_CHANGED:"themeChanged"},EVENT_SUB_KEY:{CHANGE_SUCCESS:"changeSuccess"}}},ju=void 0!==Un&&"function"==typeof Un.getSystemInfoSync&&Boolean(Un.getSystemInfoSync().fontSizeSetting),Hu=void 0!==Gn&&"undefined"==typeof window,Ku=void 0!==Gn,$u=(void 0!==Gn||"undefined"!=typeof window)&&!(ju||Hu),zu=$u&&window&&window.navigator&&window.navigator.userAgent||"",Yu=/Android/i.test(zu),Wu=/(?:Windows Phone)/.test(zu),Ju=/(?:SymbianOS)/.test(zu),Xu=/iPad/i.test(zu)||/iPhone/i.test(zu)||/iPod/i.test(zu),Zu=Yu||Wu||Ju||Xu,Qu=$u&&!Zu,el=Hu&&!ju,tl={[Vu.TUITranslatePlugin.SERVICE.NAME]:Math.pow(2,38),[Vu.TUIVoiceToTextPlugin.SERVICE.NAME]:Math.pow(2,39),[Vu.TUICustomerServicePlugin.SERVICE.NAME]:Math.pow(2,40),[Vu.TUIPushPlugin.SERVICE.NAME]:Math.pow(2,41),[Vu.TUIChatbotPlugin.SERVICE.NAME]:Math.pow(2,42),[Vu.TUIEmojiPlugin.SERVICE.NAME]:Math.pow(2,48)};let nl=class e{constructor(e){this.loginStatusPromise=new Map,this.SDKAppID=0,this.userID="",this.userSig="",this.TUICore=e,this.isOnChatEvent=!1}static getInstance(t){return!e.instance&&t&&(e.instance=new e(t)),e.instance}login(e){const{SDKAppID:t,userID:n,userSig:o,framework:i}=e;return this.chat=Nu.create(Object.assign(Object.assign({},e),{scene:this.getStatScene(i)})),this.EVENT=Nu.EVENT,this.TYPES=Nu.TYPES,this.SDKAppID=t,this.userID=n,this.userSig=o,this.offChatEvent(),this.onChatEvent(),this.registerPlugin(e),this.loginChat(e)}logout(){return this.chat.logout().then((e=>(this.userID="",this.userSig="",this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}destroy(){return this.chat.destroy().then((e=>(this.userID="",this.userSig="",this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}setLogLevel(e){return this.chat.setLogLevel(e)}getContext(){return{chat:this.chat,SDKAppID:this.SDKAppID,userID:this.userID,userSig:this.userSig}}reportPlugin(){var e;for(const t in tl)this.TUICore.getService(t)&&(null===(e=this.chat.callExperimentalAPI("isFeatureEnabledForStat",tl[t]))||void 0===e||e.catch((e=>{})))}loginChat(e){const{userID:t,userSig:n}=e;return new Promise(((e,o)=>{this.chat.login({userID:t,userSig:n}).then((t=>{t.data.repeatLogin&&this.chat.isReady()&&e(t),this.reportPlugin(),this.loginStatusPromise.set("login",{resolve:e,reject:o,imResponse:t})})).catch((e=>{o(e)}))}))}onChatEvent(){this.chat.on(this.EVENT.SDK_READY,this.onSDKReady,this),this.chat.on(this.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.chat.on(this.EVENT.KICKED_OUT,this.onUserKicked,this),this.isOnChatEvent=!0}offChatEvent(){this.isOnChatEvent&&(this.chat.off(this.EVENT.SDK_READY,this.onSDKReady,this),this.chat.off(this.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.chat.off(this.EVENT.KICKED_OUT,this.onUserKicked,this),this.isOnChatEvent=!1)}onSDKReady(){if(this.loginStatusPromise.has("login")){this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS);const e=setTimeout((()=>{const t=this.loginStatusPromise.get("login");t.resolve(t.imResponse),clearTimeout(e),this.loginStatusPromise.delete("login")}),500)}}onSDKNotReady(){this.loginStatusPromise.has("login")&&this.loginStatusPromise.get("login").reject(new Error("sdk not ready")),this.loginStatusPromise.delete("login")}onUserKicked(e){e.data.type!==this.TYPES.KICKED_OUT_USERSIG_EXPIRED?this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_KICKED_OFFLINE):this.TUICore.notifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_SIG_EXPIRED)}registerPlugin(e){const{useUploadPlugin:t=!1,useProfanityFilterPlugin:n=!1,TUIOfflinePush:o,offlinePushConfig:i,TIMPush:s,pushConfig:r}=e;!0===t&&this.chat.registerPlugin({"tim-upload-plugin":wu}),!0===n&&this.chat.registerPlugin({"tim-profanity-filter-plugin":Gu}),el&&s&&r&&this.chat.registerPlugin({"tim-push":s,pushConfig:r}),el&&o&&i&&this.chat.registerPlugin({"tim-offline-push-plugin":o,offlinePushConfig:i})}getStatScene(e){let t;return e&&qu.indexOf(e)>-1&&(t=this.genStatScene(e)),t}genStatScene(e){if("rn"===e)return"k-rn";let t="";return Ku?(Qu&&(t=`k-${e}-pc-uni`),Zu&&(t=`k-${e}-h5-uni`),el&&(t=`k-${e}-app-uni`),ju&&(t=`k-${e}-mp-uni`),t):(Qu&&(t=`k-${e}-pc`),Zu&&(t=`k-${e}-h5`),t)}},ol=class{constructor(){this.eventMap=new Map}registerEvent(e,t,n){const o=this.getKey(e,t);if(console.log(`TUIEventManager.registerEvent eventName:${e} subKey:${t}`),!this.eventMap.has(o)){const e=[];this.eventMap.set(o,e)}const i=this.eventMap.get(o);-1===i.indexOf(n)&&(i.push(n),this.renotify(e,t,n))}unregisterEvent(e,t,n){console.log(`TUIEventManager.unregisterEvent eventName:${e} subKey:${t}`);const o=this.getKey(e,t);if(this.eventMap.has(o)){const e=this.eventMap.get(o),t=e.indexOf(n);t>-1&&e.splice(t,1)}}notifyEvent(e,t,n){const o=this.getKey(e,t),i=n?`params:${JSON.stringify(n)}`:"";console.log(`TUIEventManager.notifyEvent eventName:${e} subKey:${t} ${i}`),this.eventMap.has(o)&&this.eventMap.get(o).forEach((o=>{o.onNotifyEvent(e,t,n)}))}getKey(e,t){let n=e;return t&&(n=`${e}-${n}`),n}renotify(e,t,n){if(e===Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED&&t===Vu.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS){const{chat:e}=nl.getInstance().getContext();e&&e.isReady()&&(n.onNotifyEvent(Vu.TUILogin.EVENT.LOGIN_STATE_CHANGED,Vu.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS),console.log("TUIEventManager.renotify success."))}}};console.log("TUICore.VERSION:2.4.0");const il=class e{constructor(){this.serviceManager=new Fu,this.extensionManager=new Bu,this.eventManager=new ol}static getInstance(){return e.instance||(console.log("TUICore.getInstance ok."),e.instance=new e),e.instance}registerService(e,t){return this.serviceManager.registerService(e,t)}unregisterService(e){return this.serviceManager.unregisterService(e)}getService(e){return this.serviceManager.getService(e)}callService(e){return this.serviceManager.callService(e)}registerExtension(e,t){return this.extensionManager.registerExtension(e,t)}unregisterExtension(e,t){return this.extensionManager.unregisterExtension(e,t)}getExtensionList(e,t){return this.extensionManager.getExtensionList(e,t)}registerEvent(e,t,n){return this.eventManager.registerEvent(e,t,n)}unregisterEvent(e,t,n){return this.eventManager.unregisterEvent(e,t,n)}notifyEvent(e,t,n){return this.eventManager.notifyEvent(e,t,n)}}.getInstance(),sl=nl.getInstance(il);var rl={exports:{}};window,rl.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/Users/chrisftian/Documents/projects/cos-sdk/cos-wx-sdk-v5/dist",n(n.s=8)}([function(e,t,n){function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,s=function(){};return{s:s,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw r}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function s(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
s=function(){return t};var e,t={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},c=r.iterator||"@@iterator",u=r.asyncIterator||"@@asyncIterator",l=r.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(N){p=function(e,t,n){return e[t]=n}}function d(e,t,n,o){var s=t&&t.prototype instanceof y?t:y,r=Object.create(s.prototype),a=new b(o||[]);return i(r,"_invoke",{value:L(e,n,a)}),r}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(o){return{type:"throw",arg:o}}}t.wrap=d;var g="suspendedStart",f="suspendedYield",m="executing",_="completed",v={};function y(){}function I(){}function M(){}var C={};p(C,c,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(P([])));S&&S!==n&&o.call(S,c)&&(C=S);var E=M.prototype=y.prototype=Object.create(C);function k(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(i,s,r,c){var u=h(e[i],e,s);if("throw"!==u.type){var l=u.arg,p=l.value;return p&&"object"==a(p)&&o.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,r,c)}),(function(e){n("throw",e,r,c)})):t.resolve(p).then((function(e){l.value=e,r(l)}),(function(e){return n("throw",e,r,c)}))}c(u.arg)}var s;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,i){n(e,o,t,i)}))}return s=s?s.then(i,i):i()}})}function L(t,n,o){var i=g;return function(s,r){if(i===m)throw Error("Generator is already running");if(i===_){if("throw"===s)throw r;return{value:e,done:!0}}for(o.method=s,o.arg=r;;){var a=o.delegate;if(a){var c=R(a,o);if(c){if(c===v)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(i===g)throw i=_,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);i=m;var u=h(t,n,o);if("normal"===u.type){if(i=o.done?_:f,u.arg===v)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(i=_,o.method="throw",o.arg=u.arg)}}}function R(t,n){var o=n.method,i=t.iterator[o];if(i===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,R(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v;var s=h(i,t.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,v;var r=s.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function b(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,s=function n(){for(;++i<t.length;)if(o.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return s.next=s}}throw new TypeError(a(t)+" is not iterable")}return I.prototype=M,i(E,"constructor",{value:M,configurable:!0}),i(M,"constructor",{value:I,configurable:!0}),I.displayName=p(M,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===I||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,M):(e.__proto__=M,p(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},k(D.prototype),p(D.prototype,u,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,o,i,s){void 0===s&&(s=Promise);var r=new D(d(e,n,o,i),s);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},k(E),p(E,l,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=P,b.prototype={constructor:b,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(o,i){return a.type="throw",a.arg=t,n.next=o,i&&(n.method="next",n.arg=e),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var r=this.tryEntries[s],a=r.completion;if("root"===r.tryLoc)return i("end");if(r.tryLoc<=this.prev){var c=o.call(r,"catchLoc"),u=o.call(r,"finallyLoc");if(c&&u){if(this.prev<r.catchLoc)return i(r.catchLoc,!0);if(this.prev<r.finallyLoc)return i(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return i(r.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return i(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&o.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var r=s?s.completion:{};return r.type=e,r.arg=t,s?(this.method="next",this.next=s.finallyLoc,v):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;A(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:P(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),v}},t}function r(e,t,n,o,i,s,r){try{var a=e[s](r),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(o,i)}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var c=n(10),u=n(13),l=n(14),p=l.btoa,d=Un.getFileSystemManager(),h=n(2),g=n(15),f=g.XMLParser,m=g.XMLBuilder,_=new f({ignoreDeclaration:!0,ignoreAttributes:!0,parseTagValue:!1,trimValues:!1}),v=new m,y=function e(t){if(L(t))for(var n in t){var o=t[n];"string"==typeof o?"#text"===n&&delete t[n]:Array.isArray(o)?o.forEach((function(t){e(t)})):L(o)&&e(o)}};function I(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function M(e,t){var n=[];for(var o in e)e.hasOwnProperty(o)&&n.push(t?I(o).toLowerCase():o);return n.sort((function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1}))}var C=["cache-control","content-disposition","content-encoding","content-length","content-md5","content-type","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding","pic-operations"],T=function(){},S=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&void 0!==e[n]&&null!==e[n]&&(t[n]=e[n]);return t};function E(e){return O(e,(function(e){return"object"===a(e)&&null!==e?E(e):e}))}function k(e,t){return R(t,(function(n,o){e[o]=t[o]})),e}function D(e){return e instanceof Array}function L(e){return"[object Object]"===Object.prototype.toString.call(e)}function R(e,t){for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)}function O(e,t){var n=D(e)?[]:{};for(var o in e)e.hasOwnProperty(o)&&(n[o]=t(e[o],o));return n}var A,b,P=function(e,t){if(t=k({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};t&&"object"===a(t)&&(function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}(),F.each({"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","x-cos-forbid-overwrite":"ForbidOverwrite","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext","Pic-Operations":"PicOperations"},(function(e,o){void 0!==t[e]&&(n[o]=t[e])})),t.Headers=S(n))}return t},N=function(e){return new Promise((function(t,n){d.readFile({filePath:e,success:function(e){t(e.data)},fail:function(e){n((null==e?void 0:e.errMsg)||"")}})}))},x=(A=s().mark((function e(t,n,o){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("postObject"!==t){e.next=4;break}o(),e.next=21;break;case 4:if("putObject"!==t){e.next=20;break}if(void 0!==n.Body||!n.FilePath){e.next=17;break}return e.prev=6,e.next=9,N(n.FilePath);case 9:n.Body=e.sent,e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(6),n.Body=void 0,o({error:"readFile error, ".concat(e.t0)}),e.abrupt("return");case 17:void 0!==n.Body?(n.ContentLength=n.Body.byteLength,o(null,n.ContentLength)):o({error:"missing param Body"}),e.next=21;break;case 20:n.FilePath?d.stat({path:n.FilePath,success:function(e){var t=e.stats;n.FileStat=t,n.FileStat.FilePath=n.FilePath;var i=t.isDirectory()?0:t.size;n.ContentLength=i=i||0,o(null,i)},fail:function(e){o(e)}}):o({error:"missing param FilePath"});case 21:case"end":return e.stop()}}),e,null,[[6,12]])})),b=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=A.apply(e,t);function s(e){r(i,n,o,s,a,"next",e)}function a(e){r(i,n,o,s,a,"throw",e)}s(void 0)}))},function(e,t,n){return b.apply(this,arguments)}),w=function(e){return Date.now()+(e||0)},U=function(e,t){if(!e||!t)return-1;e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.length<n;)e.push("0");for(;t.length<n;)t.push("0");for(var o=0;o<n;o++){var i=parseInt(e[o]),s=parseInt(t[o]);if(i>s)return 1;if(i<s)return-1}return 0},G=function(){var e={},t={};Un.canIUse("getAppBaseInfo")&&(e=Un.getAppBaseInfo()||{}),Un.canIUse("getDeviceInfo")&&(t=Un.getDeviceInfo()||{});var n=e.SDKVersion,o=(t.platform,U(n,"2.10.0")>=0);return function(){return o}}(),F={noop:T,formatParams:P,apiWrapper:function(e,t){return function(n,o){var i,s=this;if("function"==typeof n&&(o=n,n={}),n=P(e,n),s.options.EnableReporter)if("sliceUploadFile"===n.calledBySdk||"sliceCopyFile"===n.calledBySdk)i=n.tracker&&n.tracker.generateSubTracker({apiName:e});else if(["uploadFile","uploadFiles"].includes(e))i=null;else{var r=0;n.Body&&(r="string"==typeof n.Body?n.Body.length:n.Body.size||n.Body.byteLength||0);var a=s.options.UseAccelerate||"string"==typeof s.options.Domain&&s.options.Domain.includes("accelerate.");i=new h({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:n.Bucket,region:n.Region,apiName:e,realApi:e,accelerate:a,fileKey:n.Key,fileSize:r,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})}n.tracker=i;var c=function(e){return e&&e.headers&&(e.headers["x-ci-request-id"]&&(e.RequestId=e.headers["x-ci-request-id"]),e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},u=function(e,t){i&&i.report(e,t),o&&o(c(e),c(t))},l=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=function(e,t){var n=t.Bucket,o=t.Region,i=t.Key;if(e.indexOf("Bucket")>-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!o)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e||"uploadFile"===e){if(!n)return"Bucket";if(!o)return"Region";if(!i)return"Key"}return!1}(e,n);if(t)return"missing param "+t;if(n.Region){if(n.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(n.Region))return"Region format error.";!s.options.CompatibilityMode&&-1===n.Region.indexOf("-")&&"yfb"!==n.Region&&"default"!==n.Region&&n.Region}if(n.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(n.Bucket))if(n.AppId)n.Bucket=n.Bucket+"-"+n.AppId;else{if(!s.options.AppId)return'Bucket should format as "test-1250000000".';n.Bucket=n.Bucket+"-"+s.options.AppId}n.AppId&&delete n.AppId}n.Key&&"/"===n.Key.substr(0,1)&&(n.Key=n.Key.substr(1))}}(),p=["getAuth","getObjectUrl"].includes(e);if(!p&&!o)return new Promise((function(e,i){if(o=function(t,n){t?i(t):e(n)},l)return u({error:l});t.call(s,n,u)}));if(l)return u({error:l});var d=t.call(s,n,u);return p?d:void 0}},xml2json:function(e){var t=_.parse(e);return y(t),t},json2xml:function(e){return v.build(e)},md5:c,clearKey:S,fileSlice:function(e,t,n,o){e?d.readFile({filePath:e,position:t,length:n-t,success:function(e){o(e.data)},fail:function(){o(null)}}):o(null)},getBodyMd5:function(e,t,n){n=n||T,e&&t&&t instanceof ArrayBuffer?F.getFileMd5(t,(function(e,t){n(t)})):n()},getFileMd5:function(e,t){var n=c(e);return t&&t(n),n},binaryBase64:function(e){var t,n,o,i="";for(t=0,n=e.length/2;t<n;t++)o=parseInt(e[2*t]+e[2*t+1],16),i+=String.fromCharCode(o);return p(i)},extend:k,isArray:D,isInArray:function(e,t){for(var n=!1,o=0;o<e.length;o++)if(t===e[o]){n=!0;break}return n},makeArray:function(e){return D(e)?e:[e]},each:R,map:O,filter:function(e,t){var n=D(e),o=n?[]:{};for(var i in e)e.hasOwnProperty(i)&&t(e[i],i)&&(n?o.push(e[i]):o[i]=e[i]);return o},clone:E,attr:function(e,t,n){return e&&t in e?e[t]:n},uuid:function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},camSafeUrlEncode:I,throttleOnProgress:function(e,t){var n,o,i=this,s=0,r=0,a=Date.now();function c(){if(o=0,t&&"function"==typeof t){n=Date.now();var i,c=Math.max(0,Math.round((r-s)/((n-a)/1e3)*100)/100)||0;i=0===r&&0===e?1:Math.floor(r/e*100)/100||0,a=n,s=r;try{t({loaded:r,total:e,speed:c,percent:i})}catch(u){}}}return function(t,n){if(t&&(r=t.loaded,e=t.total),n)clearTimeout(o),c();else{if(o)return;o=setTimeout(c,i.options.ProgressInterval)}}},getFileSize:x,getFileSizeByPath:function(e){return new Promise((function(t,n){d.stat({path:e,success:function(e){var n=e.stats,o=n.isDirectory()?0:n.size;t(o)},fail:function(e){n((null==e?void 0:e.errMsg)||"")}})}))},getSkewTime:w,obj2str:function(e,t){var n,o,i,s=[],r=M(e);for(n=0;n<r.length;n++)i=void 0===e[o=r[n]]||null===e[o]?"":""+e[o],o=t?I(o).toLowerCase():I(o),i=I(i)||"",s.push(o+"="+i);return s.join("&")},getAuth:function(e){var t,n=(e=e||{}).SecretId,o=e.SecretKey,i=e.KeyTime,s=(e.method||e.Method||"get").toLowerCase(),r=E(e.Query||e.params||{}),a=function(e){var t={};for(var n in e){var o=n.toLowerCase();(o.indexOf("x-cos-")>-1||o.indexOf("x-ci-")>-1||C.indexOf(o)>-1)&&(t[n]=e[n])}return t}(E(e.Headers||e.headers||{})),c=e.Key||"";e.UseRawKey?t=e.Pathname||e.pathname||"/"+c:0!==(t=e.Pathname||e.pathname||c).indexOf("/")&&(t="/"+t);var l=!1!==e.ForceSignHost;if(!a.Host&&!a.host&&e.Bucket&&e.Region&&l&&(a.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),n&&o){var p=Math.round(w(e.SystemClockOffset)/1e3)-1,d=p,h=e.Expires||e.expires;d+=void 0===h?900:1*h||0;var g=n,f=i||p+";"+d,m=i||p+";"+d,_=M(a,!0).join(";").toLowerCase(),v=M(r,!0).join(";").toLowerCase(),y=u.HmacSHA1(m,o).toString(),I=[s,t,F.obj2str(r,!0),F.obj2str(a,!0),""].join("\n"),T=["sha1",f,u.SHA1(I).toString(),""].join("\n");return["q-sign-algorithm=sha1","q-ak="+g,"q-sign-time="+f,"q-key-time="+m,"q-header-list="+_,"q-url-param-list="+v,"q-signature="+u.HmacSHA1(T,y).toString()].join("&")}},compareVersion:U,canFileSlice:G,isCIHost:function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},error:function(e,t){var n=e;return e.message=e.message||null,"string"==typeof t?(e.error=t,e.message=t):"object"===a(t)&&null!==t&&(k(e,t),(t.code||t.name)&&(e.code=t.code||t.name),t.message&&(e.message=t.message),t.stack&&(e.stack=t.stack)),"function"==typeof Object.defineProperty&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=t&&t.name||e.name||e.code||"Error",e.code||(e.code=e.name),e.error||(e.error=E(n)),e},getSourceParams:function(e){var t=this.options.CopySourceParser;if(t)return t(e);var n=e.match(/^([^.]+-\d+)\.cos(v6|-cdc|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return n?{Bucket:n[1],Region:n[3],Key:n[7]}:null},encodeBase64:function(e,t){var n=l.encode(e);return t&&(n=n.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),n},simplifyPath:function(e){var t,n=[],i=o(e.split("/"));try{for(i.s();!(t=i.n()).done;){var s=t.value;".."===s?n.length&&n.pop():s.length&&"."!==s&&n.push(s)}}catch(r){i.e(r)}finally{i.f()}return"/"+n.join("/")},arrayBufferToString:function(e){return new TextDecoder("utf-8").decode(e)},parseResBody:function(e){var t;if(e&&"string"==typeof e){var n=e.trim(),o=0===n.indexOf("<"),i=0===n.indexOf("{");if(o)t=F.xml2json(e)||{};else if(i)try{var s=e.replace(/\n/g," "),r=JSON.parse(s);t="[object Object]"===Object.prototype.toString.call(r)?r:e}catch(a){t=e}else t=e}else t=e||{};return t}};e.exports=F},function(e,t,n){const o=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+o+"]["+o+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+i+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const o=Object.keys(t),i=o.length;for(let s=0;s<i;s++)e[o[s]]="strict"===n?[t[o[s]]]:t[o[s]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(e){return!(null==s.exec(e))},t.getAllMatches=function(e,t){const n=[];let o=t.exec(e);for(;o;){const i=[];i.startIndex=t.lastIndex-o[0].length;const s=o.length;for(let e=0;e<s;e++)i.push(o[e]);n.push(i),o=t.exec(e)}return n},t.nameRegexp=i},function(e,t,n){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
i=function(){return t};var e,t={},n=Object.prototype,s=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(N){p=function(e,t,n){return e[t]=n}}function d(e,t,n,o){var i=t&&t.prototype instanceof y?t:y,s=Object.create(i.prototype),a=new b(o||[]);return r(s,"_invoke",{value:L(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(o){return{type:"throw",arg:o}}}t.wrap=d;var g="suspendedStart",f="suspendedYield",m="executing",_="completed",v={};function y(){}function I(){}function M(){}var C={};p(C,c,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(P([])));S&&S!==n&&s.call(S,c)&&(C=S);var E=M.prototype=y.prototype=Object.create(C);function k(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(i,r,a,c){var u=h(e[i],e,r);if("throw"!==u.type){var l=u.arg,p=l.value;return p&&"object"==o(p)&&s.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(p).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,c)}))}c(u.arg)}var i;r(this,"_invoke",{value:function(e,o){function s(){return new t((function(t,i){n(e,o,t,i)}))}return i=i?i.then(s,s):s()}})}function L(t,n,o){var i=g;return function(s,r){if(i===m)throw Error("Generator is already running");if(i===_){if("throw"===s)throw r;return{value:e,done:!0}}for(o.method=s,o.arg=r;;){var a=o.delegate;if(a){var c=R(a,o);if(c){if(c===v)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(i===g)throw i=_,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);i=m;var u=h(t,n,o);if("normal"===u.type){if(i=o.done?_:f,u.arg===v)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(i=_,o.method="throw",o.arg=u.arg)}}}function R(t,n){var o=n.method,i=t.iterator[o];if(i===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,R(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v;var s=h(i,t.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,v;var r=s.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function b(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,r=function n(){for(;++i<t.length;)if(s.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return r.next=r}}throw new TypeError(o(t)+" is not iterable")}return I.prototype=M,r(E,"constructor",{value:M,configurable:!0}),r(M,"constructor",{value:I,configurable:!0}),I.displayName=p(M,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===I||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,M):(e.__proto__=M,p(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},k(D.prototype),p(D.prototype,u,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,o,i,s){void 0===s&&(s=Promise);var r=new D(d(e,n,o,i),s);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},k(E),p(E,l,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=P,b.prototype={constructor:b,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(o,i){return a.type="throw",a.arg=t,n.next=o,i&&(n.method="next",n.arg=e),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var c=s.call(r,"catchLoc"),u=s.call(r,"finallyLoc");if(c&&u){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var r=i?i.completion:{};return r.type=e,r.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;A(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:P(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),v}},t}function s(e,t,n,o,i,s,r){try{var a=e[s](r),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(o,i)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function a(e){s(r,o,i,a,c,"next",e)}function c(e){s(r,o,i,a,c,"throw",e)}a(void 0)}))}}function a(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,u(o.key),o)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var l=n(3),p=null,d=function(e){return!e||e<0?0:(e/1e3).toFixed(3)},h=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},g=function(){return new Promise((function(e){if(Un.canIUse("getNetworkType"))try{Un.getNetworkType({success:function(t){e(t.networkType)}})}catch(t){e("can_not_get_network_type")}else e("can_not_get_network_type")}))},f=function(){var e={devicePlatform:"can_not_get_system_info",wxVersion:"can_not_get_system_info",wxSystem:"can_not_get_system_info",wxSdkVersion:"can_not_get_system_info"},t={},n={};Un.canIUse("getAppBaseInfo")&&(t=Un.getAppBaseInfo()||{}),Un.canIUse("getDeviceInfo")&&(n=Un.getDeviceInfo()||{});var o=t.SDKVersion||"can_not_get_system_info",i=t.version||"can_not_get_system_info",s=n.platform||"can_not_get_system_info",r=n.system||"can_not_get_system_info";return Object.assign(e,{devicePlatform:s,wxVersion:i,wxSystem:r,wxSdkVersion:o}),e}();function m(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function _(e){var t,n={},o=["sdkVersionName","sdkVersionCode","osName","networkType","requestName","requestResult","bucket","region","appid","accelerate","url","host","requestPath","userAgent","httpMethod","httpSize","httpSpeed","httpTookTime","httpMd5","httpSign","httpFullTime","httpDomain","partNumber","httpRetryTimes","customId","traceId","realApi"],i=[].concat(o,["errorNode","errorCode","errorName","errorMessage","errorRequestId","errorHttpCode","errorServiceName","errorType","fullError"]),s="Success"===e.requestResult?o:i;for(var r in e)s.includes(r)&&(n[m(r)]=e[r]);return n.request_name=e.realApi?(t=e.realApi,["putObject","sliceUploadFile","uploadFile","uploadFiles"].includes(t)?"UploadTask":"getObject"===t?"DownloadTask":["putObjectCopy","sliceCopyFile"].includes(t)?"CopyTask":t):e.requestName,n}var v=function(){function e(t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var o=t.parent,i=t.traceId,s=t.bucket,r=t.region,c=t.apiName,u=t.realApi,d=t.httpMethod,g=t.fileKey,m=t.fileSize,_=t.accelerate,v=t.customId,y=t.delay,I=t.deepTracker,M=t.Beacon,C=t.clsReporter,T=s&&s.substr(s.lastIndexOf("-")+1)||"";this.parent=o,this.deepTracker=I,this.delay=y,C&&!this.clsReporter&&(this.clsReporter=C),this.params=(a(n={sdkVersionName:"cos-wx-sdk-v5",sdkVersionCode:l.version,osName:f.devicePlatform,networkType:"",requestName:c||"",requestResult:"",realApi:u,bucket:s,region:r,accelerate:_,httpMethod:d,url:"",host:"",httpDomain:"",requestPath:g||"",errorType:"",errorCode:"",errorName:"",errorMessage:"",errorRequestId:"",errorHttpCode:0,errorServiceName:"",errorNode:"",httpTookTime:0,httpSize:m||0,httpMd5:0,httpSign:0,httpFullTime:0,httpSpeed:0,size:m||0},"httpMd5",0),a(n,"httpSign",0),a(n,"httpFull",0),a(n,"name",c||""),a(n,"tookTime",0),a(n,"md5StartTime",0),a(n,"md5EndTime",0),a(n,"signStartTime",0),a(n,"signEndTime",0),a(n,"httpStartTime",0),a(n,"httpEndTime",0),a(n,"startTime",(new Date).getTime()),a(n,"endTime",0),a(n,"traceId",i||h()),a(n,"appid",T),a(n,"partNumber",0),a(n,"httpRetryTimes",0),a(n,"customId",v||""),a(n,"partTime",0),n),M&&(this.beacon=function(e,t){if(!p){if("function"!=typeof e)throw new Error("Beacon not found");p=new e({appkey:"0WEB05PY6MHRGK0U",versionCode:l.version,channelID:"mp_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:t,sessionDuration:6e4})}return p}(M,y))}var t,n,o,s;return t=e,n=[{key:"formatResult",value:(s=r(i().mark((function e(t,n){var o,s,r,a,c,u,l,p,h,f,m,_,v,y,I,M,C,T,S,E,k,D,L,R,O,A,b;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f=(new Date).getTime(),e.next=3,g();case 3:if(m=e.sent,_=t?(null==t||null===(o=t.error)||void 0===o||null===(s=o.error)||void 0===s?void 0:s.Code)||"Error":"",v=t&&((null==t||null===(r=t.error)||void 0===r||null===(a=r.error)||void 0===a?void 0:a.Message)||(null==t||null===(c=t.error)||void 0===c?void 0:c.error)||(null==t?void 0:t.error))||"",y=v,I=t?null==t||null===(u=t.error)||void 0===u?void 0:u.statusCode:n.statusCode,M=t?null==t||null===(l=t.error)||void 0===l||null===(p=l.error)||void 0===p?void 0:p.Resource:"",C=t?(null==t||null===(h=t.error)||void 0===h?void 0:h.RequestId)||"":(null==n?void 0:n.RequestId)||"",T=t?C?"Server":"Client":"","getObject"===this.params.requestName&&(this.params.httpSize=n?n.headers&&n.headers["content-length"]:0),S="sliceUploadFile"===this.params.realApi,E="sliceCopyFile"===this.params.realApi,S||E?(k=this.params.httpSize/1024/this.params.partTime,Object.assign(this.params,{httpSpeed:k<0?0:k.toFixed(3)})):(D=f-this.params.startTime,L=this.params.httpEndTime-this.params.httpStartTime,R=this.params.httpSize/1024/(L/1e3),O=this.params.md5EndTime-this.params.md5StartTime,A=this.params.signEndTime-this.params.signStartTime,this.parent&&(this.parent.addParamValue("httpTookTime",d(L)),this.parent.addParamValue("httpFullTime",d(D)),this.parent.addParamValue("httpMd5",d(O)),this.parent.addParamValue("httpSign",d(A)),["multipartUpload","uploadPartCopy","putObjectCopy"].includes(this.params.requestName)&&this.parent.addParamValue("partTime",d(L))),Object.assign(this.params,{httpFullTime:d(D),httpMd5:d(O),httpSign:d(A),httpTookTime:d(L),httpSpeed:R<0?0:R.toFixed(3)})),Object.assign(this.params,{networkType:m,requestResult:t?"Failure":"Success",errorType:T,errorCode:_,errorHttpCode:I,errorName:y,errorMessage:v,errorServiceName:M,errorRequestId:C}),!t||_&&v||(this.params.fullError=t?JSON.stringify(t):""),"getObject"===this.params.name&&(this.params.size=n?n.headers&&n.headers["content-length"]:-1),this.params.url){try{b=/^http(s)?:\/\/(.*?)\//.exec(this.params.url),this.params.host=b[2]}catch(i){this.params.host=this.params.url}this.params.httpDomain=this.params.host}case 19:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"report",value:(o=r(i().mark((function e(t,n){var o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.beacon||this.clsReporter){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.formatResult(t,n);case 4:o=_(this.params),this.beacon&&this.sendEventsToBeacon(o),this.clsReporter&&this.sendEventsToCLS(o);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"setParams",value:function(e){Object.assign(this.params,e)}},{key:"addParamValue",value:function(e,t){this.params[e]=(+this.params[e]+ +t).toFixed(3)}},{key:"sendEventsToBeacon",value:function(e){if("sliceUploadFile"!==this.params.requestName&&"sliceUploadFile"!==this.params.realApi||this.deepTracker){var t="qcloud_track_cos_sdk";0===this.delay?this.beacon&&this.beacon.onDirectUserAction(t,e):this.beacon&&this.beacon.onUserAction(t,e)}}},{key:"sendEventsToCLS",value:function(e){var t=!(0!==this.delay);this.clsReporter.log(e,t)}},{key:"generateSubTracker",value:function(t){return Object.assign(t,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,accelerate:this.params.accelerate,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.params.delay,clsReporter:this.clsReporter}),new e(t)}}],n&&c(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();e.exports=v},function(e){e.exports=JSON.parse('{"name":"cos-wx-sdk-v5","version":"1.8.0","description":"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)","main":"dist/cos-wx-sdk-v5.min.js","scripts":{"prettier":"prettier --write src demo/demo-sdk.js demo/test.js demo/ciDemo","dev":"cross-env NODE_ENV=development node build.js --mode=development","build":"cross-env NODE_ENV=production node build.js --mode=production","sts.js":"node server/sts.js","postinstall":"patch-package"},"repository":{"type":"git","url":"http://github.com/tencentyun/cos-wx-sdk-v5.git"},"author":"carsonxu","license":"ISC","dependencies":{"fast-xml-parser":"4.5.0","mime":"^2.4.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^7.0.3","express":"^4.17.1","patch-package":"^8.0.0","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","terser-webpack-plugin":"4.2.3","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},function(e,t,n){const o=n(1),i={allowBooleanAttributes:!1,unpairedTags:[]};function s(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function r(e,t){const n=t;for(;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{const o=e.substr(n,t-n);if(t>5&&"xml"===o)return g("InvalidXml","XML declaration allowed only at the start of the document.",m(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function a(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},i,t);const n=[];let c=!1,u=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let i=0;i<e.length;i++)if("<"===e[i]&&"?"===e[i+1]){if(i+=2,i=r(e,i),i.err)return i}else{if("<"!==e[i]){if(s(e[i]))continue;return g("InvalidChar","char '"+e[i]+"' is not expected.",m(e,i))}{let f=i;if(i++,"!"===e[i]){i=a(e,i);continue}{let _=!1;"/"===e[i]&&(_=!0,i++);let v="";for(;i<e.length&&">"!==e[i]&&" "!==e[i]&&"\t"!==e[i]&&"\n"!==e[i]&&"\r"!==e[i];i++)v+=e[i];if(v=v.trim(),"/"===v[v.length-1]&&(v=v.substring(0,v.length-1),i--),p=v,!o.isName(p)){let t;return t=0===v.trim().length?"Invalid space after '<'.":"Tag '"+v+"' is an invalid name.",g("InvalidTag",t,m(e,i))}const y=l(e,i);if(!1===y)return g("InvalidAttr","Attributes for '"+v+"' have open quote.",m(e,i));let I=y.value;if(i=y.index,"/"===I[I.length-1]){const n=i-I.length;I=I.substring(0,I.length-1);const o=d(I,t);if(!0!==o)return g(o.err.code,o.err.msg,m(e,n+o.err.line));c=!0}else if(_){if(!y.tagClosed)return g("InvalidTag","Closing tag '"+v+"' doesn't have proper closing.",m(e,i));if(I.trim().length>0)return g("InvalidTag","Closing tag '"+v+"' can't have attributes or invalid starting.",m(e,f));if(0===n.length)return g("InvalidTag","Closing tag '"+v+"' has not been opened.",m(e,f));{const t=n.pop();if(v!==t.tagName){let n=m(e,t.tagStartPos);return g("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+v+"'.",m(e,f))}0==n.length&&(u=!0)}}else{const o=d(I,t);if(!0!==o)return g(o.err.code,o.err.msg,m(e,i-I.length+o.err.line));if(!0===u)return g("InvalidXml","Multiple possible root nodes found.",m(e,i));-1!==t.unpairedTags.indexOf(v)||n.push({tagName:v,tagStartPos:f}),c=!0}for(i++;i<e.length;i++)if("<"===e[i]){if("!"===e[i+1]){i++,i=a(e,i);continue}if("?"!==e[i+1])break;if(i=r(e,++i),i.err)return i}else if("&"===e[i]){const t=h(e,i);if(-1==t)return g("InvalidChar","char '&' is not expected.",m(e,i));i=t}else if(!0===u&&!s(e[i]))return g("InvalidXml","Extra text at the end",m(e,i));"<"===e[i]&&i--}}}var p;return c?1==n.length?g("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",m(e,n[0].tagStartPos)):!(n.length>0)||g("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):g("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(e,t){let n="",o="",i=!1;for(;t<e.length;t++){if(e[t]===c||e[t]===u)""===o?o=e[t]:o!==e[t]||(o="");else if(">"===e[t]&&""===o){i=!0;break}n+=e[t]}return""===o&&{value:n,index:t,tagClosed:i}}const p=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function d(e,t){const n=o.getAllMatches(e,p),i={};for(let o=0;o<n.length;o++){if(0===n[o][1].length)return g("InvalidAttr","Attribute '"+n[o][2]+"' has no space in starting.",_(n[o]));if(void 0!==n[o][3]&&void 0===n[o][4])return g("InvalidAttr","Attribute '"+n[o][2]+"' is without value.",_(n[o]));if(void 0===n[o][3]&&!t.allowBooleanAttributes)return g("InvalidAttr","boolean attribute '"+n[o][2]+"' is not allowed.",_(n[o]));const e=n[o][2];if(!f(e))return g("InvalidAttr","Attribute '"+e+"' is an invalid name.",_(n[o]));if(i.hasOwnProperty(e))return g("InvalidAttr","Attribute '"+e+"' is repeated.",_(n[o]));i[e]=1}return!0}function h(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function g(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function f(e){return o.isName(e)}function m(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function _(e){return e.startIndex+e[1].length}},function(e,t){e.exports=function(e){return"function"==typeof e?e:Array.isArray(e)?t=>{for(const n of e){if("string"==typeof n&&t===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}}:()=>!1}},function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){n(e).push(t)},e.off=function(e,t){for(var o=n(e),i=o.length-1;i>=0;i--)t===o[i]&&o.splice(i,1)},e.emit=function(e,t){for(var o=n(e).map((function(e){return e})),i=0;i<o.length;i++)o[i](t)}};e.exports.init=n,e.exports.EventProxy=function(){n(this)}},function(e,t,n){var o,i,s=n(0),r="cos_sdk_upload_cache",a=function(){try{o.length?Un.setStorageSync(r,JSON.stringify(o)):Un.removeStorageSync(r)}catch(e){}},c=function(){if(!o){o=function(){try{var e=JSON.parse(Un.getStorageSync(r))}catch(t){}return e||(e=[]),e}();for(var e=!1,t=Math.round(Date.now()/1e3),n=o.length-1;n>=0;n--){var i=o[n][2];(!i||i+2592e3<t)&&(o.splice(n,1),e=!0)}e&&a()}},u=function(){i||(i=setTimeout((function(){a(),i=null}),400))},l={using:{},setUsing:function(e){l.using[e]=!0},removeUsing:function(e){delete l.using[e]},getFileId:function(e,t,n,o){return e.FilePath&&e.size&&e.lastModifiedTime&&t?s.md5([e.FilePath].join("::"))+"-"+s.md5([e.size,e.mode,e.lastAccessedTime,e.lastModifiedTime,t,n,o].join("::")):null},getCopyFileId:function(e,t,n,o,i){var r=t["content-length"],a=t.etag||"",c=t["last-modified"];return e&&n?s.md5([e,r,a,c,n,o,i].join("::")):null},getUploadIdList:function(e){if(!e)return null;c();for(var t=[],n=0;n<o.length;n++)o[n][0]===e&&t.push(o[n][1]);return t.length?t:null},saveUploadId:function(e,t,n){if(c(),e){for(var i=e.substr(0,e.indexOf("-")+1),s=o.length-1;s>=0;s--){var r=o[s];(r[0]===e&&r[1]===t||e!==r[0]&&0===r[0].indexOf(i))&&o.splice(s,1)}o.unshift([e,t,Math.round(Date.now()/1e3)]),o.length>n&&o.splice(n),u()}},removeUploadId:function(e){c(),delete l.using[e];for(var t=o.length-1;t>=0;t--)o[t][1]===e&&o.splice(t,1);u()}};e.exports=l},function(e,t,n){var o=n(9);e.exports=o},function(e,t,n){var o=n(0),i=n(6),s=n(25),r=n(26),a=n(32),c=n(3),u={SecretId:"",SecretKey:"",SecurityToken:"",StartTime:0,ExpiredTime:0,ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,HttpDNSServiceId:"",SimpleUploadMethod:"postObject",AutoSwitchHost:!1,CopySourceParser:null,ObjectKeySimplifyCheck:!0,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null},l=function(e){if(this.options=o.extend(o.clone(u),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,this.options.AppId,this.options.SecretId&&this.options.SecretId.indexOf(" "),this.options.SecretKey&&this.options.SecretKey.indexOf(" "),this.options.ForcePathStyle)throw new Error("ForcePathStyle is not supported");i.init(this),s.init(this)};r.init(l,s),a.init(l,s),l.util={md5:o.md5,xml2json:o.xml2json,json2xml:o.json2xml,encodeBase64:o.encodeBase64},l.getAuthorization=o.getAuth,l.version=c.version,e.exports=l},function(e,t,n){(function(e){var t;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(){var i="input is invalid type",s="object"===("undefined"==typeof window?"undefined":o(window)),r=s?window:{};r.JS_MD5_NO_WINDOW&&(s=!1),!s&&"object"===("undefined"==typeof self?"undefined":o(self))&&(r=self);var a,c=!r.JS_MD5_NO_COMMON_JS&&"object"===o(e)&&e.exports,u=n(12),l=!r.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,p="0123456789abcdef".split(""),d=[128,32768,8388608,-2147483648],h=[0,8,16,24],g=["hex","array","digest","buffer","arrayBuffer","base64"],f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),m=[];if(l){var _=new ArrayBuffer(68);a=new Uint8Array(_),m=new Uint32Array(_)}!r.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!r.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===o(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});var v=function(e){return function(t){return new y(!0).update(t)[e]()}};function y(e){if(e)m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m,this.buffer8=a;else if(l){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}y.prototype.update=function(e){if(!this.finalized){var t,n=o(e);if("string"!==n){if("object"!==n)throw i;if(null===e)throw i;if(!l||e.constructor!==ArrayBuffer&&"ArrayBuffer"!==e.constructor.name){if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw i}else e=new Uint8Array(e);t=!0}for(var s,r,a=0,c=e.length,u=this.blocks,p=this.buffer8;a<c;){if(this.hashed&&(this.hashed=!1,u[0]=u[16],u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),t)if(l)for(r=this.start;a<c&&r<64;++a)p[r++]=e[a];else for(r=this.start;a<c&&r<64;++a)u[r>>2]|=e[a]<<h[3&r++];else if(l)for(r=this.start;a<c&&r<64;++a)(s=e.charCodeAt(a))<128?p[r++]=s:s<2048?(p[r++]=192|s>>6,p[r++]=128|63&s):s<55296||s>=57344?(p[r++]=224|s>>12,p[r++]=128|s>>6&63,p[r++]=128|63&s):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),p[r++]=240|s>>18,p[r++]=128|s>>12&63,p[r++]=128|s>>6&63,p[r++]=128|63&s);else for(r=this.start;a<c&&r<64;++a)(s=e.charCodeAt(a))<128?u[r>>2]|=s<<h[3&r++]:s<2048?(u[r>>2]|=(192|s>>6)<<h[3&r++],u[r>>2]|=(128|63&s)<<h[3&r++]):s<55296||s>=57344?(u[r>>2]|=(224|s>>12)<<h[3&r++],u[r>>2]|=(128|s>>6&63)<<h[3&r++],u[r>>2]|=(128|63&s)<<h[3&r++]):(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),u[r>>2]|=(240|s>>18)<<h[3&r++],u[r>>2]|=(128|s>>12&63)<<h[3&r++],u[r>>2]|=(128|s>>6&63)<<h[3&r++],u[r>>2]|=(128|63&s)<<h[3&r++]);this.lastByteIndex=r,this.bytes+=r-this.start,r>=64?(this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=d[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},y.prototype.hash=function(){var e,t,n,o,i,s,r=this.blocks;this.first?t=((t=((e=((e=r[0]-680876937)<<7|e>>>25)-271733879|0)^(n=((n=(-271733879^(o=((o=(-1732584194^2004318071&e)+r[1]-117830708)<<12|o>>>20)+e|0)&(-271733879^e))+r[2]-1126478375)<<17|n>>>15)+o|0)&(o^e))+r[3]-1316259209)<<22|t>>>10)+n|0:(e=this.h0,t=this.h1,n=this.h2,t=((t+=((e=((e+=((o=this.h3)^t&(n^o))+r[0]-680876936)<<7|e>>>25)+t|0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+r[1]-389564586)<<12|o>>>20)+e|0)&(e^t))+r[2]+606105819)<<17|n>>>15)+o|0)&(o^e))+r[3]-1044525330)<<22|t>>>10)+n|0),t=((t+=((e=((e+=(o^t&(n^o))+r[4]-176418897)<<7|e>>>25)+t|0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+r[5]+1200080426)<<12|o>>>20)+e|0)&(e^t))+r[6]-1473231341)<<17|n>>>15)+o|0)&(o^e))+r[7]-45705983)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(o^t&(n^o))+r[8]+1770035416)<<7|e>>>25)+t|0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+r[9]-1958414417)<<12|o>>>20)+e|0)&(e^t))+r[10]-42063)<<17|n>>>15)+o|0)&(o^e))+r[11]-1990404162)<<22|t>>>10)+n|0,t=((t+=((e=((e+=(o^t&(n^o))+r[12]+1804603682)<<7|e>>>25)+t|0)^(n=((n+=(t^(o=((o+=(n^e&(t^n))+r[13]-40341101)<<12|o>>>20)+e|0)&(e^t))+r[14]-1502002290)<<17|n>>>15)+o|0)&(o^e))+r[15]+1236535329)<<22|t>>>10)+n|0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+r[1]-165796510)<<5|e>>>27)+t|0)^t))+r[6]-1069501632)<<9|o>>>23)+e|0)^e&((n=((n+=(e^t&(o^e))+r[11]+643717713)<<14|n>>>18)+o|0)^o))+r[0]-373897302)<<20|t>>>12)+n|0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+r[5]-701558691)<<5|e>>>27)+t|0)^t))+r[10]+38016083)<<9|o>>>23)+e|0)^e&((n=((n+=(e^t&(o^e))+r[15]-660478335)<<14|n>>>18)+o|0)^o))+r[4]-405537848)<<20|t>>>12)+n|0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+r[9]+568446438)<<5|e>>>27)+t|0)^t))+r[14]-1019803690)<<9|o>>>23)+e|0)^e&((n=((n+=(e^t&(o^e))+r[3]-187363961)<<14|n>>>18)+o|0)^o))+r[8]+1163531501)<<20|t>>>12)+n|0,t=((t+=((o=((o+=(t^n&((e=((e+=(n^o&(t^n))+r[13]-1444681467)<<5|e>>>27)+t|0)^t))+r[2]-51403784)<<9|o>>>23)+e|0)^e&((n=((n+=(e^t&(o^e))+r[7]+1735328473)<<14|n>>>18)+o|0)^o))+r[12]-1926607734)<<20|t>>>12)+n|0,t=((t+=((s=(o=((o+=((i=t^n)^(e=((e+=(i^o)+r[5]-378558)<<4|e>>>28)+t|0))+r[8]-2022574463)<<11|o>>>21)+e|0)^e)^(n=((n+=(s^t)+r[11]+1839030562)<<16|n>>>16)+o|0))+r[14]-35309556)<<23|t>>>9)+n|0,t=((t+=((s=(o=((o+=((i=t^n)^(e=((e+=(i^o)+r[1]-1530992060)<<4|e>>>28)+t|0))+r[4]+1272893353)<<11|o>>>21)+e|0)^e)^(n=((n+=(s^t)+r[7]-155497632)<<16|n>>>16)+o|0))+r[10]-1094730640)<<23|t>>>9)+n|0,t=((t+=((s=(o=((o+=((i=t^n)^(e=((e+=(i^o)+r[13]+681279174)<<4|e>>>28)+t|0))+r[0]-358537222)<<11|o>>>21)+e|0)^e)^(n=((n+=(s^t)+r[3]-722521979)<<16|n>>>16)+o|0))+r[6]+76029189)<<23|t>>>9)+n|0,t=((t+=((s=(o=((o+=((i=t^n)^(e=((e+=(i^o)+r[9]-640364487)<<4|e>>>28)+t|0))+r[12]-421815835)<<11|o>>>21)+e|0)^e)^(n=((n+=(s^t)+r[15]+530742520)<<16|n>>>16)+o|0))+r[2]-995338651)<<23|t>>>9)+n|0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+r[0]-198630844)<<6|e>>>26)+t|0)|~n))+r[7]+1126891415)<<10|o>>>22)+e|0)^((n=((n+=(e^(o|~t))+r[14]-1416354905)<<15|n>>>17)+o|0)|~e))+r[5]-57434055)<<21|t>>>11)+n|0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+r[12]+1700485571)<<6|e>>>26)+t|0)|~n))+r[3]-1894986606)<<10|o>>>22)+e|0)^((n=((n+=(e^(o|~t))+r[10]-1051523)<<15|n>>>17)+o|0)|~e))+r[1]-2054922799)<<21|t>>>11)+n|0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+r[8]+1873313359)<<6|e>>>26)+t|0)|~n))+r[15]-30611744)<<10|o>>>22)+e|0)^((n=((n+=(e^(o|~t))+r[6]-1560198380)<<15|n>>>17)+o|0)|~e))+r[13]+1309151649)<<21|t>>>11)+n|0,t=((t+=((o=((o+=(t^((e=((e+=(n^(t|~o))+r[4]-145523070)<<6|e>>>26)+t|0)|~n))+r[11]-1120210379)<<10|o>>>22)+e|0)^((n=((n+=(e^(o|~t))+r[2]+718787259)<<15|n>>>17)+o|0)|~e))+r[9]-343485551)<<21|t>>>11)+n|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=n-1732584194|0,this.h3=o+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+n|0,this.h3=this.h3+o|0)},y.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return p[e>>4&15]+p[15&e]+p[e>>12&15]+p[e>>8&15]+p[e>>20&15]+p[e>>16&15]+p[e>>28&15]+p[e>>24&15]+p[t>>4&15]+p[15&t]+p[t>>12&15]+p[t>>8&15]+p[t>>20&15]+p[t>>16&15]+p[t>>28&15]+p[t>>24&15]+p[n>>4&15]+p[15&n]+p[n>>12&15]+p[n>>8&15]+p[n>>20&15]+p[n>>16&15]+p[n>>28&15]+p[n>>24&15]+p[o>>4&15]+p[15&o]+p[o>>12&15]+p[o>>8&15]+p[o>>20&15]+p[o>>16&15]+p[o>>28&15]+p[o>>24&15]},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255]},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},y.prototype.buffer=y.prototype.arrayBuffer,y.prototype.base64=function(){for(var e,t,n,o="",i=this.array(),s=0;s<15;)e=i[s++],t=i[s++],n=i[s++],o+=f[e>>>2]+f[63&(e<<4|t>>>4)]+f[63&(t<<2|n>>>6)]+f[63&n];return e=i[s],o+(f[e>>>2]+f[e<<4&63]+"==")};var I=function(){var e=v("hex");e.getCtx=e.create=function(){return new y},e.update=function(t){return e.create().update(t)};for(var t=0;t<g.length;++t){var n=g[t];e[n]=v(n)}return e}();c?e.exports=I:(r.md5=I,u&&(void 0===(t=function(){return I}.call(I,n,I,e))||(e.exports=t)))}()}).call(this,n(11)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t){var n,o,i,s,r,a,c,u,l,p=p||function(e){var t={},n=t.lib={},o=function(){},i=n.Base={extend:function(e){o.prototype=this;var t=new o;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=n.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||a).stringify(this)},concat:function(e){var t=this.words,n=e.words,o=this.sigBytes;if(e=e.sigBytes,this.clamp(),o%4)for(var i=0;i<e;i++)t[o+i>>>2]|=(n[i>>>2]>>>24-i%4*8&255)<<24-(o+i)%4*8;else if(65535<n.length)for(i=0;i<e;i+=4)t[o+i>>>2]=n[i>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],o=0;o<t;o+=4)n.push(4294967296*e.random()|0);return new s.init(n,t)}}),r=t.enc={},a=r.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],o=0;o<e;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o+=2)n[o>>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new s.init(n,t/2)}},c=r.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],o=0;o<e;o++)n.push(String.fromCharCode(t[o>>>2]>>>24-o%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o<t;o++)n[o>>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new s.init(n,t)}},u=r.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},l=n.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,o=n.words,i=n.sigBytes,r=this.blockSize,a=i/(4*r);if(t=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*r,i=e.min(4*t,i),t){for(var c=0;c<t;c+=r)this._doProcessBlock(o,c);c=o.splice(0,t),n.sigBytes-=i}return new s.init(c,i)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});n.Hasher=l.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}});var p=t.algo={};return t}(Math);o=(r=(n=p).lib).WordArray,i=r.Hasher,s=[],r=n.algo.SHA1=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,o=n[0],i=n[1],r=n[2],a=n[3],c=n[4],u=0;80>u;u++){if(16>u)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}l=(o<<5|o>>>27)+c+s[u],l=20>u?l+(1518500249+(i&r|~i&a)):40>u?l+(1859775393+(i^r^a)):60>u?l+((i&r|i&a|r&a)-1894007588):l+((i^r^a)-899497514),c=a,a=r,r=i<<30|i>>>2,i=o,o=l}n[0]=n[0]+o|0,n[1]=n[1]+i|0,n[2]=n[2]+r|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(o+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=i._createHelper(r),n.HmacSHA1=i._createHmacHelper(r),l=(u=p).enc.Utf8,u.algo.HMAC=u.lib.Base.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=l.parse(t));var n=e.blockSize,o=4*n;t.sigBytes>o&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),s=this._iKey=t.clone(),r=i.words,a=s.words,c=0;c<n;c++)r[c]^=1549556828,a[c]^=909522486;i.sigBytes=s.sigBytes=o,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}}),c=(a=p).lib.WordArray,a.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,o=this._map;e.clamp();for(var i=[],s=0;s<n;s+=3)for(var r=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<n;a++)i.push(o.charAt(r>>>6*(3-a)&63));var c=o.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,o=n.charAt(64);if(o){var i=e.indexOf(o);-1!=i&&(t=i)}for(var s=[],r=0,a=0;a<t;a++)if(a%4){var u=n.indexOf(e.charAt(a-1))<<a%4*2,l=n.indexOf(e.charAt(a))>>>6-a%4*2;s[r>>>2]|=(u|l)<<24-r%4*8,r++}return c.create(s,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.exports=p},function(e,t){var n,o,i,s,r,a,c,u,l,p,d,h,g,f,m,_,v,y,I,M=(o=(n=n||{}).Base64,s=function(e){for(var t={},n=0,o=e.length;n<o;n++)t[e.charAt(n)]=n;return t}(i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),r=String.fromCharCode,a=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?r(192|t>>>6)+r(128|63&t):r(224|t>>>12&15)+r(128|t>>>6&63)+r(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return r(240|t>>>18&7)+r(128|t>>>12&63)+r(128|t>>>6&63)+r(128|63&t)},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(c,a)},l=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[i.charAt(n>>>18),i.charAt(n>>>12&63),t>=2?"=":i.charAt(n>>>6&63),t>=1?"=":i.charAt(63&n)].join("")},p=n.btoa?function(e){return n.btoa(e)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},d=function(e){return p(u(e))},h=function(e,t){return t?d(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):d(String(e))},g=new RegExp(["[À-ß][€-¿]","[à-ï][€-¿]{2}","[ð-÷][€-¿]{3}"].join("|"),"g"),f=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return r(55296+(t>>>10))+r(56320+(1023&t));case 3:return r((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return r((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},m=function(e){return e.replace(g,f)},_=function(e){var t=e.length,n=t%4,o=(t>0?s[e.charAt(0)]<<18:0)|(t>1?s[e.charAt(1)]<<12:0)|(t>2?s[e.charAt(2)]<<6:0)|(t>3?s[e.charAt(3)]:0),i=[r(o>>>16),r(o>>>8&255),r(255&o)];return i.length-=[0,0,2,1][n],i.join("")},v=n.atob?function(e){return n.atob(e)}:function(e){return e.replace(/[\s\S]{1,4}/g,_)},y=function(e){return m(v(e))},{VERSION:"2.1.9",atob:v,btoa:p,fromBase64:I=function(e){return y(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))},toBase64:h,utob:u,encode:h,encodeURI:function(e){return h(e,!0)},btou:m,decode:I,noConflict:function(){var e=n.Base64;return n.Base64=o,e}});e.exports=M},function(e,t,n){const o=n(4),i=n(16),s=n(23);e.exports={XMLParser:i,XMLValidator:o,XMLBuilder:s}},function(e,t,n){const{buildOptions:o}=n(17),i=n(18),{prettify:s}=n(22),r=n(4);e.exports=class{constructor(e){this.externalEntities={},this.options=o(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=r.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new i(this.options);n.addExternalEntities(this.externalEntities);const o=n.parseXml(e);return this.options.preserveOrder||void 0===o?o:s(o,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},function(e,t){const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};t.buildOptions=function(e){return Object.assign({},n,e)},t.defaultOptions=n},function(e,t,n){const o=n(1),i=n(19),s=n(20),r=n(21),a=n(5);function c(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const o=t[n];this.lastEntities[o]={regex:new RegExp("&"+o+";","g"),val:e[o]}}}function u(e,t,n,o,i,s,r){if(void 0!==e&&(this.options.trimValues&&!o&&(e=e.trim()),e.length>0)){r||(e=this.replaceEntitiesValue(e));const o=this.options.tagValueProcessor(t,e,n,i,s);return null==o?e:typeof o!=typeof e||o!==e?o:this.options.trimValues||e.trim()===e?M(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function l(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}const p=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function d(e,t,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof e){const n=o.getAllMatches(e,p),i=n.length,s={};for(let e=0;e<i;e++){const o=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(o,t))continue;let i=n[e][4],r=this.options.attributeNamePrefix+o;if(o.length)if(this.options.transformAttributeName&&(r=this.options.transformAttributeName(r)),"__proto__"===r&&(r="#__proto__"),void 0!==i){this.options.trimValues&&(i=i.trim()),i=this.replaceEntitiesValue(i);const e=this.options.attributeValueProcessor(o,i,t);s[r]=null==e?i:typeof e!=typeof i||e!==i?e:M(i,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[r]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=s,e}return s}}const h=function(e){const t=new i("!xml");let n=t,o="",r="";for(let a=0;a<e.length;a++)if("<"===e[a])if("/"===e[a+1]){const t=v(e,">",a,"Closing Tag is not closed.");let i=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){const e=i.indexOf(":");-1!==e&&(i=i.substr(e+1))}this.options.transformTagName&&(i=this.options.transformTagName(i)),n&&(o=this.saveTextToParentTag(o,n,r));const s=r.substring(r.lastIndexOf(".")+1);if(i&&-1!==this.options.unpairedTags.indexOf(i))throw new Error(`Unpaired tag can not be used as closing tag: </${i}>`);let c=0;s&&-1!==this.options.unpairedTags.indexOf(s)?(c=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=r.lastIndexOf("."),r=r.substring(0,c),n=this.tagsNodeStack.pop(),o="",a=t}else if("?"===e[a+1]){let t=y(e,a,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(o=this.saveTextToParentTag(o,n,r),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new i(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,r,t.tagName)),this.addChild(n,e,r)}a=t.closeIndex+1}else if("!--"===e.substr(a+1,3)){const t=v(e,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const i=e.substring(a+4,t-2);o=this.saveTextToParentTag(o,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=t}else if("!D"===e.substr(a+1,2)){const t=s(e,a);this.docTypeEntities=t.entities,a=t.i}else if("!["===e.substr(a+1,2)){const t=v(e,"]]>",a,"CDATA is not closed.")-2,i=e.substring(a+9,t);o=this.saveTextToParentTag(o,n,r);let s=this.parseTextData(i,n.tagname,r,!0,!1,!0,!0);null==s&&(s=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,s),a=t+2}else{let s=y(e,a,this.options.removeNSPrefix),c=s.tagName;const u=s.rawTagName;let l=s.tagExp,p=s.attrExpPresent,d=s.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&o&&"!xml"!==n.tagname&&(o=this.saveTextToParentTag(o,n,r,!1));const h=n;if(h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),c!==t.tagname&&(r+=r?"."+c:c),this.isItStopNode(this.options.stopNodes,r,c)){let t="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)"/"===c[c.length-1]?(c=c.substr(0,c.length-1),r=r.substr(0,r.length-1),l=c):l=l.substr(0,l.length-1),a=s.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))a=s.closeIndex;else{const n=this.readStopNodeData(e,u,d+1);if(!n)throw new Error(`Unexpected end of ${u}`);a=n.i,t=n.tagContent}const o=new i(c);c!==l&&p&&(o[":@"]=this.buildAttributesMap(l,r,c)),t&&(t=this.parseTextData(t,c,r,!0,p,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),o.add(this.options.textNodeName,t),this.addChild(n,o,r)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),r=r.substr(0,r.length-1),l=c):l=l.substr(0,l.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const e=new i(c);c!==l&&p&&(e[":@"]=this.buildAttributesMap(l,r,c)),this.addChild(n,e,r),r=r.substr(0,r.lastIndexOf("."))}else{const e=new i(c);this.tagsNodeStack.push(n),c!==l&&p&&(e[":@"]=this.buildAttributesMap(l,r,c)),this.addChild(n,e,r),n=e}o="",a=d}}else o+=e[a];return t.child};function g(e,t,n){const o=this.options.updateTag(t.tagname,n,t[":@"]);!1===o||("string"==typeof o?(t.tagname=o,e.addChild(t)):e.addChild(t))}const f=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function m(e,t,n,o){return e&&(void 0===o&&(o=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,o))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function _(e,t,n){const o="*."+n;for(const i in e){const n=e[i];if(o===n||t===n)return!0}return!1}function v(e,t,n,o){const i=e.indexOf(t,n);if(-1===i)throw new Error(o);return i+t.length-1}function y(e,t,n,o=">"){const i=function(e,t,n=">"){let o,i="";for(let s=t;s<e.length;s++){let t=e[s];if(o)t===o&&(o="");else if('"'===t||"'"===t)o=t;else if(t===n[0]){if(!n[1])return{data:i,index:s};if(e[s+1]===n[1])return{data:i,index:s}}else"\t"===t&&(t=" ");i+=t}}(e,t+1,o);if(!i)return;let s=i.data;const r=i.index,a=s.search(/\s/);let c=s,u=!0;-1!==a&&(c=s.substring(0,a),s=s.substring(a+1).trimStart());const l=c;if(n){const e=c.indexOf(":");-1!==e&&(c=c.substr(e+1),u=c!==i.data.substr(e+1))}return{tagName:c,tagExp:s,closeIndex:r,attrExpPresent:u,rawTagName:l}}function I(e,t,n){const o=n;let i=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const s=v(e,">",n,`${t} is not closed`);if(e.substring(n+2,s).trim()===t&&(i--,0===i))return{tagContent:e.substring(o,n),i:s};n=s}else if("?"===e[n+1])n=v(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=v(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=v(e,"]]>",n,"StopNode is not closed.")-2;else{const o=y(e,n,">");o&&((o&&o.tagName)===t&&"/"!==o.tagExp[o.tagExp.length-1]&&i++,n=o.closeIndex)}}function M(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&r(e,n)}return o.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=c,this.parseXml=h,this.parseTextData=u,this.resolveNameSpace=l,this.buildAttributesMap=d,this.isItStopNode=_,this.replaceEntitiesValue=f,this.readStopNodeData=I,this.saveTextToParentTag=m,this.addChild=g,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}},function(e,t,n){e.exports=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},function(e,t,n){const o=n(1);function i(e,t){let n="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)n+=e[t];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const o=e[t++];let i="";for(;t<e.length&&e[t]!==o;t++)i+=e[t];return[n,i,t]}function s(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function r(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function a(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function c(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function u(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function l(e){if(o.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}e.exports=function(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let o=1,p=!1,d=!1,h="";for(;t<e.length;t++)if("<"!==e[t]||d)if(">"===e[t]){if(d?"-"===e[t-1]&&"-"===e[t-2]&&(d=!1,o--):o--,0===o)break}else"["===e[t]?p=!0:h+=e[t];else{if(p&&r(e,t))t+=7,[entityName,val,t]=i(e,t+1),-1===val.indexOf("&")&&(n[l(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(p&&a(e,t))t+=8;else if(p&&c(e,t))t+=8;else if(p&&u(e,t))t+=9;else{if(!s)throw new Error("Invalid DOCTYPE");d=!0}o++,h=""}if(0!==o)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}}},function(e,t){const n=/^[-+]?0x[a-fA-F0-9]+$/,o=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e,t={}){if(t=Object.assign({},i,t),!e||"string"!=typeof e)return e;let s=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(s))return e;if(t.hex&&n.test(s))return Number.parseInt(s,16);{const n=o.exec(s);if(n){const o=n[1],i=n[2];let a=(r=n[3])&&-1!==r.indexOf(".")?("."===(r=r.replace(/0+$/,""))?r="0":"."===r[0]?r="0"+r:"."===r[r.length-1]&&(r=r.substr(0,r.length-1)),r):r;const c=n[4]||n[6];if(!t.leadingZeros&&i.length>0&&o&&"."!==s[2])return e;if(!t.leadingZeros&&i.length>0&&!o&&"."!==s[1])return e;{const n=Number(s),r=""+n;return-1!==r.search(/[eE]/)||c?t.eNotation?n:e:-1!==s.indexOf(".")?"0"===r&&""===a||r===a||o&&r==="-"+a?n:e:i?a===r||o+a===r?n:e:s===r||s===o+r?n:e}}return e}var r}},function(e,t,n){function o(e,t,n){let a;const c={};for(let u=0;u<e.length;u++){const l=e[u],p=i(l);let d="";if(d=void 0===n?p:n+"."+p,p===t.textNodeName)void 0===a?a=l[p]:a+=""+l[p];else{if(void 0===p)continue;if(l[p]){let e=o(l[p],t,d);const n=r(e,t);l[":@"]?s(e,l[":@"],d,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==c[p]&&c.hasOwnProperty(p)?(Array.isArray(c[p])||(c[p]=[c[p]]),c[p].push(e)):t.isArray(p,d,n)?c[p]=[e]:c[p]=e}}}return"string"==typeof a?a.length>0&&(c[t.textNodeName]=a):void 0!==a&&(c[t.textNodeName]=a),c}function i(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const e=t[n];if(":@"!==e)return e}}function s(e,t,n,o){if(t){const i=Object.keys(t),s=i.length;for(let r=0;r<s;r++){const s=i[r];o.isArray(s,n+"."+s,!0,!0)?e[s]=[t[s]]:e[s]=t[s]}}}function r(e,t){const{textNodeName:n}=t,o=Object.keys(e).length;return 0===o||!(1!==o||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}t.prettify=function(e,t){return o(e,t)}},function(e,t,n){const o=n(24),i=n(5),s={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(e){this.options=Object.assign({},s,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=i(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=c,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(e,t,n,o){const i=this.j2x(e,n+1,o.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,n):this.buildObjectNode(i.val,t,i.attrStr,n)}function c(e){return this.options.indentBy.repeat(e)}function u(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}r.prototype.build=function(e){return this.options.preserveOrder?o(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},r.prototype.j2x=function(e,t,n){let o="",i="";const s=n.join(".");for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))if(void 0===e[r])this.isAttribute(r)&&(i+="");else if(null===e[r])this.isAttribute(r)?i+="":"?"===r[0]?i+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if(e[r]instanceof Date)i+=this.buildTextValNode(e[r],r,"",t);else if("object"!=typeof e[r]){const n=this.isAttribute(r);if(n&&!this.ignoreAttributesFn(n,s))o+=this.buildAttrPairStr(n,""+e[r]);else if(!n)if(r===this.options.textNodeName){let t=this.options.tagValueProcessor(r,""+e[r]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[r],r,"",t)}else if(Array.isArray(e[r])){const o=e[r].length;let s="",a="";for(let c=0;c<o;c++){const o=e[r][c];if(void 0===o);else if(null===o)"?"===r[0]?i+=this.indentate(t)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+r+"/"+this.tagEndChar;else if("object"==typeof o)if(this.options.oneListGroup){const e=this.j2x(o,t+1,n.concat(r));s+=e.val,this.options.attributesGroupName&&o.hasOwnProperty(this.options.attributesGroupName)&&(a+=e.attrStr)}else s+=this.processTextOrObjNode(o,r,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(r,o);e=this.replaceEntitiesValue(e),s+=e}else s+=this.buildTextValNode(o,r,"",t)}this.options.oneListGroup&&(s=this.buildObjectNode(s,r,a,t)),i+=s}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const t=Object.keys(e[r]),n=t.length;for(let i=0;i<n;i++)o+=this.buildAttrPairStr(t[i],""+e[r][t[i]])}else i+=this.processTextOrObjNode(e[r],r,t,n);return{attrStr:o,val:i}},r.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},r.prototype.buildObjectNode=function(e,t,n,o){if(""===e)return"?"===t[0]?this.indentate(o)+"<"+t+n+"?"+this.tagEndChar:this.indentate(o)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let i="</"+t+this.tagEndChar,s="";return"?"===t[0]&&(s="?",i=""),!n&&""!==n||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===s.length?this.indentate(o)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(o)+"<"+t+n+s+this.tagEndChar+e+this.indentate(o)+i:this.indentate(o)+"<"+t+n+s+">"+e+i}},r.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},r.prototype.buildTextValNode=function(e,t,n,o){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(o)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(o)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(o)+"<"+t+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),""===i?this.indentate(o)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(o)+"<"+t+n+">"+i+"</"+t+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e},e.exports=r},function(e,t){function n(e,t,a,c){let u="",l=!1;for(let p=0;p<e.length;p++){const d=e[p],h=o(d);if(void 0===h)continue;let g="";if(g=0===a.length?h:`${a}.${h}`,h===t.textNodeName){let e=d[h];s(g,t)||(e=t.tagValueProcessor(h,e),e=r(e,t)),l&&(u+=c),u+=e,l=!1;continue}if(h===t.cdataPropName){l&&(u+=c),u+=`<![CDATA[${d[h][0][t.textNodeName]}]]>`,l=!1;continue}if(h===t.commentPropName){u+=c+`\x3c!--${d[h][0][t.textNodeName]}--\x3e`,l=!0;continue}if("?"===h[0]){const e=i(d[":@"],t),n="?xml"===h?"":c;let o=d[h][0][t.textNodeName];o=0!==o.length?" "+o:"",u+=n+`<${h}${o}${e}?>`,l=!0;continue}let f=c;""!==f&&(f+=t.indentBy);const m=c+`<${h}${i(d[":@"],t)}`,_=n(d[h],t,g,f);-1!==t.unpairedTags.indexOf(h)?t.suppressUnpairedNode?u+=m+">":u+=m+"/>":_&&0!==_.length||!t.suppressEmptyNode?_&&_.endsWith(">")?u+=m+`>${_}${c}</${h}>`:(u+=m+">",_&&""!==c&&(_.includes("/>")||_.includes("</"))?u+=c+t.indentBy+_+c:u+=_,u+=`</${h}>`):u+=m+"/>",l=!0}return u}function o(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const o=t[n];if(e.hasOwnProperty(o)&&":@"!==o)return o}}function i(e,t){let n="";if(e&&!t.ignoreAttributes)for(let o in e){if(!e.hasOwnProperty(o))continue;let i=t.attributeValueProcessor(o,e[o]);i=r(i,t),!0===i&&t.suppressBooleanAttributes?n+=` ${o.substr(t.attributeNamePrefix.length)}`:n+=` ${o.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function s(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let o in t.stopNodes)if(t.stopNodes[o]===e||t.stopNodes[o]==="*."+n)return!0;return!1}function r(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const o=t.entities[n];e=e.replace(o.regex,o.val)}return e}e.exports=function(e,t){let o="";return t.format&&t.indentBy.length>0&&(o="\n"),n(e,t,"",o)}},function(e,t,n){var o=n(7),i=n(0),s={};e.exports.transferToTaskMethod=function(e,t){s[t]=e[t],e[t]=function(e,n){e.SkipTask?s[t].call(this,e,n):this._addTask(t,e,n)}},e.exports.init=function(e){var t,n,r=[],a={},c=0,u=0,l=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),t},p=(n=function(){t=0,e.emit("task-list-update",{list:i.map(r,l)}),e.emit("list-update",{list:i.map(r,l)})},function(){t||(t=setTimeout(n))}),d=function(){if(!(r.length<=e.options.UploadQueueSize)){for(var t=0;t<u&&t<r.length&&r.length>e.options.UploadQueueSize;){var n="waiting"===r[t].state||"checking"===r[t].state||"uploading"===r[t].state;r[t]&&n?t++:(a[r[t].id]&&delete a[r[t].id],r.splice(t,1),u--)}p()}},h=function t(){if(!(c>=e.options.FileParallelLimit)){for(;r[u]&&"waiting"!==r[u].state;)u++;if(!(u>=r.length)){var n=r[u];u++,c++,n.state="checking",n.params.onTaskStart&&n.params.onTaskStart(l(n)),!n.params.UploadData&&(n.params.UploadData={});var o=i.formatParams(n.api,n.params);s[n.api].call(e,o,(function(o,i){e._isRunningTask(n.id)&&("checking"!==n.state&&"uploading"!==n.state||(n.state=o?"error":"success",o&&(n.error=o),c--,p(),t(),n.callback&&n.callback(o,i),"success"===n.state&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)),d())})),p(),setTimeout(t)}}},g=function(t,n){var i=a[t];if(i){var s=i&&"waiting"===i.state,r=i&&("checking"===i.state||"uploading"===i.state);if("canceled"===n&&"canceled"!==i.state||"paused"===n&&s||"paused"===n&&r){if("paused"===n&&i.params.Body&&"function"==typeof i.params.Body.pipe)return;i.state=n,e.emit("inner-kill-task",{TaskId:t,toState:n});try{var u=i&&i.params&&i.params.UploadData.UploadId}catch(l){}"canceled"===n&&u&&o.removeUsing(u),p(),r&&(c--,h()),"canceled"===n&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)}d()}};e._addTasks=function(t){i.each(t,(function(t){e._addTask(t.api,t.params,t.callback,!0)})),p()},e._addTask=function(t,n,o,s){var c="postObject"===e.options.SimpleUploadMethod?"postObject":"putObject";"sliceUploadFile"!==t||i.canFileSlice()||(t=c),n=i.formatParams(t,n);var u=i.uuid();n.TaskId=u,n.onTaskReady&&n.onTaskReady(u);var l={params:n,callback:o,api:t,index:r.length,id:u,Bucket:n.Bucket,Region:n.Region,Key:n.Key,FilePath:n.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null},g=n.onHashProgress;n.onHashProgress=function(t){e._isRunningTask(l.id)&&(l.hashPercent=t.percent,g&&g(t),p())};var f=n.onProgress;return n.onProgress=function(t){e._isRunningTask(l.id)&&("checking"===l.state&&(l.state="uploading"),l.loaded=t.loaded,l.size=t.total,l.speed=t.speed,l.percent=t.percent,f&&f(t),p())},i.getFileSize(t,n,(function(e,t){e?o(e):(a[u]=l,r.push(l),l.size=t,!s&&p(),h(),d())})),u},e._isRunningTask=function(e){var t=a[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return i.map(r,l)},e.cancelTask=function(e){g(e,"canceled")},e.pauseTask=function(e){g(e,"paused")},e.restartTask=function(e){var t=a[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",p(),u=Math.min(u,t.index),h())},e.isUploadRunning=function(){return c||u<r.length}}},function(e,t,n){var o=n(27),i=n(0),s=n(28);function r(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},o=(e&&e.AccessControlList||{}).Grant;o&&(o=i.isArray(o)?o:[o]);var s={READ:0,WRITE:0,FULL_CONTROL:0};return o&&o.length&&i.each(o,(function(o){"qcs::cam::anyone:anyone"===o.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===o.Grantee.URI?s[o.Permission]=1:o.Grantee.ID!==e.Owner.ID&&t[n[o.Permission]].push('id="'+o.Grantee.ID+'"')})),s.FULL_CONTROL||s.WRITE&&s.READ?t.ACL="public-read-write":s.READ?t.ACL="public-read":t.ACL="private",i.each(n,(function(e){t[e]=a(t[e].join(","))})),t}function a(e){var t,n,o=e.split(","),i={};for(t=0;t<o.length;)i[n=o[t].trim()]?o.splice(t,1):(i[n]=!0,o[t]=n,t++);return o.join(",")}function c(e){var t=e.bucket,n=t.substr(0,t.lastIndexOf("-")),o=t.substr(t.lastIndexOf("-")+1),s=e.domain,r=e.region,a=e.object;s||(s=["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(r)>-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(s="{Bucket}."+s)),s=(s=s.replace(/\{\{AppId\}\}/gi,o).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,r).replace(/\{\{.*?\}\}/gi,"")).replace(/\{AppId\}/gi,o).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,r).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(s)||(s="https://"+s),"/"===s.slice(-1)&&(s=s.slice(0,-1));var c=s;return e.ForcePathStyle&&(c+="/"+t),c+="/",a&&(c+=i.camSafeUrlEncode(a).replace(/%2F/g,"/")),e.isLocation&&(c=c.replace(/^https?:\/\//,"")),c}var u=function(e){if(!e.Bucket||!e.Region)return"";var t=void 0===e.UseAccelerate?this.options.UseAccelerate:e.UseAccelerate;return(e.Url||c({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:t?"accelerate":e.Region})).replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1")};function l(e,t){var n=i.clone(e.Headers),o="";i.each(n,(function(e,t){(""===e||["content-type","cache-control"].indexOf(t.toLowerCase())>-1)&&delete n[t],"host"===t.toLowerCase()&&(o=e)}));var s=!1!==e.ForceSignHost;!o&&e.SignHost&&s&&(n.Host=e.SignHost);var r=!1,a=function(e,n){r||(r=!0,n&&n.XCosSecurityToken&&!n.SecurityToken&&((n=i.clone(n)).SecurityToken=n.XCosSecurityToken,delete n.XCosSecurityToken),t&&t(e,n))},c=this,u=e.Bucket||"",l=e.Region||"",p="name/cos:PostObject"!==e.Action&&e.Key?e.Key:"";c.options.ForcePathStyle&&u&&(p=u+"/"+p);var d="/"+p,h={},g=e.Scope;if(!g){var f=e.Action||"",m=e.ResourceKey||e.Key||"";g=e.Scope||[{action:f,bucket:u,region:l,prefix:m}]}var _=i.md5(JSON.stringify(g));c._StsCache=c._StsCache||[],function(){var e,t;for(e=c._StsCache.length-1;e>=0;e--){t=c._StsCache[e];var n=Math.round(i.getSkewTime(c.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n<t.StartTime||n>=t.ExpiredTime)c._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===_){h=t;break}}}();var v=function(){var t="";h.StartTime&&e.Expires?t=h.StartTime+";"+(h.StartTime+1*e.Expires):h.StartTime&&h.ExpiredTime&&(t=h.StartTime+";"+h.ExpiredTime);var o={Authorization:i.getAuth({SecretId:h.TmpSecretId,SecretKey:h.TmpSecretKey,Method:e.Method,Pathname:d,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:c.options.SystemClockOffset,KeyTime:t,ForceSignHost:s}),SecurityToken:h.SecurityToken||h.XCosSecurityToken||"",Token:h.Token||"",ClientIP:h.ClientIP||"",ClientUA:h.ClientUA||"",SignFrom:"client"};a(null,o)},y=function(e){if(e.Authorization){var t=!1,n=e.Authorization;if(n)if(n.indexOf(" ")>-1)t=!1;else if(n.indexOf("q-sign-algorithm=")>-1&&n.indexOf("q-ak=")>-1&&n.indexOf("q-sign-time=")>-1&&n.indexOf("q-key-time=")>-1&&n.indexOf("q-url-param-list=")>-1)t=!0;else try{(n=atob(n)).indexOf("a=")>-1&&n.indexOf("k=")>-1&&n.indexOf("t=")>-1&&n.indexOf("r=")>-1&&n.indexOf("b=")>-1&&(t=!0)}catch(o){}if(!t)return i.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return i.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return i.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return i.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return i.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return i.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return i.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(h.ExpiredTime&&h.ExpiredTime-i.getSkewTime(c.options.SystemClockOffset)/1e3>60)v();else if(c.options.getAuthorization)c.options.getAuthorization.call(c,{Bucket:u,Region:l,Method:e.Method,Key:p,Pathname:d,Query:e.Query,Headers:n,Scope:g,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:s},(function(e){"string"==typeof e&&(e={Authorization:e});var t=y(e);if(t)return a(t);e.Authorization?a(null,e):((h=e||{}).Scope=g,h.ScopeKey=_,c._StsCache.push(h),v())}));else{if(!c.options.getSTS)return function(){var t="";if(c.options.StartTime&&e.Expires){if(10!==c.options.StartTime.toString().length)return a(i.error(new Error('params "StartTime" should be 10 digits')));t=c.options.StartTime+";"+(c.options.StartTime+1*e.Expires)}else if(c.options.StartTime&&c.options.ExpiredTime){if(10!==c.options.StartTime.toString().length)return a(i.error(new Error('params "StartTime" should be 10 digits')));if(10!==c.options.ExpiredTime.toString().length)return a(i.error(new Error('params "ExpiredTime" should be 10 digits')));t=c.options.StartTime+";"+1*c.options.ExpiredTime}var o={Authorization:i.getAuth({SecretId:e.SecretId||c.options.SecretId,SecretKey:e.SecretKey||c.options.SecretKey,Method:e.Method,Pathname:d,Query:e.Query,Headers:n,Expires:e.Expires,KeyTime:t,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:s}),SecurityToken:c.options.SecurityToken||c.options.XCosSecurityToken,SignFrom:"client"};return a(null,o),o}();c.options.getSTS.call(c,{Bucket:u,Region:l},(function(e){(h=e||{}).Scope=g,h.ScopeKey=_,h.TmpSecretId||(h.TmpSecretId=h.SecretId),h.TmpSecretKey||(h.TmpSecretKey=h.SecretKey);var t=y(h);if(t)return a(t);c._StsCache.push(h),v()}))}return""}function p(e){var t=this,n=!1,o=!1,s=!1,r=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,c=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===c)&&(s=!0)}catch(d){}if(e){if(s&&r){var u=Date.parse(r);this.options.CorrectClockSkew&&Math.abs(i.getSkewTime(this.options.SystemClockOffset)-u)>=3e4&&(this.options.SystemClockOffset=u-Date.now(),n=!0)}else{if(5===Math.floor(e.statusCode/100))return{canRetry:!0,networkError:!1};if("timeout"===e.message)return{canRetry:!0,networkError:t.options.AutoSwitchHost}}if(e.statusCode){var l=Math.floor(e.statusCode/100),p=(null==e?void 0:e.headers)&&(null==e?void 0:e.headers["x-cos-request-id"]);[3,4,5].includes(l)&&!p&&(n=t.options.AutoSwitchHost,o=!0)}else n=!0,o=t.options.AutoSwitchHost}return{canRetry:n,networkError:o}}function d(e){var t=e.requestUrl,n=e.clientCalcSign,o=e.networkError;return!!this.options.AutoSwitchHost&&!!t&&!!n&&!!o&&/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/.test(t)&&!/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/.test(t)}function h(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=i.clearKey(e.qs),e.headers&&(e.headers=i.clearKey(e.headers)),e.qs&&(e.qs=i.clearKey(e.qs));var o=i.clone(e.qs);e.action&&(o[e.action]="");var s=e.url||e.Url,r=e.SignHost||u.call(this,{Bucket:e.Bucket,Region:e.Region,Url:s}),a=e.tracker;!function i(s){var c=n.options.SystemClockOffset;e.SwitchHost&&(r=r.replace(/myqcloud.com/,"tencentcos.cn")),a&&a.setParams({signStartTime:(new Date).getTime(),httpRetryTimes:s-1}),l.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:o,Headers:e.headers,SignHost:r,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:n.options.ForceSignHost},(function(o,r){o?t(o):(a&&a.setParams({signEndTime:(new Date).getTime(),httpStartTime:(new Date).getTime()}),e.AuthData=r,g.call(n,e,(function(o,u){var l=!1,h=!1;if(o){var g=p.call(n,o);l=g.canRetry||c!==n.options.SystemClockOffset,h=g.networkError}if(a&&a.setParams({httpEndTime:(new Date).getTime()}),o&&s<4&&l){e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]);var f=d.call(n,{requestUrl:(null==o?void 0:o.url)||"",clientCalcSign:"client"===(null==r?void 0:r.SignFrom),networkError:h});e.SwitchHost=f,e.headers["x-cos-sdk-retry"]="true",i(s+1)}else t(o,u)})))}))}(1)}function g(e,t){var n=this,s=e.TaskId;if(!s||n._isRunningTask(s)){var r=e.Bucket,a=e.Region,u=e.Key,l=e.method||"GET",p=e.url||e.Url,d=e.body,h=e.json,g=e.rawBody,f=e.dataType,m=n.options.HttpDNSServiceId;n.options.UseAccelerate&&(a="accelerate"),p=p||c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:r,region:a,object:u}),e.SwitchHost&&(p=p.replace(/myqcloud.com/,"tencentcos.cn"));var _=u?p:"";e.action&&(p=p+"?"+e.action),e.qsStr&&(p=p.indexOf("?")>-1?p+"&"+e.qsStr:p+"?"+e.qsStr);var v={method:l,url:p,headers:e.headers,qs:e.qs,filePath:e.filePath,body:d,json:h,httpDNSServiceId:m,dataType:f},y="x-cos-security-token";i.isCIHost(p)&&(y="x-ci-security-token"),v.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(v.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(v.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(v.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(v.headers[y]=e.AuthData.SecurityToken),v.headers&&(v.headers=i.clearKey(v.headers)),v=i.clearKey(v),e.onProgress&&"function"==typeof e.onProgress&&(v.onProgress=function(t){if(!s||n._isRunningTask(s)){var o=t?t.loaded:0;e.onProgress({loaded:o,total:t.total})}}),this.options.Timeout&&(v.timeout=this.options.Timeout),n.options.ForcePathStyle&&(v.pathStyle=n.options.ForcePathStyle),n.emit("before-send",v);var I,M=v.url.includes("accelerate."),C=v.qs?Object.keys(v.qs).map((function(e){return"".concat(e,"=").concat(v.qs[e])})).join("&"):"",T=C?v.url+"?"+C:v.url;e.tracker&&(e.tracker.setParams({url:T,httpMethod:v.method,accelerate:M,httpSize:(null===(I=v.body)||void 0===I?void 0:I.size)||0}),e.tracker.parent&&!e.tracker.parent.params.url&&e.tracker.parent.setParams({url:_,accelerate:M}));var S=o(v,(function(e,o,r){if("abort"!==e){var a,c=function(e,r){if(s&&n.off("inner-kill-task",E),!a){a=!0;var c={};o&&o.statusCode&&(c.statusCode=o.statusCode),o&&o.headers&&(c.headers=o.headers),e?(v.url&&(c.url=v.url),v.method&&(c.method=v.method),e=i.extend(e||{},c),t(e,null)):(r=i.extend(r||{},c),t(null,r)),S=null}};if(e)c({error:e});else{var u=o.statusCode,l=2===Math.floor(u/100);if(g){if(l)return c(null,{body:r});if(r instanceof ArrayBuffer){var p=i.arrayBufferToString(r),d=i.parseResBody(p);return c({error:d.Error||d})}}var h=i.parseResBody(r);l?h.Error?c({error:h.Error}):c(null,h):c({error:h.Error||h})}}})),E=function e(t){t.TaskId===s&&(S&&S.abort&&S.abort(),n.off("inner-kill-task",e))};s&&n.on("inner-kill-task",E)}}var f={getService:function(e,t){"function"==typeof e&&(t=e,e={});var n="https:",o=this.options.ServiceDomain,s=e.Region;o?(o=o.replace(/\{\{Region\}\}/gi,s||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(o)||(o=n+"//"+o),"/"===o.slice(-1)&&(o=o.slice(0,-1))):o=s?n+"//cos."+s+".myqcloud.com":n+"//service.cos.myqcloud.com",o.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),h.call(this,{Action:"name/cos:GetService",url:o,method:"GET",headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n&&n.ListAllMyBucketsResult&&n.ListAllMyBucketsResult.Buckets&&n.ListAllMyBucketsResult.Buckets.Bucket||[];o=i.isArray(o)?o:[o];var s=n&&n.ListAllMyBucketsResult&&n.ListAllMyBucketsResult.Owner||{};t(null,{Buckets:o,Owner:s,statusCode:n.statusCode,headers:n.headers})}))},putBucket:function(e,t){var n=this,o="";if(e.BucketAZConfig){var s={BucketAZConfig:e.BucketAZConfig};o=i.json2xml({CreateBucketConfiguration:s})}h.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:o,tracker:e.tracker},(function(o,i){if(o)return t(o);var s=c({protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});t(null,{Location:s,statusCode:i.statusCode,headers:i.headers})}))},headBucket:function(e,t){h.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD",tracker:e.tracker},(function(e,n){t(e,n)}))},getBucket:function(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n.marker=e.Marker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucket",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.ListBucketResult||{},s=o.Contents||[],r=o.CommonPrefixes||[];s=i.isArray(s)?s:[s],r=i.isArray(r)?r:[r];var a=i.clone(o);i.extend(a,{Contents:s,CommonPrefixes:r,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},deleteBucket:function(e,t){h.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketAcl:function(e,t){var n=e.Headers,o="";if(e.AccessControlPolicy){var s=i.clone(e.AccessControlPolicy||{}),r=s.Grants||s.Grant;r=i.isArray(r)?r:[r],delete s.Grant,delete s.Grants,s.AccessControlList={Grant:r},o=i.json2xml({AccessControlPolicy:s}),n["Content-Type"]="application/xml",n["Content-MD5"]=i.binaryBase64(i.md5(o))}i.each(n,(function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=a(n[t]))})),h.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:n,action:"acl",body:o,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketAcl:function(e,t){h.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.AccessControlPolicy||{},s=o.Owner||{},a=o.AccessControlList.Grant||[];a=i.isArray(a)?a:[a];var c=r(o);n.headers&&n.headers["x-cos-acl"]&&(c.ACL=n.headers["x-cos-acl"]),c=i.extend(c,{Owner:s,Grants:a,statusCode:n.statusCode,headers:n.headers}),t(null,c)}))},putBucketCors:function(e,t){var n=(e.CORSConfiguration||{}).CORSRules||e.CORSRules||[];n=i.clone(i.isArray(n)?n:[n]),i.each(n,(function(e){i.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var n=t+"s",o=e[n]||e[t]||[];delete e[n],e[t]=i.isArray(o)?o:[o]}))}));var o={CORSRule:n};e.ResponseVary&&(o.ResponseVary=e.ResponseVary);var s=i.json2xml({CORSConfiguration:o}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"cors",headers:r,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketCors:function(e,t){h.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&e.error&&"NoSuchCORSConfiguration"===e.error.Code){var o={CORSRules:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var s=n.CORSConfiguration||{},r=s.CORSRules||s.CORSRule||[];r=i.clone(i.isArray(r)?r:[r]);var a=s.ResponseVary;i.each(r,(function(e){i.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var n=t+"s",o=e[n]||e[t]||[];delete e[t],e[n]=i.isArray(o)?o:[o]}))})),t(null,{CORSRules:r,ResponseVary:a,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketCors:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode||e.statusCode,headers:n.headers})}))},getBucketLocation:function(e,t){h.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location",tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,n)}))},getBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0,tracker:e.tracker},(function(e,n){if(e)return e.statusCode&&403===e.statusCode?t({ErrorStatus:"Access Denied"}):e.statusCode&&405===e.statusCode?t({ErrorStatus:"Method Not Allowed"}):e.statusCode&&404===e.statusCode?t({ErrorStatus:"Policy Not Found"}):t(e);var o={};try{o=JSON.parse(n.body)}catch(i){}t(null,{Policy:o,statusCode:n.statusCode,headers:n.headers})}))},putBucketPolicy:function(e,t){var n=e.Policy,o=n;try{"string"==typeof n?n=JSON.parse(o):o=JSON.stringify(n)}catch(r){t({error:"Policy format error"})}var s=e.Headers;s["Content-Type"]="application/json",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:o,headers:s,json:!0,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},deleteBucketPolicy:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode||e.statusCode,headers:n.headers})}))},putBucketTagging:function(e,t){var n=e.Tagging||{},o=n.TagSet||n.Tags||e.Tags||[];o=i.clone(i.isArray(o)?o:[o]);var s=i.json2xml({Tagging:{TagSet:{Tag:o}}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"tagging",headers:r,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketTagging:function(e,t){h.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var o={Tags:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else{var s=[];try{s=n.Tagging.TagSet.Tag||[]}catch(r){}s=i.clone(i.isArray(s)?s:[s]),t(null,{Tags:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketTagging:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketLifecycle:function(e,t){var n=(e.LifecycleConfiguration||{}).Rules||e.Rules||[];n=i.clone(n);var o=i.json2xml({LifecycleConfiguration:{Rule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"lifecycle",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&e.error&&"NoSuchLifecycleConfiguration"===e.error.Code){var o={Rules:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var s=[];try{s=n.LifecycleConfiguration.Rule||[]}catch(r){}s=i.clone(i.isArray(s)?s:[s]),t(null,{Rules:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketLifecycle:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketVersioning:function(e,t){if(e.VersioningConfiguration){var n=e.VersioningConfiguration||{},o=i.json2xml({VersioningConfiguration:n}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"versioning",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param VersioningConfiguration"})},getBucketVersioning:function(e,t){h.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning",tracker:e.tracker},(function(e,n){e||!n.VersioningConfiguration&&(n.VersioningConfiguration={}),t(e,n)}))},putBucketReplication:function(e,t){var n=i.clone(e.ReplicationConfiguration),o=i.json2xml({ReplicationConfiguration:n});o=(o=o.replace(/<(\/?)Rules>/gi,"<$1Rule>")).replace(/<(\/?)Tags>/gi,"<$1Tag>");var s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"replication",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketReplication:function(e,t){h.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var o={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)}))},deleteBucketReplication:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketWebsite:function(e,t){if(e.WebsiteConfiguration){var n=i.clone(e.WebsiteConfiguration||{}),o=n.RoutingRules||n.RoutingRule||[];o=i.isArray(o)?o:[o],delete n.RoutingRule,delete n.RoutingRules,o.length&&(n.RoutingRules={RoutingRule:o});var s=i.json2xml({WebsiteConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"website",headers:r,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param WebsiteConfiguration"})},getBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var o={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var s=n.WebsiteConfiguration||{};if(s.RoutingRules){var r=i.clone(s.RoutingRules.RoutingRule||[]);r=i.makeArray(r),s.RoutingRules=r}t(null,{WebsiteConfiguration:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteBucketWebsite:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketReferer:function(e,t){if(e.RefererConfiguration){var n=i.clone(e.RefererConfiguration||{}),o=n.DomainList||{},s=o.Domains||o.Domain||[];(s=i.isArray(s)?s:[s]).length&&(n.DomainList={Domain:s});var r=i.json2xml({RefererConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.binaryBase64(i.md5(r)),h.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"referer",headers:a,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param RefererConfiguration"})},getBucketReferer:function(e,t){h.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer",tracker:e.tracker},(function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var o={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var s=n.RefererConfiguration||{};if(s.DomainList){var r=i.makeArray(s.DomainList.Domain||[]);s.DomainList={Domains:r}}t(null,{RefererConfiguration:s,statusCode:n.statusCode,headers:n.headers})}}))},putBucketDomain:function(e,t){var n=(e.DomainConfiguration||{}).DomainRule||e.DomainRule||[];n=i.clone(n);var o=i.json2xml({DomainConfiguration:{DomainRule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"domain",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketDomain:function(e,t){h.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=[];try{o=n.DomainConfiguration.DomainRule||[]}catch(s){}o=i.clone(i.isArray(o)?o:[o]),t(null,{DomainRule:o,statusCode:n.statusCode,headers:n.headers})}))},deleteBucketDomain:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketOrigin:function(e,t){var n=(e.OriginConfiguration||{}).OriginRule||e.OriginRule||[];n=i.clone(n);var o=i.json2xml({OriginConfiguration:{OriginRule:n}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"origin",headers:s,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=[];try{o=n.OriginConfiguration.OriginRule||[]}catch(s){}o=i.clone(i.isArray(o)?o:[o]),t(null,{OriginRule:o,statusCode:n.statusCode,headers:n.headers})}))},deleteBucketOrigin:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketLogging:function(e,t){var n=i.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=i.binaryBase64(i.md5(n)),h.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:o,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketLogging:function(e,t){h.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging",tracker:e.tracker},(function(e,n){if(e)return t(e);delete n.BucketLoggingStatus._xmlns,t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})}))},putBucketInventory:function(e,t){var n=i.clone(e.InventoryConfiguration);if(n.OptionalFields){var o=n.OptionalFields||[];n.OptionalFields={Field:o}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var s=n.Destination.COSBucketDestination.Encryption;Object.keys(s).indexOf("SSECOS")>-1&&(s["SSE-COS"]=s.SSECOS,delete s.SSECOS)}var r=i.json2xml({InventoryConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.binaryBase64(i.md5(r)),h.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"inventory",qs:{id:e.Id},headers:a,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getBucketInventory:function(e,t){h.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.InventoryConfiguration;if(o&&o.OptionalFields&&o.OptionalFields.Field){var s=o.OptionalFields.Field;i.isArray(s)||(s=[s]),o.OptionalFields=s}if(o.Destination&&o.Destination.COSBucketDestination&&o.Destination.COSBucketDestination.Encryption){var r=o.Destination.COSBucketDestination.Encryption;Object.keys(r).indexOf("SSE-COS")>-1&&(r.SSECOS=r["SSE-COS"],delete r["SSE-COS"])}t(null,{InventoryConfiguration:o,statusCode:n.statusCode,headers:n.headers})}))},listBucketInventory:function(e,t){h.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken},tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.ListInventoryConfigurationResult,s=o.InventoryConfiguration||[];s=i.isArray(s)?s:[s],delete o.InventoryConfiguration,i.each(s,(function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;i.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}})),o.InventoryConfigurations=s,i.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)}))},deleteBucketInventory:function(e,t){h.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id},tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},putBucketAccelerate:function(e,t){if(e.AccelerateConfiguration){var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},o=i.json2xml(n),s={"Content-Type":"application/xml"};s["Content-MD5"]=i.binaryBase64(i.md5(o)),h.call(this,{Interface:"putBucketAccelerate",Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"accelerate",headers:s,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))}else t({error:"missing param AccelerateConfiguration"})},getBucketAccelerate:function(e,t){h.call(this,{Interface:"getBucketAccelerate",Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate",tracker:e.tracker},(function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)}))},getObject:function(e,t){if(this.options.ObjectKeySimplifyCheck&&"/"===i.simplifyPath(e.Key))t(i.error(new Error("The Getobject Key is illegal")));else{var n=e.Query||{},o=e.QueryString||"",s=e.tracker;s&&s.setParams({signStartTime:(new Date).getTime()}),n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,h.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,qs:n,qsStr:o,rawBody:!0,dataType:e.DataType,tracker:s},(function(n,o){if(n){var s=n.statusCode;return e.Headers["If-Modified-Since"]&&s&&304===s?t(null,{NotModified:!0}):t(n)}t(null,{Body:o.body,ETag:i.attr(o.headers,"etag",""),statusCode:o.statusCode,headers:o.headers})}))}},headObject:function(e,t){h.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(n,o){if(n){var s=n.statusCode;return e.Headers["If-Modified-Since"]&&s&&304===s?t(null,{NotModified:!0,statusCode:s}):t(n)}o.ETag=i.attr(o.headers,"etag",""),t(null,o)}))},listObjectVersions:function(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,h.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.ListVersionsResult||{},s=o.DeleteMarker||[];s=i.isArray(s)?s:[s];var r=o.Version||[];r=i.isArray(r)?r:[r];var a=i.clone(o);delete a.DeleteMarker,delete a.Version,i.extend(a,{DeleteMarkers:s,Versions:r,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},putObject:function(e,t){var n=this,o=e.ContentLength,r=i.throttleOnProgress.call(n,o,e.onProgress),a=e.Headers;a["Cache-Control"]||a["cache-control"]||(a["Cache-Control"]=""),a["Content-Type"]||a["content-type"]||(a["Content-Type"]=s.getType(e.Key)||"application/octet-stream");var u=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5,l=e.tracker;u&&l&&l.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(u,e.Body,(function(s){s&&(l&&l.setParams({md5EndTime:(new Date).getTime()}),n.options.UploadCheckContentMd5&&(a["Content-MD5"]=i.binaryBase64(s)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(a["x-cos-meta-md5"]=s)),void 0!==e.ContentLength&&(a["Content-Length"]=e.ContentLength),r(null,!0),h.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:r,tracker:l},(function(s,a){if(s)return r(null,!0),t(s);r({loaded:o,total:o},!0);var u=c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});u=u.substr(u.indexOf("://")+3),a.Location=u,a.ETag=i.attr(a.headers,"etag",""),t(null,a)}))}))},postObject:function(e,t){var n=this,o={},s=e.FilePath;if(s){for(var r in o["Cache-Control"]=e.CacheControl,o["Content-Disposition"]=e.ContentDisposition,o["Content-Encoding"]=e.ContentEncoding,o["Content-MD5"]=e.ContentMD5,o["Content-Length"]=e.ContentLength,o["Content-Type"]=e.ContentType,o.Expect=e.Expect,o.Expires=e.Expires,o["x-cos-acl"]=e.ACL,o["x-cos-grant-read"]=e.GrantRead,o["x-cos-grant-write"]=e.GrantWrite,o["x-cos-grant-full-control"]=e.GrantFullControl,o["x-cos-storage-class"]=e.StorageClass,o["x-cos-mime-limit"]=e.MimeLimit,o["x-cos-traffic-limit"]=e.TrafficLimit,o["x-cos-forbid-overwrite"]=e.ForbidOverwrite,o["x-cos-server-side-encryption-customer-algorithm"]=e.SSECustomerAlgorithm,o["x-cos-server-side-encryption-customer-key"]=e.SSECustomerKey,o["x-cos-server-side-encryption-customer-key-MD5"]=e.SSECustomerKeyMD5,o["x-cos-server-side-encryption"]=e.ServerSideEncryption,o["x-cos-server-side-encryption-cos-kms-key-id"]=e.SSEKMSKeyId,o["x-cos-server-side-encryption-context"]=e.SSEContext,delete o["Content-Length"],delete o["content-length"],e)r.indexOf("x-cos-meta-")>-1&&(o[r]=e[r]);var a=i.throttleOnProgress.call(n,o["Content-Length"],e.onProgress);h.call(this,{Action:"name/cos:PostObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:o,qs:e.Query,filePath:s,TaskId:e.TaskId,onProgress:a,tracker:e.tracker},(function(o,i){if(a(null,!0),o)return t(o);if(i&&i.headers){var r=i.headers,u=r.etag||r.Etag||r.ETag||"",l=s.substr(s.lastIndexOf("/")+1),p=c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key.replace(/\$\{filename\}/g,l),isLocation:!0});return t(null,{Location:p,statusCode:i.statusCode,headers:r,ETag:u})}t(null,i)}))}else t({error:"missing param FilePath"})},deleteObject:function(e,t){h.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,tracker:e.tracker},(function(e,n){if(e){var o=e.statusCode;return o&&204===o?t(null,{statusCode:o}):o&&404===o?t(null,{BucketNotFound:!0,statusCode:o}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})}))},getObjectAcl:function(e,t){var n={};e.VersionId&&(n.versionId=e.VersionId),h.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,action:"acl",tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.AccessControlPolicy||{},s=o.Owner||{},a=o.AccessControlList&&o.AccessControlList.Grant||[];a=i.isArray(a)?a:[a];var c=r(o);n.headers&&n.headers["x-cos-acl"]&&(c.ACL=n.headers["x-cos-acl"]),c=i.extend(c,{Owner:s,Grants:a,statusCode:n.statusCode,headers:n.headers}),t(null,c)}))},putObjectAcl:function(e,t){var n=e.Headers,o="";if(e.AccessControlPolicy){var s=i.clone(e.AccessControlPolicy||{}),r=s.Grants||s.Grant;r=i.isArray(r)?r:[r],delete s.Grant,delete s.Grants,s.AccessControlList={Grant:r},o=i.json2xml({AccessControlPolicy:s}),n["Content-Type"]="application/xml",n["Content-MD5"]=i.binaryBase64(i.md5(o))}i.each(n,(function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=a(n[t]))})),h.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:o,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},optionsObject:function(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,h.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n,tracker:e.tracker},(function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var o=n.headers||{};t(null,{AccessControlAllowOrigin:o["access-control-allow-origin"],AccessControlAllowMethods:o["access-control-allow-methods"],AccessControlAllowHeaders:o["access-control-allow-headers"],AccessControlExposeHeaders:o["access-control-expose-headers"],AccessControlMaxAge:o["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})}))},putObjectCopy:function(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var o=e.CopySource||"",s=i.getSourceParams.call(this,o);if(s){var r=s.Bucket,a=s.Region,c=decodeURIComponent(s.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:r,region:a,prefix:c},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=i.clone(n.CopyObjectResult||{});i.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)}))}else t({error:"CopySource format error"})},deleteMultipleObject:function(e,t){var n=e.Objects||[],o=e.Quiet;n=i.isArray(n)?n:[n];var s=i.json2xml({Delete:{Object:n,Quiet:o||!1}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s));var a=i.map(n,(function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}}));h.call(this,{Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:s,action:"delete",headers:r,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=n.DeleteResult||{},s=o.Deleted||[],r=o.Error||[];s=i.isArray(s)?s:[s],r=i.isArray(r)?r:[r];var a=i.clone(o);i.extend(a,{Error:r,Deleted:s,statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},restoreObject:function(e,t){var n=e.Headers;if(e.RestoreRequest){var o=e.RestoreRequest||{},s=i.json2xml({RestoreRequest:o});n["Content-Type"]="application/xml",n["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:s,action:"restore",headers:n,tracker:e.tracker},(function(e,n){t(e,n)}))}else t({error:"missing param RestoreRequest"})},putObjectTagging:function(e,t){var n=e.Tagging||{},o=n.TagSet||n.Tags||e.Tags||[];o=i.clone(i.isArray(o)?o:[o]);var s=i.json2xml({Tagging:{TagSet:{Tag:o}}}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=i.binaryBase64(i.md5(s)),h.call(this,{Interface:"putObjectTagging",Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:s,action:"tagging",headers:r,VersionId:e.VersionId,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},getObjectTagging:function(e,t){h.call(this,{Interface:"getObjectTagging",Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var o={Tags:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else{var s=[];try{s=n.Tagging.TagSet.Tag||[]}catch(r){}s=i.clone(i.isArray(s)?s:[s]),t(null,{Tags:s,statusCode:n.statusCode,headers:n.headers})}}))},deleteObjectTagging:function(e,t){h.call(this,{Interface:"deleteObjectTagging",Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId,tracker:e.tracker},(function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})}))},appendObject:function(e,t){h.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,n)}))},uploadPartCopy:function(e,t){var n=e.CopySource||"",o=i.getSourceParams.call(this,n);if(o){var s=o.Bucket,r=o.Region,a=decodeURIComponent(o.Key);h.call(this,{Scope:[{action:"name/cos:GetObject",bucket:s,region:r,prefix:a},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,tracker:e.tracker},(function(e,n){if(e)return t(e);var o=i.clone(n.CopyPartResult||{});i.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)}))}else t({error:"CopySource format error"})},multipartInit:function(e,t){var n=e.Headers,o=e.tracker;n["Cache-Control"]||n["cache-control"]||(n["Cache-Control"]=""),n["Content-Type"]||n["content-type"]||(n["Content-Type"]=s.getType(e.Key)||"application/octet-stream"),h.call(this,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:o},(function(e,n){return e?(o&&o.parent&&o.parent.setParams({errorNode:"multipartInit"}),t(e)):(n=i.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,i.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)}))},multipartUpload:function(e,t){var n=this;i.getFileSize("multipartUpload",e,(function(){var o=e.tracker,s=n.options.UploadCheckContentMd5;s&&o&&o.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(s,e.Body,(function(r){r&&(e.Headers["Content-MD5"]=i.binaryBase64(r),s&&o&&o.setParams({md5EndTime:(new Date).getTime()})),o&&o.setParams({partNumber:e.PartNumber}),h.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null,tracker:o},(function(e,n){if(e)return o&&o.parent&&o.parent.setParams({errorNode:"multipartUpload"}),t(e);t(null,{ETag:i.attr(n.headers,"etag",{}),statusCode:n.statusCode,headers:n.headers})}))}))}))},multipartComplete:function(e,t){for(var n=this,o=e.UploadId,s=e.Parts,r=e.tracker,a=0,u=s.length;a<u;a++)0!==s[a].ETag.indexOf('"')&&(s[a].ETag='"'+s[a].ETag+'"');var l=i.json2xml({CompleteMultipartUpload:{Part:s}}),p=e.Headers;p["Content-Type"]="application/xml",p["Content-MD5"]=i.binaryBase64(i.md5(l)),h.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{uploadId:o},body:l,headers:p,tracker:r},(function(o,s){if(o)return r&&r.parent&&r.parent.setParams({errorNode:"multipartComplete"}),t(o);var a=c({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key,isLocation:!0}),u=s.CompleteMultipartUploadResult||{},l=i.extend(u,{Location:a,statusCode:s.statusCode,headers:s.headers});t(null,l)}))},multipartList:function(e,t){var n={};n.delimiter=e.Delimiter,n["encoding-type"]=e.EncodingType,n.prefix=e.Prefix||"",n["max-uploads"]=e.MaxUploads,n["key-marker"]=e.KeyMarker,n["upload-id-marker"]=e.UploadIdMarker,n=i.clearKey(n);var o=e.tracker;o&&o.setParams({signStartTime:(new Date).getTime()}),h.call(this,{Action:"name/cos:ListMultipartUploads",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"uploads",tracker:o},(function(e,n){if(e)return o&&o.parent&&o.parent.setParams({errorNode:"multipartList"}),t(e);if(n&&n.ListMultipartUploadsResult){var s=n.ListMultipartUploadsResult.Upload||[],r=n.ListMultipartUploadsResult.CommonPrefixes||[];r=i.isArray(r)?r:[r],s=i.isArray(s)?s:[s],n.ListMultipartUploadsResult.Upload=s,n.ListMultipartUploadsResult.CommonPrefixes=r}var a=i.clone(n.ListMultipartUploadsResult||{});i.extend(a,{statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},multipartListPart:function(e,t){var n={},o=e.tracker;n.uploadId=e.UploadId,n["encoding-type"]=e.EncodingType,n["max-parts"]=e.MaxParts,n["part-number-marker"]=e.PartNumberMarker,h.call(this,{Action:"name/cos:ListParts",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,tracker:o},(function(e,n){if(e)return o&&o.parent&&o.parent.setParams({errorNode:"multipartListPart"}),t(e);var s=n.ListPartsResult||{},r=s.Part||[];r=i.isArray(r)?r:[r],s.Part=r;var a=i.clone(s);i.extend(a,{statusCode:n.statusCode,headers:n.headers}),t(null,a)}))},multipartAbort:function(e,t){var n={};n.uploadId=e.UploadId,h.call(this,{Action:"name/cos:AbortMultipartUpload",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,tracker:e.tracker},(function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})}))},request:function(e,t){h.call(this,{method:e.Method,Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:e.Action,headers:e.Headers,qs:e.Query,body:e.Body,Url:e.Url,rawBody:e.RawBody,dataType:e.DataType,tracker:e.tracker},(function(e,n){if(e)return t(e);n&&n.body&&(n.Body=n.body,delete n.body),t(e,n)}))},getObjectUrl:function(e,t){var n=this,o=void 0===e.UseAccelerate?n.options.UseAccelerate:e.UseAccelerate,s=c({ForcePathStyle:n.options.ForcePathStyle,protocol:e.Protocol||n.options.Protocol,domain:e.Domain||n.options.Domain,bucket:e.Bucket,region:o?"accelerate":e.Region,object:e.Key}),r="";e.Query&&(r+=i.obj2str(e.Query)),e.QueryString&&(r+=(r?"&":"")+e.QueryString);var a=s;if(void 0!==e.Sign&&!e.Sign)return r&&(a+="?"+r),t(null,{Url:a}),a;var p=u.call(this,{Bucket:e.Bucket,Region:e.Region,UseAccelerate:e.UseAccelerate,Url:s}),d=l.call(this,{Action:"PUT"===(e.Method||"").toUpperCase()?"name/cos:PutObject":"name/cos:GetObject",Bucket:e.Bucket||"",Region:e.Region||"",Method:e.Method||"get",Key:e.Key,Expires:e.Expires,Headers:e.Headers,Query:e.Query,SignHost:p,ForceSignHost:!1!==e.ForceSignHost&&n.options.ForceSignHost},(function(e,n){if(t)if(e)t(e);else{var o=s;o+="?"+(n.Authorization.indexOf("q-signature")>-1?(i=n.Authorization,a=i.match(/q-url-param-list.*?(?=&)/g)[0],c="q-url-param-list="+encodeURIComponent(a.replace(/q-url-param-list=/,"")).toLowerCase(),u=new RegExp(a,"g"),i.replace(u,c)):"sign="+encodeURIComponent(n.Authorization)),n.SecurityToken&&(o+="&x-cos-security-token="+n.SecurityToken),n.ClientIP&&(o+="&clientIP="+n.ClientIP),n.ClientUA&&(o+="&clientUA="+n.ClientUA),n.Token&&(o+="&token="+n.Token),r&&(o+="&"+r),setTimeout((function(){t(null,{Url:o})}))}var i,a,c,u}));return d?(a+="?"+d.Authorization+(d.SecurityToken?"&x-cos-security-token="+d.SecurityToken:""),r&&(a+="&"+r)):r&&(a+="?"+r),a},getAuth:function(e){return i.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,SystemClockOffset:this.options.SystemClockOffset})}};e.exports.init=function(e,t){t.transferToTaskMethod(f,"postObject"),t.transferToTaskMethod(f,"putObject"),i.each(f,(function(t,n){e.prototype[n]=i.apiWrapper(n,t)}))}},function(e,t){function n(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}var o=function(e,t){var o,i,s,r=[],a=function(e,t){var o=[];for(var i in e)e.hasOwnProperty(i)&&o.push(t?n(i).toLowerCase():i);return o.sort((function(e,t){return(e=e.toLowerCase())===(t=t.toLowerCase())?0:e>t?1:-1}))}(e);for(o=0;o<a.length;o++)s=void 0===e[i=a[o]]||null===e[i]?"":""+e[i],i=t?n(i).toLowerCase():n(i),s=n(s)||"",r.push(i+"="+s);return r.join("&")};e.exports=function(e,t){var n,i=e.filePath,s=e.headers||{},r=e.url||e.Url,a=e.method,c=e.onProgress,u=e.httpDNSServiceId,l=function(e,n){var o=n.header,i={};if(o)for(var s in o)o.hasOwnProperty(s)&&(i[s.toLowerCase()]=o[s]);t(e,{statusCode:n.statusCode,headers:i},n.data)};if(i){var p,d=r.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/);e.pathStyle?(p=decodeURIComponent(d[3]||""),r=d[1]+d[2]):(p=decodeURIComponent(d[2]+d[3]||""),r=d[1]);var h={key:p,success_action_status:200,Signature:s.Authorization},g=["Cache-Control","Content-Type","Content-Disposition","Content-Encoding","Expires","x-cos-storage-class","x-cos-security-token","x-ci-security-token"];for(var f in e.headers)e.headers.hasOwnProperty(f)&&(f.indexOf("x-cos-meta-")>-1||g.indexOf(f)>-1)&&(h[f]=e.headers[f]);s["x-cos-acl"]&&(h.acl=s["x-cos-acl"]),!h["Content-Type"]&&(h["Content-Type"]=""),(n=Un.uploadFile({url:r,method:a,name:"file",header:s,filePath:i,formData:h,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}})).onProgressUpdate((function(e){c&&c({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend,progress:e.progress/100})}))}else{var m=e.qs&&o(e.qs)||"";m&&(r+=(r.indexOf("?")>-1?"&":"?")+m),s["Content-Length"]&&delete s["Content-Length"];var _={url:r,method:a,header:s,dataType:"text",data:e.body,responseType:e.dataType||"text",timeout:e.timeout,redirect:"manual",success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}};u&&Object.assign(_,{enableHttpDNS:!0,httpDNSServiceId:u}),n=Un.request(_)}return n}},function(e,t,n){let o=n(29);e.exports=new o(n(30),n(31))},function(e,t,n){function o(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e<arguments.length;e++)this.define(arguments[e]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}o.prototype.define=function(e,t){for(let n in e){let o=e[n].map((function(e){return e.toLowerCase()}));n=n.toLowerCase();for(let e=0;e<o.length;e++){const i=o[e];if("*"!==i[0]){if(!t&&i in this._types)throw new Error('Attempt to change mapping for "'+i+'" extension from "'+this._types[i]+'" to "'+n+'". Pass `force=true` to allow this, otherwise remove "'+i+'" from the list of extensions for "'+n+'".');this._types[i]=n}}if(t||!this._extensions[n]){const e=o[0];this._extensions[n]="*"!==e[0]?e:e.substr(1)}}},o.prototype.getType=function(e){let t=(e=String(e)).replace(/^.*[/\\]/,"").toLowerCase(),n=t.replace(/^.*\./,"").toLowerCase(),o=t.length<e.length;return(n.length<t.length-1||!o)&&this._types[n]||null},o.prototype.getExtension=function(e){return(e=/^\s*([^;\s]*)/.test(e)&&RegExp.$1)&&this._extensions[e.toLowerCase()]||null},e.exports=o},function(e,t){e.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}},function(e,t){e.exports={"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.sap.vds":["vds"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}},function(e,t,n){function o(){
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
o=function(){return t};var e,t={},n=Object.prototype,s=n.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(N){p=function(e,t,n){return e[t]=n}}function d(e,t,n,o){var i=t&&t.prototype instanceof y?t:y,s=Object.create(i.prototype),a=new b(o||[]);return r(s,"_invoke",{value:L(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(o){return{type:"throw",arg:o}}}t.wrap=d;var g="suspendedStart",f="suspendedYield",m="executing",_="completed",v={};function y(){}function I(){}function M(){}var C={};p(C,c,(function(){return this}));var T=Object.getPrototypeOf,S=T&&T(T(P([])));S&&S!==n&&s.call(S,c)&&(C=S);var E=M.prototype=y.prototype=Object.create(C);function k(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function D(e,t){function n(o,r,a,c){var u=h(e[o],e,r);if("throw"!==u.type){var l=u.arg,p=l.value;return p&&"object"==i(p)&&s.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(p).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,c)}))}c(u.arg)}var o;r(this,"_invoke",{value:function(e,i){function s(){return new t((function(t,o){n(e,i,t,o)}))}return o=o?o.then(s,s):s()}})}function L(t,n,o){var i=g;return function(s,r){if(i===m)throw Error("Generator is already running");if(i===_){if("throw"===s)throw r;return{value:e,done:!0}}for(o.method=s,o.arg=r;;){var a=o.delegate;if(a){var c=R(a,o);if(c){if(c===v)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(i===g)throw i=_,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);i=m;var u=h(t,n,o);if("normal"===u.type){if(i=o.done?_:f,u.arg===v)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(i=_,o.method="throw",o.arg=u.arg)}}}function R(t,n){var o=n.method,i=t.iterator[o];if(i===e)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=e,R(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v;var s=h(i,t.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,v;var r=s.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function b(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function P(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,r=function n(){for(;++o<t.length;)if(s.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return r.next=r}}throw new TypeError(i(t)+" is not iterable")}return I.prototype=M,r(E,"constructor",{value:M,configurable:!0}),r(M,"constructor",{value:I,configurable:!0}),I.displayName=p(M,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===I||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,M):(e.__proto__=M,p(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},t.awrap=function(e){return{__await:e}},k(D.prototype),p(D.prototype,u,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,o,i,s){void 0===s&&(s=Promise);var r=new D(d(e,n,o,i),s);return t.isGeneratorFunction(n)?r:r.next().then((function(e){return e.done?e.value:r.next()}))},k(E),p(E,l,"Generator"),p(E,c,(function(){return this})),p(E,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var o in t)n.push(o);return n.reverse(),function e(){for(;n.length;){var o=n.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},t.values=P,b.prototype={constructor:b,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(o,i){return a.type="throw",a.arg=t,n.next=o,i&&(n.method="next",n.arg=e),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var c=s.call(r,"catchLoc"),u=s.call(r,"finallyLoc");if(c&&u){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(c){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&s.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var r=i?i.completion:{};return r.type=e,r.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(r)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;A(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,o){return this.delegate={iterator:P(t),resultName:n,nextLoc:o},"next"===this.method&&(this.arg=e),v}},t}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t,n,o,i,s,r){try{var a=e[s](r),c=a.value}catch(u){return void n(u)}a.done?t(c):Promise.resolve(c).then(o,i)}function r(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var r=e.apply(t,n);function a(e){s(r,o,i,a,c,"next",e)}function c(e){s(r,o,i,a,c,"throw",e)}a(void 0)}))}}var a=n(7),c=n(33),u=n(6).EventProxy,l=n(0),p=n(2);function d(e,t){var n=e.TaskId,o=e.Bucket,i=e.Region,s=e.Key,r=e.StorageClass,p=this,d={},f=e.FileSize,m=e.SliceSize,_=Math.ceil(f/m),v=0,y=l.throttleOnProgress.call(p,f,e.onHashProgress),I=function(t,n){var o=t.length;return 0===o?n(null,!0):o>_||o>1&&Math.max(t[0].Size,t[1].Size)!==m?n(null,!1):void function i(s){if(s<o){var r=t[s];a=r.PartNumber,c=function(e,t){t&&t.ETag===r.ETag&&t.Size===r.Size?i(s+1):n(null,!1)},u=m*(a-1),p=Math.min(u+m,f),h=p-u,d[a]?c(null,{PartNumber:a,ETag:d[a],Size:h}):l.fileSlice(e.FilePath,u,p,(function(e){try{var t=l.getFileMd5(e)}catch(o){return c(o)}var n='"'+t+'"';d[a]=n,v+=h,c(null,{PartNumber:a,ETag:n,Size:h}),y({loaded:v,total:f})}))}else n(null,!0);var a,c,u,p,h}(0)},M=new u;M.on("error",(function(e){if(p._isRunningTask(n))return t(e)})),M.on("upload_id_available",(function(e){var n={},o=[];l.each(e.PartList,(function(e){n[e.PartNumber]=e}));for(var i=1;i<=_;i++){var s=n[i];s?(s.PartNumber=i,s.Uploaded=!0):s={PartNumber:i,ETag:null,Uploaded:!1},o.push(s)}e.PartList=o,t(null,e)})),M.on("no_available_upload_id",(function(){if(p._isRunningTask(n)){var a=l.extend({Bucket:o,Region:i,Key:s,Headers:l.clone(e.Headers),Query:l.clone(e.Query),StorageClass:r,calledBySdk:"sliceUploadFile",tracker:e.tracker},e);p.multipartInit(a,(function(e,o){if(p._isRunningTask(n)){if(e)return M.emit("error",e);var i=o.UploadId;if(!i)return t({Message:"no upload id"});M.emit("upload_id_available",{UploadId:i,PartList:[]})}}))}})),M.on("has_and_check_upload_id",(function(t){t=t.reverse(),c.eachLimit(t,1,(function(t,r){p._isRunningTask(n)&&(a.using[t]?r():g.call(p,{Bucket:o,Region:i,Key:s,UploadId:t,tracker:e.tracker},(function(e,o){if(p._isRunningTask(n)){if(e)return a.removeUsing(t),M.emit("error",e);var i=o.PartList;i.forEach((function(e){e.PartNumber*=1,e.Size*=1,e.ETag=e.ETag||""})),I(i,(function(e,o){if(p._isRunningTask(n))return e?M.emit("error",e):void(o?r({UploadId:t,PartList:i}):r())}))}})))}),(function(e){p._isRunningTask(n)&&(y(null,!0),e&&e.UploadId?M.emit("upload_id_available",e):M.emit("no_available_upload_id"))}))})),M.on("seek_local_avail_upload_id",(function(t){var r=a.getFileId(e.FileStat,e.ChunkSize,o,s),c=a.getUploadIdList(r);r&&c?function r(u){if(u>=c.length)M.emit("has_and_check_upload_id",t);else{var d=c[u];if(!l.isInArray(t,d))return a.removeUploadId(d),void r(u+1);a.using[d]?r(u+1):g.call(p,{Bucket:o,Region:i,Key:s,UploadId:d,tracker:e.tracker},(function(e,t){p._isRunningTask(n)&&(e?(a.removeUploadId(d),r(u+1)):M.emit("upload_id_available",{UploadId:d,PartList:t.PartList}))}))}}(0):M.emit("has_and_check_upload_id",t)})),M.on("get_remote_upload_id_list",(function(){h.call(p,{Bucket:o,Region:i,Key:s,tracker:e.tracker},(function(t,i){if(p._isRunningTask(n)){if(t)return M.emit("error",t);var c=l.filter(i.UploadList,(function(e){return e.Key===s&&(!r||e.StorageClass.toUpperCase()===r.toUpperCase())})).reverse().map((function(e){return e.UploadId||e.UploadID}));if(c.length)M.emit("seek_local_avail_upload_id",c);else{var u,d=a.getFileId(e.FileStat,e.ChunkSize,o,s);d&&(u=a.getUploadIdList(d))&&l.each(u,(function(e){a.removeUploadId(e)})),M.emit("no_available_upload_id")}}}))})),M.emit("get_remote_upload_id_list")}function h(e,t){var n=this,o=[],i={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key,calledBySdk:e.calledBySdk||"sliceUploadFile",tracker:e.tracker};!function e(){n.multipartList(i,(function(n,s){if(n)return t(n);o.push.apply(o,s.Upload||[]),"true"===s.IsTruncated?(i.KeyMarker=s.NextKeyMarker,i.UploadIdMarker=s.NextUploadIdMarker,e()):t(null,{UploadList:o})}))}()}function g(e,t){var n=this,o=[],i={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId,calledBySdk:"sliceUploadFile",tracker:e.tracker};!function e(){n.multipartListPart(i,(function(n,s){if(n)return t(n);o.push.apply(o,s.Part||[]),"true"===s.IsTruncated?(i.PartNumberMarker=s.NextPartNumberMarker,e()):t(null,{PartList:o})}))}()}function f(e,t){var n=this,o=e.TaskId,i=e.Bucket,s=e.Region,r=e.Key,a=e.UploadData,u=e.FileSize,p=e.SliceSize,d=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),h=e.FilePath,g=Math.ceil(u/p),f=0,_=e.ServerSideEncryption,v=l.filter(a.PartList,(function(e){return e.Uploaded&&(f+=e.PartNumber>=g&&u%p||p),!e.Uploaded})),y=e.onProgress;c.eachLimit(v,d,(function(t,c){if(n._isRunningTask(o)){var l=t.PartNumber,d=Math.min(u,t.PartNumber*p)-(t.PartNumber-1)*p,g=0;m.call(n,{TaskId:o,Bucket:i,Region:s,Key:r,SliceSize:p,FileSize:u,PartNumber:l,ServerSideEncryption:_,FilePath:h,UploadData:a,onProgress:function(e){f+=e.loaded-g,g=e.loaded,y({loaded:f,total:u})},tracker:e.tracker},(function(e,i){n._isRunningTask(o)&&(e?f-=g:(f+=d-g,t.ETag=i.ETag),y({loaded:f,total:u}),c(e||null,i))}))}}),(function(e){if(n._isRunningTask(o))return e?t(e):void t(null,{UploadId:a.UploadId,SliceList:a.PartList})}))}function m(e,t){var n=this,o=e.TaskId,i=e.Bucket,s=e.Region,r=e.Key,a=e.FileSize,u=e.FilePath,p=1*e.PartNumber,d=e.SliceSize,h=e.ServerSideEncryption,g=e.UploadData,f=n.options.ChunkRetryTimes+1,m=e.Headers||{},_=d*(p-1),v=d,y=_+d;y>a&&(v=(y=a)-_);var I=["x-cos-traffic-limit","x-cos-mime-limit"],M={};l.each(m,(function(e,t){I.indexOf(t)>-1&&(M[t]=e)})),l.fileSlice(u,_,y,(function(a){var u=l.getFileMd5(a),d=u?l.binaryBase64(u):null,m=g.PartList[p-1];c.retry(f,(function(t){n._isRunningTask(o)&&n.multipartUpload({TaskId:o,Bucket:i,Region:s,Key:r,ContentLength:v,PartNumber:p,UploadId:g.UploadId,ServerSideEncryption:h,Body:a,Headers:M,onProgress:e.onProgress,ContentMD5:d,calledBySdk:"sliceUploadFile",tracker:e.tracker},(function(e,i){if(n._isRunningTask(o))return e?t(e):(m.Uploaded=!0,t(null,i))}))}),(function(e,i){if(n._isRunningTask(o))return t(e,i)}))}))}function _(e,t){var n=e.Bucket,o=e.Region,i=e.Key,s=e.UploadId,r=e.SliceList,a=this,u=this.options.ChunkRetryTimes+1,l=r.map((function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));c.retry(u,(function(t){a.multipartComplete({Bucket:n,Region:o,Key:i,UploadId:s,Parts:l,calledBySdk:"sliceUploadFile",Headers:e.Headers||{},tracker:e.tracker},t)}),(function(e,n){t(e,n)}))}function v(e,t){var n=e.Bucket,o=e.Region,i=e.Key,s=e.AbortArray,r=e.AsyncLimit||1,a=this,u=0,l=new Array(s.length);c.eachLimit(s,r,(function(t,s){var r=u;if(i&&i!==t.Key)return l[r]={error:{KeyNotMatch:!0}},void s(null);var c=t.UploadId||t.UploadID;a.multipartAbort({Bucket:n,Region:o,Key:t.Key,Headers:e.Headers,UploadId:c},(function(e){var i={Bucket:n,Region:o,Key:t.Key,UploadId:c};l[r]={error:e,task:i},s(null)})),u++}),(function(e){if(e)return t(e);for(var n=[],o=[],i=0,s=l.length;i<s;i++){var r=l[i];r.task&&(r.error?o.push(r.task):n.push(r.task))}return t(null,{successList:n,errorList:o})}))}function y(){return(y=r(o().mark((function e(t,n){var s,r,a,c,u,d,h,g,f,m,_,v;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this,r=void 0===t.SliceSize?s.options.SliceSize:t.SliceSize,a=[],e.prev=3,e.next=6,l.getFileSizeByPath(t.FilePath);case 6:c=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),n({error:e.t0}),e.abrupt("return");case 13:u={TaskId:""},s.options.EnableReporter&&(d=s.options.UseAccelerate||"string"==typeof s.options.Domain&&s.options.Domain.includes("accelerate."),h=c>r?"sliceUploadFile":"putObject",t.tracker=new p({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:t.Bucket,region:t.Region,apiName:"uploadFile",realApi:h,fileKey:t.Key,fileSize:c,accelerate:d,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})),l.each(t,(function(e,t){"object"!==i(e)&&"function"!=typeof e&&(u[t]=e)})),g=t.onTaskReady,t.onTaskReady=function(e){u.TaskId=e,g&&g(e)},f=t.onFileFinish,m=function(e,o){t.tracker&&t.tracker.report(e,o),f&&f(e,o,u),n&&n(e,o)},_="postObject"===s.options.SimpleUploadMethod?"postObject":"putObject",v=c>r?"sliceUploadFile":_,a.push({api:v,params:t,callback:m}),s._addTasks(a);case 24:case"end":return e.stop()}}),e,this,[[3,9]])})))).apply(this,arguments)}function I(){return I=r(o().mark((function e(t,n){var s,a,c,u,d,h,g,f,m,_,v;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this,a=void 0===t.SliceSize?s.options.SliceSize:t.SliceSize,c=0,u=0,d=l.throttleOnProgress.call(s,u,t.onProgress),h=t.files.length,g=t.onFileFinish,f=Array(h),m=function(e,t,o){d(null,!0),g&&g(e,t,o),f[o.Index]={options:o,error:e,data:t},--h<=0&&n&&n(null,{files:f})},_=[],v=function(){return t.files.map((function(e,t){return new Promise((n=r(o().mark((function n(r){var h,g,f,v,y,I,M,C,T,S,E;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return h=0,n.prev=1,n.next=4,l.getFileSizeByPath(e.FilePath);case 4:h=n.sent,n.next=9;break;case 7:n.prev=7,n.t0=n.catch(1);case 9:g={Index:t,TaskId:""},c+=h,s.options.EnableReporter&&(f=s.options.UseAccelerate||"string"==typeof s.options.Domain&&s.options.Domain.includes("accelerate."),v=h>a?"sliceUploadFile":"putObject",e.tracker=new p({Beacon:s.options.BeaconReporter,clsReporter:s.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFiles",realApi:v,fileKey:e.Key,fileSize:h,accelerate:f,deepTracker:s.options.DeepTracker,customId:s.options.CustomId,delay:s.options.TrackerDelay})),l.each(e,(function(e,t){"object"!==i(e)&&"function"!=typeof e&&(g[t]=e)})),y=e.onTaskReady,e.onTaskReady=function(e){g.TaskId=e,y&&y(e)},I=0,M=e.onProgress,e.onProgress=function(e){u=u-I+e.loaded,I=e.loaded,M&&M(e),d({loaded:u,total:c})},C=e.onFileFinish,T=function(t,n){e.tracker&&e.tracker.report(t,n),C&&C(t,n),m&&m(t,n,g)},S="postObject"===s.options.SimpleUploadMethod?"postObject":"putObject",E=h>a?"sliceUploadFile":S,_.push({api:E,params:e,callback:T}),r(!0);case 24:case"end":return n.stop()}}),n,null,[[1,7]])}))),function(e){return n.apply(this,arguments)}));var n}))},e.next=13,Promise.all(v());case 13:s._addTasks(_);case 14:case"end":return e.stop()}}),e,this)}))),I.apply(this,arguments)}function M(e,t){var n=e.TaskId,o=e.Bucket,i=e.Region,s=e.Key,r=e.CopySource,a=e.UploadId,u=1*e.PartNumber,l=e.CopySourceRange,p=this.options.ChunkRetryTimes+1,d=this;c.retry(p,(function(t){d.uploadPartCopy({TaskId:n,Bucket:o,Region:i,Key:s,CopySource:r,UploadId:a,PartNumber:u,CopySourceRange:l,onProgress:e.onProgress,tracker:e.tracker,calledBySdk:e.calledBySdk},(function(e,n){t(e||null,n)}))}),(function(e,n){return t(e,n)}))}var C={sliceUploadFile:function(e,t){var n=this;if(!l.canFileSlice())return e.SkipTask=!0,void("postObject"===n.options.SimpleUploadMethod?n.postObject(e,t):n.putObject(e,t));var o,i,s=new u,r=e.TaskId,c=e.Bucket,p=e.Region,h=e.Key,g=e.FilePath,m=e.ChunkSize||e.SliceSize||n.options.ChunkSize,v=e.AsyncLimit,y=e.StorageClass,I=e.ServerSideEncryption,M=e.onHashProgress,C=e.tracker;C&&C.setParams({chunkSize:m}),s.on("error",(function(o){if(n._isRunningTask(r)){var i={UploadId:e.UploadData.UploadId||"",err:o,error:o};return t(i)}})),s.on("upload_complete",(function(n){var o=l.extend({UploadId:e.UploadData.UploadId||""},n);t(null,o)})),s.on("upload_slice_complete",(function(t){var u={};l.each(e.Headers,(function(e,t){var n=t.toLowerCase();0!==n.indexOf("x-cos-meta-")&&"pic-operations"!==n||(u[t]=e)})),_.call(n,{Bucket:c,Region:p,Key:h,UploadId:t.UploadId,SliceList:t.SliceList,Headers:u,tracker:C},(function(e,c){if(n._isRunningTask(r)){if(a.removeUsing(t.UploadId),e)return i(null,!0),s.emit("error",e);a.removeUploadId(t.UploadId),i({loaded:o,total:o},!0),s.emit("upload_complete",c)}}))})),s.on("get_upload_data_finish",(function(t){var u=a.getFileId(e.FileStat,e.ChunkSize,c,h);u&&a.saveUploadId(u,t.UploadId,n.options.UploadIdCacheLimit),a.setUsing(t.UploadId),i(null,!0),f.call(n,{TaskId:r,Bucket:c,Region:p,Key:h,FilePath:g,FileSize:o,SliceSize:m,AsyncLimit:v,ServerSideEncryption:I,UploadData:t,onProgress:i,tracker:C},(function(e,t){if(n._isRunningTask(r))return e?(i(null,!0),s.emit("error",e)):void s.emit("upload_slice_complete",t)}))})),s.on("get_file_size_finish",(function(){if(i=l.throttleOnProgress.call(n,o,e.onProgress),e.UploadData.UploadId)s.emit("get_upload_data_finish",e.UploadData);else{var t=l.extend({TaskId:r,Bucket:c,Region:p,Key:h,Headers:e.Headers,StorageClass:y,FilePath:g,FileSize:o,SliceSize:m,onHashProgress:M,tracker:C},e);t.FileSize=o,d.call(n,t,(function(t,o){if(n._isRunningTask(r)){if(t)return s.emit("error",t);e.UploadData.UploadId=o.UploadId,e.UploadData.PartList=o.PartList,s.emit("get_upload_data_finish",e.UploadData)}}))}})),o=e.ContentLength,delete e.ContentLength,!e.Headers&&(e.Headers={}),l.each(e.Headers,(function(t,n){"content-length"===n.toLowerCase()&&delete e.Headers[n]})),function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],i=1048576,s=0;s<t.length&&!(o/(i=1024*t[s]*1024)<=n.options.MaxPartNumber);s++);e.ChunkSize=e.SliceSize=m=Math.max(m,i)}(),0===o?(e.Body="",e.ContentLength=0,e.SkipTask=!0,n.putObject(e,(function(e,n){if(e)return t(e);t(null,n)}))):s.emit("get_file_size_finish")},abortUploadTask:function(e,t){var n=e.Bucket,o=e.Region,i=e.Key,s=e.UploadId,r=e.Level||"task",a=e.AsyncLimit,c=this,l=new u;if(l.on("error",(function(e){return t(e)})),l.on("get_abort_array",(function(s){v.call(c,{Bucket:n,Region:o,Key:i,Headers:e.Headers,AsyncLimit:a,AbortArray:s},(function(e,n){if(e)return t(e);t(null,n)}))})),"bucket"===r)h.call(c,{Bucket:n,Region:o,calledBySdk:"abortUploadTask"},(function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])}));else if("file"===r){if(!i)return t({error:"abort_upload_task_no_key"});h.call(c,{Bucket:n,Region:o,Key:i,calledBySdk:"abortUploadTask"},(function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])}))}else{if("task"!==r)return t({error:"abort_unknown_level"});if(!s)return t({error:"abort_upload_task_no_id"});if(!i)return t({error:"abort_upload_task_no_key"});l.emit("get_abort_array",[{Key:i,UploadId:s}])}},uploadFile:function(e,t){return y.apply(this,arguments)},uploadFiles:function(e,t){return I.apply(this,arguments)},sliceCopyFile:function(e,t){var n=new u,o=this,i=e.Bucket,s=e.Region,r=e.Key,p=e.CopySource,d=l.getSourceParams.call(this,p);if(d){var h=d.Bucket,f=d.Region,m=decodeURIComponent(d.Key),_=void 0===e.CopySliceSize?o.options.CopySliceSize:e.CopySliceSize;_=Math.max(0,_);var v,y,I=e.CopyChunkSize||this.options.CopyChunkSize,C=this.options.CopyChunkParallelLimit,T=this.options.ChunkRetryTimes+1,S=0,E=0,k={},D={},L={};n.on("copy_slice_complete",(function(n){l.each(e.Headers,(function(e,t){t.toLowerCase().indexOf("x-cos-meta-")}));var u=l.map(n.PartList,(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));c.retry(T,(function(t){o.multipartComplete({Bucket:i,Region:s,Key:r,UploadId:n.UploadId,Parts:u,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)}),(function(e,o){if(a.removeUsing(n.UploadId),e)return y(null,!0),t(e);a.removeUploadId(n.UploadId),y({loaded:v,total:v},!0),t(null,o)}))})),n.on("get_copy_data_finish",(function(u){var d=a.getCopyFileId(p,k,I,i,r);d&&a.saveUploadId(d,u.UploadId,o.options.UploadIdCacheLimit),a.setUsing(u.UploadId);var h=l.filter(u.PartList,(function(e){return e.Uploaded&&(E+=e.PartNumber>=S&&v%I||I),!e.Uploaded}));c.eachLimit(h,C,(function(t,n){var a=t.PartNumber,l=t.CopySourceRange,d=t.end-t.start,h=0;c.retry(T,(function(t){M.call(o,{Bucket:i,Region:s,Key:r,CopySource:p,UploadId:u.UploadId,PartNumber:a,CopySourceRange:l,tracker:e.tracker,calledBySdk:"sliceCopyFile",onProgress:function(e){E+=e.loaded-h,h=e.loaded,y({loaded:E,total:v})}},t)}),(function(e,o){if(e)return n(e);y({loaded:E,total:v}),E+=d-h,t.ETag=o.ETag,n(e||null,o)}))}),(function(e){if(e)return a.removeUsing(u.UploadId),y(null,!0),t(e);n.emit("copy_slice_complete",u)}))})),n.on("get_chunk_size_finish",(function(){var c=function(){o.multipartInit({Bucket:i,Region:s,Key:r,Headers:L,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(o,i){if(o)return t(o);e.UploadId=i.UploadId,n.emit("get_copy_data_finish",{UploadId:e.UploadId,PartList:e.PartList})}))},u=a.getCopyFileId(p,k,I,i,r),d=a.getUploadIdList(u);if(!u||!d)return c();!function t(u){if(u>=d.length)return c();var p=d[u];if(a.using[p])return t(u+1);g.call(o,{Bucket:i,Region:s,Key:r,UploadId:p,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(o,i){if(o)a.removeUploadId(p),t(u+1);else{if(a.using[p])return t(u+1);var s={},r=0;l.each(i.PartList,(function(e){var t=parseInt(e.Size),n=r+t-1;s[e.PartNumber+"|"+r+"|"+n]=e.ETag,r+=t})),l.each(e.PartList,(function(e){var t=s[e.PartNumber+"|"+e.start+"|"+e.end];t&&(e.ETag=t,e.Uploaded=!0)})),n.emit("get_copy_data_finish",{UploadId:p,PartList:e.PartList})}}))}(0)})),n.on("get_file_size_finish",(function(){var i;if(function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,i=0;i<t.length&&!(v/(n=1024*t[i]*1024)<=o.options.MaxPartNumber);i++);e.ChunkSize=I=Math.max(I,n),S=Math.ceil(v/I);for(var s=[],r=1;r<=S;r++){var a=(r-1)*I,c=r*I<v?r*I-1:v-1,u={PartNumber:r,start:a,end:c,CopySourceRange:"bytes="+a+"-"+c};s.push(u)}e.PartList=s}(),(i="Replaced"===e.Headers["x-cos-metadata-directive"]?e.Headers:D)["x-cos-storage-class"]=e.Headers["x-cos-storage-class"]||D["x-cos-storage-class"],i=l.clearKey(i),"ARCHIVE"===D["x-cos-storage-class"]||"DEEP_ARCHIVE"===D["x-cos-storage-class"]){var s=D["x-cos-restore"];if(!s||'ongoing-request="true"'===s)return void t({error:"Unrestored archive object is not allowed to be copied"})}delete i["x-cos-copy-source"],delete i["x-cos-metadata-directive"],delete i["x-cos-copy-source-If-Modified-Since"],delete i["x-cos-copy-source-If-Unmodified-Since"],delete i["x-cos-copy-source-If-Match"],delete i["x-cos-copy-source-If-None-Match"],n.emit("get_chunk_size_finish")})),o.headObject({Bucket:h,Region:f,Key:m,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(i,s){if(i)i.statusCode&&404===i.statusCode?t({ErrorStatus:m+" Not Exist"}):t(i);else if(void 0!==(v=e.FileSize=s.headers["content-length"])&&v)if(e.tracker&&e.tracker.setParams({httpSize:v}),y=l.throttleOnProgress.call(o,v,e.onProgress),v<=_)e.Headers["x-cos-metadata-directive"]||(e.Headers["x-cos-metadata-directive"]="Copy"),o.putObjectCopy(Object.assign(e,{calledBySdk:"sliceCopyFile"}),(function(e,n){if(e)return y(null,!0),t(e);y({loaded:v,total:v},!0),t(e,n)}));else{var r=s.headers;k=r,D={"Cache-Control":r["cache-control"],"Content-Disposition":r["content-disposition"],"Content-Encoding":r["content-encoding"],"Content-Type":r["content-type"],Expires:r.expires,"x-cos-storage-class":r["x-cos-storage-class"]},l.each(r,(function(e,t){var n="x-cos-meta-";0===t.indexOf(n)&&t.length>11&&(D[t]=e)})),n.emit("get_file_size_finish")}else t({error:'get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.'})}))}else t({error:"CopySource format error"})}};e.exports.init=function(e,t){t.transferToTaskMethod(C,"sliceUploadFile"),l.each(C,(function(t,n){e.prototype[n]=l.apiWrapper(n,t)}))}},function(e,t){var n={eachLimit:function(e,t,n,o){if(o=o||function(){},!e.length||t<=0)return o();var i=0,s=0,r=0;!function a(){if(i>=e.length)return o();for(;r<t&&s<e.length;)r+=1,n(e[(s+=1)-1],(function(t){t?(o(t),o=function(){}):(r-=1,(i+=1)>=e.length?o():a())}))}()},retry:function(e,t,n){e<1?n():function o(i){t((function(t,s){t&&i<e?o(i+1):n(t,s)}))}(1)}};e.exports=n}]);const al=bu(rl.exports);function cl(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}function ul(e,t,n,o){return new(n||(n=Promise))((function(i,s){function r(e){try{c(o.next(e))}catch(t){s(t)}}function a(e){try{c(o.throw(e))}catch(t){s(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,a)}c((o=o.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;let ll=class e{constructor(t){return e.instance||(e.instance=this,this.engine=t,this.events={},this.bindIMEvents()),e.instance}addEvent(e,t){this.events[e]||(this.events[e]=new Map),this.events[e].set(t,1)}removeEvents(){Object.keys(this.events).forEach((e=>{this.events[e].clear()})),this.events={}}dispatch(e,t){if(this.events[e])for(const n of this.events[e].keys())n.call(this,t)}bindIMEvents(){this.engine.chat.on(this.engine.EVENT.SDK_READY,this.onSDKReady,this),this.engine.chat.on(this.engine.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.engine.chat.on(this.engine.EVENT.KICKED_OUT,this.onKickedOut,this),this.engine.chat.on(this.engine.EVENT.NET_STATE_CHANGE,this.onNetStateChange,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_RECEIVED,this.onReceiveMessage,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_MODIFIED,this.onMessageModified,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_REVOKED,this.onMessageRevoked,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_READ_BY_PEER,this.onMessageReadByPeer,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,this.onMessageReadReceiptReceived,this),this.engine.chat.on(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED,this.onMessageReactionsUpdated,this),this.engine.chat.on(this.engine.EVENT.CONVERSATION_LIST_UPDATED,this.onConversationListUpdated,this),this.engine.chat.on(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,this.onTotalMessageCountUpdated,this),this.engine.chat.on(this.engine.EVENT.PROFILE_UPDATED,this.onProfileUpdated,this),this.engine.chat.on(this.engine.EVENT.BLACKLIST_UPDATED,this.onBlacklistUpdated,this),this.engine.chat.on(this.engine.EVENT.USER_STATUS_UPDATED,this.onUserStatusUpdated,this),this.engine.chat.on(this.engine.EVENT.GROUP_LIST_UPDATED,this.onGroupListUpdated,this),this.engine.chat.on(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED,this.onGroupAttributesUpdated,this),this.engine.chat.on(this.engine.EVENT.GROUP_COUNTER_UPDATED,this.onGroupCounterUpdated,this),this.engine.chat.on(this.engine.EVENT.FRIEND_LIST_UPDATED,this.onFriendListUpdated,this),this.engine.chat.on(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED,this.onFriendApplicationListUpdated,this)}unbindIMEvents(){this.engine.chat.off(this.engine.EVENT.SDK_READY,this.onSDKReady,this),this.engine.chat.off(this.engine.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.engine.chat.off(this.engine.EVENT.KICKED_OUT,this.onKickedOut,this),this.engine.chat.off(this.engine.EVENT.NET_STATE_CHANGE,this.onNetStateChange,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_RECEIVED,this.onReceiveMessage,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_MODIFIED,this.onMessageModified,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_REVOKED,this.onMessageRevoked,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_READ_BY_PEER,this.onMessageReadByPeer,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,this.onMessageReadReceiptReceived,this),this.engine.chat.off(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED,this.onMessageReactionsUpdated,this),this.engine.chat.off(this.engine.EVENT.CONVERSATION_LIST_UPDATED,this.onConversationListUpdated,this),this.engine.chat.off(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,this.onTotalMessageCountUpdated,this),this.engine.chat.off(this.engine.EVENT.PROFILE_UPDATED,this.onProfileUpdated,this),this.engine.chat.off(this.engine.EVENT.BLACKLIST_UPDATED,this.onBlacklistUpdated,this),this.engine.chat.off(this.engine.EVENT.USER_STATUS_UPDATED,this.onUserStatusUpdated,this),this.engine.chat.off(this.engine.EVENT.GROUP_LIST_UPDATED,this.onGroupListUpdated,this),this.engine.chat.off(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED,this.onGroupAttributesUpdated,this),this.engine.chat.off(this.engine.EVENT.GROUP_COUNTER_UPDATED,this.onGroupCounterUpdated,this),this.engine.chat.off(this.engine.EVENT.FRIEND_LIST_UPDATED,this.onFriendListUpdated,this),this.engine.chat.off(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED,this.onFriendApplicationListUpdated,this),e.instance=null}onSDKReady(e){this.dispatch(this.engine.EVENT.SDK_READY,e.data)}onSDKNotReady(e){this.dispatch(this.engine.EVENT.SDK_NOT_READY,e.data)}onKickedOut(e){this.dispatch(this.engine.EVENT.KICKED_OUT,e.data)}onNetStateChange(e){this.dispatch(this.engine.EVENT.NET_STATE_CHANGE,e.data)}onReceiveMessage(e){this.dispatch(this.engine.EVENT.MESSAGE_RECEIVED,e.data)}onMessageModified(e){this.dispatch(this.engine.EVENT.MESSAGE_MODIFIED,e.data)}onMessageRevoked(e){this.dispatch(this.engine.EVENT.MESSAGE_REVOKED,e.data)}onMessageReadByPeer(e){this.dispatch(this.engine.EVENT.MESSAGE_READ_BY_PEER,e.data)}onMessageReadReceiptReceived(e){this.dispatch(this.engine.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,e.data)}onMessageReactionsUpdated(e){this.dispatch(this.engine.EVENT.MESSAGE_REACTIONS_UPDATED,e.data)}onConversationListUpdated(e){this.dispatch(this.engine.EVENT.CONVERSATION_LIST_UPDATED,e.data)}onTotalMessageCountUpdated(e){this.dispatch(this.engine.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,e.data)}onProfileUpdated(e){this.dispatch(this.engine.EVENT.PROFILE_UPDATED,e.data)}onBlacklistUpdated(e){this.dispatch(this.engine.EVENT.BLACKLIST_UPDATED,e.data)}onUserStatusUpdated(e){this.dispatch(this.engine.EVENT.USER_STATUS_UPDATED,e.data)}onGroupListUpdated(e){this.dispatch(this.engine.EVENT.GROUP_LIST_UPDATED,e.data)}onGroupAttributesUpdated(e){this.dispatch(this.engine.EVENT.GROUP_ATTRIBUTES_UPDATED,e.data)}onGroupCounterUpdated(e){this.dispatch(this.engine.EVENT.GROUP_COUNTER_UPDATED,e.data)}onFriendListUpdated(e){this.dispatch(this.engine.EVENT.FRIEND_LIST_UPDATED,e.data)}onFriendApplicationListUpdated(e){this.dispatch(this.engine.EVENT.FRIEND_APPLICATION_LIST_UPDATED,e.data)}};var pl,dl,hl,gl,fl,ml,_l,vl,yl;exports.o=void 0,(yl=pl||(pl={})).TUIStore="TUIStore",yl.TUITranslate="TUITranslate",yl.TUIConversation="TUIConversation",yl.TUIChat="TUIChat",yl.TUIGroup="TUIGroup",yl.TUIUser="TUIUser",yl.TUIFriend="TUIFriend",yl.TUIReport="TUIReport",function(e){e.APP="application",e.CONV="conversation",e.CHAT="chat",e.GRP="group",e.USER="user",e.FRIEND="friend",e.SEARCH="search",e.CUSTOM="custom"}(exports.o||(exports.o={})),function(e){e[e.UNSUB_USER=-1]="UNSUB_USER"}(dl||(dl={})),function(e){e.BUSINESS_ID="user_typing_status",e[e.STATUS_START=1]="STATUS_START",e[e.STATUS_END=0]="STATUS_END",e[e.VERSION=1]="VERSION",e[e.ACTION_START_ID=14]="ACTION_START_ID",e[e.ACTION_END_ID=0]="ACTION_END_ID",e.ACTION_START="EIMAMSG_InputStatus_Ing",e.ACTION_END="EIMAMSG_InputStatus_End",e[e.NEED_TYPING=1]="NEED_TYPING"}(hl||(hl={})),function(e){e.ADD="add",e.REMOVE="remove"}(gl||(gl={})),function(e){e[e.MSG_MODIFY_CONFLICT=2480]="MSG_MODIFY_CONFLICT",e[e.MSG_MODIFY_DISABLED_IN_AVCHATROOM=2481]="MSG_MODIFY_DISABLED_IN_AVCHATROOM",e[e.MODIFY_MESSAGE_NOT_EXIST=20026]="MODIFY_MESSAGE_NOT_EXIST"}(fl||(fl={})),function(e){e[e.NOT_INIT=-1e5]="NOT_INIT",e[e.INVALID_CONV_ID=-100001]="INVALID_CONV_ID",e[e.CONV_ID_SAME=-100002]="CONV_ID_SAME",e[e.CONV_NOT_EXIST=-100003]="CONV_NOT_EXIST",e[e.GET_MSG_LIST_ERROR=-100004]="GET_MSG_LIST_ERROR",e[e.MISMATCH_TYPE_AND_PAYLOAD=-100005]="MISMATCH_TYPE_AND_PAYLOAD"}(ml||(ml={})),function(e){e.MSG_MODIFY_CONFLICT="MODIFY_MESSAGE_ERROR,修改消息发生冲突, data.message 是最新的消息",e.MSG_MODIFY_DISABLED_IN_AVCHATROOM="MODIFY_MESSAGE_ERROR,不支持修改直播群消息.",e.MODIFY_MESSAGE_NOT_EXIST="MODIFY_MESSAGE_ERROR,消息不存在."}(_l||(_l={})),function(e){e.NOT_INIT="TUIChatEngine 初始化未完成,请确认 TUIChatEngine.login 接口调用是否正常。",e.INVALID_CONV_ID="会话 ID 无效",e.CONV_ID_SAME="您切换的是同一个会话 ID",e.CONV_NOT_EXIST="会话不存在",e.GET_MSG_LIST_ERROR="Chat SDK is not ready.",e.MISMATCH_TYPE_AND_PAYLOAD="type 与 payload 不匹配."}(vl||(vl={}));const Il={logout:1,destroy:1},Ml=function(e){return void 0===e},Cl=function(e){return e.startsWith("_")},Tl=function(e){return/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)},Sl=function(e){return e&&function(e){if("string"==typeof e)try{return!!JSON.parse(e)}catch(t){return!1}return!1}(e)?JSON.parse(e):e},El=function(e){let t="";return t=e>=1048576?`${(e/1048576).toFixed(2)} Mb`:e>=1024?`${(e/1024).toFixed(2)} Kb`:`${e.toFixed(2)}B`,t},kl={"[TUIEmoji_Expect]":"emoji_0@2x.png","[TUIEmoji_Blink]":"emoji_1@2x.png","[TUIEmoji_Guffaw]":"emoji_2@2x.png","[TUIEmoji_KindSmile]":"emoji_3@2x.png","[TUIEmoji_Haha]":"emoji_4@2x.png","[TUIEmoji_Cheerful]":"emoji_5@2x.png","[TUIEmoji_Smile]":"emoji_6@2x.png","[TUIEmoji_Sorrow]":"emoji_7@2x.png","[TUIEmoji_Speechless]":"emoji_8@2x.png","[TUIEmoji_Amazed]":"emoji_9@2x.png","[TUIEmoji_Complacent]":"emoji_10@2x.png","[TUIEmoji_Lustful]":"emoji_11@2x.png","[TUIEmoji_Stareyes]":"emoji_12@2x.png","[TUIEmoji_Giggle]":"emoji_13@2x.png","[TUIEmoji_Daemon]":"emoji_14@2x.png","[TUIEmoji_Rage]":"emoji_15@2x.png","[TUIEmoji_Yawn]":"emoji_16@2x.png","[TUIEmoji_TearsLaugh]":"emoji_17@2x.png","[TUIEmoji_Silly]":"emoji_18@2x.png","[TUIEmoji_Wail]":"emoji_19@2x.png","[TUIEmoji_Kiss]":"emoji_20@2x.png","[TUIEmoji_Trapped]":"emoji_21@2x.png","[TUIEmoji_Fear]":"emoji_22@2x.png","[TUIEmoji_BareTeeth]":"emoji_23@2x.png","[TUIEmoji_FlareUp]":"emoji_24@2x.png","[TUIEmoji_Tact]":"emoji_25@2x.png","[TUIEmoji_Shit]":"emoji_26@2x.png","[TUIEmoji_ShutUp]":"emoji_27@2x.png","[TUIEmoji_Sigh]":"emoji_28@2x.png","[TUIEmoji_Hehe]":"emoji_29@2x.png","[TUIEmoji_Silent]":"emoji_30@2x.png","[TUIEmoji_Skull]":"emoji_31@2x.png","[TUIEmoji_Mask]":"emoji_32@2x.png","[TUIEmoji_Beer]":"emoji_33@2x.png","[TUIEmoji_Cake]":"emoji_34@2x.png","[TUIEmoji_RedPacket]":"emoji_35@2x.png","[TUIEmoji_Bombs]":"emoji_36@2x.png","[TUIEmoji_Ai]":"emoji_37@2x.png","[TUIEmoji_Celebrate]":"emoji_38@2x.png","[TUIEmoji_Bless]":"emoji_39@2x.png","[TUIEmoji_Flower]":"emoji_40@2x.png","[TUIEmoji_Watermelon]":"emoji_41@2x.png","[TUIEmoji_Cow]":"emoji_42@2x.png","[TUIEmoji_Fool]":"emoji_43@2x.png","[TUIEmoji_Surprised]":"emoji_44@2x.png","[TUIEmoji_Askance]":"emoji_45@2x.png","[TUIEmoji_Monster]":"emoji_46@2x.png","[TUIEmoji_Pig]":"emoji_47@2x.png","[TUIEmoji_Coffee]":"emoji_48@2x.png","[TUIEmoji_Ok]":"emoji_49@2x.png","[TUIEmoji_Heart]":"emoji_50@2x.png","[TUIEmoji_Sun]":"emoji_51@2x.png","[TUIEmoji_Moon]":"emoji_52@2x.png","[TUIEmoji_Star]":"emoji_53@2x.png","[TUIEmoji_Rich]":"emoji_54@2x.png","[TUIEmoji_Fortune]":"emoji_55@2x.png","[TUIEmoji_857]":"emoji_56@2x.png","[TUIEmoji_666]":"emoji_57@2x.png","[TUIEmoji_Prohibit]":"emoji_58@2x.png","[TUIEmoji_Convinced]":"emoji_59@2x.png","[TUIEmoji_Knife]":"emoji_60@2x.png","[TUIEmoji_Like]":"emoji_61@2x.png"},Dl={"[TUIEmoji_Smile]":"[微笑]","[TUIEmoji_Expect]":"[期待]","[TUIEmoji_Blink]":"[眨眼]","[TUIEmoji_Guffaw]":"[大笑]","[TUIEmoji_KindSmile]":"[姨母笑]","[TUIEmoji_Haha]":"[哈哈哈]","[TUIEmoji_Cheerful]":"[愉快]","[TUIEmoji_Speechless]":"[无语]","[TUIEmoji_Amazed]":"[惊讶]","[TUIEmoji_Sorrow]":"[悲伤]","[TUIEmoji_Complacent]":"[得意]","[TUIEmoji_Silly]":"[傻了]","[TUIEmoji_Lustful]":"[色]","[TUIEmoji_Giggle]":"[憨笑]","[TUIEmoji_Kiss]":"[亲亲]","[TUIEmoji_Wail]":"[大哭]","[TUIEmoji_TearsLaugh]":"[哭笑]","[TUIEmoji_Trapped]":"[困]","[TUIEmoji_Mask]":"[口罩]","[TUIEmoji_Fear]":"[恐惧]","[TUIEmoji_BareTeeth]":"[龇牙]","[TUIEmoji_FlareUp]":"[发怒]","[TUIEmoji_Yawn]":"[打哈欠]","[TUIEmoji_Tact]":"[机智]","[TUIEmoji_Stareyes]":"[星星眼]","[TUIEmoji_ShutUp]":"[闭嘴]","[TUIEmoji_Sigh]":"[叹气]","[TUIEmoji_Hehe]":"[呵呵]","[TUIEmoji_Silent]":"[收声]","[TUIEmoji_Surprised]":"[惊喜]","[TUIEmoji_Askance]":"[白眼]","[TUIEmoji_Ok]":"[OK]","[TUIEmoji_Shit]":"[便便]","[TUIEmoji_Monster]":"[怪兽]","[TUIEmoji_Daemon]":"[恶魔]","[TUIEmoji_Rage]":"[恶魔怒]","[TUIEmoji_Fool]":"[衰]","[TUIEmoji_Pig]":"[猪]","[TUIEmoji_Cow]":"[牛]","[TUIEmoji_Ai]":"[AI]","[TUIEmoji_Skull]":"[骷髅]","[TUIEmoji_Bombs]":"[炸弹]","[TUIEmoji_Coffee]":"[咖啡]","[TUIEmoji_Cake]":"[蛋糕]","[TUIEmoji_Beer]":"[啤酒]","[TUIEmoji_Flower]":"[花]","[TUIEmoji_Watermelon]":"[瓜]","[TUIEmoji_Rich]":"[壕]","[TUIEmoji_Heart]":"[爱心]","[TUIEmoji_Moon]":"[月亮]","[TUIEmoji_Sun]":"[太阳]","[TUIEmoji_Star]":"[星星]","[TUIEmoji_RedPacket]":"[红包]","[TUIEmoji_Celebrate]":"[庆祝]","[TUIEmoji_Bless]":"[福]","[TUIEmoji_Fortune]":"[发]","[TUIEmoji_Convinced]":"[服]","[TUIEmoji_Prohibit]":"[禁]","[TUIEmoji_666]":"[666]","[TUIEmoji_857]":"[857]","[TUIEmoji_Knife]":"[刀]","[TUIEmoji_Like]":"[赞]"},Ll={enabledMessageReadReceipt:Math.pow(2,5),enabledEmojiPlugin:Math.pow(2,48),enabledOnlineStatus:Math.pow(2,7),enabledCustomerServicePlugin:Math.pow(2,40),enabledTranslationPlugin:Math.pow(2,38),enabledVoiceToText:Math.pow(2,39)},Rl=["messageList","conversationList","newMessageList"],Ol=["translateTextInfo","voiceToTextInfo"],Al=void 0!==Un&&"function"==typeof Un.getSystemInfoSync&&Boolean(Un.getSystemInfoSync().fontSizeSetting),bl=void 0!==Gn&&"undefined"==typeof window,Pl=Al||bl,Nl=(void 0!==Gn||"undefined"!=typeof window)&&!Pl,xl=Al?Un:void 0!==Gn?Gn:window,wl=Nl&&window&&window.navigator&&window.navigator.userAgent||"",Ul=/Android/i.test(wl),Gl=/(?:Windows Phone)/.test(wl),Fl=/(?:SymbianOS)/.test(wl),Bl=/iPad/i.test(wl)||/iPhone/i.test(wl)||/iPod/i.test(wl),ql=Ul||Gl||Fl||Bl,Vl=Nl&&!ql;class jl{constructor(){this.global=xl,this.isOfficial=!1}static getInstance(){return jl.instance||(jl.instance=new jl),jl.instance}initOfficial(e){this.isOfficial=e}getPlatform(){let e="";return Vl?e="pc":ql?e="h5":Al?e="wechat":bl&&!Al&&(e="app"),e}}class Hl{constructor(){this.EVENT=Nu.EVENT,this.TYPES=Nu.TYPES,this.loginStatusPromise=new Map,this.userID="",this.isInited=!1}static getInstance(){return Hl.instance||(Hl.instance=new Hl),Hl.instance}mount(e,t){this[e]=t}login(e){const{chat:t,SDKAppID:n,userID:o}=e,i=1400187352===n||1400188366===n;return this.createChat(e),this.userID=o,jl.getInstance().initOfficial(i),this.TUIStore.update(exports.o.APP,"isOfficial",i),this.TUIStore.update(exports.o.APP,"SDKVersion",Nu.VERSION),this.eventCenter=new ll(this),this.eventCenter.removeEvents(),this.resetStore(),this.initService(),t&&t.isReady()?(console.log("TUIChatEngine.login ok, from TUICore."),this.TUIUser.getUserProfile(),this.checkCommercialAbility(),Promise.resolve({})):(this.registerPlugin(e),this.eventCenter.addEvent(this.EVENT.SDK_READY,(()=>{this.onSDKReady()})),this.eventCenter.addEvent(this.EVENT.SDK_NOT_READY,(()=>{this.onSDKNotReady()})),this.loginChat(e))}logout(){return this.userID="",this.isInited=!1,this.resetStore(),this.chat.logout()}isReady(){var e;return(null===(e=this.chat)||void 0===e?void 0:e.isReady())||!1}setLogLevel(e){this.chat?this.chat.setLogLevel(e):console.warn("TUIChatEngine 初始化未完成,请确认 TUIChatEngine.login 接口调用是否正常。")}destroy(){return this.eventCenter.unbindIMEvents(),this.isInited=!1,this.resetStore(),this.chat.destroy()}getMyUserID(){return this.userID}resetStore(){this.TUIStore.reset(exports.o.CHAT),this.TUIStore.reset(exports.o.CONV),this.TUIStore.reset(exports.o.GRP),this.TUIStore.reset(exports.o.USER),this.TUIStore.reset(exports.o.SEARCH),this.TUIStore.reset(exports.o.FRIEND),this.TUIStore.reset(exports.o.CUSTOM),console.log("TUIChatEngine.resetStore ok.")}initService(){this.TUIChat.init(),this.TUIConversation.init(),this.TUIUser.init(),this.initOptionalServices(),this.isInited=!0,console.log("TUIChatEngine.initService ok.")}initOptionalServices(){const e=Nu.VERSION.split(".");e[0]>3||3===e[0]&&e[1]>=3&&e[2]>0?(!0===this.chat.callExperimentalAPI("canIUseModule",["group-module"])&&this.TUIGroup.init(),!0===this.chat.callExperimentalAPI("canIUseModule",["relationship-module"])&&this.TUIFriend.init()):(this.TUIGroup.init(),this.TUIFriend.init())}createChat(e){const{chat:t}=e,n=cl(e,["chat"]);Ml(t)?this.chat=Nu.create(Object.assign(Object.assign({},n),{scene:"chat-uikit-engine"})):this.chat=t}loginChat(e){const{userID:t,userSig:n}=e;return new Promise(((e,o)=>{this.chat.login({userID:t,userSig:n}).then((t=>{console.log("TUIChatEngine.loginChat ok."),this.checkCommercialAbility(),t.data.repeatLogin&&this.chat.isReady()&&e(t),this.loginStatusPromise.set("login",{resolve:e,reject:o,imResponse:t})})).catch((e=>{o(e)}))}))}registerPlugin(e){const{useUploadPlugin:t=!1,useProfanityFilterPlugin:n=!1,TIMPush:o,pushConfig:i,TUIOfflinePush:s,offlinePushConfig:r}=e;!0===t&&this.chat.registerPlugin({"tim-upload-plugin":wu}),!0===n&&this.chat.registerPlugin({"tim-profanity-filter-plugin":Gu}),!bl||Al||Ml(o)||Ml(i)||this.chat.registerPlugin({"tim-push":o,pushConfig:i}),!bl||Al||Ml(s)||Ml(r)||this.chat.registerPlugin({"tim-offline-push-plugin":s,offlinePushConfig:r})}onSDKReady(){if(this.loginStatusPromise.has("login")){const e=this.loginStatusPromise.get("login");e.resolve(e.imResponse),this.TUIUser.getUserProfile()}this.loginStatusPromise.delete("login")}onSDKNotReady(){this.loginStatusPromise.has("login")&&this.loginStatusPromise.get("login").reject(new Error("sdk not ready")),this.loginStatusPromise.delete("login"),this.resetStore()}checkCommercialAbility(){Object.keys(Ll).forEach((e=>{const t=Ll[e];this.chat.callExperimentalAPI("isCommercialAbilityEnabled",t).then((t=>{const{enabled:n=!1}=t.data;this.TUIStore.update(exports.o.APP,e,n)}))}))}}class Kl{constructor(){this.defaultStore={enabledMessageReadReceipt:!1,enabledEmojiPlugin:!1,enabledOnlineStatus:!1,enabledCustomerServicePlugin:!1,enabledTranslationPlugin:!1,enabledVoiceToText:!1,enableTyping:!0,enableConversationDraft:!0,isOfficial:!1,SDKVersion:"3.0.0",tasks:{sendMessage:!1,revokeMessage:!1,modifyNickName:!1,groupChat:!1,muteGroup:!1,dismissGroup:!1,call:!1,searchCloudMessage:!1,customerService:!1,translateTextMessage:!1}},this.store={enabledEmojiPlugin:!1,enabledMessageReadReceipt:!1,enabledOnlineStatus:!1,enabledCustomerServicePlugin:!1,enabledTranslationPlugin:!1,enabledVoiceToText:!1,enableTyping:!0,enableConversationDraft:!0,isOfficial:!1,SDKVersion:"3.0.0",tasks:{sendMessage:!1,revokeMessage:!1,modifyNickName:!1,groupChat:!1,muteGroup:!1,dismissGroup:!1,call:!1,searchCloudMessage:!1,customerService:!1,translateTextMessage:!1}}}update(e,t){this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}}class $l{constructor(){this.defaultStore={userProfile:{},displayOnlineStatus:!1,displayMessageReadReceipt:!0,userStatusList:new Map,kickedOut:"",netStateChange:"",userBlacklist:[],targetLanguage:"zh"},this.store={userProfile:{},displayOnlineStatus:!1,displayMessageReadReceipt:!0,userStatusList:new Map,kickedOut:"",netStateChange:"",userBlacklist:[],targetLanguage:"zh"}}update(e,t){"userStatusList"===e?this.updateUserStatusList(t):this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}updateUserStatusList(e){0!==e.length?e.forEach((e=>{const{userID:t,statusType:n=0,customStatus:o=""}=e;n===dl.UNSUB_USER?this.store.userStatusList.delete(t):this.store.userStatusList.set(t,{statusType:n,customStatus:o})})):this.store.userStatusList.clear()}}class zl{getEngine(){return Hl.getInstance()}}const Yl=function(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(function(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(e)){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1},Wl=["[图片]","[语音]","[视频]","[文件]","[位置]","[地理位置]","[动画表情]","[自定义消息]","[群提示消息]","[聊天记录]"];class Jl extends zl{constructor(e){super(),this.initProxy(e),this.isMuted=this.messageRemindType===this.getEngine().TYPES.MSG_REMIND_ACPT_NOT_NOTE||this.messageRemindType===this.getEngine().TYPES.MSG_REMIND_DISCARD,this.operationType=0,this._conversation=e}initProxy(e){Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}updateProperties(e){Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}updateOperationType(e){this.operationType=e}getConversation(){return this._conversation}deleteConversation(){return this.getEngine().TUIConversation.deleteConversation(this.conversationID)}pinConversation(){return this.getEngine().TUIConversation.pinConversation({conversationID:this.conversationID,isPinned:!this.isPinned})}muteConversation(){const e=this.getEngine(),t={messageRemindType:!0===this.isMuted?e.TYPES.MSG_REMIND_ACPT_AND_NOTE:e.TYPES.MSG_REMIND_ACPT_NOT_NOTE};if(this.type===e.TYPES.CONV_C2C){const n=this.conversationID.replace(e.TYPES.CONV_C2C,"");t.userIDList=[n]}else if(this.type===e.TYPES.CONV_GROUP){const n=this.conversationID.replace(e.TYPES.CONV_GROUP,"");t.groupID=n}return e.TUIConversation.muteConversation(t)}getAvatar(){var e,t,n,o,i,s;const r=this.getEngine();let a="";switch(this.type){case r.TYPES.CONV_C2C:a=Tl(null===(e=this.userProfile)||void 0===e?void 0:e.avatar)?null===(t=this.userProfile)||void 0===t?void 0:t.avatar:"https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_16.png";break;case r.TYPES.CONV_GROUP:a=Tl(null===(n=this.groupProfile)||void 0===n?void 0:n.avatar)?null===(o=this.groupProfile)||void 0===o?void 0:o.avatar:"https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.png";break;case r.TYPES.CONV_SYSTEM:a=Tl(null===(i=this.groupProfile)||void 0===i?void 0:i.avatar)?null===(s=this.groupProfile)||void 0===s?void 0:s.avatar:"https://web.sdk.qcloud.com/component/TUIKit/assets/group_avatar.png"}return a}getShowName(){var e,t,n,o;const i=this.getEngine();let s="";switch(this.type){case i.TYPES.CONV_C2C:s=this.remark||(null===(e=this.userProfile)||void 0===e?void 0:e.nick)||(null===(t=this.userProfile)||void 0===t?void 0:t.userID)||"";break;case i.TYPES.CONV_GROUP:s=(null===(n=this.groupProfile)||void 0===n?void 0:n.name)||(null===(o=this.groupProfile)||void 0===o?void 0:o.groupID)||"";break;case i.TYPES.CONV_SYSTEM:s=i.TUITranslate.t("系统通知")}return s}getGroupAtInfo(){const e=this.getEngine(),t=e.TUITranslate.t.bind(e.TUITranslate),n=[`[${t("TUIConversation.有人@我")}]`,`[${t("TUIConversation.@所有人")}]`,`[${t("TUIConversation.@所有人")}][${t("TUIConversation.有人@我")}]`];let o="";for(let i=0;i<this.groupAtInfoList.length;i++)this.groupAtInfoList[i].atTypeArray[0]&&this.unreadCount>0&&(o=n[this.groupAtInfoList[i].atTypeArray[0]-1]);return o}getLastMessage(e){return"time"===e?this.getLastMessageTime():"text"===e?this.getLastMessageText():(console.warn(`ConversationModel.getLastMessage key:${e} is invalid.`),null)}getLastMessageTime(){var e;const t=this.getEngine();let n="";return(null===(e=this.lastMessage)||void 0===e?void 0:e.lastTime)>0&&(n=function(e,t){const n=36e5,o=24*n,i=7*o,s=(new Date).getTime()-e;let r="";if(s<0)return r;const a=s/6e4,c=s/n,u=s/o,l=s/i;if(l>=1&&l<=4)r=` ${parseInt(`${l}`,10)} ${t("time.周")}${t("time.前")}`;else if(u>=1&&u<=6)r=` ${parseInt(`${u}`,10)} ${t("time.天")}${t("time.前")}`;else if(c>=1&&c<=23)r=` ${parseInt(`${c}`,10)} ${t("time.小时")}${t("time.前")}`;else if(a>=1&&a<=59)r=` ${parseInt(`${a}`,10)} ${t("time.分钟")}${t("time.前")}`;else if(s>=0&&s<=6e4)r=`${t("time.刚刚")}`;else{const t=new Date;t.setTime(e),r=`${t.getFullYear()}-${t.getMonth()+1<10?`0${t.getMonth()+1}`:t.getMonth()+1}-${t.getDate()<10?`0${t.getDate()}`:t.getDate()}`}return r}(1e3*this.lastMessage.lastTime,t.TUITranslate.t.bind(t.TUITranslate))),n}getLastMessageText(){var e;if(this.draftText)return Sl(this.draftText).abstract;const t=this.getEngine(),n=t.TUITranslate.t.bind(t.TUITranslate);if(4===this.operationType)return n("TUIConversation.您已被群管理员移出群聊");if(5===this.operationType)return n("TUIConversation.该群聊已被解散");if(8===this.operationType)return n("TUIConversation.您已退出该群聊");const o=this._conversation,{lastMessage:i}=this;let s="",r="";const a=o.unreadCount>0&&o.messageRemindType===t.TYPES.MSG_REMIND_ACPT_NOT_NOTE?`[${o.unreadCount>99?"99+":o.unreadCount}${n("TUIConversation.条")}]`:"";if(o.type===t.TYPES.CONV_GROUP)if(i.fromAccount===t.getMyUserID())s=n("TUIConversation.我");else{const e=i.fromAccount;s=t.TUIFriend.getFriendRemark([e])[e]||i.nameCard||i.nick||e}if(i.type===t.TYPES.MSG_TEXT)r=this.decodeTextMessage(i.payload.text);else if(i.type===t.TYPES.MSG_CUSTOM){const o=Sl(null===(e=null==i?void 0:i.payload)||void 0===e?void 0:e.data);if(1===(null==o?void 0:o.businessID))return r=t.TUIChat.messageHandler.handleCallKitSignaling(i),r;r=Wl.includes(i.messageForShow)?n(`TUIChat.${i.messageForShow}`):i.messageForShow}else r=Wl.includes(i.messageForShow)?n(`TUIChat.${i.messageForShow}`):i.messageForShow;return i.isRevoked&&(r=n("TUIChat.撤回了一条消息")),o.type===t.TYPES.CONV_GROUP&&i.type===t.TYPES.MSG_GRP_TIP?r:`${a}${s?`${s}:`:""}${r}`}decodeTextMessage(e){if(Yl(e))return e;const t=/(\[.+?\])/g;let n=e;if(t.test(e)){const o=this.getEngine(),i=o.TUITranslate.t.bind(o.TUITranslate);n=e.replace(t,(e=>{const t=i(`Emoji.${e}`);return Al||!t||t.startsWith("Emoji.")?Dl[e]||e:t}))}return n}}class Xl{constructor(){this.defaultStore={currentConversationID:"",totalUnreadCount:0,conversationList:[],currentConversation:null,operationTypeMap:new Map},this.store={currentConversationID:"",totalUnreadCount:0,conversationList:[],currentConversation:null,operationTypeMap:new Map}}update(e,t){switch(e){case"conversationList":this.updateConversationList(t);break;case"operationTypeMap":this.updateOperationTypeMap(t);break;default:this.store[e]=t}}getData(e){return this.store[e]}getModel(e){return this.store.conversationList.find((t=>t.conversationID===e))}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}updateConversationList(e){const t=[];e.forEach((e=>{let n=e;e instanceof Jl?n.updateProperties(e):n=new Jl(e);const o=this.getOperationType(e);n.updateOperationType(o),t.push(n)})),this.store.conversationList=t}updateOperationTypeMap(e){const{conversationID:t,operationType:n=0}=e;this.store.operationTypeMap.set(t,n)}getOperationType(e){const{conversationID:t}=e;return this.store.operationTypeMap.get(t)||0}}class Zl extends zl{constructor(e){super(),this.messageHandlers={[this.getEngine().TYPES.MSG_TEXT]:e=>this.getEngine().TUIChat.messageHandler.handleTextMessage(e),[this.getEngine().TYPES.MSG_FACE]:e=>this.getEngine().TUIChat.messageHandler.handleFaceMessage(e),[this.getEngine().TYPES.MSG_LOCATION]:e=>this.getEngine().TUIChat.messageHandler.handleLocationMessage(e),[this.getEngine().TYPES.MSG_IMAGE]:e=>this.getEngine().TUIChat.messageHandler.handleImageMessage(e),[this.getEngine().TYPES.MSG_AUDIO]:e=>this.getEngine().TUIChat.messageHandler.handleAudioMessage(e),[this.getEngine().TYPES.MSG_VIDEO]:e=>this.getEngine().TUIChat.messageHandler.handleVideoMessage(e),[this.getEngine().TYPES.MSG_FILE]:e=>this.getEngine().TUIChat.messageHandler.handleFileMessage(e),[this.getEngine().TYPES.MSG_CUSTOM]:e=>this.getEngine().TUIChat.messageHandler.handleCustomMessage(e),[this.getEngine().TYPES.MSG_MERGER]:e=>this.getEngine().TUIChat.messageHandler.handleMergeMessage(e),[this.getEngine().TYPES.MSG_GRP_TIP]:e=>this.getEngine().TUIChat.messageHandler.handleGroupTipsMessage(e)},this._message=e,this._signalingInfo=void 0,this.progress=0,this.reactionList=[],this.initProperties(e)}initProperties(e){Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}updateProperties(e){this._message=e,Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}getMessage(){return this._message}modifyMessage(e){return e.type&&this._message.type!==e.type&&!e.payload?Promise.reject({code:ml.MISMATCH_TYPE_AND_PAYLOAD,message:vl.MISMATCH_TYPE_AND_PAYLOAD}):(this._message.type=e.type||this._message.type,this._message.payload=e.payload||this._message.payload,this._message.cloudCustomData=e.cloudCustomData||this._message.cloudCustomData,this.getEngine().TUIChat.modifyMessage(this._message))}revokeMessage(){return this.getEngine().TUIChat.revokeMessage(this._message)}resendMessage(){return this.getEngine().TUIChat.resendMessage(this._message)}deleteMessage(){return this.getEngine().TUIChat.deleteMessage([this._message])}quoteMessage(){return this.getEngine().TUIChat.quoteMessage(this._message)}replyMessage(){return this.getEngine().TUIChat.replyMessage(this._message)}setMessageExtensions(e){return this.getEngine().TUIChat.setMessageExtensions(this._message,e)}getMessageExtensions(){return this.getEngine().TUIChat.getMessageExtensions(this._message)}deleteMessageExtensions(e){return this.getEngine().TUIChat.deleteMessageExtensions(this._message,e)}getSignalingInfo(){return this.type!==this.getEngine().TYPES.MSG_CUSTOM?null:Ml(this._signalingInfo)?(this._signalingInfo=this.getEngine().chat.getSignalingInfo(this._message),this._signalingInfo):this._signalingInfo}getMessageContent(){const e=this.messageHandlers[this.type];if(Ml(e))return{};if(this.type===this.getEngine().TYPES.MSG_GRP_TIP)return e(this._message);const t=this.getEngine().TUIFriend.getFriendRemark([this.from]);return Object.assign(Object.assign({},e(this._message)),{showName:t[this.from]||this.nameCard||this.nick||this.from})}sendForwardMessage(e){return this.getEngine().TUIChat.sendForwardMessage(e,[this._message])}}class Ql{constructor(){this.defaultStore={messageList:[],isCompleted:!1,nextReqMessageID:"",quoteMessage:{},newMessageList:[],typingStatus:!1,messageSource:void 0,translateTextInfo:void 0,voiceToTextInfo:void 0,userInfo:{}},this.store={messageList:[],isCompleted:!1,nextReqMessageID:"",quoteMessage:{},newMessageList:[],typingStatus:!1,messageSource:void 0,translateTextInfo:void 0,voiceToTextInfo:void 0,userInfo:{}}}update(e,t){switch(e){case"messageList":this.updateMessageList(t);break;case"translateTextInfo":this.updateTranslateTextInfo(t);break;case"voiceToTextInfo":this.updateVoiceToTextInfo(t);break;default:this.store[e]=t}}getData(e){return this.store[e]}getModel(e){return this.store.messageList.find((t=>t.ID===e))}reset(e=[]){const t=e.filter((e=>!Ol.includes(e)));this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),null==t?void 0:t.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}updateMessageList(e){const t=[];e.forEach((e=>{let n=e;e instanceof Zl||(n=this.getModel(e.ID),n?n.updateProperties(e):n=new Zl(e)),t.push(n)})),this.store.messageList=t}updateTranslateTextInfo(e){this.updateBykey("translateTextInfo",e)}updateVoiceToTextInfo(e){this.updateBykey("voiceToTextInfo",e)}updateBykey(e,t){const{conversationID:n,messageID:o,visible:i=!1}=t;this.store[e]||(this.store[e]=new Map),this.store[e].has(n)||this.store[e].set(n,[]);const s=this.store[e].get(n)||[];let r=!0;for(let a=0;a<s.length;a++)if(s[a].messageID===o){s[a].visible=i,r=!1;break}r&&s.push({messageID:o,visible:i}),this.store[e].set(n,s)}}class ep{constructor(e){this.groupAttributes={},this.groupCounters={},this.initProxy(e)}initProxy(e){Object.keys(e).forEach((t=>{Cl(t)||(this[t]=e[t])}))}}class tp{constructor(){this.defaultStore={currentGroupID:"",currentGroup:{},currentGroupAttributes:{},currentGroupCounters:{},currentGroupMemberList:[],groupList:[],groupSystemNoticeList:[],isCompleted:!1,offset:0},this.store={currentGroupID:"",currentGroup:void 0,currentGroupAttributes:{},currentGroupCounters:{},currentGroupMemberList:[],groupList:[],groupSystemNoticeList:[],isCompleted:!1,offset:0}}update(e,t){switch(e){case"groupList":this.updateGroupList(t);break;case"currentGroup":this.store.currentGroup=t instanceof ep?t:new ep(t);break;default:this.store[e]=t}}getData(e){if("groupSystemNoticeList"===e){const e=[...this.store.groupSystemNoticeList];return this.store.groupSystemNoticeList.length=0,e}return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}updateGroupList(e){this.store.groupList=e.map((e=>e instanceof ep?e:new ep(e)))}}class np{constructor(){this.store={}}update(e,t){this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){0===e.length&&(this.store={}),this.store=Object.assign(Object.assign({},this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:void 0})),{}))}}class op{constructor(){this.defaultStore={friendList:[],friendApplicationList:[],friendApplicationUnreadCount:0},this.store={friendList:[],friendApplicationList:[],friendApplicationUnreadCount:0}}update(e,t){this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}}class ip{constructor(){this.defaultStore={currentSearchInputValue:{value:"",searchType:"global"},currentSearchMessageType:{value:{key:"",label:"",value:""},searchType:"global"},currentSearchMessageTime:{value:{key:"",label:"",value:{timePosition:0,timePeriod:0}},searchType:"global"},currentSearchingStatus:{isSearching:!1,searchType:"global"},isShowInConversationSearch:!1},this.store={currentSearchInputValue:{value:"",searchType:"global"},currentSearchMessageType:{value:{key:"",label:"",value:""},searchType:"global"},currentSearchMessageTime:{value:{key:"",label:"",value:{timePosition:0,timePeriod:0}},searchType:"global"},currentSearchingStatus:{isSearching:!1,searchType:"global"},isShowInConversationSearch:!1}}update(e,t){this.store[e]=t}getData(e){return this.store[e]}reset(e=[]){this.store=Object.assign(Object.assign(Object.assign({},this.defaultStore),this.store),null==e?void 0:e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:this.defaultStore[t]})),{}))}}class sp{constructor(){this.storeMap={[exports.o.APP]:new Kl,[exports.o.USER]:new $l,[exports.o.CONV]:new Xl,[exports.o.CHAT]:new Ql,[exports.o.GRP]:new tp,[exports.o.FRIEND]:new op,[exports.o.SEARCH]:new ip},this.task={}}static getInstance(){return sp.instance||(sp.instance=new sp),sp.instance}watch(e,t){this.task[e]||(this.task[e]={});const n=this.task[e];Object.keys(t).forEach((o=>{const i=t[o];n[o]||(n[o]=new Map),n[o].set(i,1),this.notifyOnWatch(e,o,i)}))}unwatch(e,t){if(!this.task[e])return;const n=this.task[e];Object.keys(t).forEach((e=>{var o;null===(o=n[e])||void 0===o||o.delete(t[e])}))}update(e,t,n){var o;e!==exports.o.CUSTOM||this.storeMap[e]||(this.storeMap[e]=new np),null===(o=this.storeMap[e])||void 0===o||o.update(t,n),this.notify(e,t)}getData(e,t){var n;return e!==exports.o.CUSTOM||this.storeMap[e]||(this.storeMap[e]=new np),null===(n=this.storeMap[e])||void 0===n?void 0:n.getData(t)}getConversationModel(e){var t;return null===(t=this.storeMap[exports.o.CONV])||void 0===t?void 0:t.getModel(e)}getMessageModel(e){var t;return null===(t=this.storeMap[exports.o.CHAT])||void 0===t?void 0:t.getModel(e)}reset(e,t=[],n=!1){if(e in this.storeMap){const o=this.storeMap[e];0===t.length&&(t=Object.keys(null==o?void 0:o.store)),o.reset(t),n&&t.forEach((t=>{this.notify(e,t)}))}}notifyOnWatch(e,t,n){const o=this.getData(e,t);Rl.indexOf(t)>-1&&0===o.length||n&&n.call(this,o)}notify(e,t){if(!this.task[e])return;const n=this.task[e];if(n[t]){const o=n[t],i=this.getData(e,t);for(const[e]of o.entries())e.call(this,i)}}}function rp(e){return(rp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ap(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cp(e){var t=function(e){if("object"!=rp(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=rp(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rp(t)?t:t+""}function up(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,cp(o.key),o)}}function lp(e,t,n){return t&&up(e.prototype,t),n&&up(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pp(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dp(e,t){return(dp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function hp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dp(e,t)}function gp(e,t){if(t&&("object"==rp(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pp(e)}function fp(e){return(fp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mp(e,t,n){return(t=cp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function vp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function yp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vp(Object(n),!0).forEach((function(t){mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ip={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},Mp=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ap(this,e),this.init(t,n)}return lp(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Ip,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,o){return o&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,yp(yp({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}()),Cp=function(){function e(){ap(this,e),this.observers={}}return lp(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function Tp(){var e,t,n=new Promise((function(n,o){e=n,t=o}));return n.resolve=e,n.reject=t,n}function Sp(e){return null==e?"":""+e}function Ep(e,t,n){function o(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var s="string"!=typeof t?[].concat(t):t.split(".");s.length>1;){if(i())return{};var r=o(s.shift());!e[r]&&n&&(e[r]=new n),e=Object.prototype.hasOwnProperty.call(e,r)?e[r]:{}}return i()?{}:{obj:e,k:o(s.shift())}}function kp(e,t,n){var o=Ep(e,t,Object);o.obj[o.k]=n}function Dp(e,t){var n=Ep(e,t),o=n.obj,i=n.k;if(o)return o[i]}function Lp(e,t,n){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||e[o]instanceof String||"string"==typeof t[o]||t[o]instanceof String?n&&(e[o]=t[o]):Lp(e[o],t[o],n):e[o]=t[o]);return e}function Rp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Op={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Ap(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Op[e]})):e}var bp="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Pp=[" ",",","?","!",";"];function Np(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var o=t.split(n),i=e,s=0;s<o.length;++s){if(!i)return;if("string"==typeof i[o[s]]&&s+1<o.length)return;if(void 0===i[o[s]]){for(var r=2,a=o.slice(s,s+r).join(n),c=i[a];void 0===c&&o.length>s+r;)r++,c=i[a=o.slice(s,s+r).join(n)];if(void 0===c)return;if(null===c)return null;if(t.endsWith(a)){if("string"==typeof c)return c;if(a&&"string"==typeof c[a])return c[a]}var u=o.slice(s+r).join(n);return u?Np(c,u,n):void 0}i=i[o[s]]}return i}}function xp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function wp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xp(Object(n),!0).forEach((function(t){mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Up=function(){hp(t,Cp);var e=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=fp(e);if(t){var i=fp(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return gp(this,n)}}(t);function t(n){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return ap(this,t),o=e.call(this),bp&&Cp.call(pp(o)),o.data=n||{},o.options=i,void 0===o.options.keySeparator&&(o.options.keySeparator="."),void 0===o.options.ignoreJSONStructure&&(o.options.ignoreJSONStructure=!0),o}return lp(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure,r=[e,t];n&&"string"!=typeof n&&(r=r.concat(n)),n&&"string"==typeof n&&(r=r.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=e.split("."));var a=Dp(this.data,r);return a||!s||"string"!=typeof n?a:Np(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,r=[e,t];n&&(r=r.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(o=t,t=(r=e.split("."))[1]),this.addNamespaces(t),kp(this.data,r,o),i.silent||this.emit("added",e,t,n,o)}},{key:"addResources",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});o.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,o,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},r=[e,t];e.indexOf(".")>-1&&(o=n,n=t,t=(r=e.split("."))[1]),this.addNamespaces(t);var a=Dp(this.data,r)||{};o?Lp(a,n,i):a=wp(wp({},a),n),kp(this.data,r,a),s.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?wp(wp({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),t}(),Gp={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,o,i){var s=this;return e.forEach((function(e){s.processors[e]&&(t=s.processors[e].process(t,n,o,i))})),t}};function Fp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Bp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fp(Object(n),!0).forEach((function(t){mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var qp={},Vp=function(){hp(t,Cp);var e=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=fp(e);if(t){var i=fp(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return gp(this,n)}}(t);function t(n){var o,i,s,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ap(this,t),o=e.call(this),bp&&Cp.call(pp(o)),i=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],s=n,r=pp(o),i.forEach((function(e){s[e]&&(r[e]=s[e])})),o.options=a,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o.logger=Mp.create("translator"),o}return lp(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],s=n&&e.indexOf(n)>-1,r=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var o=Pp.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===o.length)return!0;var i=new RegExp("(".concat(o.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),s=!i.test(e);if(!s){var r=e.indexOf(n);r>0&&!i.test(e.substring(0,r))&&(s=!0)}return s}(e,n,o));if(s&&!r){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:i};var c=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),e=c.join(o)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,o){var i=this;if("object"!==rp(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"===rp(n)&&(n=Bp({},n)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var s=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],n),c=a.key,u=a.namespaces,l=u[u.length-1],p=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase()){if(d){var h=n.nsSeparator||this.options.nsSeparator;return s?{res:"".concat(l).concat(h).concat(c),usedKey:c,exactUsedKey:c,usedLng:p,usedNS:l}:"".concat(l).concat(h).concat(c)}return s?{res:c,usedKey:c,exactUsedKey:c,usedLng:p,usedNS:l}:c}var g=this.resolve(e,n),f=g&&g.res,m=g&&g.usedKey||c,_=g&&g.exactUsedKey||c,v=Object.prototype.toString.apply(f),y=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject;if(I&&f&&"string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f&&["[object Number]","[object Function]","[object RegExp]"].indexOf(v)<0&&("string"!=typeof y||"[object Array]"!==v)){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,f,Bp(Bp({},n),{},{ns:u})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return s?(g.res=M,g):M}if(r){var C="[object Array]"===v,T=C?[]:{},S=C?_:m;for(var E in f)if(Object.prototype.hasOwnProperty.call(f,E)){var k="".concat(S).concat(r).concat(E);T[E]=this.translate(k,Bp(Bp({},n),{joinArrays:!1,ns:u})),T[E]===k&&(T[E]=f[E])}f=T}}else if(I&&"string"==typeof y&&"[object Array]"===v)(f=f.join(y))&&(f=this.extendTranslation(f,e,n,o));else{var D=!1,L=!1,R=void 0!==n.count&&"string"!=typeof n.count,O=t.hasDefaultValue(n),A=R?this.pluralResolver.getSuffix(p,n.count,n):"",b=n["defaultValue".concat(A)]||n.defaultValue;!this.isValidLookup(f)&&O&&(D=!0,f=b),this.isValidLookup(f)||(L=!0,f=c);var P=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:f,N=O&&b!==f&&this.options.updateMissing;if(L||D||N){if(this.logger.log(N?"updateKey":"missingKey",p,l,c,N?b:f),r){var x=this.resolve(c,Bp(Bp({},n),{},{keySeparator:!1}));x&&x.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var w=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var G=0;G<U.length;G++)w.push(U[G]);else"all"===this.options.saveMissingTo?w=this.languageUtils.toResolveHierarchy(n.lng||this.language):w.push(n.lng||this.language);var F=function(e,t,o){var s=O&&o!==f?o:P;i.options.missingKeyHandler?i.options.missingKeyHandler(e,l,t,s,N,n):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,l,t,s,N,n),i.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?w.forEach((function(e){i.pluralResolver.getSuffixes(e,n).forEach((function(t){F([e],c+t,n["defaultValue".concat(t)]||b)}))})):F(w,c,b))}f=this.extendTranslation(f,e,n,g,o),L&&f===c&&this.options.appendNamespaceToMissingKey&&(f="".concat(l,":").concat(c)),(L||D)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(c):c,D?f:void 0):this.options.parseMissingKeyHandler(f))}return s?(g.res=f,g):f}},{key:"extendTranslation",value:function(e,t,n,o,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Bp(Bp({},this.options.interpolation.defaultVariables),n),o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Bp(Bp({},n),{interpolation:Bp(Bp({},this.options.interpolation),n.interpolation)}));var r,a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){var c=e.match(this.interpolator.nestingRegexp);r=c&&c.length}var u=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(u=Bp(Bp({},this.options.interpolation.defaultVariables),u)),e=this.interpolator.interpolate(e,u,n.lng||this.language,n),a){var l=e.match(this.interpolator.nestingRegexp);r<(l&&l.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&o&&o.res&&(n.lng=o.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return i&&i[0]===o[0]&&!n.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(o[0]," in key: ").concat(t[0])),null):s.translate.apply(s,o.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var p=n.postProcess||this.options.postProcess,d="string"==typeof p?[p]:p;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=Gp.handle(d,e,t,this.options&&this.options.postProcessPassResolved?Bp({i18nResolved:o},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,o,i,s,r=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!r.isValidLookup(t)){var c=r.extractFromKey(e,a),u=c.key;n=u;var l=c.namespaces;r.options.fallbackNS&&(l=l.concat(r.options.fallbackNS));var p=void 0!==a.count&&"string"!=typeof a.count,d=p&&!a.ordinal&&0===a.count&&r.pluralResolver.shouldUseIntlApi(),h=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,g=a.lngs?a.lngs:r.languageUtils.toResolveHierarchy(a.lng||r.language,a.fallbackLng);l.forEach((function(e){r.isValidLookup(t)||(s=e,!qp["".concat(g[0],"-").concat(e)]&&r.utils&&r.utils.hasLoadedNamespace&&!r.utils.hasLoadedNamespace(s)&&(qp["".concat(g[0],"-").concat(e)]=!0,r.logger.warn('key "'.concat(n,'" for languages "').concat(g.join(", "),'" won\'t get resolved as namespace "').concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach((function(n){if(!r.isValidLookup(t)){i=n;var s,c=[u];if(r.i18nFormat&&r.i18nFormat.addLookupKeys)r.i18nFormat.addLookupKeys(c,u,n,e,a);else{var l;p&&(l=r.pluralResolver.getSuffix(n,a.count,a));var g="".concat(r.options.pluralSeparator,"zero");if(p&&(c.push(u+l),d&&c.push(u+g)),h){var f="".concat(u).concat(r.options.contextSeparator).concat(a.context);c.push(f),p&&(c.push(f+l),d&&c.push(f+g))}}for(;s=c.pop();)r.isValidLookup(t)||(o=s,t=r.getResource(n,e,s,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:s}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),t}();function jp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Hp=function(){function e(t){ap(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Mp.create("languageUtils")}return lp(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=jp(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=jp(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=jp(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var o=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(o)||(t=o)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var o=n.getLanguagePartFromCode(e);if(n.isSupportedCode(o))return t=o;t=n.options.supportedLngs.find((function(e){return e===o?e:e.indexOf("-")<0&&o.indexOf("-")<0?void 0:0===e.indexOf(o)?e:void 0}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,o=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],s=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):"string"==typeof e&&s(this.formatLanguageCode(e)),o.forEach((function(e){i.indexOf(e)<0&&s(n.formatLanguageCode(e))})),i}}]),e}(),Kp=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$p={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},zp=["v1","v2","v3"],Yp={zero:0,one:1,two:2,few:3,many:4,other:5},Wp=function(){function e(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ap(this,e),this.languageUtils=t,this.options=o,this.logger=Mp.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},Kp.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:$p[e.fc]}}))})),n)}return lp(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.getRule(e,n);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort((function(e,t){return Yp[e]-Yp[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):o.numbers.map((function(o){return t.getSuffix(e,o,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.getRule(e,n);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(t)):this.getSuffixRetroCompatible(o,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,o=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[o];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var s=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?s():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!zp.includes(this.options.compatibilityJSON)}}]),e}();function Jp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function Xp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jp(Object(n),!0).forEach((function(t){mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jp(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zp(e,t,n){var o,i,s,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=(o=t,void 0!==(s=Dp(e,i=n))?s:Dp(o,i));return!c&&a&&"string"==typeof n&&void 0===(c=Np(e,n,r))&&(c=Np(t,n,r)),c}var Qp=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ap(this,e),this.logger=Mp.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return lp(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:Ap,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Rp(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Rp(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?Rp(t.nestingPrefix):t.nestingPrefixEscaped||Rp("$t("),this.nestingSuffix=t.nestingSuffix?Rp(t.nestingSuffix):t.nestingSuffixEscaped||Rp(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,o){var i,s,r,a=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(a.formatSeparator)<0){var i=Zp(t,c,e,a.options.keySeparator,a.options.ignoreJSONStructure);return a.alwaysFormat?a.format(i,void 0,n,Xp(Xp(Xp({},o),t),{},{interpolationkey:e})):i}var s=e.split(a.formatSeparator),r=s.shift().trim(),u=s.join(a.formatSeparator).trim();return a.format(Zp(t,c,r,a.options.keySeparator,a.options.ignoreJSONStructure),u,n,Xp(Xp(Xp({},o),t),{},{interpolationkey:r}))};this.resetRegExp();var p=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,d=o&&o.interpolation&&void 0!==o.interpolation.skipOnVariables?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?u(a.escape(e)):u(e)}}].forEach((function(t){for(r=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(s=l(n)))if("function"==typeof p){var c=p(e,i,o);s="string"==typeof c?c:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))s="";else{if(d){s=i[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),s=""}else"string"==typeof s||a.useRawValueToEscape||(s=Sp(s));var u=t.safeValue(s);if(e=e.replace(i[0],u),d?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++r>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,o,i,s=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var o=e.split(new RegExp("".concat(n,"[ ]*{"))),s="{".concat(o[1]);e=o[0];var r=(s=this.interpolate(s,i)).match(/'/g),a=s.match(/"/g);(r&&r.length%2==0&&!a||a.length%2!=0)&&(s=s.replace(/'/g,'"'));try{i=JSON.parse(s),t&&(i=Xp(Xp({},t),i))}catch(c){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),c),"".concat(e).concat(n).concat(s)}return delete i.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var c=[];(i=(i=Xp({},r)).replace&&"string"!=typeof i.replace?i.replace:i).applyPostProcessor=!1,delete i.defaultValue;var u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),c=l,u=!0}if((o=t(a.call(this,n[1].trim(),i),i))&&n[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=Sp(o)),o||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),o=""),u&&(o=c.reduce((function(e,t){return s.format(e,t,r.lng,Xp(Xp({},r),{},{interpolationkey:n[1].trim()}))}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}]),e}();function ed(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function td(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ed(Object(n),!0).forEach((function(t){mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ed(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function nd(e){var t={};return function(n,o,i){var s=o+JSON.stringify(i),r=t[s];return r||(r=e(o,i),t[s]=r),r(n)}}var od=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ap(this,e),this.logger=Mp.create("formatter"),this.options=t,this.formats={number:nd((function(e,t){var n=new Intl.NumberFormat(e,td({},t));return function(e){return n.format(e)}})),currency:nd((function(e,t){var n=new Intl.NumberFormat(e,td(td({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:nd((function(e,t){var n=new Intl.DateTimeFormat(e,td({},t));return function(e){return n.format(e)}})),relativetime:nd((function(e,t){var n=new Intl.RelativeTimeFormat(e,td({},t));return function(e){return n.format(e,t.range||"day")}})),list:nd((function(e,t){var n=new Intl.ListFormat(e,td({},t));return function(e){return n.format(e)}}))},this.init(t)}return lp(e,[{key:"init",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=nd(t)}},{key:"format",value:function(e,t,n){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce((function(e,t){var s=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var o=e.split("(");t=o[0].toLowerCase().trim();var i=o[1].substring(0,o[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_p(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.split(":")),o=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[o.trim()]||(n[o.trim()]=i),"false"===i&&(n[o.trim()]=!1),"true"===i&&(n[o.trim()]=!0),isNaN(i)||(n[o.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),r=s.formatName,a=s.formatOptions;if(o.formats[r]){var c=e;try{var u=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},l=u.locale||u.lng||i.locale||i.lng||n;c=o.formats[r](e,l,td(td(td({},a),i),u))}catch(p){o.logger.warn(p)}return c}return o.logger.warn("there was no format function for ".concat(r)),e}),e)}}]),e}();function id(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function sd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?id(Object(n),!0).forEach((function(t){mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):id(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rd=function(){hp(t,Cp);var e=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=fp(e);if(t){var i=fp(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return gp(this,n)}}(t);function t(n,o,i){var s,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return ap(this,t),s=e.call(this),bp&&Cp.call(pp(s)),s.backend=n,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=r,s.logger=Mp.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=r.maxParallelReads||10,s.readingCalls=0,s.maxRetries=r.maxRetries>=0?r.maxRetries:5,s.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,r.backend,r),s}return lp(t,[{key:"queueLoad",value:function(e,t,n,o){var i=this,s={},r={},a={},c={};return e.forEach((function(e){var o=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?void 0===r[a]&&(r[a]=!0):(i.state[a]=1,o=!1,void 0===r[a]&&(r[a]=!0),void 0===s[a]&&(s[a]=!0),void 0===c[t]&&(c[t]=!0)))})),o||(a[e]=!0)})),(Object.keys(s).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(r),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,n){var o=e.split("|"),i=o[0],s=o[1];t&&this.emit("failedLoading",i,s,t),n&&this.store.addResourceBundle(i,s,n),this.state[e]=t?-1:2;var r={};this.queue.forEach((function(n){var o,a,c,u,l,p,d;o=n.loaded,a=s,(u=(c=Ep(o,[i],Object)).obj)[l=c.k]=u[l]||[],u[l].push(a),d=e,void 0!==(p=n).pending[d]&&(delete p.pending[d],p.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){r[e]||(r[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===r[e][t]&&(r[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,r=arguments.length>5?arguments[5]:void 0;if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:s,callback:r});else{this.readingCalls++;var a=function(a,c){if(o.readingCalls--,o.waitingReads.length>0){var u=o.waitingReads.shift();o.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}a&&c&&i<o.maxRetries?setTimeout((function(){o.read.call(o,e,t,n,i+1,2*s,r)}),s):r(a,c)},c=this.backend[n].bind(this.backend);if(2!==c.length)return c(e,t,a);try{var u=c(e,t);u&&"function"==typeof u.then?u.then((function(e){return a(null,e)})).catch(a):a(null,u)}catch(l){a(l)}}}},{key:"prepareLoading",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var s=this.queueLoad(e,t,o,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=e.split("|"),i=o[0],s=o[1];this.read(i,s,"read",void 0,void 0,(function(o,r){o&&t.logger.warn("".concat(n,"loading namespace ").concat(s," for language ").concat(i," failed"),o),!o&&r&&t.logger.log("".concat(n,"loaded namespace ").concat(s," for language ").concat(i),r),t.loaded(e,o,r)}))}},{key:"saveMissing",value:function(e,t,n,o,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var a=sd(sd({},s),{},{isUpdate:i}),c=this.backend.create.bind(this.backend);if(c.length<6)try{var u;(u=5===c.length?c(e,t,n,o,a):c(e,t,n,o))&&"function"==typeof u.then?u.then((function(e){return r(null,e)})).catch(r):r(null,u)}catch(l){r(l)}else c(e,t,n,o,r,a)}e&&e[0]&&this.store.addResource(e[0],t,n,o)}}}]),t}();function ad(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===rp(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===rp(e[2])||"object"===rp(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,o){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function cd(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function ud(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function ld(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ud(Object(n),!0).forEach((function(t){mp(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ud(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pd(){}var dd=function(){hp(t,Cp);var e=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=fp(e);if(t){var i=fp(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return gp(this,n)}}(t);function t(){var n,o,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;if(ap(this,t),n=e.call(this),bp&&Cp.call(pp(n)),n.options=cd(i),n.services={},n.logger=Mp,n.modules={external:[]},o=pp(n),Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach((function(e){"function"==typeof o[e]&&(o[e]=o[e].bind(o))})),s&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,s),gp(n,pp(n));setTimeout((function(){n.init(i,s)}),0)}return n}return lp(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var o=ad();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=ld(ld(ld({},o),this.options),cd(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=ld(ld({},o.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var s;this.modules.logger?Mp.init(i(this.modules.logger),this.options):Mp.init(null,this.options),this.modules.formatter?s=this.modules.formatter:"undefined"!=typeof Intl&&(s=od);var r=new Hp(this.options);this.store=new Up(this.options.resources,this.options);var a=this.services;a.logger=Mp,a.resourceStore=this.store,a.languageUtils=r,a.pluralResolver=new Wp(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!s||this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format||(a.formatter=i(s),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new Qp(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new rd(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];e.emit.apply(e,[t].concat(o))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new Vp(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];e.emit.apply(e,[t].concat(o))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=pd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var u=Tp(),l=function(){var t=function(t,o){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),u.resolve(o),n(t,o)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),u}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pd,o="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return n();var i=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return s(e)})),this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(i,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,n){var o=Tp();return e||(e=this.languages),t||(t=this.options.ns),n||(n=pd),this.services.backendConnector.reload(e,t,(function(e){o.resolve(),n(e)})),o}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Gp.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var o=Tp();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},s=function(s){e||s||!n.services.languageDetector||(s=[]);var r="string"==typeof s?s:n.services.languageUtils.getBestMatchFromCodes(s);r&&(n.language||i(r),n.translator.language||n.translator.changeLanguage(r),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(r)),n.loadResources(r,(function(e){var s,a;s=e,(a=r)?(i(a),n.translator.changeLanguage(a),n.isLanguageChangingTo=void 0,n.emit("languageChanged",a),n.logger.log("languageChanged",a)):n.isLanguageChangingTo=void 0,o.resolve((function(){return n.t.apply(n,arguments)})),t&&t(s,(function(){return n.t.apply(n,arguments)}))}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),o}},{key:"getFixedT",value:function(e,t,n){var o=this,i=function e(t,i){var s;if("object"!==rp(i)){for(var r=arguments.length,a=new Array(r>2?r-2:0),c=2;c<r;c++)a[c-2]=arguments[c];s=o.options.overloadTranslationOptionHandler([t,i].concat(a))}else s=ld({},i);s.lng=s.lng||e.lng,s.lngs=s.lngs||e.lngs,s.ns=s.ns||e.ns,s.keyPrefix=s.keyPrefix||n||e.keyPrefix;var u,l=o.options.keySeparator||".";return u=s.keyPrefix&&Array.isArray(t)?t.map((function(e){return"".concat(s.keyPrefix).concat(l).concat(e)})):s.keyPrefix?"".concat(s.keyPrefix).concat(l).concat(t):t,o.t(u,s)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var o=n.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,s=this.languages[this.languages.length-1];if("cimode"===o.toLowerCase())return!0;var r=function(e,n){var o=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===o||2===o};if(n.precheck){var a=n.precheck(this,r);if(void 0!==a)return a}return!(!this.hasResourceBundle(o,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!r(o,e)||i&&!r(s,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,o=Tp();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){o.resolve(),t&&t(e)})),o):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Tp();"string"==typeof e&&(e=[e]);var o=this.options.preload||[],i=e.filter((function(e){return o.indexOf(e)<0}));return i.length?(this.options.preload=o.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new Hp(ad());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pd,i=ld(ld(ld({},this.options),n),{isClone:!0}),s=new t(i);return void 0===n.debug&&void 0===n.prefix||(s.logger=s.logger.clone(n)),["store","services","language"].forEach((function(t){s[t]=e[t]})),s.services=ld({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new Vp(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];s.emit.apply(s,[e].concat(n))})),s.init(i,o),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}();mp(dd,"createInstance",(function(){return new dd(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var hd=dd.createInstance();hd.createInstance=dd.createInstance,hd.createInstance,hd.dir,hd.init,hd.loadResources,hd.reloadResources,hd.use,hd.changeLanguage,hd.getFixedT,hd.t,hd.exists,hd.setDefaultNamespace,hd.hasLoadedNamespace,hd.loadNamespaces,hd.loadLanguages;class gd extends zl{constructor(){super(),this.languages=null,this.keyMap={}}static getInstance(){return gd.instance||(gd.instance=new gd),gd.instance}provideLanguages(e){var t;Al||(this.languages=e,(null===(t=e["zh-CN"])||void 0===t?void 0:t.Chat)&&this.setKeyMap(e["zh-CN"]),console.log("TUITranslateService.provideLanguages ok."))}useI18n(e){var t;if(Al)return;if(!this.languages)return void console.warn("TUITranslateService.useI18next not have messages.");const n={};for(const[i,s]of Object.entries(this.languages))n["zh_cn"===i?"zh":i]={translation:s};hd.init({compatibilityJSON:"v3",lng:e||"zh",fallbackLng:"zh",detection:{order:["querystring","navigator"],caches:["localStorage","cookie"]},resources:n});let o=this.normalizeLanguageKey(e||"zh");null===(t=this.getEngine().TUIReport)||void 0===t||t.reportFeature(201,o)}changeLanguage(e){let t=this.normalizeLanguageKey(e);return this.getEngine().TUIReport.reportFeature(201,t),hd.changeLanguage(e)}normalizeLanguageKey(e){return e.includes("en")?"en-us":e.includes("tw")?"zh-tw":e.includes("zh")||e.includes("cn")?"zh-cn":e.includes("ko")||e.includes("kr")?"ko-kr":e.includes("ja")||e.includes("jp")?"ja-jp":"other-"+e}t(e){if(!this.languages){let t=e;return!Ml(e)&&e.indexOf(".")>-1&&(t=e.split(".").pop()||""),t}const t=this.keyMap[e];return t?hd.t(t):hd.t(e)}setKeyMap(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=t?`${t}.${n}`:n;if(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])&&null!==e[n])this.setKeyMap(e[n],o);else{let o=t?`${t}.${e[n]}`:e[n];o=this.replaceKey(o),this.keyMap[o]=`${t}.${n}`}}}replaceKey(e){return e.startsWith("Chat")?e.replace("Chat","TUIChat"):e.startsWith("Conversation")?e.replace("Conversation","TUIConversation"):e.startsWith("Message")?e.replace("Message","message.tip"):e.startsWith("Call")?e.replace("Call","message.custom"):e}}class fd extends zl{constructor(){super(),this.serv="TUIConversationService"}static getInstance(){return fd.instance||(fd.instance=new fd),fd.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.CONVERSATION_LIST_UPDATED,this.onConversationListUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED,this.onTotalUnreadCountUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_RECEIVED,this.onMessageReceived.bind(this)),this.getConversationInitData()}onConversationListUpdated(e){const t=this.filterSystemConversation(e);this.getEngine().TUIStore.update(exports.o.CONV,"conversationList",t),this.updateCurrentConversation()}onTotalUnreadCountUpdated(e){this.getEngine().TUIStore.update(exports.o.CONV,"totalUnreadCount",e)}onMessageReceived(e){const t=this.getEngine(),n=this.getEngine().TUIStore.getData(exports.o.CONV,"conversationList");let o=!1;for(let i=0;i<e.length;i++){if(e[i].type!==t.TYPES.MSG_GRP_SYS_NOTICE)continue;const{operationType:s}=e[i].payload,r=`GROUP${e[i].to}`,a=4===s||5===s||8===s,c=2===s||6===s||7===s;if(a||c)for(let e=0;e<n.length;e++)if(n[e].type!==t.TYPES.CONV_C2C&&n[e].conversationID===r){if(a){this.getEngine().TUIStore.update(exports.o.CONV,"operationTypeMap",{conversationID:r,operationType:s}),o=!0;break}if(c&&n[e].operationType>0){this.getEngine().TUIStore.update(exports.o.CONV,"operationTypeMap",{conversationID:r,operationType:0}),o=!0;break}}}if(o){this.getEngine().TUIStore.update(exports.o.CONV,"conversationList",n);const e=this.getEngine().TUIStore.getData(exports.o.CONV,"currentConversationID")||"",t=this.findConversation(e);t&&this.getEngine().TUIStore.update(exports.o.CONV,"currentConversation",t)}}getConversationInitData(){const e=this.getEngine();e.chat.isReady()&&e.chat.getConversationList().then((t=>{const{conversationList:n,isSyncCompleted:o}=t.data;if(console.log(`${this.serv}.init, getConversationList count:${n.length} isSyncCompleted:${o}`),n.length>0){this.onConversationListUpdated(n);const t=e.chat.getTotalUnreadMessageCount();this.onTotalUnreadCountUpdated(t)}}))}switchConversation(e){return ul(this,void 0,void 0,(function*(){const t=`${this.serv}.switchConversation`,n=this.getEngine();if(!e)return n.TUIStore.reset(exports.o.CHAT,["messageList","isCompleted","nextReqMessageID"]),n.TUIStore.update(exports.o.CONV,"currentConversationID",""),n.TUIStore.update(exports.o.CONV,"currentConversation",null),console.log(`${t} conversationID is empty, conversationID:${e}`),Promise.resolve({});if(!e.startsWith(n.TYPES.CONV_C2C)&&!e.startsWith(n.TYPES.CONV_GROUP))return console.warn(`${t} conversationID is invalid, conversationID:${e}`),Promise.reject({code:ml.INVALID_CONV_ID,message:vl.INVALID_CONV_ID});const o=n.TUIStore.getData(exports.o.CONV,"currentConversationID");if(o&&o===e)return this.setMessageRead(o),console.warn(`${t} please check conversationID, conversationID:${e}`),Promise.resolve({code:ml.CONV_ID_SAME,message:vl.CONV_ID_SAME});const i=yield this.getConversationModel(e);return Ml(i)?(console.warn(`${t} target conversation is not exist, conversationID:${e}`),Promise.reject({code:ml.CONV_NOT_EXIST,message:vl.CONV_NOT_EXIST})):(o&&this.setMessageRead(o),e&&this.setMessageRead(e),n.TUIStore.reset(exports.o.CHAT,["messageList","isCompleted","nextReqMessageID"]),n.TUIStore.update(exports.o.CONV,"currentConversationID",e),n.TUIStore.update(exports.o.CONV,"currentConversation",i),Promise.resolve(i))}))}getConversationModel(e){return ul(this,void 0,void 0,(function*(){let t=this.findConversation(e);if(Ml(t))try{const n=yield this.getConversationProfile(e);n.data&&n.data.conversation&&(t=new Jl(n.data.conversation))}catch(n){t=void 0}return t}))}findConversation(e){let t;const n=this.getEngine().TUIStore.getData(exports.o.CONV,"conversationList");for(let o=0;o<n.length;o++)if(n[o].conversationID===e){t=n[o];break}return t}updateCurrentConversation(){const e=this.getEngine(),t=e.TUIStore.getData(exports.o.CONV,"currentConversationID"),n=this.findConversation(t);n&&e.TUIStore.update(exports.o.CONV,"currentConversation",n)}getConversationList(){return this.getEngine().chat.getConversationList()}getConversationProfile(e){return this.getEngine().chat.getConversationProfile(e)}deleteConversation(e){return this.getEngine().chat.deleteConversation(e).then((t=>{const n=this.getEngine().TUIStore.getData(exports.o.CONV,"currentConversationID");return console.log(`${this.serv}.deleteConversation conversationID:${e} currentConversationID:${n}`),e===n&&(this.getEngine().TUIStore.update(exports.o.CONV,"currentConversationID",""),this.getEngine().TUIStore.update(exports.o.CONV,"currentConversation",null)),t}))}pinConversation(e){return this.getEngine().chat.pinConversation(e)}muteConversation(e){return this.getEngine().chat.setMessageRemindType(e)}clearHistoryMessage(e){return this.getEngine().chat.clearHistoryMessage(e).then((e=>(this.getEngine().TUIStore.update(exports.o.CHAT,"messageList",[]),this.getEngine().TUIStore.update(exports.o.CHAT,"nextReqMessageID",""),this.getEngine().TUIStore.update(exports.o.CHAT,"isCompleted",!0),e)))}setMessageRead(e){return this.getEngine().chat.setMessageRead({conversationID:e})}setConversationDraft(e){const{conversationID:t,draftInfo:n}=e;let o="";return n&&(o=JSON.stringify(n)),this.getEngine().chat.setConversationDraft({conversationID:t,draftText:o}).then((e=>{const{conversation:t}=e.data;this.updateConversation(t)}))}updateConversation(e){let t=!1;const n=this.getEngine().TUIStore.getData(exports.o.CONV,"conversationList");for(let o=0;o<n.length;o++)if(n[o].conversationID===e.conversationID){n[o]=e,t=!0;break}t&&this.getEngine().TUIStore.update(exports.o.CONV,"conversationList",n)}filterSystemConversation(e){return e.filter((e=>e.type!==this.getEngine().TYPES.CONV_SYSTEM))}}class md{constructor(e){this.TUIUserService=e}getEngine(){return this.TUIUserService.getEngine()}init(){this.getEngine().eventCenter.addEvent(this.getEngine().EVENT.PROFILE_UPDATED,this.onProfileUpdated.bind(this)),this.getEngine().eventCenter.addEvent(this.getEngine().EVENT.BLACKLIST_UPDATED,this.onBlacklistUpdated.bind(this)),this.getUserProfileInitData()}onProfileUpdated(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.USER,"userProfile");e.forEach((e=>{e.userID===n.userID&&t.TUIStore.update(exports.o.USER,"userProfile",e)}))}onBlacklistUpdated(e){const t=this.getEngine();this.getBlacklistProfile(e).then((e=>{t.TUIStore.update(exports.o.USER,"userBlacklist",e)}))}getUserProfileInitData(){const e=this.getEngine();e.chat.isReady()&&e.chat.getBlacklist().then((e=>{const t=e.data||[];console.log(`TUIUserProfileHandler.init, getBlacklist count:${t.length}`),t.length>0&&this.onBlacklistUpdated(t)}))}getBlacklistProfile(e){const t=[];let n=0;for(;n<e.length;)t.push(e.slice(n,n+=100));const o=[];t.forEach((e=>{o.push(this.TUIUserService.getUserProfile({userIDList:e}))}));const i=[];return Promise.all(o).then((e=>(e.forEach((e=>{const t=e.data.map((e=>{const{userID:t,nick:n,avatar:o}=e;return{userID:t,nick:n,avatar:o}}));i.push(...t)})),i)))}getUserProfile(e){const t=this.getEngine();return Ml(e)?t.chat.getMyProfile().then((e=>(t.TUIStore.update(exports.o.USER,"userProfile",e.data),e))).catch((e=>Promise.reject(e))):t.chat.getUserProfile(e)}updateMyProfile(e){return this.getEngine().chat.updateMyProfile(e)}addToBlacklist(e){return this.getEngine().chat.addToBlacklist(e)}removeFromBlacklist(e){return this.getEngine().chat.removeFromBlacklist(e)}}function _d(e,t,n=!0){var o,i;o=n?yd(e):e,i=t,Pl?xl.setStorageSync(o,i):Id()&&localStorage.setItem(o,JSON.stringify(i))}function vd(e,t=!0){try{return function(e){if(Pl)return xl.getStorageSync(e);if(Id()){const t=localStorage.getItem(e);if("undefined"!==t)return JSON.parse(t)}}(t?yd(e):e)}catch(n){return void console.warn("Storage.getStorageItem error:",n)}}function yd(e){return`chat_engine_${e}`}function Id(){return navigator&&navigator.cookieEnabled&&localStorage}class Md{constructor(e){this.TUIUserService=e}getEngine(){return this.TUIUserService.getEngine()}init(){const e=this.getEngine(),t=vd("displayOnlineStatus")||!1;e.TUIStore.update(exports.o.USER,"displayOnlineStatus",t),e.eventCenter.addEvent(e.EVENT.USER_STATUS_UPDATED,this.onUserStatusUpdated.bind(this)),this.onConversationListUpdated()}onConversationListUpdated(){const e=this.getEngine();e.TUIStore.watch(exports.o.CONV,{conversationList:()=>{const t=e.TUIStore.getData(exports.o.APP,"enabledOnlineStatus"),n=e.TUIStore.getData(exports.o.USER,"displayOnlineStatus");t&&n&&this.startToSubscribe()}})}onUserStatusUpdated(e){this.getEngine().TUIStore.update(exports.o.USER,"userStatusList",e)}switchUserStatus(e){const t=this.getEngine(),{displayOnlineStatus:n=!1}=e;t.TUIStore.update(exports.o.USER,"displayOnlineStatus",n),_d("displayOnlineStatus",n);const o=t.TUIStore.getData(exports.o.APP,"enabledOnlineStatus");o?!0===n?this.startToSubscribe():this.unsubscribeUserStatus():console.warn(`UserStatusHandler.switchUserStatus enabledOnlineStatus:${o} displayOnlineStatus:${n}`)}getUserStatus(e){const t=this.getEngine();return t.chat.getUserStatus(e).then((e=>{const{successUserList:n}=e.data;return n.length>0&&t.TUIStore.update(exports.o.USER,"userStatusList",n),e})).catch((e=>Promise.reject(e)))}subscribeUserStatus(e){var t;const n=(null===(t=null==e?void 0:e.userIDList)||void 0===t?void 0:t.length)||0;return 0===n?(console.warn(`UserStatusHandler.subscribeUserStatus userID count:${n}`),Promise.resolve()):this.getEngine().chat.subscribeUserStatus(e)}unsubscribeUserStatus(e){const t=this.getEngine(),{userIDList:n=[]}=e||{};return t.chat.unsubscribeUserStatus({userIDList:n}).then((e=>{const{failureUserList:o}=e.data,i=[];return n.forEach((e=>{o.includes(e)||i.push({userID:e,statusType:dl.UNSUB_USER})})),t.TUIStore.update(exports.o.USER,"userStatusList",i),e})).catch((e=>Promise.reject(e)))}startToSubscribe(){const e=this.getEngine(),t=e.TUIStore.getData(exports.o.CONV,"conversationList"),n=e.TUIStore.getData(exports.o.USER,"userStatusList"),o=[];t.forEach((t=>{if(t.type===e.TYPES.CONV_C2C){const i=t.conversationID.replace(e.TYPES.CONV_C2C,"");n.has(i)||o.push(i)}})),0!==o.length&&e.chat.isReady()&&(this.subscribeUserStatus({userIDList:o}),this.getUserStatus({userIDList:o}))}}class Cd extends zl{constructor(){super(),this.userProfileHandler=new md(this),this.userStatusHandler=new Md(this)}static getInstance(){return Cd.instance||(Cd.instance=new Cd),Cd.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.KICKED_OUT,this.onKickedOut.bind(this)),e.eventCenter.addEvent(e.EVENT.NET_STATE_CHANGE,this.onNetStateChange.bind(this)),this.userProfileHandler.init(),this.userStatusHandler.init(),this.initMessageReadReceipt()}onKickedOut(e){this.getEngine().TUIStore.update(exports.o.USER,"kickedOut",e.type)}onNetStateChange(e){this.getEngine().TUIStore.update(exports.o.USER,"netStateChange",e.state)}initMessageReadReceipt(){const e=vd("displayMessageReadReceipt")||!0;this.getEngine().TUIStore.update(exports.o.USER,"displayMessageReadReceipt",e)}switchUserStatus(e){return this.userStatusHandler.switchUserStatus(e)}switchMessageReadStatus(e){this.getEngine().TUIStore.update(exports.o.USER,"displayMessageReadReceipt",e),_d("displayMessageReadReceipt",e)}getUserProfile(e){return this.userProfileHandler.getUserProfile(e)}updateMyProfile(e){return this.userProfileHandler.updateMyProfile(e)}addToBlacklist(e){return this.userProfileHandler.addToBlacklist(e)}removeFromBlacklist(e){return this.userProfileHandler.removeFromBlacklist(e)}getUserStatus(e){return this.userStatusHandler.getUserStatus(e)}subscribeUserStatus(e){return this.userStatusHandler.subscribeUserStatus(e)}unsubscribeUserStatus(e){return this.userStatusHandler.unsubscribeUserStatus(e)}}class Td{constructor(e){this.TUIChatService=e,this.userShowNameMap=new Map,this.requestedUserMap=new Map}getEngine(){return this.TUIChatService.getEngine()}t(e){return this.getEngine().TUITranslate.t(e)}handleTextMessage(e){return{text:this.decodeText(e.payload)}}handleFaceMessage(e){const t={name:"",url:"",type:""};return e.payload.data.indexOf("@custom")>-1?(t.name=e.payload.data,t.type="custom",t):(t.name=e.payload.data.indexOf("@2x")<0?`${e.payload.data}@2x`:e.payload.data,t.url=`https://web.sdk.qcloud.com/im/assets/face-elem/${t.name}.png`,t)}handleLocationMessage(e){const t={lon:"",lat:"",href:"",url:"",description:""};return t.lon=e.payload.longitude.toFixed(6),t.lat=e.payload.latitude.toFixed(6),t.href=`https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=${t.lon}&pointy=${t.lat}&name=${e.payload.description}`,t.url=`https://apis.map.qq.com/ws/staticmap/v2/?center=${t.lat},${t.lon}&zoom=10&size=300*150&maptype=roadmap&markers=size:large|color:0xFFCCFF|label:k|${t.lat},${t.lon}&key=UBNBZ-PTP3P-TE7DB-LHRTI-Y4YLE-VWBBD`,t.description=e.payload.description,t}handleImageMessage(e){return{url:e.payload.imageInfoArray[0].url,width:e.payload.imageInfoArray[0].width,height:e.payload.imageInfoArray[0].height}}handleAudioMessage(e){return{url:e.payload.url,second:e.payload.second}}handleVideoMessage(e){return{url:e.payload.videoUrl,snapshotUrl:e.payload.snapshotUrl,snapshotWidth:e.payload.snapshotWidth,snapshotHeight:e.payload.snapshotHeight}}handleFileMessage(e){return{url:e.payload.fileUrl,name:e.payload.fileName,size:El(e.payload.fileSize)}}handleCustomMessage(e){var t;const n=this.handleCreateGroupCustomMessage(e);return{custom:this.handleCallKitSignaling(e)||n||(null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.extension)||`${this.t("TUIChat.[自定义消息]")}`,businessID:n?"group_create":""}}handleMergeMessage(e){return Object.assign({},e.payload)}handleGroupTipsMessage(e){var t,n,o,i,s,r;const a=this.getEngine(),c={text:""};let u=(null==e?void 0:e.nick)||(null===(n=null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.userIDList)||void 0===n?void 0:n.join(","));switch((null===(i=null===(o=null==e?void 0:e.payload)||void 0===o?void 0:o.memberList)||void 0===i?void 0:i.length)>0&&(u="",null===(r=null===(s=null==e?void 0:e.payload)||void 0===s?void 0:s.memberList)||void 0===r||r.map((e=>{const t=(null==e?void 0:e.nick)||(null==e?void 0:e.userID);return u+=`${this.substringByLength(t)},`,e})),u=null==u?void 0:u.slice(0,-1)),e.payload.operationType){case a.TYPES.GRP_TIP_MBR_JOIN:c.text=`${u} ${this.t("message.tip.加入群组")}`;break;case a.TYPES.GRP_TIP_MBR_QUIT:c.text=`${this.t("message.tip.群成员")}${u} ${this.t("message.tip.退出群组")}`;break;case a.TYPES.GRP_TIP_MBR_KICKED_OUT:c.text=`${this.t("message.tip.群成员")}${u} ${this.t("message.tip.被")}${this.t("message.tip.踢出群组")}`;break;case a.TYPES.GRP_TIP_MBR_SET_ADMIN:c.text=`${this.t("message.tip.群成员")}${u} ${this.t("message.tip.成为管理员")}`;break;case a.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:c.text=`${this.t("message.tip.群成员")}${u} ${this.t("message.tip.被撤销管理员")}`;break;case a.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:c.text=this.handleGroupProfileUpdated(e);break;case a.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:for(const t of e.payload.memberList)t.muteTime>0?c.text=`${this.t("message.tip.群成员")}${u} ${this.t("message.tip.被禁言")}`:c.text=`${this.t("message.tip.群成员")}${u} ${this.t("message.tip.被取消禁言")}`;break;default:c.text=`[${this.t("message.tip.群提示消息")}]`}return c}handleGroupSystemMessage(e){const t=e.payload.groupProfile.name||e.payload.groupProfile.groupID,n={text:""};switch(e.payload.operationType){case 1:n.text=`${e.payload.operatorID} ${this.t("message.tip.申请加入群组")}${t}`;break;case 2:n.text=`${this.t("message.tip.成功加入群组")}${t}`;break;case 3:n.text=`${this.t("message.tip.申请加入群组")}${t} ${this.t("message.tip.被拒绝")}`;break;case 4:n.text=`${this.t("message.tip.你被管理员")}${e.payload.operatorID} ${this.t("message.tip.踢出群组")}${t}`;break;case 5:n.text=`${this.t("message.tip.群")}${t} ${this.t("message.tip.被")} ${e.payload.operatorID} ${this.t("message.tip.解散")}`;break;case 6:n.text=`${e.payload.operatorID} ${this.t("message.tip.创建群")}${t}`;break;case 7:case 12:n.text=`${e.payload.operatorID} ${this.t("message.tip.邀请你加群")}${t}`;break;case 8:n.text=`${this.t("message.tip.你退出群组")}${t}`;break;case 9:n.text=`${this.t("message.tip.你被")}${e.payload.operatorID} ${this.t("message.tip.设置为群")}${t} ${this.t("message.tip.的管理员")}`;break;case 10:n.text=`${this.t("message.tip.你被")}${e.payload.operatorID} ${this.t("message.tip.撤销群")}${t} ${this.t("message.tip.的管理员身份")}`;break;case 13:n.text=`${e.payload.operatorID} ${this.t("message.tip.同意加群")}${t}`;break;case 14:n.text=`${e.payload.operatorID} ${this.t("message.tip.拒接加群")}${t}`;break;case 255:n.text=`${this.t("message.tip.自定义群系统通知")}: ${e.payload.userDefinedField}`;break;default:n.text="未解析的群系统通知"}return n}handleCallKitSignaling(e){var t,n,o,i,s,r,a,c,u,l;const p=Sl(e.payload.data);if(1!==(null==p?void 0:p.businessID))return"";const d=Sl(null==p?void 0:p.data),h=e.fromAccount||e.from,g=this.getEngine().TUIFriend.getFriendRemark([h]),f=this.getEngine().getMyUserID();let m=g[h]||e.nameCard||e.nick||h;switch(m=this.substringByLength(m),null==p?void 0:p.actionType){case 1:return"audioCall"!==(null===(t=null==d?void 0:d.data)||void 0===t?void 0:t.cmd)&&"videoCall"!==(null===(n=null==d?void 0:d.data)||void 0===n?void 0:n.cmd)||!(null==p?void 0:p.groupID)?"hangup"===(null===(o=null==d?void 0:d.data)||void 0===o?void 0:o.cmd)?(null==p?void 0:p.groupID)?`${this.t("message.custom.通话结束")}`:`${this.t("message.custom.通话时长")}${function(e){const t=e;let n,o,i,s="";return t>=3600?(n=parseInt(""+t/3600,10)<10?`0${parseInt(""+t/3600,10)}`:parseInt(""+t/3600,10),o=parseInt(""+t%60/60,10)<10?`0${parseInt(""+t%60/60,10)}`:parseInt(""+t%60/60,10),i=t%3600<10?"0"+t%3600:t%3600,i>60&&(o=parseInt(""+i/60,10)<10?`0${parseInt(""+i/60,10)}`:parseInt(""+i/60,10),i=i%60<10?"0"+i%60:i%60),s=`${n}:${o}:${i}`):t>=60&&t<3600?(o=parseInt(""+t/60,10)<10?`0${parseInt(""+t/60,10)}`:parseInt(""+t/60,10),i=t%60<10?"0"+t%60:t%60,s=`00:${o}:${i}`):t<60&&(i=t<10?`0${t}`:t,s=`00:00:${i}`),s}(null==d?void 0:d.call_end)}`:"switchToAudio"===(null===(i=null==d?void 0:d.data)||void 0===i?void 0:i.cmd)?`${this.t("message.custom.切换语音通话")}`:"switchToVideo"===(null===(s=null==d?void 0:d.data)||void 0===s?void 0:s.cmd)?`${this.t("message.custom.切换视频通话")}`:`${this.t("message.custom.发起通话")}`:`${m} ${this.t("message.custom.发起通话")}`;case 2:return(null==p?void 0:p.groupID)?`${m} ${this.t("message.custom.取消通话")}`:this.isOldUIKit("message.custom.已取消")?this.t("message.custom.取消通话"):(null==p?void 0:p.inviter)===f?this.t("message.custom.已取消"):this.t("message.custom.对方已取消");case 3:return"switchToAudio"===(null===(r=null==d?void 0:d.data)||void 0===r?void 0:r.cmd)?`${this.t("message.custom.切换语音通话")}`:"switchToVideo"===(null===(a=null==d?void 0:d.data)||void 0===a?void 0:a.cmd)?`${this.t("message.custom.切换视频通话")}`:(null==p?void 0:p.groupID)?`${m} ${this.t("message.custom.已接听")}`:this.t("message.custom.已接听");case 4:return(null==p?void 0:p.groupID)?`${m} ${this.t("message.custom.拒绝通话")}`:this.isOldUIKit("message.custom.已拒绝")?this.t("message.custom.拒绝通话"):"line_busy"===(null==d?void 0:d.line_busy)||"lineBusy"===(null==d?void 0:d.data.message)?(null==p?void 0:p.inviter)===f?this.t("message.custom.对方忙线中"):this.t("message.custom.忙线未接听"):(null==p?void 0:p.inviter)===f?this.t("message.custom.对方已拒绝"):this.t("message.custom.已拒绝");case 5:if("switchToAudio"===(null===(c=null==d?void 0:d.data)||void 0===c?void 0:c.cmd))return`${this.t("message.custom.切换语音通话")}`;if("switchToVideo"===(null===(u=null==d?void 0:d.data)||void 0===u?void 0:u.cmd))return`${this.t("message.custom.切换视频通话")}`;if(null==p?void 0:p.groupID){if(h===(null==p?void 0:p.inviter)){this.handleCallkitTimeoutSignaling(p.inviteeList);let e="";return null===(l=p.inviteeList)||void 0===l||l.forEach((t=>{const n=this.userShowNameMap.get(t)||t;e+=`${this.substringByLength(n)}、`})),e=e.substring(0,e.lastIndexOf("、")),`${e} ${this.t("message.custom.无应答")}`}return`${m} ${this.t("message.custom.无应答")}`}return this.isOldUIKit("message.custom.对方无应答")?this.t("message.custom.无应答"):(null==p?void 0:p.inviter)===f?this.t("message.custom.对方无应答"):this.t("message.custom.超时无应答");default:return""}}handleCreateGroupCustomMessage(e){let t;const n=Sl(e.payload.data);return"group_create"===(null==n?void 0:n.businessID)&&(t=`${n.opUser} ${n.content}`),t}decodeText(e){const t=[];let n=e.text,o=-1,i=-1;for(;""!==n;)switch(o=n.indexOf("["),i=n.indexOf("]"),o){case 0:if(-1===i)t.push({name:"text",text:n}),n="";else{const e=n.slice(0,i+1);e.indexOf("@custom")>-1?(t.push({name:"img",src:"",type:"custom",emojiKey:e}),n=n.substring(i+1)):kl[e]?(t.push({name:"img",src:"https://web.sdk.qcloud.com/im/assets/emoji-plugin/"+kl[e],emojiKey:e}),n=n.substring(i+1)):(t.push({name:"text",text:"["}),n=n.slice(1))}break;case-1:t.push({name:"text",text:n}),n="";break;default:t.push({name:"text",text:n.slice(0,o)}),n=n.substring(o)}return t}handleGroupProfileUpdated(e){const{nick:t,payload:n}=e,{newGroupProfile:o,memberList:i,operatorID:s}=n;let r="";const a=t||s,c=Object.keys(o)[0];switch(c){case"muteAllMembers":r=o[c]?`${this.t("message.tip.管理员")} ${a} ${this.t("message.tip.开启全员禁言")}`:`${this.t("message.tip.管理员")} ${a} ${this.t("message.tip.取消全员禁言")}`;break;case"ownerID":r=`${i[0].nick||i[0].userID} ${this.t("message.tip.成为新的群主")}`;break;case"groupName":r=`${a} ${this.t("message.tip.修改群名为")} ${o[c]}`;break;case"notification":r=this.isOldUIKit("message.tip.把群公告修改为")?`${a} ${this.t("message.tip.发布新公告")}`:`${a} ${this.t("message.tip.把群公告修改为")} "${o[c]}"`}return r}handleCallkitTimeoutSignaling(e=[]){if(0===e.length)return;const t=this.getEngine().TUIFriend.getFriendRemark(e),n=[];e.forEach((e=>{const o=t[e];o?this.userShowNameMap.set(e,o):this.requestedUserMap.has(e)||(n.push(e),this.requestedUserMap.set(e,1))})),n.length>0&&this.getEngine().TUIUser.getUserProfile({userIDList:n}).then((e=>{(e.data||[]).forEach((e=>{const{userID:t,nick:n}=e,o=n||t;this.userShowNameMap.set(t,o)}))})).catch((()=>{}))}substringByLength(e,t=12){return e.length>t?`${e.slice(0,t)}...`:e}isOldUIKit(e){var t;const n=e.lastIndexOf("."),o=e.slice(0,n+1);return null===(t=this.t(e))||void 0===t?void 0:t.startsWith(o)}}class Sd{constructor(e){this.TUIChatService=e,this.typingTo="",this.timer=null}getEngine(){return this.TUIChatService.getEngine()}clearTypingStatus(){this.getEngine().TUIStore.getData(exports.o.CHAT,"typingStatus")&&this.getEngine().TUIStore.update(exports.o.CHAT,"typingStatus",!1),this.timer&&clearTimeout(this.timer),this.timer=null}handleLastMessage(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.CHAT,"typingStatus");if(e.type===this.getEngine().TYPES.MSG_CUSTOM&&"in"===e.flow){const o=Sl(e.payload.data);if(o.businessID===hl.BUSINESS_ID){const{typingStatus:e,userAction:i}=o;if(e===hl.STATUS_START||i===hl.ACTION_START_ID)return n?(this.timer&&clearTimeout(this.timer),this.timer=null):t.TUIStore.update(exports.o.CHAT,"typingStatus",!0),this.timer=setTimeout((()=>{this.clearTypingStatus()}),3e4),t.TUIStore.getData(exports.o.CHAT,"typingStatus");e!==hl.STATUS_END&&i!==hl.ACTION_END_ID||this.clearTypingStatus()}}}filterTypingMessage(e=[]){return 0===e.length?[]:(this.getEngine().TUIStore.getData(exports.o.APP,"enableTyping")&&this.handleLastMessage(e[e.length-1]),e.filter((e=>e.type!==this.getEngine().TYPES.MSG_CUSTOM||Sl(e.payload.data).businessID!==hl.BUSINESS_ID)))}createTypingMessage(e=hl.STATUS_END,t=""){const{BUSINESS_ID:n,STATUS_START:o,VERSION:i,ACTION_START_ID:s,ACTION_END_ID:r,ACTION_START:a,ACTION_END:c,NEED_TYPING:u}=hl;return{to:t,conversationType:this.getEngine().TYPES.CONV_C2C,payload:{data:JSON.stringify({businessID:n,typingStatus:e,version:i,userAction:e===o?s:r,actionParam:e===o?a:c}),description:"",extension:""},cloudCustomData:JSON.stringify({messageFeature:{needTyping:u,version:i}})}}sendTyping(e=!1,t=""){if(e){this.typingTo=t;const e=this.createTypingMessage(hl.STATUS_START,t);this.getEngine().TUIChat.sendCustomMessage(e,{onlineUserOnly:!0})}else this.sendTypingEnd()}sendTypingEnd(){if(this.typingTo){const e=this.createTypingMessage(hl.STATUS_END,this.typingTo);this.getEngine().TUIChat.sendCustomMessage(e,{onlineUserOnly:!0})}this.typingTo=""}}class Ed{constructor(e){this.TUIChatService=e}getEngine(){return this.TUIChatService.getEngine()}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.MESSAGE_READ_RECEIPT_RECEIVED,this.onMessageReadReceiptReceived.bind(this))}onMessageReadReceiptReceived(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.CONV,"currentConversationID"),o=[];e.forEach((e=>{const{messageID:i}=e,s=t.chat.findMessage(i);s&&n===s.conversationID&&o.push(s)})),o.length>0&&t.TUIChat.updateMessageList(o,"edit")}sendMessageReadReceipt(e){const t=[];return e.forEach((e=>{const n=e.getMessage();t.push(n)})),this.getEngine().chat.sendMessageReadReceipt(t)}getGroupMessageReadMemberList(e){const t=e.message.getMessage(),n=Object.assign(Object.assign({},e),{message:t});return this.getEngine().chat.getGroupMessageReadMemberList(n)}getMessageReadReceiptList(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.APP,"enabledMessageReadReceipt"),o=t.TUIStore.getData(exports.o.USER,"displayMessageReadReceipt");!n||!o||0===e.length||e[0].conversationType!==t.TYPES.CONV_GROUP||t.chat.getMessageReadReceiptList(e).then((e=>{const{messageList:t}=e.data;this.TUIChatService.updateMessageList(t,"edit")})).catch((e=>{console.warn(`ReadReceiptHandler.getMessageReadReceiptList error:${e.message}`)}))}}class kd extends zl{constructor(){super(),this.serv="TUIChatService",this.messageHandler=new Td(this),this.typingHandler=new Sd(this),this.readReceiptHandler=new Ed(this),this.isSwitching=!0,this.delayGetHoppingFunction=void 0,this.hoppingConfigMap=new Map}static getInstance(){return kd.instance||(kd.instance=new kd),kd.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.MESSAGE_RECEIVED,this.onMessageReceived.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_MODIFIED,this.onMessageModified.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_REVOKED,this.onMessageRevoked.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_READ_BY_PEER,this.onMessageReadByPeer.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_REACTIONS_UPDATED,this.onMessageReactionsUpdated.bind(this)),this.onCurrentConversationIDUpdated(),this.onMessageSource(),this.readReceiptHandler.init()}onMessageReceived(e){this.updateMessageList(e,"received"),this.getEngine().TUIStore.update(exports.o.CHAT,"newMessageList",e)}onMessageModified(e){this.updateMessageList(e,"edit")}onMessageRevoked(e){this.updateMessageList(e,"edit")}onMessageReadByPeer(e){this.updateMessageList(e,"edit")}onMessageReactionsUpdated(e){this.updateMessageReactionList([e])}onCurrentConversationIDUpdated(){const e=this.getEngine();e.TUIStore.watch(exports.o.CONV,{currentConversationID:t=>{this.isSwitching=!0,this.delayGetHoppingFunction=void 0,this.hoppingConfigMap.clear(),e.TUIStore.reset(exports.o.CHAT),this.typingHandler.clearTypingStatus(),this.typingHandler.sendTypingEnd(),Yl(t)||this.getMessageList().finally((()=>{this.isSwitching=!1,this.delayGetHoppingFunction&&this.delayGetHoppingFunction()}))}})}onMessageSource(){const e=this.getEngine();e.TUIStore.watch(exports.o.CHAT,{messageSource:t=>{const n=this.getStoreData(exports.o.CONV,"currentConversationID");if(!n||t&&t.conversationID!==n)return;if(Ml(t))return this.hoppingConfigMap.clear(),e.TUIStore.update(exports.o.CHAT,"messageList",[]),e.TUIStore.update(exports.o.CHAT,"nextReqMessageID",""),e.TUIStore.update(exports.o.CHAT,"isCompleted",!1),void this.getMessageList();const o=this.getStoreData(exports.o.CHAT,"messageList");o&&o.find((e=>t&&e.ID===t.ID))||(this.isSwitching?this.delayGetHoppingFunction=this.getMessageListHoppingForDown:this.getMessageListHoppingForDown())}})}getMessageListHoppingForDown(){const e=this.getStoreData(exports.o.CHAT,"messageList"),{conversationID:t,sequence:n,time:o,ID:i}=this.getStoreData(exports.o.CHAT,"messageSource");if(e&&e.find((e=>i&&e.ID===i)))return;const s=this.getEngine();s.TUIStore.update(exports.o.CHAT,"messageList",[]),s.TUIStore.update(exports.o.CHAT,"nextReqMessageID",""),s.TUIStore.update(exports.o.CHAT,"isCompleted",!1),this.getMessageListHopping({conversationID:t,sequence:n,time:o,direction:1})}getStoreData(e,t){return this.getEngine().TUIStore.getData(e,t)}sendMessage(e,t){this.updateMessageList([e],"send");const n=this.getEngine().chat.sendMessage(e,t);return this.getResponse(n)}getResponse(e,t=!0,n=!0){return e.then((e=>{const n=e.data.messageList?e.data.messageList:[e.data.message];return t&&this.updateMessageList(n,"edit"),e})).catch((e=>{var t;return n&&(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.message)&&this.updateMessageList([e.data.message],"edit"),Promise.reject(e)}))}updateMessageList(e,t=""){if(this.getStoreData(exports.o.CHAT,"messageSource")&&"unshift"!==t&&"edit"!==t)return;const n=this.getStoreData(exports.o.CHAT,"messageList"),o=this.updateTargetMessageList(e,n,t);this.getEngine().TUIStore.update(exports.o.CHAT,"messageList",o)}updateTargetMessageList(e,t,n=""){const o=this.getStoreData(exports.o.CONV,"currentConversationID");let i=e.filter((e=>e.conversationID===o));if(i=this.handleC2CCallSignaling(i),!n||0===i.length)return t;const s=t||[];let r=[];if("send"===n||"push"===n){const e=this.getStoreData(exports.o.CHAT,"userInfo");Object.keys(e).length>0&&this.updateLocalMessage(i,e)}switch(n){case"edit":for(const e of t){const t=i.find((t=>t.ID===e.ID));r.push(t||e)}break;case"resend":r=s.filter((e=>e.ID!==i[0].ID)).concat(i);break;case"send":r=s.concat(this.typingHandler.filterTypingMessage(i));break;case"push":r=s.concat(this.typingHandler.filterTypingMessage(i)),this.getEngine().chat.setMessageRead({conversationID:o});break;case"received":r=s.concat(this.typingHandler.filterTypingMessage(i)),r=this.sortMessageList(r),this.getEngine().chat.setMessageRead({conversationID:o});break;case"unshift":r=i.filter((e=>0===s.length||!s.find((t=>t.ID===e.ID)))),r.push(...s),r=this.sortMessageList(r)}return r}enterTypingState(){this.getStoreData(exports.o.APP,"enableTyping")&&this.sendTyping(!0)}leaveTypingState(){this.getStoreData(exports.o.APP,"enableTyping")&&this.sendTyping(!1)}sendTyping(e){const t=this.getEngine(),n=this.getStoreData(exports.o.CONV,"currentConversationID");if(!n.startsWith(t.TYPES.CONV_C2C))return;const o=n.replace(t.TYPES.CONV_C2C,"");if(e){const e=this.getStoreData(exports.o.CHAT,"messageList").filter((e=>"in"===e.flow));if(0===e.length)return;const t=1e3*e[e.length-1].time;if((new Date).getTime()-t>3e4)return}this.typingHandler.sendTyping(e,o)}quoteMessage(e){var t;return this.getEngine().TUIStore.update(exports.o.CHAT,"quoteMessage",{message:e,type:"quote"}),null===(t=this.getEngine().TUIReport)||void 0===t||t.reportFeature(205),e}replyMessage(e){return this.getEngine().TUIStore.update(exports.o.CHAT,"quoteMessage",{message:e,type:"reply"}),e}getCurrentConvInfo(){const{conversationID:e="",type:t}=this.getStoreData(exports.o.CONV,"currentConversation")||{};return{to:e.replace(t,""),conversationType:t}}t(e){return this.getEngine().TUITranslate.t(e)||e}getMessageAbstractAndType(e){var t,n;const o=this.getEngine(),i={abstract:"",type:0};switch(e.type){case o.TYPES.MSG_TEXT:i.abstract=null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.text,i.type=1;break;case o.TYPES.MSG_CUSTOM:i.abstract="[自定义消息]",i.type=2;break;case o.TYPES.MSG_IMAGE:i.abstract="[图片]",i.type=3;break;case o.TYPES.MSG_AUDIO:i.abstract="[语音]",i.type=4;break;case o.TYPES.MSG_VIDEO:i.abstract="[视频]",i.type=5;break;case o.TYPES.MSG_FILE:i.abstract="[文件]",i.type=6;break;case o.TYPES.MSG_LOCATION:i.type=7;break;case o.TYPES.MSG_FACE:i.abstract="[表情]",i.type=8;break;case o.TYPES.MSG_GRP_TIP:i.type=9;break;case o.TYPES.MSG_MERGER:i.abstract=null===(n=null==e?void 0:e.payload)||void 0===n?void 0:n.title,i.type=10}return i}genMessageReply(e,t){if("reply"!==t&&"quote"!==t)return{};const{abstract:n,type:o}=this.getMessageAbstractAndType(e),i={messageAbstract:n,messageSender:e.nick||e.from,messageID:e.ID},s=Object.assign(Object.assign({},i),{messageType:o,messageTime:null==e?void 0:e.time,messageSequence:null==e?void 0:e.sequence,version:1});if("reply"===t&&(s.messageRootID=e.ID,e.cloudCustomData)){const t=Sl(e.cloudCustomData);t.messageReply&&t.messageReply.messageRootID&&(s.messageRootID=t.messageReply.messageRootID)}return{messageReply:s,messageReplyRoot:i}}getMessageInfo(e,t,n){const{messageReply:o,messageReplyRoot:i}=this.genMessageReply(t,n),s=e.cloudCustomData?Sl(e.cloudCustomData):{};let r;if(s.messageReply?s.messageReply=Object.assign(Object.assign({},o),s.messageReply):s.messageReply=o,"reply"===n){const{messageRootID:e}=o;r=this.getEngine().chat.findMessage(e);const t=(null==r?void 0:r.cloudCustomData)?Sl(r.cloudCustomData):{};t.messageReplies||(t.messageReplies={}),a=t.messageReplies.replies,("function"==typeof Array.isArray?Array.isArray(a):"array"===Object.prototype.toString.call(a).match(/^\[object (.*)\]$/)[1].toLowerCase())||(t.messageReplies.replies=[]),t.messageReplies.replies.push(i),r.cloudCustomData=JSON.stringify(t)}var a;return{cloudCustomData:JSON.stringify(s),rootMessage:r}}sendTextMessage(e,t){const n=this.getEngine(),{message:o,type:i}=this.getStoreData(exports.o.CHAT,"quoteMessage");let s={cloudCustomData:e.cloudCustomData||"",rootMessage:void 0};o&&(s=this.getMessageInfo(e,o,i));const r=n.chat.createTextMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{cloudCustomData:s.cloudCustomData}));return this.sendMessage(r,t).then((e=>(s.rootMessage&&this.modifyMessage(s.rootMessage),n.TUIStore.reset(exports.o.CHAT,["quoteMessage"],!0),e)))}sendTextAtMessage(e,t){const n=this.getEngine(),{message:o,type:i}=this.getStoreData(exports.o.CHAT,"quoteMessage");let s={cloudCustomData:e.cloudCustomData||"",rootMessage:void 0};o&&(s=this.getMessageInfo(e,o,i));const r=n.chat.createTextAtMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{cloudCustomData:s.cloudCustomData}));return this.sendMessage(r,t).then((e=>(s.rootMessage&&this.modifyMessage(s.rootMessage),n.TUIStore.reset(exports.o.CHAT,["quoteMessage"],!0),e)))}sendImageMessage(e,t){const n=this.getEngine().chat.createImageMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{onProgress:e=>{this.onProgress(n.ID,e)}}));return this.sendMessage(n,t)}sendAudioMessage(e,t){const n=this.getEngine().chat.createAudioMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{onProgress:e=>{this.onProgress(n.ID,e)}}));return this.sendMessage(n,t)}sendVideoMessage(e,t){const n=this.getEngine().chat.createVideoMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{onProgress:e=>{this.onProgress(n.ID,e)}}));return this.sendMessage(n,t)}sendCustomMessage(e,t){const n=this.getEngine().chat.createCustomMessage(Object.assign(Object.assign({},this.getCurrentConvInfo()),e));return this.sendMessage(n,t)}sendFaceMessage(e,t){const n=this.getEngine().chat.createFaceMessage(Object.assign(Object.assign({},this.getCurrentConvInfo()),e));return this.sendMessage(n,t)}sendFileMessage(e,t){const n=this.getEngine().chat.createFileMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{onProgress:e=>{this.onProgress(n.ID,e)}}));return this.sendMessage(n,t)}sendLocationMessage(e,t){const n=this.getEngine().chat.createLocationMessage(Object.assign(Object.assign({},this.getCurrentConvInfo()),e));return this.sendMessage(n,t)}onProgress(e,t){const n=this.getEngine().TUIStore.getMessageModel(e);n&&(t-n.progress>=.1||1===t)&&(n.progress=t,this.updateMessageList([n],"edit"))}setAbstractList(e){const t=this.getEngine(),n=e.nick||e.from;let o="";switch(e.type){case t.TYPES.MSG_TEXT:o=e.payload.text||"",o.length>20&&(o=o.slice(0,20));break;case t.TYPES.MSG_MERGER:o=`${this.t("TUIChat.[聊天记录]")}`;break;case t.TYPES.MSG_IMAGE:o=`${this.t("TUIChat.[图片]")}`;break;case t.TYPES.MSG_AUDIO:o=`${this.t("TUIChat.[音频]")}`;break;case t.TYPES.MSG_VIDEO:o=`${this.t("TUIChat.[视频]")}`;break;case t.TYPES.MSG_CUSTOM:o=`${this.t("TUIChat.[自定义消息]")}`;break;case t.TYPES.MSG_FILE:o=`${this.t("TUIChat.[文件]")}`;break;case t.TYPES.MSG_FACE:o=`${this.t("TUIChat.[动画表情]")}`}return`${n}: ${o}`}genMergerForwardPayload(e,t){const{abstractList:n=[],compatibleText:o="",title:i}=t;return 0===n.length&&e.forEach((e=>{n.push(this.setAbstractList(e))})),{messageList:e,title:i,abstractList:n,compatibleText:o||this.t("TUIChat.请升级IMSDK到v2.10.1或更高版本查看此消息")}}genSendMergerForwardMessage(e){const{conversationList:t,messageList:n,params:o,mergeInfo:i,sendMessageOptions:s}=e,r=[];for(let a=0;a<t.length;a++){const{conversationID:e,type:c}=t[a],u=Object.assign({to:e.replace(`${c}`,""),conversationType:c,payload:this.genMergerForwardPayload(n,i)},o),l=this.getEngine().chat.createMergerMessage(u);r.push(this.sendMessage(l,s))}return r}genTitle(e,t){const{nick:n,from:o,to:i}=e;return`${n||o} ${this.t("TUIChat.和")} ${t||i} ${this.t("TUIChat.的聊天记录")}`}genMergeInfo(e){var t;return ul(this,void 0,void 0,(function*(){const{messageList:n,mergeInfo:o}=e;if(o.title)return o;if(n[0].conversationType===this.getEngine().TYPES.CONV_GROUP)return o.title=this.t("TUIChat.群聊的聊天记录"),o;try{const{data:e=[]}=yield this.getEngine().TUIUser.getUserProfile({userIDList:[n[0].to]});o.title=this.genTitle(n[0],null===(t=e[0])||void 0===t?void 0:t.nick)}catch(i){o.title=this.genTitle(n[0])}return o}))}sendMergerForwardMessage(e){return ul(this,void 0,void 0,(function*(){return e.mergeInfo=yield this.genMergeInfo(e),Promise.all(this.genSendMergerForwardMessage(e))}))}getOriginMessageList(e){return e.map((e=>e instanceof Zl?e.getMessage():e))}sendForwardMessage(e,t,n){t=this.getOriginMessageList(t);const o=n||{},{needMerge:i=!1,params:s={},mergeInfo:r={}}=o,a=cl(o,["needMerge","params","mergeInfo"]);if(i)return this.sendMergerForwardMessage({conversationList:e,messageList:t,params:s,mergeInfo:r,sendMessageOptions:a});const c=[];for(let u=0;u<e.length;u++){const{conversationID:n,type:o}=e[u],i=Object.assign({to:n.replace(`${o}`,""),conversationType:o},s),r=a[n]||a;for(let e=0;e<t.length;e++){Reflect.set(i,"payload",t[e]);const n=this.getEngine().chat.createForwardMessage(i);c.push(this.sendMessage(n,r))}}return Promise.all(c)}revokeMessage(e){const t=this.getEngine().chat.revokeMessage(e);return this.getResponse(t,!0,!1)}resendMessage(e){e.status="unSend",this.updateMessageList([e],"resend");const t=this.getEngine().chat.resendMessage(e);return this.getResponse(t,!0,!0)}deleteMessage(e){const t=this.getEngine().chat.deleteMessage(e);return this.getResponse(t,!0,!1)}setMessageExtensions(e,t){return this.getEngine().chat.setMessageExtensions(e,t)}getMessageExtensions(e){return this.getEngine().chat.getMessageExtensions(e)}deleteMessageExtensions(e,t){return this.getEngine().chat.deleteMessageExtensions(e,t)}modifyMessage(e){const t=this.getEngine().chat.modifyMessage(e);return this.getResponse(t,!0,!1).catch((e=>{const{code:t=0,data:n={}}=e.code;throw t===fl.MSG_MODIFY_CONFLICT?console.warn(`${_l.MSG_MODIFY_CONFLICT} data.message: ${null==n?void 0:n.message}`):t===fl.MSG_MODIFY_DISABLED_IN_AVCHATROOM?console.warn(_l.MSG_MODIFY_DISABLED_IN_AVCHATROOM):t===fl.MODIFY_MESSAGE_NOT_EXIST&&console.warn(_l.MODIFY_MESSAGE_NOT_EXIST),e}))}getMessageList(e={conversationID:this.getStoreData(exports.o.CONV,"currentConversationID"),nextReqMessageID:this.getStoreData(exports.o.CHAT,"nextReqMessageID")}){const t=this.getEngine();if(!t.chat.isReady())return Promise.reject({code:ml.GET_MSG_LIST_ERROR,message:vl.GET_MSG_LIST_ERROR});if(this.getStoreData(exports.o.CHAT,"isCompleted"))return Promise.resolve({data:{messageList:[],nextReqMessageID:"",isCompleted:!0}});const n=this.getStoreData(exports.o.CHAT,"messageSource"),o=this.hoppingConfigMap.get("nextMessageSeq"),i=this.hoppingConfigMap.get("nextMessageTime"),s=o||i;return n&&n.conversationID===(null==e?void 0:e.conversationID)&&s?this.getMessageListHopping():t.chat.getMessageList(e).then((e=>{var n;const{messageList:o,nextReqMessageID:i,isCompleted:s}=e.data,r=this.getStoreData(exports.o.CHAT,"userInfo");Object.keys(r).length>0&&this.updateLocalMessage(o,r),this.updateMessageList(o,"unshift"),t.TUIStore.update(exports.o.CHAT,"nextReqMessageID",i),t.TUIStore.update(exports.o.CHAT,"isCompleted",s);const a=null===(n=o[0])||void 0===n?void 0:n.conversationID,{operationType:c=0}=this.getEngine().TUIStore.getConversationModel(a)||{};return 0===c&&(this.getMessageReactions({messageList:o}),this.readReceiptHandler.getMessageReadReceiptList(o)),e})).catch((e=>Promise.reject(e)))}getMessageListHopping(e){var t;void 0===e&&(e={conversationID:null===(t=this.getStoreData(exports.o.CHAT,"messageSource"))||void 0===t?void 0:t.conversationID,sequence:this.hoppingConfigMap.get("nextMessageSeq"),time:this.hoppingConfigMap.get("nextMessageTime")});const n=this.getEngine();return n.chat.getMessageListHopping(e).then((t=>{const{messageList:o,nextMessageSeq:i,nextMessageTime:s,isCompleted:r}=t.data,a=1===e.direction?e.sequence:i,c=1===e.direction?e.time:s;return this.updateMessageList(o,"unshift"),this.delayGetHoppingFunction=void 0,this.hoppingConfigMap.set("nextMessageSeq",a),this.hoppingConfigMap.set("nextMessageTime",c),n.TUIStore.update(exports.o.CHAT,"isCompleted",r),t})).catch((e=>Promise.reject(e)))}sendMessageReadReceipt(e){return this.readReceiptHandler.sendMessageReadReceipt(e)}getGroupMessageReadMemberList(e){return this.readReceiptHandler.getGroupMessageReadMemberList(e).then((e=>{const{isCompleted:t,cursor:n,messageID:o,unreadUserIDList:i,readUserIDList:s}=e.data,r={code:0,data:{cursor:n,isCompleted:t,messageID:o,unreadUserInfoList:[],readUserInfoList:[]}},a=[...i,...s];return 0===a.length?r:this.getEngine().TUIUser.getUserProfile({userIDList:a}).then((e=>(i.length>0?e.data.forEach((e=>{const{userID:t,nick:n="",avatar:o=""}=e;r.data.unreadUserInfoList.push({userID:t,nick:n,avatar:o})})):e.data.forEach((e=>{const{userID:t,nick:n="",avatar:o=""}=e;r.data.readUserInfoList.push({userID:t,nick:n,avatar:o})})),r)))}))}downloadMergedMessages(e){return this.getEngine().chat.downloadMergerMessage(e)}setTranslationLanguage(e){this.getEngine().TUIStore.update(exports.o.USER,"targetLanguage",e)}translateText(e){const t=this.getStoreData(exports.o.USER,"targetLanguage"),n=Object.assign({targetLanguage:t,sourceLanguage:"auto"},e);return this.getEngine().chat.translateText(n)}searchCloudMessages(e){const t=this.getStoreData(exports.o.CONV,"conversationList");return this.getEngine().chat.searchCloudMessages(e).then((e=>{const{searchResultList:n}=e.data;return e.data.searchResultList=n.map((e=>{const{messageList:n,conversationID:o}=e,i=cl(e,["messageList","conversationID"]),s=n.map((e=>new Zl(e))),r=t.find((e=>e.conversationID===o));return Object.assign(Object.assign({},i),{messageList:s.sort(((e,t)=>t.time-e.time)),conversation:r})})),e}))}addMessageReaction(e,t){return this.getEngine().chat.addMessageReaction(e.getMessage(),t)}removeMessageReaction(e,t){return this.getEngine().chat.removeMessageReaction(e.getMessage(),t)}getMessageReactions(e){const{messageList:t=[]}=e,n=this.getStoreData(exports.o.APP,"enabledEmojiPlugin");console.log(`TUIChatService.getMessageReactions enabledEmojiPlugin:${n} messageList length:${t.length}`),n&&t.length>0&&this.getEngine().chat.getMessageReactions(e).then((e=>{const t=e.data.resultList||e.data;this.updateMessageReactionList(t)})).catch((()=>{}))}getAllUserListOfMessageReaction(e){var t;return this.getEngine().chat.getAllUserListOfMessageReaction(Object.assign(Object.assign({},e),{message:null===(t=null==e?void 0:e.message)||void 0===t?void 0:t.getMessage()}))}updateMessageReactionList(e){const t=[];e.forEach((e=>{const{messageID:n,reactionList:o}=e,i=this.getEngine().TUIStore.getMessageModel(n);if(i){const e=[];for(let t=0;t<o.length;t++){let n=!0;for(let e=0;e<i.reactionList.length;e++)if(o[t].reactionID===i.reactionList[e].reactionID){i.reactionList[e]=o[t],n=!1;break}n&&e.push(o[t])}i.reactionList.push(...e),e.length=0,t.push(i)}})),t.length>0&&this.updateMessageList(t,"edit")}convertVoiceToText(e){const{message:t,language:n="zh"}=e,o=t.getMessage();return this.getEngine().chat.convertVoiceToText({message:o,language:n})}clearHistoryMessage(e){const t=this.getEngine();return t.chat.clearHistoryMessage(e).then((e=>(t.TUIStore.update(exports.o.CHAT,"messageList",[]),t.TUIStore.update(exports.o.CHAT,"nextReqMessageID",""),t.TUIStore.update(exports.o.CHAT,"isCompleted",!1),e)))}updateMessageInfo(e){const t=this.getStoreData(exports.o.CHAT,"userInfo");this.getEngine().TUIStore.update(exports.o.CHAT,"userInfo",Object.assign(t,e));const n=this.getStoreData(exports.o.CHAT,"messageList");n.length>0&&this.updateLocalMessage(n,e)&&this.getEngine().TUIStore.update(exports.o.CHAT,"messageList",n)}updateLocalMessage(e,t){let n=!1;return e.forEach((e=>{if(t[e.from]){const{nick:o,nameCard:i,avatar:s}=t[e.from];o&&(e.nick=o,n=!0),i&&(e.nameCard=i,n=!0),s&&(e.avatar=s,n=!0)}})),n}handleC2CCallSignaling(e){const t=this.getEngine(),n=t.getMyUserID();return e.filter((e=>{var o,i,s,r,a;const{conversationType:c,type:u,payload:l}=e;let p=!0;if(c===t.TYPES.CONV_C2C&&u===t.TYPES.MSG_CUSTOM&&t.chat.getSignalingInfo(e)){const t=Sl(l.data);if(1===(null==t?void 0:t.businessID)){const c=Sl(t.data);if(p=!(e._isExcludedFromUnreadCount&&e._isExcludedFromLastMessage),p&&!0!==(null===(o=null==c?void 0:c.data)||void 0===o?void 0:o.consumed)){let o=null===(i=null==c?void 0:c.data)||void 0===i?void 0:i.inviter;"line_busy"!==(null==c?void 0:c.line_busy)&&"lineBusy"!==(null===(s=null==c?void 0:c.data)||void 0===s?void 0:s.message)||(o=t.inviter);const{from:u,to:l}=e;if(o!==n&&e.from===n){const t=this.getStoreData(exports.o.CONV,"currentConversation");e.from=l,e.to=u,e.flow="in",e.avatar=(null===(r=null==t?void 0:t.userProfile)||void 0===r?void 0:r.avatar)||""}if(o===n&&e.from!==n){const t=this.getStoreData(exports.o.USER,"userProfile");e.from=l,e.to=u,e.flow="out",e.avatar=null==t?void 0:t.avatar}console.log(`${this.serv}.handleC2CCallSignaling myUserID:${n} callSignaling.inviter:${t.inviter} customData.data.inviter:${null===(a=null==c?void 0:c.data)||void 0===a?void 0:a.inviter}`)}}}return p}))}sortMessageList(e){const{conversationType:t}=e[0];if(t===this.getEngine().TYPES.CONV_C2C)return e.sort(((e,t)=>e.time-t.time));const n=e.filter((e=>"success"===e.status)).sort(((e,t)=>e.sequence-t.sequence));for(let o=0;o<e.length;o++)"success"!==e[o].status&&n.splice(o,0,e[o]);return n}}class Dd extends zl{constructor(){super(),this.groupMap=new Map}static getInstance(){return Dd.instance||(Dd.instance=new Dd),Dd.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.GROUP_LIST_UPDATED,this.onGroupListUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.GROUP_ATTRIBUTES_UPDATED,this.onGroupAttributesUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.GROUP_COUNTER_UPDATED,this.onGroupCounterUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.MESSAGE_RECEIVED,this.onMessageReceived.bind(this)),this.getGroupInitData()}onGroupListUpdated(e){const t=this.getEngine();t.TUIStore.update(exports.o.GRP,"groupList",e);const n=t.TUIStore.getData(exports.o.GRP,"currentGroupID");e.forEach((e=>{e.groupID===n&&t.TUIStore.update(exports.o.GRP,"currentGroup",e)}))}onGroupAttributesUpdated(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.GRP,"currentGroupID");let o=t.TUIStore.getData(exports.o.GRP,"groupList");const{groupID:i,groupAttributes:s}=e;n===i&&t.TUIStore.update(exports.o.GRP,"currentGroupAttributes",s),o=o.map((e=>(e.groupID===i&&(e.groupAttributes=s),e))),t.TUIStore.update(exports.o.GRP,"groupList",o)}onGroupCounterUpdated(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.GRP,"currentGroupID"),o=t.TUIStore.getData(exports.o.GRP,"currentGroupCounters")||{};let i=t.TUIStore.getData(exports.o.GRP,"groupList");const{groupID:s,key:r,value:a}=e;n===s&&(o[r]=a,t.TUIStore.update(exports.o.GRP,"currentGroupCounters",o)),i=i.map((e=>(e.groupID===s&&(e.groupCounters=Object.assign(Object.assign({},e.groupCounters),{[r]:a})),e))),t.TUIStore.update(exports.o.GRP,"groupList",i)}onMessageReceived(e){const t=this.getEngine(),n=[];e.forEach((e=>{if(e.type===t.TYPES.MSG_GRP_TIP){const{payload:n}=e,{operationType:o,userIDList:i}=n;switch(o){case t.TYPES.GRP_TIP_MBR_JOIN:this.addMemberList(i);break;case t.TYPES.GRP_TIP_MBR_QUIT:case t.TYPES.GRP_TIP_MBR_KICKED_OUT:this.removeMemberList(i);break;case t.TYPES.GRP_TIP_MBR_SET_ADMIN:case t.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:this.updateGroupMember(i);break;case t.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:break;case t.TYPES.GRP_TIP_MBR_PROFILE_UPDATED:case t.TYPES.GRP_TIP_BAN_AVCHATROOM_MEMBER:case t.TYPES.GRP_TIP_UNBAN_AVCHATROOM_MEMBER:this.updateGroupMember(i)}}e.type===t.TYPES.MSG_GRP_SYS_NOTICE&&n.push(e)})),n.length>0&&t.TUIStore.update(exports.o.GRP,"groupSystemNoticeList",n)}getGroupInitData(){const e=this.getEngine();e.chat.isReady()&&e.chat.getGroupList().then((e=>{const{groupList:t=[]}=e.data;console.log(`TUIGroupService.init, getGroupList count:${t.length}`),t.length>0&&this.onGroupListUpdated(t)}))}updateGroupMember(e){return ul(this,void 0,void 0,(function*(){const t=this.getEngine().TUIStore.getData(exports.o.GRP,"currentGroupID");if(t){const n=yield this.getGroupMemberProfile({groupID:t,userIDList:e}),{memberList:o}=n.data;this.updateMemberList(o)}}))}resetCurrentStore(){this.getEngine().TUIStore.reset(exports.o.GRP,["currentGroupID","currentGroup","currentGroupAttributes","currentGroupCounters","currentGroupMemberList"],!0)}switchGroup(e){return ul(this,void 0,void 0,(function*(){const t=this.getEngine();t.TUIStore.update(exports.o.GRP,"offset",0),t.TUIStore.update(exports.o.GRP,"isCompleted",!1);const n=t.TUIStore.getConversationModel(`GROUP${e}`);if((null==n?void 0:n.operationType)>0){const e=t.TUIStore.getData(exports.o.GRP,"currentGroup");return Promise.resolve(e)}const o=t.TUIStore.getData(exports.o.GRP,"currentGroupID");if(!e)return this.resetCurrentStore(),Promise.resolve({});if(o===e){const e=t.TUIStore.getData(exports.o.GRP,"currentGroup");return Promise.resolve(e)}this.resetCurrentStore(),t.TUIStore.update(exports.o.GRP,"currentGroupID",e);try{yield this.getGroupInfo(e)}catch(r){Promise.reject(r)}const i=setTimeout((()=>{this.groupMap.delete(e),clearTimeout(i)}),5e3),s=t.TUIStore.getData(exports.o.GRP,"currentGroup");return Promise.resolve(s)}))}getGroupInfo(e){return ul(this,void 0,void 0,(function*(){const t=this.getEngine(),n=this.groupMap.get(e);if(n)return this.updateMemberList((null==n?void 0:n.memberList)||[]),t.TUIStore.update(exports.o.GRP,"currentGroup",n.group),t.TUIStore.update(exports.o.GRP,"currentGroupAttributes",n.groupAttributes||{}),void t.TUIStore.update(exports.o.GRP,"currentGroupCounters",n.counters||{});const o={group:{},memberList:[],groupAttributes:void 0,counters:void 0},{data:{group:i}}=yield this.getGroupProfile({groupID:e});o.group=i;const{data:{memberList:s}}=yield this.getGroupMemberList({groupID:e});o.memberList=s;const r=yield this.getGroupAttributes({groupID:e,keyList:[]}),{groupAttributes:a}=r.data;o.groupAttributes=a,t.TUIStore.update(exports.o.GRP,"currentGroupAttributes",a);try{const n=yield this.getGroupCounters({groupID:e,keyList:[]}),{counters:i}=n.data;o.counters=i,t.TUIStore.update(exports.o.GRP,"currentGroupCounters",i)}catch(c){console.warn(null==c?void 0:c.message)}this.groupMap.set(e,o)}))}getGroupProfile(e){const t=this.getEngine();return t.chat.getGroupProfile(e).then((n=>ul(this,void 0,void 0,(function*(){if(t.TUIStore.getData(exports.o.GRP,"currentGroupID")===e.groupID){const{group:e}=n.data;t.TUIStore.update(exports.o.GRP,"currentGroup",e)}return n}))))}updateGroupProfile(e){return this.getEngine().chat.updateGroupProfile(e)}createGroup(e){return this.getEngine().chat.createGroup(e)}dismissGroup(e){return this.getEngine().chat.dismissGroup(e)}searchGroupByID(e){const t=this.getEngine();return t.chat.searchGroupByID(e).then((e=>{const{group:n}=e.data,o=t.TUIStore.getData(exports.o.GRP,"groupList");return e.data.group.isJoinedGroup=o.some((e=>e.groupID===n.groupID)),e}))}joinGroup(e){return this.getEngine().chat.joinGroup(e)}quitGroup(e){return this.getEngine().chat.quitGroup(e)}getGroupApplicationList(){return this.getEngine().chat.getGroupApplicationList()}handleGroupApplication(e){return this.getEngine().chat.handleGroupApplication(e)}getGroupOnlineMemberCount(e){return this.getEngine().chat.getGroupOnlineMemberCount(e)}changeGroupOwner(e){return this.getEngine().chat.changeGroupOwner(e)}initGroupAttributes(e){return this.getEngine().chat.initGroupAttributes(e)}setGroupAttributes(e){return this.getEngine().chat.setGroupAttributes(e)}deleteGroupAttributes(e){return this.getEngine().chat.deleteGroupAttributes(e)}getGroupAttributes(e){return this.getEngine().chat.getGroupAttributes(e)}setGroupCounters(e){return this.getEngine().chat.setGroupCounters(e)}increaseGroupCounter(e){return this.getEngine().chat.increaseGroupCounter(e)}decreaseGroupCounter(e){return this.getEngine().chat.decreaseGroupCounter(e)}getGroupCounters(e){return this.getEngine().chat.getGroupCounters(e)}updateMemberList(e){const t=this.getEngine(),n=[...(t.TUIStore.getData(exports.o.GRP,"currentGroupMemberList")||[]).filter((t=>!e.find((e=>e.userID===t.userID)))),...e];t.TUIStore.update(exports.o.GRP,"currentGroupMemberList",n)}addMemberList(e){return ul(this,void 0,void 0,(function*(){const t=this.getEngine().TUIStore.getData(exports.o.GRP,"currentGroupID");if(t)try{const n=yield this.getGroupMemberProfile({groupID:t,userIDList:e}),{memberList:o}=n.data;this.updateMemberList(o)}catch(n){const t=e.map((e=>({userID:e,avatar:"",nick:"",role:"",joinTime:0,nameCard:"",muteUntil:0,memberCustomField:[]})));this.updateMemberList(t)}}))}removeMemberList(e){const t=this.getEngine(),n=t.TUIStore.getData(exports.o.GRP,"currentGroupMemberList").filter((t=>-1===e.indexOf(t.userID)));t.TUIStore.update(exports.o.GRP,"currentGroupMemberList",n)}getGroupMemberList(e){const t=this.getEngine();if(Ml(e.offset)){const n=t.TUIStore.getData(exports.o.GRP,"offset");e.offset=n}return t.chat.getGroupMemberList(e).then((n=>{if(t.TUIStore.getData(exports.o.GRP,"currentGroupID")===e.groupID){const{memberList:e,offset:o=0}=n.data;this.updateMemberList(e),t.TUIStore.update(exports.o.GRP,"offset",o),0===o&&t.TUIStore.update(exports.o.GRP,"isCompleted",!0)}return n}))}getGroupMemberProfile(e){return this.getEngine().chat.getGroupMemberProfile(e)}addGroupMember(e){const t=this.getEngine();return t.chat.addGroupMember(e).then((n=>ul(this,void 0,void 0,(function*(){if(t.TUIStore.getData(exports.o.GRP,"currentGroupID")===e.groupID){const{successUserIDList:e,group:o}=n.data;t.TUIStore.update(exports.o.GRP,"currentGroup",o),this.addMemberList(e)}return n}))))}deleteGroupMember(e){const t=this.getEngine();return t.chat.deleteGroupMember(e).then((n=>{if(t.TUIStore.getData(exports.o.GRP,"currentGroupID")===e.groupID){const{userIDList:e,group:o}=n.data;this.removeMemberList(e),t.TUIStore.update(exports.o.GRP,"currentGroup",o)}return n}))}setGroupMemberMuteTime(e){return this.getEngine().chat.setGroupMemberMuteTime(e)}setGroupMemberRole(e){return this.getEngine().chat.setGroupMemberRole(e)}setGroupMemberNameCard(e){return this.getEngine().chat.setGroupMemberNameCard(e)}setGroupMemberCustomField(e){return this.getEngine().chat.setGroupMemberCustomField(e)}markGroupMemberList(e){return this.getEngine().chat.markGroupMemberList(e)}}class Ld extends zl{constructor(){super()}static getInstance(){return Ld.instance||(Ld.instance=new Ld),Ld.instance}init(){const e=this.getEngine();e.eventCenter.addEvent(e.EVENT.FRIEND_LIST_UPDATED,this.onFriendListUpdated.bind(this)),e.eventCenter.addEvent(e.EVENT.FRIEND_APPLICATION_LIST_UPDATED,this.onFriendApplicationListUpdated.bind(this)),this.getFriendInitData()}onFriendListUpdated(e){this.getEngine().TUIStore.update(exports.o.FRIEND,"friendList",e)}onFriendApplicationListUpdated(e){const{friendApplicationList:t,unreadCount:n=0}=e,o=this.getEngine();o.TUIStore.update(exports.o.FRIEND,"friendApplicationList",t),o.TUIStore.update(exports.o.FRIEND,"friendApplicationUnreadCount",n)}getFriendInitData(){const e=this.getEngine();e.chat.isReady()&&(e.chat.getFriendList().then((e=>{const t=e.data||[];console.log(`TUIFriendService.init, getFriendList count:${t.length}`),t.length>0&&this.onFriendListUpdated(t)})),e.chat.getFriendApplicationList().then((e=>{this.onFriendApplicationListUpdated(e.data)})))}getFriendList(){return this.getEngine().chat.getFriendList()}getFriendRemark(e){const t=this.getEngine().TUIStore.getData(exports.o.FRIEND,"friendList"),n={};return e.forEach((e=>{for(let o=0;o<t.length;o++)t[o].userID!==e||(n[e]=t[o].remark)})),n}addFriend(e){return this.getEngine().chat.addFriend(e)}deleteFriend(e){return this.getEngine().chat.deleteFriend(e)}checkFriend(e){return this.getEngine().chat.checkFriend(e)}getFriendProfile(e){return this.getEngine().chat.getFriendProfile(e)}updateFriend(e){return this.getEngine().chat.updateFriend(e)}acceptFriendApplication(e){return this.getEngine().chat.acceptFriendApplication(e)}refuseFriendApplication(e){return this.getEngine().chat.refuseFriendApplication({userID:e})}deleteFriendApplication(e){return this.getEngine().chat.deleteFriendApplication(e)}setFriendApplicationRead(){return this.getEngine().chat.setFriendApplicationRead()}}class Rd extends zl{static getInstance(){return Rd.instance||(Rd.instance=new Rd),Rd.instance}reportFeature(e,t){var n;return null===(n=this.getEngine().chat)||void 0===n?void 0:n.callExperimentalAPI("statTUIKeyFeatures",{code:e,msg:t?`${e}-${t}`:""})}}class Od{constructor(){this.cache=[],this.middlewares=[],this.options=null}use(e){return"function"!=typeof e&&console.error("middleware must be a function"),this.cache.push(e),this}next(){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}run(e){return this.middlewares=this.cache.map((e=>e)),this.options=e,this.next()}}function Ad(e,t,n){const o=Object.create(null);Object.keys(n).forEach((n=>{if(!t[n])return;o[n]=t[n];const i=new Od;t[n]=function(){const s=Array.from(arguments);return i.use(((t,o)=>e.isInited?o():Promise.reject({code:ml.NOT_INIT,message:`${n} | ${vl.NOT_INIT}`}))).use((e=>o[n].apply(t,e))),i.run(s)}}))}console.log("TUIChatEngine.VERSION:2.4.4");const bd=Hl.getInstance();jl.getInstance();const Pd=sp.getInstance(),Nd=gd.getInstance(),xd=fd.getInstance(),wd=Cd.getInstance(),Ud=kd.getInstance(),Gd=Dd.getInstance(),Fd=Ld.getInstance(),Bd=Rd.getInstance();bd.mount(pl.TUIStore,Pd),bd.mount(pl.TUITranslate,Nd),bd.mount(pl.TUIConversation,xd),bd.mount(pl.TUIUser,wd),bd.mount(pl.TUIChat,Ud),bd.mount(pl.TUIGroup,Gd),bd.mount(pl.TUIFriend,Fd),bd.mount(pl.TUIReport,Bd),Ad(bd,bd,Il),Ad(bd,xd,{deleteConversation:1,pinConversation:1,muteConversation:1,switchConversation:1,getConversationProfile:1,clearHistoryMessage:1}),Ad(bd,Ud,{modifyMessage:1,revokeMessage:1,resendMessage:1,deleteMessage:1,quoteMessage:1,replyMessage:1,setMessageExtensions:1,deleteMessageExtensions:1,getMessageExtensions:1,sendTextMessage:1,sendTextAtMessage:1,sendImageMessage:1,sendAudioMessage:1,sendVideoMessage:1,sendFileMessage:1,sendCustomMessage:1,sendFaceMessage:1,sendLocationMessage:1,sendForwardMessage:1,enterTypingState:1,leaveTypingState:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageList:1,downloadMergedMessages:1,setTranslationLanguage:1,translateText:1,searchCloudMessages:1,addMessageReaction:1,removeMessageReaction:1,getMessageReactions:1,getAllUserListOfMessageReaction:1}),Ad(bd,Gd,{switchGroup:1,getGroupProfile:1,updateGroupProfile:1,createGroup:1,dismissGroup:1,searchGroupByID:1,joinGroup:1,quitGroup:1,getGroupApplicationList:1,handleGroupApplication:1,getGroupOnlineMemberCount:1,changeGroupOwner:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getGroupMemberList:1,getGroupMemberProfile:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberNameCard:1,setGroupMemberCustomField:1,markGroupMemberList:1}),Ad(bd,wd,{switchUserStatus:1,switchMessageReadStatus:1,getUserProfile:1,updateMyProfile:1,addToBlacklist:1,removeFromBlacklist:1}),Ad(bd,Fd,{getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,getFriendProfile:1,updateFriend:1,acceptFriendApplication:1,refuseFriendApplication:1,deleteFriendApplication:1,setFriendApplicationRead:1}),Ad(bd,Bd,Il);const qd=void 0!==Un&&"function"==typeof Un.getSystemInfoSync&&Boolean(Un.getSystemInfoSync().fontSizeSetting),Vd=void 0!==Gn&&"undefined"==typeof window,Hd=void 0!==Gn,Kd=(void 0!==Gn||"undefined"!=typeof window)&&!(qd||Vd),$d=qd?Un:Hd?Gn:"undefined"!=typeof window?window:{},zd=Kd&&window&&window.navigator&&window.navigator.userAgent||"",Yd=/Android/i.test(zd),Wd=/(?:Windows Phone)/.test(zd),Jd=/(?:SymbianOS)/.test(zd),Xd=/OpenHarmony/i.test(zd),Zd=Kd&&("ontouchstart"in window||navigator.maxTouchPoints>0)&&function(){if(Kd){if(/Tablet|Pad/i.test(zd))return!0;if(180===window.orientation||0===window.orientation)return window.innerWidth>=768&&window.innerHeight>=1024;if(90===window.orientation||-90===window.orientation)return window.innerWidth>=1024&&window.innerHeight>=768}return!1}(),Qd=/iPhone/i.test(zd)||/iPod/i.test(zd),eh=qd,th=Yd||Wd||Jd||Qd||Zd||Xd,nh=Kd&&!th,oh=Vd&&!qd;const ih=new Map;class sh{constructor(){if(sh.instance)return sh.instance;sh.instance=this,this.eventCallback=null,this.listener=null,this.button=0,this.init()}init(){Kd&&(this.eventCallback=e=>{this.listener&&this.listener(e)},document.addEventListener("mousedown",this.eventCallback))}listen(e){if(Kd){const{domRefs:t,ignoreDomRefs:n,handler:o,button:i=0}=e;this.button=i,this.listener=e=>{const i=Array.isArray(n)?n:[n];for(const t of i)if(t&&t.contains(e.target))return;const s=Array.isArray(t)?t:[t];for(const t of s)if(t&&t.contains(e.target)&&this.button===e.button)return;o(e),this.remove()}}}remove(){this.listener=null,this.button=-1}}const rh={PROTOCOLS:["javascript:","vbscript:","file:","about:","ftp:","ws:","wss:","mailto:","tel:","sms:","gopher:","data:","blob:"],HTML_TAGS:["<script","<img","<iframe","<object","<embed","<video","<audio","<link","<meta","<style","<form","<input","<svg","<xml","<xmp","<xsl","<base"],EVENT_HANDLERS:["onclick","onload","onerror","onmouseover","onmouseout","onfocus","onblur","onsubmit","onreset","onselect","onchange","onkeyup","onkeydown","onkeypress","ondblclick","oncontextmenu","ondrag","ondrop","onmouseenter","onmouseleave","onanimation","onafterprint","onbeforeprint","onbeforeunload","onhashchange","onmessage","onoffline","ononline","onpagehide","onpageshow","onpopstate","onresize","onstorage","onunload"],JS_FUNCTIONS:["eval(","setTimeout(","setInterval(","Function(","constructor","prototype","__proto__","window.","document.","location.","alert(","confirm(","prompt(","fetch(","XMLHttpRequest"],CSS_PATTERNS:["expression(","url(","@import","behavior:","-moz-binding"],ENCODING_SEQUENCES:["&#","\\","fromCharCode","String.fromCharCode","unescape(","escape(","encodeURI(","decodeURI(","atob(","btoa("],SPECIAL_MARKERS:["\x3c!--","--\x3e","*/>","]]>","<!ENTITY","<!DOCTYPE"],DATA_MARKERS:["base64,","0x","%0","U+","\\u","\\x"],OTHER_PATTERNS:["null","undefined","NaN","true","false","instanceof"]};console.log("UniversalAPI.VERSION:2.4.0");const ah=new sh,ch=e=>(t,n=Kr())=>{!exports.isInSSRComponentSetup&&qs(e,t,n)},uh=ch($),lh=ch(Z),ph=ch(Q),dh=ch(ee);var hh={exports:{}};hh.exports=function(){var e=1e3,t=6e4,n=36e5,o="millisecond",i="second",s="minute",r="hour",a="day",c="week",u="month",l="quarter",p="year",d="date",h="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},_=function(e,t,n){var o=String(e);return!o||o.length>=t?e:""+Array(t+1-o.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),o=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+_(o,2,"0")+":"+_(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var o=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(o,u),s=n-i<0,r=t.clone().add(o+(s?-1:1),u);return+(-(o+(n-i)/(s?i-r:r-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:p,w:c,d:a,D:d,h:r,m:s,s:i,ms:o,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",I={};I[y]=m;var M="$isDayjsObject",C=function(e){return e instanceof k||!(!e||!e[M])},T=function e(t,n,o){var i;if(!t)return y;if("string"==typeof t){var s=t.toLowerCase();I[s]&&(i=s),n&&(I[s]=n,i=s);var r=t.split("-");if(!i&&r.length>1)return e(r[0])}else{var a=t.name;I[a]=t,i=a}return!o&&i&&(y=i),i||!o&&y},S=function(e,t){if(C(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new k(n)},E=v;E.l=T,E.i=C,E.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function m(e){this.$L=T(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[M]=!0}var _=m.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(E.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var o=t.match(g);if(o){var i=o[2]-1||0,s=(o[7]||"0").substring(0,3);return n?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,s)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,s)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return E},_.isValid=function(){return!(this.$d.toString()===h)},_.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return S(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<S(e)},_.$g=function(e,t,n){return E.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,o=!!E.u(t)||t,l=E.p(e),h=function(e,t){var i=E.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return o?i:i.endOf(a)},g=function(e,t){return E.w(n.toDate()[e].apply(n.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},f=this.$W,m=this.$M,_=this.$D,v="set"+(this.$u?"UTC":"");switch(l){case p:return o?h(1,0):h(31,11);case u:return o?h(1,m):h(0,m+1);case c:var y=this.$locale().weekStart||0,I=(f<y?f+7:f)-y;return h(o?_-I:_+(6-I),m);case a:case d:return g(v+"Hours",0);case r:return g(v+"Minutes",1);case s:return g(v+"Seconds",2);case i:return g(v+"Milliseconds",3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=E.p(e),l="set"+(this.$u?"UTC":""),h=(n={},n[a]=l+"Date",n[d]=l+"Date",n[u]=l+"Month",n[p]=l+"FullYear",n[r]=l+"Hours",n[s]=l+"Minutes",n[i]=l+"Seconds",n[o]=l+"Milliseconds",n)[c],g=c===a?this.$D+(t-this.$W):t;if(c===u||c===p){var f=this.clone().set(d,1);f.$d[h](g),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else h&&this.$d[h](g);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[E.p(e)]()},_.add=function(o,l){var d,h=this;o=Number(o);var g=E.p(l),f=function(e){var t=S(h);return E.w(t.date(t.date()+Math.round(e*o)),h)};if(g===u)return this.set(u,this.$M+o);if(g===p)return this.set(p,this.$y+o);if(g===a)return f(1);if(g===c)return f(7);var m=(d={},d[s]=t,d[r]=n,d[i]=e,d)[g]||1,_=this.$d.getTime()+o*m;return E.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var o=e||"YYYY-MM-DDTHH:mm:ssZ",i=E.z(this),s=this.$H,r=this.$m,a=this.$M,c=n.weekdays,u=n.months,l=n.meridiem,p=function(e,n,i,s){return e&&(e[n]||e(t,o))||i[n].slice(0,s)},d=function(e){return E.s(s%12||12,e,"0")},g=l||function(e,t,n){var o=e<12?"AM":"PM";return n?o.toLowerCase():o};return o.replace(f,(function(e,o){return o||function(e){switch(e){case"YY":return String(t.$y).slice(-2);case"YYYY":return E.s(t.$y,4,"0");case"M":return a+1;case"MM":return E.s(a+1,2,"0");case"MMM":return p(n.monthsShort,a,u,3);case"MMMM":return p(u,a);case"D":return t.$D;case"DD":return E.s(t.$D,2,"0");case"d":return String(t.$W);case"dd":return p(n.weekdaysMin,t.$W,c,2);case"ddd":return p(n.weekdaysShort,t.$W,c,3);case"dddd":return c[t.$W];case"H":return String(s);case"HH":return E.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return g(s,r,!0);case"A":return g(s,r,!1);case"m":return String(r);case"mm":return E.s(r,2,"0");case"s":return String(t.$s);case"ss":return E.s(t.$s,2,"0");case"SSS":return E.s(t.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(o,d,h){var g,f=this,m=E.p(d),_=S(o),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,I=function(){return E.m(f,_)};switch(m){case p:g=I()/12;break;case u:g=I();break;case l:g=I()/3;break;case c:g=(y-v)/6048e5;break;case a:g=(y-v)/864e5;break;case r:g=y/n;break;case s:g=y/t;break;case i:g=y/e;break;default:g=y}return h?g:E.a(g)},_.daysInMonth=function(){return this.endOf(u).$D},_.$locale=function(){return I[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),o=T(e,t,!0);return o&&(n.$L=o),n},_.clone=function(){return E.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},m}(),D=k.prototype;return S.prototype=D,[["$ms",o],["$s",i],["$m",s],["$H",r],["$W",a],["$M",u],["$y",p],["$D",d]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,k,S),e.$i=!0),S},S.locale=T,S.isDayjs=C,S.unix=function(e){return S(1e3*e)},S.en=I[y],S.Ls=I,S.p={},S}();var gh=hh.exports;const fh=bu(gh);var mh={exports:{}};mh.exports=function(e,t,n){var o=t.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},s=function(e,t,n,o,s){var r=e.name?e:e.$locale(),a=i(r[t]),c=i(r[n]),u=a||c.map((function(e){return e.slice(0,o)}));if(!s)return u;var l=r.weekStart;return u.map((function(e,t){return u[(t+(l||0))%7]}))},r=function(){return n.Ls[n.locale()]},a=function(e,t){return e.formats[t]||e.formats[t.toUpperCase()].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))},c=function(){var e=this;return{months:function(t){return t?t.format("MMMM"):s(e,"months")},monthsShort:function(t){return t?t.format("MMM"):s(e,"monthsShort","months",3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format("dddd"):s(e,"weekdays")},weekdaysMin:function(t){return t?t.format("dd"):s(e,"weekdaysMin","weekdays",2)},weekdaysShort:function(t){return t?t.format("ddd"):s(e,"weekdaysShort","weekdays",3)},longDateFormat:function(t){return a(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return c.bind(this)()},n.localeData=function(){var e=r();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return a(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return s(r(),"months")},n.monthsShort=function(){return s(r(),"monthsShort","months",3)},n.weekdays=function(e){return s(r(),"weekdays",null,null,e)},n.weekdaysShort=function(e){return s(r(),"weekdaysShort","weekdays",3,e)},n.weekdaysMin=function(e){return s(r(),"weekdaysMin","weekdays",2,e)}};const _h=bu(mh.exports);var vh={exports:{}};const yh=bu(vh.exports=function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}});var Ih={exports:{}};const Mh=bu(Ih.exports=function(e,t){t.prototype.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)}});!function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,t){return"W"===t?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,t){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1100?"上午":n<1300?"中午":n<1800?"下午":"晚上"}};n.default.locale(o,null,!0)}(gh);var Ch=function(e,t){return(Ch=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var Th,Sh=function(){return Sh=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Sh.apply(this,arguments)};function Eh(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function kh(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,s=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(o=s.next()).done;)r.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return r}function Dh(e,t,n){if(n||2===arguments.length)for(var o,i=0,s=t.length;i<s;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var Lh=[],Rh=function(){function e(e){this.active=!0,this.effects=[],this.cleanups=[],this.vm=e}return e.prototype.run=function(e){if(this.active)try{return this.on(),e()}finally{this.off()}},e.prototype.on=function(){this.active&&(Lh.push(this),Th=this)},e.prototype.off=function(){this.active&&(Lh.pop(),Th=Lh[Lh.length-1])},e.prototype.stop=function(){this.active&&(this.vm.$destroy(),this.effects.forEach((function(e){return e.stop()})),this.cleanups.forEach((function(e){return e()})),this.active=!1)},e}(),Oh=function(e){function t(t){void 0===t&&(t=!1);var n,o=void 0;return function(e){var t=Uh;Uh=!1;try{e()}finally{Uh=t}}((function(){o=ag(Bh())})),n=e.call(this,o)||this,t||function(e,t){var n;if((t=t||Th)&&t.active)return void t.effects.push(e);var o=null===(n=jh())||void 0===n?void 0:n.proxy;o&&o.$on("hook:destroyed",(function(){return e.stop()}))}(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ch(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Rh);function Ah(){return Th}function bh(){var e,t;return(null===(e=Ah())||void 0===e?void 0:e.vm)||(null===(t=jh())||void 0===t?void 0:t.proxy)}var Ph=void 0;try{var Nh=require("vue");Nh&&Fh(Nh)?Ph=Nh:Nh&&"default"in Nh&&Fh(Nh.default)&&(Ph=Nh.default)}catch(sm){}var xh=null,wh=null,Uh=!0,Gh="__composition_api_installed__";function Fh(e){return e&&sg(e)&&"Vue"===e.name}function Bh(){return xh}function qh(){return xh||Ph}function Vh(e){if(Uh){var t=wh;null==t||t.scope.off(),null==(wh=e)||wh.scope.on()}}function jh(){return wh}var Hh=new WeakMap;function Kh(e){if(Hh.has(e))return Hh.get(e);var t={proxy:e,update:e.$forceUpdate,type:e.$options,uid:e._uid,emit:e.$emit.bind(e),parent:null,root:null};!function(e){if(!e.scope){var t=new Rh(e.proxy);e.scope=t,e.proxy.$on("hook:destroyed",(function(){return t.stop()}))}e.scope}(t);return["data","props","attrs","refs","vnode","slots"].forEach((function(n){Wh(t,n,{get:function(){return e["$".concat(n)]}})})),Wh(t,"isMounted",{get:function(){return e._isMounted}}),Wh(t,"isUnmounted",{get:function(){return e._isDestroyed}}),Wh(t,"isDeactivated",{get:function(){return e._inactive}}),Wh(t,"emitted",{get:function(){return e._events}}),Hh.set(e,t),e.$parent&&(t.parent=Kh(e.$parent)),e.$root&&(t.root=Kh(e.$root)),t}function $h(e){return"function"==typeof e&&/native code/.test(e.toString())}var zh="undefined"!=typeof Symbol&&$h(Symbol)&&"undefined"!=typeof Reflect&&$h(Reflect.ownKeys),Yh=function(e){return e};function Wh(e,t,n){var o=n.get,i=n.set;Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:o||Yh,set:i||Yh})}function Jh(e,t,n,o){Object.defineProperty(e,t,{value:n,enumerable:!!o,writable:!0,configurable:!0})}function Xh(e,t){return Object.hasOwnProperty.call(e,t)}function Zh(e){return Array.isArray(e)}var Qh,eg=Object.prototype.toString,tg=function(e){return eg.call(e)};function ng(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)&&t<=4294967295}function og(e){return null!==e&&"object"==typeof e}function ig(e){return"[object Object]"===function(e){return Object.prototype.toString.call(e)}(e)}function sg(e){return"function"==typeof e}function rg(e,t){return t=t||jh()}function ag(e,t){void 0===t&&(t={});var n=e.config.silent;e.config.silent=!0;var o=new e(t);return e.config.silent=n,o}function cg(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(e.$scopedSlots[t])return e.$scopedSlots[t].apply(e,n)}}function ug(e){return zh?Symbol.for(e):e}var lg=ug("composition-api.preFlushQueue"),pg=ug("composition-api.postFlushQueue"),dg="composition-api.refKey",hg=new WeakMap,gg=new WeakMap,fg=new WeakMap;function mg(e,t,n){var o=Bh().util;o.warn;var i=o.defineReactive,s=e.__ob__;function r(){s&&og(n)&&!Xh(n,"__ob__")&&bg(n)}if(Zh(e)){if(ng(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),r(),n;if("length"===t&&n!==e.length)return e.length=n,null==s||s.dep.notify(),n}return t in e&&!(t in Object.prototype)?(e[t]=n,r(),n):e._isVue||s&&s.vmCount?n:s?(i(s.value,t,n),Og(e,t,n),r(),s.dep.notify(),n):(e[t]=n,n)}var _g=!1;function vg(e){_g=e}var yg=function(){return function(e){Wh(this,"value",{get:e.get,set:e.set})}}();function Ig(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=new yg(e);n&&(o.effect=!0);var i=Object.seal(o);return t&&fg.set(i,!0),i}function Mg(e){var t;if(Cg(e))return e;var n=xg(((t={})[dg]=e,t));return Ig({get:function(){return n[dg]},set:function(e){return n[dg]=e}})}function Cg(e){return e instanceof yg}function Tg(e){return Cg(e)?e.value:e}function Sg(e){if(!ig(e))return e;var t={};for(var n in e)t[n]=Eg(e,n);return t}function Eg(e,t){t in e||mg(e,t,void 0);var n=e[t];return Cg(n)?n:Ig({get:function(){return e[t]},set:function(n){return e[t]=n}})}var kg="__v_skip";function Dg(e){var t;return Boolean(e&&Xh(e,"__ob__")&&"object"==typeof e.__ob__&&(null===(t=e.__ob__)||void 0===t?void 0:t[kg]))}function Lg(e){var t;return Boolean(e&&Xh(e,"__ob__")&&"object"==typeof e.__ob__&&!(null===(t=e.__ob__)||void 0===t?void 0:t[kg]))}function Rg(e){if(!(!ig(e)||Dg(e)||Zh(e)||Cg(e)||(t=e,n=Bh(),n&&t instanceof n)||hg.has(e))){var t,n;hg.set(e,!0);for(var o=Object.keys(e),i=0;i<o.length;i++)Og(e,o[i])}}function Og(e,t,n){if("__ob__"!==t&&!Dg(e[t])){var o,i,s=Object.getOwnPropertyDescriptor(e,t);if(s){if(!1===s.configurable)return;o=s.get,i=s.set,o&&!i||2!==arguments.length||(n=e[t])}Rg(n),Wh(e,t,{get:function(){var i=o?o.call(e):n;return t!==dg&&Cg(i)?i.value:i},set:function(s){o&&!i||(t!==dg&&Cg(n)&&!Cg(s)?n.value=s:i?(i.call(e,s),n=s):n=s,Rg(s))}})}}function Ag(e){var t,n=qh();n.observable?t=n.observable(e):t=ag(n,{data:{$$state:e}})._data.$$state;return Xh(t,"__ob__")||bg(t),t}function bg(e,t){var n,o;if(void 0===t&&(t=new Set),!t.has(e)&&!Xh(e,"__ob__")&&Object.isExtensible(e)){Jh(e,"__ob__",function(e){void 0===e&&(e={});return{value:e,dep:{notify:Yh,depend:Yh,addSub:Yh,removeSub:Yh}}}(e)),t.add(e);try{for(var i=Eh(Object.keys(e)),s=i.next();!s.done;s=i.next()){var r=e[s.value];(ig(r)||Zh(r))&&!Dg(r)&&Object.isExtensible(r)&&bg(r,t)}}catch(a){n={error:a}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}}function Pg(){return Ag({}).__ob__}function Ng(e){var t,n;if(!og(e))return e;if(!ig(e)&&!Zh(e)||Dg(e)||!Object.isExtensible(e))return e;var o=Ag(Zh(e)?[]:{}),i=o.__ob__,s=function(t){var n,s,r=e[t],a=Object.getOwnPropertyDescriptor(e,t);if(a){if(!1===a.configurable)return"continue";n=a.get,s=a.set}Wh(o,t,{get:function(){var e;return null===(e=i.dep)||void 0===e||e.depend(),r},set:function(t){var o;n&&!s||(_g||r!==t)&&(s?s.call(e,t):r=t,null===(o=i.dep)||void 0===o||o.notify())}})};try{for(var r=Eh(Object.keys(e)),a=r.next();!a.done;a=r.next()){s(a.value)}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return o}function xg(e){if(!og(e))return e;if(!ig(e)&&!Zh(e)||Dg(e)||!Object.isExtensible(e))return e;var t=Ag(e);return Rg(t),t}function wg(e){return function(t,n){var o=rg(function(e){"on".concat(e[0].toUpperCase()+e.slice(1))}(e),n);return o&&function(e,t,n,o){var i=t.proxy.$options,s=e.config.optionMergeStrategies[n],r=function(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=jh();Vh(e);try{return t.apply(void 0,Dh([],kh(n),!1))}finally{Vh(i)}}}(t,o);return i[n]=s(i[n],r),r}(Bh(),o,e,t)}}var Ug,Gg=wg("beforeMount"),Fg=wg("mounted"),Bg=wg("beforeUpdate"),qg=wg("updated"),Vg=wg("beforeDestroy"),jg=wg("destroyed"),Hg=wg("errorCaptured"),Kg=wg("activated"),$g=wg("deactivated"),zg=wg("serverPrefetch");function Yg(){Xg(this,lg)}function Wg(){Xg(this,pg)}function Jg(){var e=bh();return e?function(e){return void 0!==e[lg]}(e)||function(e){e[lg]=[],e[pg]=[],e.$on("hook:beforeUpdate",Yg),e.$on("hook:updated",Wg)}(e):(Ug||(Ug=ag(Bh())),e=Ug),e}function Xg(e,t){for(var n=e[t],o=0;o<n.length;o++)n[o]();n.length=0}function Zg(e,t,n){var o=function(){e.$nextTick((function(){e[lg].length&&Xg(e,lg),e[pg].length&&Xg(e,pg)}))};switch(n){case"pre":o(),e[lg].push(t);break;case"post":o(),e[pg].push(t);break;default:!function(e,t){if(!e)throw new Error("[vue-composition-api] ".concat(t))}(!1,'flush must be one of ["post", "pre", "sync"], but got '.concat(n))}}function Qg(e,t){var n=e.teardown;e.teardown=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n.apply(e,o),t()}}function ef(e,t,n,o){var i,s,r=o.flush,a="sync"===r,c=function(e){s=function(){try{e()}catch(t){!function(e){if("undefined"==typeof window||"undefined"==typeof console)throw e;console.error(e)}(t)}}},u=function(){s&&(s(),s=null)},l=function(t){return a||e===Ug?t:function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return Zg(e,(function(){t.apply(void 0,Dh([],kh(n),!1))}),r)}};if(null===n){var p=!1,d=function(e,t,n,o){var i=e._watchers.length;return e.$watch(t,n,{immediate:o.immediateInvokeCallback,deep:o.deep,lazy:o.noRun,sync:o.sync,before:o.before}),e._watchers[i]}(e,(function(){if(!p)try{p=!0,t(c)}finally{p=!1}}),Yh,{deep:o.deep||!1,sync:a,before:u});Qg(d,u),d.lazy=!1;var h=d.get.bind(d);return d.get=l(h),function(){d.teardown()}}var g,f=o.deep,m=!1;if(Cg(t)?g=function(){return t.value}:Lg(t)?(g=function(){return t},f=!0):Zh(t)?(m=!0,g=function(){return t.map((function(e){return Cg(e)?e.value:Lg(e)?nf(e):sg(e)?e():Yh}))}):g=sg(t)?t:Yh,f){var _=g;g=function(){return nf(_())}}var v=function(e,t){if(f||!m||!e.every((function(e,n){return o=e,i=t[n],o===i?0!==o||1/o==1/i:o!=o&&i!=i;var o,i})))return u(),n(e,t,c)},y=l(v);if(o.immediate){var I=y,M=function(e,t){return M=I,v(e,Zh(e)?[]:t)};y=function(e,t){return M(e,t)}}var C=e.$watch(g,y,{immediate:o.immediate,deep:f,sync:a}),T=e._watchers[e._watchers.length-1];return Lg(T.value)&&(null===(i=T.value.__ob__)||void 0===i?void 0:i.dep)&&f&&T.value.__ob__.dep.addSub({update:function(){T.run()}}),Qg(T,u),function(){C()}}function tf(e,t){var n=function(e){return Sh({flush:"pre"},e)}(t);return ef(Jg(),e,null,n)}function nf(e,t){if(void 0===t&&(t=new Set),!og(e)||t.has(e)||gg.has(e))return e;if(t.add(e),Cg(e))nf(e.value,t);else if(Zh(e))for(var n=0;n<e.length;n++)nf(e[n],t);else if("[object Set]"===tg(e)||function(e){return"[object Map]"===tg(e)}(e))e.forEach((function(e){nf(e,t)}));else if(ig(e))for(var o in e)nf(e[o],t);return e}var of={};var sf={},rf=function(e){var t;void 0===e&&(e="$style");var n=jh();if(!n)return sf;var o=null===(t=n.proxy)||void 0===t?void 0:t[e];return o||sf},af=rf;var cf;function uf(){return jh().setupContext}var lf={set:function(e,t,n){(e.__composition_api_state__=e.__composition_api_state__||{})[t]=n},get:function(e,t){return(e.__composition_api_state__||{})[t]}};function pf(e){var t=lf.get(e,"rawBindings")||{};if(t&&Object.keys(t).length){for(var n=e.$refs,o=lf.get(e,"refs")||[],i=0;i<o.length;i++){var s=t[c=o[i]];!n[c]&&s&&Cg(s)&&(s.value=null)}var r=Object.keys(n),a=[];for(i=0;i<r.length;i++){var c;s=t[c=r[i]];n[c]&&s&&Cg(s)&&(s.value=n[c],a.push(c))}lf.set(e,"refs",a)}}function df(e){for(var t=[e._vnode];t.length;){var n=t.pop();if(n&&(n.context&&pf(n.context),n.children))for(var o=0;o<n.children.length;++o)t.push(n.children[o])}}function hf(e,t){var n,o;if(e){var i=lf.get(e,"attrBindings");if(i||t){if(!i){var s=xg({});i={ctx:t,data:s},lf.set(e,"attrBindings",i),Wh(t,"attrs",{get:function(){return null==i?void 0:i.data},set:function(){}})}var r=e.$attrs,a=function(t){Xh(i.data,t)||Wh(i.data,t,{get:function(){return e.$attrs[t]}})};try{for(var c=Eh(Object.keys(r)),u=c.next();!u.done;u=c.next()){a(u.value)}}catch(l){n={error:l}}finally{try{u&&!u.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}}}}function gf(e,t){var n=e.$options._parentVnode;if(n){for(var o=lf.get(e,"slots")||[],i=function(e,t){var n;if(e){if(e._normalized)return e._normalized;for(var o in n={},e)e[o]&&"$"!==o[0]&&(n[o]=!0)}else n={};for(var o in t)o in n||(n[o]=!0);return n}(n.data.scopedSlots,e.$slots),s=0;s<o.length;s++){i[a=o[s]]||delete t[a]}var r=Object.keys(i);for(s=0;s<r.length;s++){var a;t[a=r[s]]||(t[a]=cg(e,a))}lf.set(e,"slots",r)}}function ff(e,t,n){var o=jh();Vh(e);try{return t(e)}catch(i){if(!n)throw i;n(i)}finally{Vh(o)}}function mf(e){function t(e,n){if(void 0===n&&(n=new Set),!n.has(e)&&ig(e)&&!Cg(e)&&!Lg(e)&&!Dg(e)){var o=Bh().util.defineReactive;Object.keys(e).forEach((function(i){var s=e[i];o(e,i,s),s&&(n.add(s),t(s,n))}))}}function n(e,t){return void 0===t&&(t=new Map),t.has(e)?t.get(e):(t.set(e,!1),Zh(e)&&Lg(e)?(t.set(e,!0),!0):!(!ig(e)||Dg(e)||Cg(e))&&Object.keys(e).some((function(o){return n(e[o],t)})))}e.mixin({beforeCreate:function(){var e=this,o=e.$options,i=o.setup,s=o.render;s&&(o.render=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return ff(Kh(e),(function(){return s.apply(t,n)}))});if(!i)return;if(!sg(i))return;var r=o.data;o.data=function(){return function(e,o){void 0===o&&(o={});var i,s=e.$options.setup,r=function(e){var t={slots:{}},n=["emit"];return["root","parent","refs","listeners","isServer","ssrContext"].forEach((function(n){var o="$".concat(n);Wh(t,n,{get:function(){return e[o]},set:function(){}})})),hf(e,t),n.forEach((function(n){var o="$".concat(n);Wh(t,n,{get:function(){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];e[o].apply(e,t)}}})})),t}(e),a=Kh(e);if(a.setupContext=r,Jh(o,"__ob__",Pg()),gf(e,r.slots),ff(a,(function(){i=s(o,r)})),!i)return;if(sg(i)){var c=i;return void(e.$options.render=function(){return gf(e,r.slots),ff(a,(function(){return c()}))})}if(og(i)){Lg(i)&&(i=Sg(i)),lf.set(e,"rawBindings",i);var u=i;Object.keys(u).forEach((function(o){var i=u[o];if(!Cg(i))if(Lg(i))Zh(i)&&(i=Mg(i));else if(sg(i)){var s=i;i=i.bind(e),Object.keys(s).forEach((function(e){i[e]=s[e]}))}else og(i)?n(i)&&t(i):i=Mg(i);!function(e,t,n){var o=e.$options.props;t in e||o&&Xh(o,t)||(Cg(n)?Wh(e,t,{get:function(){return n.value},set:function(e){n.value=e}}):Wh(e,t,{get:function(){return Lg(n)&&n.__ob__.dep.depend(),n},set:function(e){n=e}}))}(e,o,i)}))}}(e,e.$props),sg(r)?r.call(e,e):r||{}}},mounted:function(){df(this)},beforeUpdate:function(){hf(this)},updated:function(){df(this)}})}function _f(e,t){if(!e)return t;if(!t)return e;for(var n,o,i,s=zh?Reflect.ownKeys(e):Object.keys(e),r=0;r<s.length;r++)"__ob__"!==(n=s[r])&&(o=t[n],i=e[n],Xh(t,n)?o!==i&&ig(o)&&!Cg(o)&&ig(i)&&!Cg(i)&&_f(i,o):t[n]=i);return t}function vf(e){(function(e){return xh&&Xh(e,Gh)})(e)||(e.config.optionMergeStrategies.setup=function(e,t){return function(n,o){return _f(sg(e)?e(n,o)||{}:void 0,sg(t)?t(n,o)||{}:void 0)}},function(e){xh=e,Object.defineProperty(e,Gh,{configurable:!0,writable:!0,value:!0})}(e),mf(e))}var yf={install:function(e){return vf(e)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(yf);const If=Object.freeze(Object.defineProperty({__proto__:null,EffectScope:Oh,computed:function(e){var t,n,o,i,s=bh();if(sg(e)?t=e:(t=e.get,n=e.set),s&&!s.$isServer){var r,a=function(){if(!Qh){var e=ag(Bh(),{computed:{value:function(){return 0}}}),t=e._computedWatchers.value.constructor,n=e._data.__ob__.dep.constructor;Qh={Watcher:t,Dep:n},e.$destroy()}return Qh}(),c=a.Watcher,u=a.Dep;i=function(){return r||(r=new c(s,t,Yh,{lazy:!0})),r.dirty&&r.evaluate(),u.target&&r.depend(),r.value},o=function(e){n&&n(e)}}else{var l=ag(Bh(),{computed:{$$state:{get:t,set:n}}});s&&s.$on("hook:destroyed",(function(){return l.$destroy()})),i=function(){return l.$$state},o=function(e){l.$$state=e}}return Ig({get:i,set:o},!n,!0)},createApp:function(e,t){void 0===t&&(t=void 0);var n=Bh(),o=void 0,i={},s={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(e,t){return i[e]=t,this},directive:function(e,t){return t?(n.directive(e,t),s):n.directive(e)},mount:function(s,r){return o||((o=new n(Sh(Sh({propsData:t},e),{provide:Sh(Sh({},i),e.provide)}))).$mount(s,r),o)},unmount:function(){o&&(o.$destroy(),o=void 0)}};return s},createRef:Ig,customRef:function(e){var t=Mg(0);return Ig(e((function(){t.value}),(function(){++t.value})))},default:yf,defineAsyncComponent:function(e){sg(e)&&(e={loader:e});var t=e.loader,n=e.loadingComponent,o=e.errorComponent,i=e.delay,s=void 0===i?200:i,r=e.timeout;e.suspensible;var a=e.onError,c=null,u=0,l=function(){var e;return c||(e=c=t().catch((function(e){if(e=e instanceof Error?e:new Error(String(e)),a)return new Promise((function(t,n){a(e,(function(){return t((u++,c=null,l()))}),(function(){return n(e)}),u+1)}));throw e})).then((function(t){return e!==c&&c?c:(t&&(t.__esModule||"Module"===t[Symbol.toStringTag])&&(t=t.default),t)})))};return function(){return{component:l(),delay:s,timeout:r,error:o,loading:n}}},defineComponent:function(e){return e},del:function(e,t){if(Bh().util.warn,Zh(e)&&ng(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||Xh(e,t)&&(delete e[t],n&&n.dep.notify())}},effectScope:function(e){return new Oh(e)},getCurrentInstance:jh,getCurrentScope:Ah,h:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=(null==this?void 0:this.proxy)||(null===(e=jh())||void 0===e?void 0:e.proxy);return o?o.$createElement.apply(o,t):(cf||(cf=ag(Bh()).$createElement),cf.apply(cf,t))},inject:function(e,t,n){var o;void 0===n&&(n=!1);var i=null===(o=jh())||void 0===o?void 0:o.proxy;if(i){if(!e)return t;var s=function(e,t){for(var n=t;n;){if(n._provided&&Xh(n._provided,e))return n._provided[e];n=n.$parent}return of}(e,i);return s!==of?s:arguments.length>1?n&&sg(t)?t():t:void 0}},isRaw:Dg,isReactive:Lg,isReadonly:function(e){return fg.has(e)},isRef:Cg,markRaw:function(e){if(!ig(e)&&!Zh(e)||!Object.isExtensible(e))return e;var t=Pg();return t[kg]=!0,Jh(e,"__ob__",t),gg.set(e,!0),e},nextTick:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return null===(e=Bh())||void 0===e?void 0:e.nextTick.apply(this,t)},onActivated:Kg,onBeforeMount:Gg,onBeforeUnmount:Vg,onBeforeUpdate:Bg,onDeactivated:$g,onErrorCaptured:Hg,onMounted:Fg,onScopeDispose:function(e){Th&&Th.cleanups.push(e)},onServerPrefetch:zg,onUnmounted:jg,onUpdated:qg,provide:function(e,t){var n,o=null===(n=rg())||void 0===n?void 0:n.proxy;if(o){if(!o._provided){var i={};Wh(o,"_provided",{get:function(){return i},set:function(e){return Object.assign(i,e)}})}o._provided[e]=t}},proxyRefs:function(e){var t,n,o;if(Lg(e))return e;var i=xg(((t={})[dg]=e,t));Jh(i,dg,i[dg],!1);var s=function(e){Wh(i,e,{get:function(){return Cg(i[dg][e])?i[dg][e].value:i[dg][e]},set:function(t){if(Cg(i[dg][e]))return i[dg][e].value=Tg(t);i[dg][e]=Tg(t)}})};try{for(var r=Eh(Object.keys(e)),a=r.next();!a.done;a=r.next()){s(a.value)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(o=r.return)&&o.call(r)}finally{if(n)throw n.error}}return i},reactive:xg,readonly:function(e){return fg.set(e,!0),e},ref:Mg,set:mg,shallowReactive:Ng,shallowReadonly:function(e){var t,n;if(!og(e))return e;if(!ig(e)&&!Zh(e)||!Object.isExtensible(e)&&!Cg(e))return e;var o=Cg(e)?new yg({}):Lg(e)?Ag({}):{},i=xg({}).__ob__,s=function(t){var n,s=e[t],r=Object.getOwnPropertyDescriptor(e,t);if(r){if(!1===r.configurable&&!Cg(e))return"continue";n=r.get}Wh(o,t,{get:function(){var t=n?n.call(e):s;return i.dep.depend(),t},set:function(e){}})};try{for(var r=Eh(Object.keys(e)),a=r.next();!a.done;a=r.next()){s(a.value)}}catch(c){t={error:c}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return fg.set(o,!0),o},shallowRef:function(e){var t;if(Cg(e))return e;var n=Ng(((t={})[dg]=e,t));return Ig({get:function(){return n[dg]},set:function(e){return n[dg]=e}})},toRaw:function(e){var t;return Dg(e)||!Object.isExtensible(e)?e:(null===(t=null==e?void 0:e.__ob__)||void 0===t?void 0:t.value)||e},toRef:Eg,toRefs:Sg,triggerRef:function(e){Cg(e)&&(vg(!0),e.value=e.value,vg(!1))},unref:Tg,useAttrs:function(){return uf().attrs},useCSSModule:af,useCssModule:rf,useSlots:function(){return uf().slots},version:"1.7.2",warn:function(e){var t,n,o,i;n=e,o=null===(t=jh())||void 0===t?void 0:t.proxy,(i=qh())&&i.util?i.util.warn(n,o):console.warn("[vue-composition-api] ".concat(n))},watch:function(e,t,n){var o=null;sg(t)?o=t:(n=t,o=null);var i=function(e){return Sh({immediate:!1,deep:!1,flush:"pre"},e)}(n);return ef(Jg(),e,o,i)},watchEffect:tf,watchPostEffect:function(e){return tf(e,{flush:"post"})},watchSyncEffect:function(e){return tf(e,{flush:"sync"})}},Symbol.toStringTag,{value:"Module"}));function Mf(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Cf={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const Tf=/[&<>"']/,Sf=/[&<>"']/g,Ef=/[<>"']|&(?!#?\w+;)/,kf=/[<>"']|&(?!#?\w+;)/g,Df={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Lf=e=>Df[e];function Rf(e,t){if(t){if(Tf.test(e))return e.replace(Sf,Lf)}else if(Ef.test(e))return e.replace(kf,Lf);return e}const Of=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Af(e){return e.replace(Of,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const bf=/(^|[^\[])\^/g;function Pf(e,t){e=e.source||e,t=t||"";const n={replace:(t,o)=>(o=(o=o.source||o).replace(bf,"$1"),e=e.replace(t,o),n),getRegex:()=>new RegExp(e,t)};return n}const Nf=/[^\w:]/g,xf=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function wf(e,t,n){if(e){let e;try{e=decodeURIComponent(Af(n)).replace(Nf,"").toLowerCase()}catch(yl){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!xf.test(n)&&(n=function(e,t){Uf[" "+e]||(Gf.test(e)?Uf[" "+e]=e+"/":Uf[" "+e]=Hf(e,"/",!0));e=Uf[" "+e];const n=-1===e.indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(Ff,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(Bf,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(yl){return null}return n}const Uf={},Gf=/^[^:]+:\/*[^/]*$/,Ff=/^([^:]+:)[\s\S]*$/,Bf=/^([^:]+:\/*[^/]*)[\s\S]*$/;const qf={exec:function(){}};function Vf(e){let t,n,o=1;for(;o<arguments.length;o++)for(n in t=arguments[o],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function jf(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let o=!1,i=t;for(;--i>=0&&"\\"===n[i];)o=!o;return o?"|":" |"})).split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function Hf(e,t,n){const o=e.length;if(0===o)return"";let i=0;for(;i<o;){const s=e.charAt(o-i-1);if(s!==t||n){if(s===t||!n)break;i++}else i++}return e.substr(0,o-i)}function Kf(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function $f(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function zf(e,t,n,o){const i=t.href,s=t.title?Rf(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){o.state.inLink=!0;const e={type:"link",raw:n,href:i,title:s,text:r,tokens:o.inlineTokens(r,[])};return o.state.inLink=!1,e}return{type:"image",raw:n,href:i,title:s,text:Rf(r)}}class Yf{constructor(e){this.options=e||Cf}space(e){const t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Hf(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const o=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=o.length?e.slice(o.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=Hf(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,o,i,s,r,a,c,u,l,p,d=t[1].trim();const h=d.length>1,g={type:"list",raw:"",ordered:h,start:h?+d.slice(0,-1):"",loose:!1,items:[]};d=h?`\\d{1,9}\\${d.slice(-1)}`:`\\${d}`,this.options.pedantic&&(d=h?d:"[*+-]");const f=new RegExp(`^( {0,3}${d})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`);for(;e&&!this.rules.block.hr.test(e)&&(t=f.exec(e));){l=t[2].split("\n"),this.options.pedantic?(s=2,p=l[0].trimLeft()):(s=t[2].search(/[^ ]/),s=t[1].length+(s>4?1:s),p=l[0].slice(s-t[1].length)),a=!1,n=t[0],!l[0]&&/^ *$/.test(l[1])&&(n=t[1]+l.slice(0,2).join("\n")+"\n",g.loose=!0,l=[]);const d=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(r=1;r<l.length;r++){if(u=l[r],this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),d.test(u)){n=t[1]+l.slice(0,r).join("\n")+"\n";break}if(a){if(!(u.search(/[^ ]/)>=s)&&u.trim()){n=t[1]+l.slice(0,r).join("\n")+"\n";break}p+="\n"+u.slice(s)}else u.trim()||(a=!0),u.search(/[^ ]/)>=s?p+="\n"+u.slice(s):p+="\n"+u}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(p),o&&(i="[ ] "!==o[0],p=p.replace(/^\[[ xX]\] +/,""))),g.items.push({type:"list_item",raw:n,task:!!o,checked:i,loose:!1,text:p}),g.raw+=n,e=e.slice(n.length)}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=p.trimRight(),g.raw=g.raw.trimRight();const m=g.items.length;for(r=0;r<m;r++)this.lexer.state.top=!1,g.items[r].tokens=this.lexer.blockTokens(g.items[r].text,[]),g.items[r].tokens.some((e=>"space"===e.type))&&(g.loose=!0,g.items[r].loose=!0);return g}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):Rf(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));return{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:jf(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,o,i,s,r=e.align.length;for(n=0;n<r;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(r=e.rows.length,n=0;n<r;n++)e.rows[n]=jf(e.rows[n],e.header.length).map((e=>({text:e})));for(r=e.header.length,o=0;o<r;o++)e.header[o].tokens=[],this.lexer.inlineTokens(e.header[o].text,e.header[o].tokens);for(r=e.rows.length,o=0;o<r;o++)for(s=e.rows[o],i=0;i<s.length;i++)s[i].tokens=[],this.lexer.inlineTokens(s[i].text,s[i].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Rf(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Rf(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=Hf(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let o=0,i=0;for(;i<n;i++)if("\\"===e[i])i++;else if(e[i]===t[0])o++;else if(e[i]===t[1]&&(o--,o<0))return i;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),zf(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return zf(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let o=this.rules.inline.emStrong.lDelim.exec(e);if(!o)return;if(o[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=o[1]||o[2]||"";if(!i||i&&(""===n||this.rules.inline.punctuation.exec(n))){const n=o[0].length-1;let i,s,r=n,a=0;const c="*"===o[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);null!=(o=c.exec(t));){if(i=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!i)continue;if(s=i.length,o[3]||o[4]){r+=s;continue}if((o[5]||o[6])&&n%3&&!((n+s)%3)){a+=s;continue}if(r-=s,r>0)continue;if(s=Math.min(s,s+r+a),Math.min(n,s)%2){const t=e.slice(1,n+o.index+s);return{type:"em",raw:e.slice(0,n+o.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+o.index+s-1);return{type:"strong",raw:e.slice(0,n+o.index+s+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),o=/^ /.test(e)&&/ $/.test(e);return n&&o&&(e=e.substring(1,e.length-1)),e=Rf(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,o;return"@"===n[2]?(e=Rf(this.options.mangle?t(n[1]):n[1]),o="mailto:"+e):(e=Rf(n[1]),o=e),{type:"link",raw:n[0],text:e,href:o,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,o;if("@"===n[2])e=Rf(this.options.mangle?t(n[0]):n[0]),o="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=Rf(n[0]),o="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:o,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Rf(n[0]):n[0]:Rf(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Wf={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:qf,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Wf.def=Pf(Wf.def).replace("label",Wf._label).replace("title",Wf._title).getRegex(),Wf.bullet=/(?:[*+-]|\d{1,9}[.)])/,Wf.listItemStart=Pf(/^( *)(bull) */).replace("bull",Wf.bullet).getRegex(),Wf.list=Pf(Wf.list).replace(/bull/g,Wf.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Wf.def.source+")").getRegex(),Wf._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wf._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Wf.html=Pf(Wf.html,"i").replace("comment",Wf._comment).replace("tag",Wf._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Wf.paragraph=Pf(Wf._paragraph).replace("hr",Wf.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wf._tag).getRegex(),Wf.blockquote=Pf(Wf.blockquote).replace("paragraph",Wf.paragraph).getRegex(),Wf.normal=Vf({},Wf),Wf.gfm=Vf({},Wf.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Wf.gfm.table=Pf(Wf.gfm.table).replace("hr",Wf.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wf._tag).getRegex(),Wf.pedantic=Vf({},Wf.normal,{html:Pf("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Wf._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qf,paragraph:Pf(Wf.normal._paragraph).replace("hr",Wf.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Wf.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const Jf={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:qf,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:qf,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function Xf(e){return e.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Zf(e){let t,n,o="";const i=e.length;for(t=0;t<i;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),o+="&#"+n+";";return o}Jf._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Jf.punctuation=Pf(Jf.punctuation).replace(/punctuation/g,Jf._punctuation).getRegex(),Jf.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Jf.escapedEmSt=/\\\*|\\_/g,Jf._comment=Pf(Wf._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Jf.emStrong.lDelim=Pf(Jf.emStrong.lDelim).replace(/punct/g,Jf._punctuation).getRegex(),Jf.emStrong.rDelimAst=Pf(Jf.emStrong.rDelimAst,"g").replace(/punct/g,Jf._punctuation).getRegex(),Jf.emStrong.rDelimUnd=Pf(Jf.emStrong.rDelimUnd,"g").replace(/punct/g,Jf._punctuation).getRegex(),Jf._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Jf._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Jf._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Jf.autolink=Pf(Jf.autolink).replace("scheme",Jf._scheme).replace("email",Jf._email).getRegex(),Jf._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Jf.tag=Pf(Jf.tag).replace("comment",Jf._comment).replace("attribute",Jf._attribute).getRegex(),Jf._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Jf._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Jf._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Jf.link=Pf(Jf.link).replace("label",Jf._label).replace("href",Jf._href).replace("title",Jf._title).getRegex(),Jf.reflink=Pf(Jf.reflink).replace("label",Jf._label).getRegex(),Jf.reflinkSearch=Pf(Jf.reflinkSearch,"g").replace("reflink",Jf.reflink).replace("nolink",Jf.nolink).getRegex(),Jf.normal=Vf({},Jf),Jf.pedantic=Vf({},Jf.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Pf(/^!?\[(label)\]\((.*?)\)/).replace("label",Jf._label).getRegex(),reflink:Pf(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jf._label).getRegex()}),Jf.gfm=Vf({},Jf.normal,{escape:Pf(Jf.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Jf.gfm.url=Pf(Jf.gfm.url,"i").replace("email",Jf.gfm._extended_email).getRegex(),Jf.breaks=Vf({},Jf.gfm,{br:Pf(Jf.br).replace("{2,}","*").getRegex(),text:Pf(Jf.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class Qf{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Cf,this.options.tokenizer=this.options.tokenizer||new Yf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Wf.normal,inline:Jf.normal};this.options.pedantic?(t.block=Wf.pedantic,t.inline=Jf.pedantic):this.options.gfm&&(t.block=Wf.gfm,this.options.breaks?t.inline=Jf.breaks:t.inline=Jf.gfm),this.tokenizer.rules=t}static get rules(){return{block:Wf,inline:Jf}}static lex(e,t){return new Qf(t).lex(e)}static lexInline(e,t){return new Qf(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,o,i,s;for(this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((o=>!!(n=o.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.type&&t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?t.push(n):(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),o=t[t.length-1],!o||"paragraph"!==o.type&&"text"!==o.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(o.raw+="\n"+n.raw,o.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startBlock.forEach((function(e){o=e.call({lexer:this},n),"number"==typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i)))o=t[t.length-1],s&&"paragraph"===o.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n),s=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===o.type?(o.raw+="\n"+n.raw,o.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,o,i,s,r,a,c=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(c));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,s.index)+"["+$f("a",s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,s.index)+"["+$f("a",s[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,s.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(r||(a=""),r=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((o=>!!(n=o.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===n.type&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),o=t[t.length-1],o&&"text"===n.type&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,c,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,Zf))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,Zf))){if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let o;this.options.extensions.startInline.forEach((function(e){o=e.call({lexer:this},n),"number"==typeof o&&o>=0&&(t=Math.min(t,o))})),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i,Xf))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),r=!0,o=t[t.length-1],o&&"text"===o.type?(o.raw+=n.raw,o.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class em{constructor(e){this.options=e||Cf}code(e,t,n){const o=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,o);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",o?'<pre><code class="'+this.options.langPrefix+Rf(o,!0)+'">'+(n?e:Rf(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:Rf(e,!0))+"</code></pre>\n"}blockquote(e){return"<blockquote>\n"+e+"</blockquote>\n"}html(e){return e}heading(e,t,n,o){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+o.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+o+">\n"}listitem(e){return"<li>"+e+"</li>\n"}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){const n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,n){if(null===(e=wf(this.options.sanitize,this.options.baseUrl,e)))return n;let o='<a href="'+Rf(e)+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){if(null===(e=wf(this.options.sanitize,this.options.baseUrl,e)))return n;let o='<img src="'+e+'" alt="'+n+'"';return t&&(o+=' title="'+t+'"'),o+=this.options.xhtml?"/>":">",o}text(e){return e}}class tm{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class nm{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,o=0;if(this.seen.hasOwnProperty(n)){o=this.seen[e];do{o++,n=e+"-"+o}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=o,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class om{constructor(e){this.options=e||Cf,this.options.renderer=this.options.renderer||new em,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tm,this.slugger=new nm}static parse(e,t){return new om(t).parse(e)}static parseInline(e,t){return new om(t).parseInline(e)}parse(e,t=!0){let n,o,i,s,r,a,c,u,l,p,d,h,g,f,m,_,v,y,I,M="";const C=e.length;for(n=0;n<C;n++)if(p=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(I=this.options.extensions.renderers[p.type].call({parser:this},p),!1!==I||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)))M+=I||"";else switch(p.type){case"space":continue;case"hr":M+=this.renderer.hr();continue;case"heading":M+=this.renderer.heading(this.parseInline(p.tokens),p.depth,Af(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":M+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(u="",c="",s=p.header.length,o=0;o<s;o++)c+=this.renderer.tablecell(this.parseInline(p.header[o].tokens),{header:!0,align:p.align[o]});for(u+=this.renderer.tablerow(c),l="",s=p.rows.length,o=0;o<s;o++){for(a=p.rows[o],c="",r=a.length,i=0;i<r;i++)c+=this.renderer.tablecell(this.parseInline(a[i].tokens),{header:!1,align:p.align[i]});l+=this.renderer.tablerow(c)}M+=this.renderer.table(u,l);continue;case"blockquote":l=this.parse(p.tokens),M+=this.renderer.blockquote(l);continue;case"list":for(d=p.ordered,h=p.start,g=p.loose,s=p.items.length,l="",o=0;o<s;o++)m=p.items[o],_=m.checked,v=m.task,f="",m.task&&(y=this.renderer.checkbox(_),g?m.tokens.length>0&&"paragraph"===m.tokens[0].type?(m.tokens[0].text=y+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=y+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:y}):f+=y),f+=this.parse(m.tokens,g),l+=this.renderer.listitem(f,v,_);M+=this.renderer.list(l,d,h);continue;case"html":M+=this.renderer.html(p.text);continue;case"paragraph":M+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(l=p.tokens?this.parseInline(p.tokens):p.text;n+1<C&&"text"===e[n+1].type;)p=e[++n],l+="\n"+(p.tokens?this.parseInline(p.tokens):p.text);M+=t?this.renderer.paragraph(l):l;continue;default:{const e='Token with "'+p.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return M}parseInline(e,t){t=t||this.renderer;let n,o,i,s="";const r=e.length;for(n=0;n<r;n++)if(o=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(i=this.options.extensions.renderers[o.type].call({parser:this},o),!1!==i||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)))s+=i||"";else switch(o.type){case"escape":case"text":s+=t.text(o.text);break;case"html":s+=t.html(o.text);break;case"link":s+=t.link(o.href,o.title,this.parseInline(o.tokens,t));break;case"image":s+=t.image(o.href,o.title,o.text);break;case"strong":s+=t.strong(this.parseInline(o.tokens,t));break;case"em":s+=t.em(this.parseInline(o.tokens,t));break;case"codespan":s+=t.codespan(o.text);break;case"br":s+=t.br();break;case"del":s+=t.del(this.parseInline(o.tokens,t));break;default:{const e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return s}}function im(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),Kf(t=Vf({},im.defaults,t||{})),n){const o=t.highlight;let i;try{i=Qf.lex(e,t)}catch(yl){return n(yl)}const s=function(e){let s;if(!e)try{t.walkTokens&&im.walkTokens(i,t.walkTokens),s=om.parse(i,t)}catch(yl){e=yl}return t.highlight=o,e?n(e):n(null,s)};if(!o||o.length<3)return s();if(delete t.highlight,!i.length)return s();let r=0;return im.walkTokens(i,(function(e){"code"===e.type&&(r++,setTimeout((()=>{o(e.text,e.lang,(function(t,n){if(t)return s(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),r--,0===r&&s()}))}),0))})),void(0===r&&s())}try{const n=Qf.lex(e,t);return t.walkTokens&&im.walkTokens(n,t.walkTokens),om.parse(n,t)}catch(yl){if(yl.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+Rf(yl.message+"",!0)+"</pre>";throw yl}}im.options=im.setOptions=function(e){var t;return Vf(im.defaults,e),t=im.defaults,Cf=t,im},im.getDefaults=Mf,im.defaults=Cf,im.use=function(...e){const t=Vf({},...e),n=im.defaults.extensions||{renderers:{},childTokens:{}};let o;e.forEach((e=>{if(e.extensions&&(o=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let o=e.renderer.apply(this,n);return!1===o&&(o=t.apply(this,n)),o}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=im.defaults.renderer||new em;for(const t in e.renderer){const o=n[t];n[t]=(...i)=>{let s=e.renderer[t].apply(n,i);return!1===s&&(s=o.apply(n,i)),s}}t.renderer=n}if(e.tokenizer){const n=im.defaults.tokenizer||new Yf;for(const t in e.tokenizer){const o=n[t];n[t]=(...i)=>{let s=e.tokenizer[t].apply(n,i);return!1===s&&(s=o.apply(n,i)),s}}t.tokenizer=n}if(e.walkTokens){const n=im.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}o&&(t.extensions=n),im.setOptions(t)}))},im.walkTokens=function(e,t){for(const n of e)switch(t.call(im,n),n.type){case"table":for(const e of n.header)im.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)im.walkTokens(n.tokens,t);break;case"list":im.walkTokens(n.items,t);break;default:im.defaults.extensions&&im.defaults.extensions.childTokens&&im.defaults.extensions.childTokens[n.type]?im.defaults.extensions.childTokens[n.type].forEach((function(e){im.walkTokens(n[e],t)})):n.tokens&&im.walkTokens(n.tokens,t)}},im.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");Kf(t=Vf({},im.defaults,t||{}));try{const n=Qf.lexInline(e,t);return t.walkTokens&&im.walkTokens(n,t.walkTokens),om.parseInline(n,t)}catch(yl){if(yl.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+Rf(yl.message+"",!0)+"</pre>";throw yl}},im.Parser=om,im.parser=om.parse,im.Renderer=em,im.TextRenderer=tm,im.Lexer=Qf,im.lexer=Qf.lex,im.Tokenizer=Yf,im.Slugger=nm,im.parse=im,im.options,im.setOptions,im.use,im.walkTokens,im.parseInline,om.parse,Qf.lex,exports.A=sl,exports.A$1=function(e){return function(e){const t=/(?:https?:\/\/|mailto:|www\.)(?:localhost(?::\d{1,5})?|[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b)(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi,n=[],o=e.split(t),i=e.match(t)||[];let s=0;return o.forEach((e=>{if(e&&n.push({type:"text",text:e}),i[s]){const e=i[s];let t=e;e.toLowerCase().startsWith("www.")&&(t="https://"+e),n.push({type:"url",text:e,url:t}),s++}})),n}(e).map((e=>{if("url"===e.type){const t=function(t,n={}){const{maxLength:o=2083,allowedProtocols:i=["http:","https:","mailto:"],allowCredentials:s=!1,allowDataUrl:r=!1}=n;if(!t||"string"!=typeof t)return"about:blank";if(t.length>o)return"about:blank";try{let n=t.replace(/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/g,"");n=n.normalize("NFKC"),n=n.replace(/\s+/g," ").trim();let o=n;const a=new Set;let c=0;for(;c<5;)try{const e=decodeURIComponent(o);if(a.has(e))break;a.add(e),o=e,c++}catch(e){break}const u=function(){const e=[],t=Object.keys(rh);for(let n=0;n<t.length;n++){const o=rh[t[n]];for(let t=0;t<o.length;t++)e.push(o[t])}return e}();for(const e of a){const t=e.toLowerCase();for(let e=0;e<u.length;e++)if(-1!==t.indexOf(u[e]))return"about:blank"}const l=function(e){const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/);if(!t)throw new Error("Invalid URL");const n=(t[4]||"").split("@"),o=n[n.length-1];let i="",s="";if(n.length>1){const e=n[0].split(":");i=e[0]||"",s=e[1]||""}const r=o.split(":"),a=r[0],c=r[1]||"";return{href:e,protocol:(t[1]||"").toLowerCase(),host:o,hostname:a,port:c,pathname:t[5]||"",search:t[6]||"",hash:t[8]||"",username:i,password:s}}(n),p=l.protocol.replace(":","").toLowerCase()+":";let d=!1;for(let e=0;e<i.length;e++)if(i[e]===p){d=!0;break}if(!d)return"about:blank";if(!s&&(l.username||l.password))return"about:blank";if(!r&&"data:"===p)return"about:blank";if(!/^[\w\-.]+(:\d+)?$/.test(l.host))return"about:blank";const h=l.pathname+l.search+l.hash;return/^[\w\-./=?#&%+@,:()[\]]+$/.test(h)?n:"about:blank"}catch(e){return"about:blank"}}(e.url);return"about:blank"===t?{type:"text",text:e.text}:Object.assign(Object.assign({},e),{url:t})}return e}))},exports.COS=al,exports.E=Vu,exports.EMPTY_OBJ=t,exports.EffectScope=qn,exports.Fragment=Ur,exports.Jt=Pd,exports.O=ah,exports.P=function(e,t){if(!e)return Promise.reject(new Error(`getScrollInfo get error selector ${typeof e}.`));if(!Hd&&window){const t="object"==typeof e?e:document.querySelector(e);return t?Promise.resolve({id:t.id,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft,scrollWidth:t.scrollWidth,scrollHeight:t.scrollHeight}):Promise.reject(new Error(`getScrollInfo can't find ${e} dom.`))}if(Hd){if(!t)return Promise.reject(new Error("getScrollInfo need instanceName in params."));const n=Gn.createSelectorQuery().in(ih.get(t));return new Promise(((t,o)=>{n.select(e).scrollOffset((e=>{e&&t(e)})).exec(),setTimeout((()=>o(new Error(`getScrollInfo ${e} timeout.`))),500)}))}return Promise.reject(new Error("getScrollInfo occur error"))},exports.Pinia=Ou,exports.Qt=Ud,exports.R=il,exports.ReactiveEffect=$n,exports.T=function(e,t){if(!e)return Promise.reject(new Error(`getBoundingClientRect get error selector ${typeof e}.`));if(window||document){const t="object"==typeof e?e:document.querySelector(e);if(!t)return Promise.reject(new Error(`getBoundingClientRect can't find ${e} dom.`));const n=t.getBoundingClientRect();return Promise.resolve({id:t.id,top:n.top,left:n.left,right:n.right,bottom:n.bottom,width:n.width,height:n.height,x:n.x,y:n.y})}if(Hd){if(!t)return Promise.reject(new Error("getBoundingClientRect need instanceName in params."));const n=Gn.createSelectorQuery().in(ih.get(t));return new Promise(((t,o)=>{n.select(e).boundingClientRect((e=>{e&&t(e)})).exec(),setTimeout((()=>o(new Error(`getBoundingClientRect ${e} timeout.`))),500)}))}return Promise.reject(new Error("getBoundingClientRect occur error"))},exports.Text=Gr,exports.VueApi=If,exports.Wt=Nd,exports.Xt=xd,exports.Zt=wd,exports._Vue=Cc,exports._export_sfc=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},exports.c=lc,exports.callWithAsyncErrorHandling=Ni,exports.callWithErrorHandling=Pi,exports.camelize=k,exports.computed=ta,exports.createApp=Ic,exports.createPinia=_u,exports.createPropsRestProxy=gr,exports.createSSRApp=Mc,exports.createVNode=Na,exports.createVueApp=Oa,exports.customRef=Di,exports.d=rc,exports.dayjs=fh,exports.dayjs_minExports=gh,exports.defineAsyncComponent=ra,exports.defineComponent=ws,exports.defineEmits=sr,exports.defineExpose=rr,exports.defineProps=ir,exports.defineStore=ku,exports.devtoolsComponentAdded=ns,exports.devtoolsComponentRemoved=is,exports.devtoolsComponentUpdated=os,exports.diff=ua,exports.e=pc,exports.effect=Jn,exports.effectScope=Vn,exports.es=Gd,exports.f=sc,exports.f$1=Qd,exports.findComponentPropsData=Ya,exports.g=function(){let e="";return nh?e="pc":th?e="h5":eh?e="wechat":oh&&(e="app"),e},exports.gei=yc,exports.getCurrentInstance=Kr,exports.getCurrentScope=Hn,exports.getExposeProxy=ea,exports.guardReactiveProps=Fr,exports.h=dc,exports.hasInjectionContext=xs,exports.hasQueueJob=Wi,exports.i=$d,exports.index=Gn,exports.initVueI18n=function(e,t={},n,o){if("string"!=typeof e){const n=[t,e];e=n[0],t=n[1]}"string"!=typeof e&&(e=void 0!==Gn&&Gn.getLocale?Gn.getLocale():"undefined"!=typeof global&&global.getLocale?global.getLocale():Be),"string"!=typeof n&&(n="undefined"!=typeof __uniConfig&&__uniConfig.fallbackLocale||Be);const i=new Ke({locale:e,fallbackLocale:n,messages:t,watcher:o});let s=(e,t)=>{if("function"!=typeof getApp)s=function(e,t){return i.t(e,t)};else{let e=!1;s=function(t,n){const o=getApp().$vm;return o&&(o.$locale,e||(e=!0,function(e,t){e.$watchLocale?e.$watchLocale((e=>{t.setLocale(e)})):e.$watch((()=>e.$locale),(e=>{t.setLocale(e)}))}(o,i))),i.t(t,n)}}return s(e,t)};return{i18n:i,f:(e,t,n)=>i.f(e,t,n),t:(e,t)=>s(e,t),add:(e,t,n=!0)=>i.add(e,t,n),watch:e=>i.watchLocale(e),getLocale:()=>i.getLocale(),setLocale:e=>i.setLocale(e)}},exports.inject=Ns,exports.injectHook=qs,exports.invalidateJob=Ji,exports.isProxy=ci,exports.isReactive=si,exports.isReadonly=ri,exports.isRef=mi,exports.isSameOrAfter=yh,exports.isSameOrBefore=Mh,exports.isShallow=ai,exports.j=vc,exports.k=function(e){const{element:t,onLongPress:n,options:o={}}=e;if(!t||!n)throw new Error("addLongPressEventListener missing arguments");const{duration:i=800,eventDelegation:s}=o;let r;function a(){clearTimeout(r),u()}function c(){clearTimeout(r),u()}function u(){t.removeEventListener("pointerup",a),t.removeEventListener("pointermove",c)}t.addEventListener("pointerdown",(e=>{const o=e.target,u=(null==s?void 0:s.subSelector)?o.closest(s.subSelector)||void 0:o,l=e.currentTarget;r=setTimeout((()=>n(e,u,l)),i),t.addEventListener("pointerup",a),t.addEventListener("pointermove",c)}))},exports.localeData=_h,exports.logError=wi,exports.m=_c,exports.markRaw=li,exports.marked=im,exports.mergeDefaults=dr,exports.mergeModels=hr,exports.mergeProps=Br,exports.n=hc,exports.nextTick$1=$i,exports.normalizeClass=B,exports.normalizeProps=q,exports.normalizeStyle=x,exports.o$1=ic,exports.onActivated=Us,exports.onBeforeMount=js,exports.onBeforeUnmount=zs,exports.onBeforeUpdate=Ks,exports.onDeactivated=Gs,exports.onErrorCaptured=Zs,exports.onHide=uh,exports.onLoad=lh,exports.onMounted=Hs,exports.onReady=ph,exports.onRenderTracked=Xs,exports.onRenderTriggered=Js,exports.onScopeDispose=Kn,exports.onServerPrefetch=Ws,exports.onUnload=dh,exports.onUnmounted=Ys,exports.onUpdated=$s,exports.p=fc,exports.patch=_a,exports.provide=Ps,exports.proxyRefs=Ei,exports.pruneComponentPropsCache=za,exports.qt=bd,exports.queuePostFlushCb=Xi,exports.r=ac,exports.reactive=ei,exports.readonly=ni,exports.ref=_i,exports.resolveComponent=gs,exports.resolveDirective=fs,exports.resolveFilter=null,exports.s=uc,exports.setCurrentRenderingInstance=ls,exports.setTemplateRef=Ia,exports.setupDevtoolsPlugin=oc,exports.shallowReactive=ti,exports.shallowReadonly=oi,exports.shallowRef=vi,exports.sr=mc,exports.ss=Bd,exports.stop=Xn,exports.t=gc,exports.toDisplayString=V,exports.toHandlerKey=O,exports.toHandlers=Qs,exports.toRaw=ui,exports.toRef=Ai,exports.toRefs=Li,exports.toValue=Ti,exports.triggerRef=Mi,exports.ts=Fd,exports.unref=Ci,exports.updateProps=Lr,exports.useAttrs=ur,exports.useCssModule=Aa,exports.useCssVars=ba,exports.useModel=na,exports.useSSRContext=ys,exports.useSlots=cr,exports.v=function(e,t){ih.set(e,t)},exports.version=oa,exports.w=cc,exports.warn=ia,exports.watch=Ss,exports.watchEffect=Is,exports.watchPostEffect=Ms,exports.watchSyncEffect=Cs,exports.withAsyncContext=fr,exports.withCtx=ds,exports.withDefaults=ar,exports.withDirectives=Rs,exports.withModifiers=Pa,exports.withScopeId=ps,exports.wx$1=Un;