16 lines
218 KiB
JavaScript
16 lines
218 KiB
JavaScript
import{ap as e,a5 as t,j as n,a7 as i,b6 as s,b5 as r,a6 as o,o as a,a as c,u,c as l,N as g,E as h,f as p}from"./index-CH9-aFWw.js";import"./adapter-vue.FAvEd_HK.js";import{h as d,i as f}from"./index.DzsMB11z.js";import{_ as v}from"./_plugin-vue_export-helper.BCo6x5W8.js";var E={exports:{}};E.exports=function(){function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(s=void 0,"symbol"==typeof(s=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(i.key,"string"))?s:String(s)),i)}var s}function i(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(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 i,s,r,o,a=[],c=!0,u=!1;try{if(r=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(i=r.call(n)).done)&&(a.push(i.value),a.length!==t);c=!0);}catch(l){u=!0,s=l}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw s}}return a}}(e,t)||o(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 r(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(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 o(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=o(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,s=function(){};return{s:s,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},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}}}}var u,l,g=function(){for(var e=" \t\r\n~!@#$%^&*()_+-=【】、{}|;':\",。、《》?αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠=≤≥<>≮≯∷±+-×÷/∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°#&@\︿_ ̄―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄",t=new Map,n=0,i=e.length;n<i;n++)t.set(e.charCodeAt(0),!0);return t}(),h=function(){function e(n){t(this,e);var i,s=n.input,o=n.isArray,a=n.isMap;this._trieTree={},o(s)?i=s:a(s)&&(i=r(s.keys()),this._map=s);for(var c=0,u=i.length;c<u;c++)if(i[c]){for(var l=this._trieTree,g=i[c],h=0,p=g.length;h<p;h++)l[g[h]]||(l[g[h]]={}),l=l[g[h]];l.isEnd=!0}}return i(e,[{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 i=this._trieTree,s=t.toLowerCase(),r="",o=!1,a=s.length,c=0;c<a;c++)if(!0!==g.get(s.charCodeAt(c))){for(var u=0,l="",h=!1,p=c;p<a;p++){if(!i[s[p]]){i=this._trieTree;break}if(l+=s[p],i[s[p]].isEnd){h=!0,u=p-c,i=this._trieTree;break}i=i[s[p]]}if(u>1&&(c+=u),h){if(o=!0,!n)break;var d=this._map.get(l)||"*";r=t.replace(new RegExp(l,"gi"),d)}}return{isMatched:o,modifiedText:r}}},{key:"reset",value:function(){this._trieTree={},this._map=null}}]),e}(),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},d={},f=(u=function(e,t){var n,i,s,r,o,a,c,u,l,g,h,f,v;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!==p&&p.crypto&&(t=p.crypto),!t)try{t=d}catch(v){}var n=function(){if(t){if("function"==typeof t.getRandomValues)try{return t.getRandomValues(new Uint32Array(1))[0]}catch(v){}if("function"==typeof t.randomBytes)try{return t.randomBytes(4).readInt32LE()}catch(v){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},r=s.lib={},o=r.Base={extend:function(e){var t=i(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=r.WordArray=o.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,i=this.sigBytes,s=e.sigBytes;if(this.clamp(),i%4)for(var r=0;r<s;r++){var o=n[r>>>2]>>>24-r%4*8&255;t[i+r>>>2]|=o<<24-(i+r)%4*8}else for(r=0;r<s;r+=4)t[i+r>>>2]=n[r>>>2];return this.sigBytes+=s,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=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(n());return new a.init(t,e)}}),c=s.enc={},u=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],s=0;s<n;s++){var r=t[s>>>2]>>>24-s%4*8&255;i.push((r>>>4).toString(16)),i.push((15&r).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new a.init(n,t/2)}},l=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],s=0;s<n;s++){var r=t[s>>>2]>>>24-s%4*8&255;i.push(String.fromCharCode(r))}return i.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new a.init(n,t)}},g=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)))}},h=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=g.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,i=this._data,s=i.words,r=i.sigBytes,o=this.blockSize,c=r/(4*o),u=(c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0))*o,l=e.min(4*u,r);if(u){for(var g=0;g<u;g+=o)this._doProcessBlock(s,g);n=s.splice(0,u),i.sigBytes-=l}return new a.init(n,l)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),f=(r.Hasher=h.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.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)}}}),s.algo={});return s}(Math),o=(r=a).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,i=this._map;e.clamp();for(var s=[],r=0;r<n;r+=3)for(var o=(t[r>>>2]>>>24-r%4*8&255)<<16|(t[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|t[r+2>>>2]>>>24-(r+2)%4*8&255,a=0;a<4&&r+.75*a<n;a++)s.push(i.charAt(o>>>6*(3-a)&63));var c=i.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var s=0;s<n.length;s++)i[n.charCodeAt(s)]=s}var r=n.charAt(64);if(r){var a=e.indexOf(r);-1!==a&&(t=a)}return function(e,t,n){for(var i=[],s=0,r=0;r<t;r++)if(r%4){var a=n[e.charCodeAt(r-1)]<<r%4*2|n[e.charCodeAt(r)]>>>6-r%4*2;i[s>>>2]|=a<<24-s%4*8,s++}return o.create(i,s)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(e){var t=a,n=t.lib,i=n.WordArray,s=n.Hasher,r=t.algo,o=[];!function(){for(var t=0;t<64;t++)o[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=r.MD5=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var i=t+n,s=e[i];e[i]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r=this._hash.words,a=e[t+0],c=e[t+1],p=e[t+2],d=e[t+3],f=e[t+4],v=e[t+5],E=e[t+6],m=e[t+7],T=e[t+8],S=e[t+9],y=e[t+10],I=e[t+11],_=e[t+12],b=e[t+13],C=e[t+14],M=e[t+15],U=r[0],O=r[1],D=r[2],P=r[3];U=u(U,O,D,P,a,7,o[0]),P=u(P,U,O,D,c,12,o[1]),D=u(D,P,U,O,p,17,o[2]),O=u(O,D,P,U,d,22,o[3]),U=u(U,O,D,P,f,7,o[4]),P=u(P,U,O,D,v,12,o[5]),D=u(D,P,U,O,E,17,o[6]),O=u(O,D,P,U,m,22,o[7]),U=u(U,O,D,P,T,7,o[8]),P=u(P,U,O,D,S,12,o[9]),D=u(D,P,U,O,y,17,o[10]),O=u(O,D,P,U,I,22,o[11]),U=u(U,O,D,P,_,7,o[12]),P=u(P,U,O,D,b,12,o[13]),D=u(D,P,U,O,C,17,o[14]),U=l(U,O=u(O,D,P,U,M,22,o[15]),D,P,c,5,o[16]),P=l(P,U,O,D,E,9,o[17]),D=l(D,P,U,O,I,14,o[18]),O=l(O,D,P,U,a,20,o[19]),U=l(U,O,D,P,v,5,o[20]),P=l(P,U,O,D,y,9,o[21]),D=l(D,P,U,O,M,14,o[22]),O=l(O,D,P,U,f,20,o[23]),U=l(U,O,D,P,S,5,o[24]),P=l(P,U,O,D,C,9,o[25]),D=l(D,P,U,O,d,14,o[26]),O=l(O,D,P,U,T,20,o[27]),U=l(U,O,D,P,b,5,o[28]),P=l(P,U,O,D,p,9,o[29]),D=l(D,P,U,O,m,14,o[30]),U=g(U,O=l(O,D,P,U,_,20,o[31]),D,P,v,4,o[32]),P=g(P,U,O,D,T,11,o[33]),D=g(D,P,U,O,I,16,o[34]),O=g(O,D,P,U,C,23,o[35]),U=g(U,O,D,P,c,4,o[36]),P=g(P,U,O,D,f,11,o[37]),D=g(D,P,U,O,m,16,o[38]),O=g(O,D,P,U,y,23,o[39]),U=g(U,O,D,P,b,4,o[40]),P=g(P,U,O,D,a,11,o[41]),D=g(D,P,U,O,d,16,o[42]),O=g(O,D,P,U,E,23,o[43]),U=g(U,O,D,P,S,4,o[44]),P=g(P,U,O,D,_,11,o[45]),D=g(D,P,U,O,M,16,o[46]),U=h(U,O=g(O,D,P,U,p,23,o[47]),D,P,a,6,o[48]),P=h(P,U,O,D,m,10,o[49]),D=h(D,P,U,O,C,15,o[50]),O=h(O,D,P,U,v,21,o[51]),U=h(U,O,D,P,_,6,o[52]),P=h(P,U,O,D,d,10,o[53]),D=h(D,P,U,O,y,15,o[54]),O=h(O,D,P,U,c,21,o[55]),U=h(U,O,D,P,T,6,o[56]),P=h(P,U,O,D,M,10,o[57]),D=h(D,P,U,O,E,15,o[58]),O=h(O,D,P,U,b,21,o[59]),U=h(U,O,D,P,f,6,o[60]),P=h(P,U,O,D,I,10,o[61]),D=h(D,P,U,O,p,15,o[62]),O=h(O,D,P,U,S,21,o[63]),r[0]=r[0]+U|0,r[1]=r[1]+O|0,r[2]=r[2]+D|0,r[3]=r[3]+P|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,s=8*t.sigBytes;n[s>>>5]|=128<<24-s%32;var r=e.floor(i/4294967296),o=i;n[15+(s+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),n[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>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=s.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,i,s,r,o){var a=e+(t&n|~t&i)+s+o;return(a<<r|a>>>32-r)+t}function l(e,t,n,i,s,r,o){var a=e+(t&i|n&~i)+s+o;return(a<<r|a>>>32-r)+t}function g(e,t,n,i,s,r,o){var a=e+(t^n^i)+s+o;return(a<<r|a>>>32-r)+t}function h(e,t,n,i,s,r,o){var a=e+(n^(t|~i))+s+o;return(a<<r|a>>>32-r)+t}t.MD5=s._createHelper(c),t.HmacMD5=s._createHmacHelper(c)}(Math),u=(c=a).lib,l=u.WordArray,g=u.Hasher,h=c.algo,f=[],v=h.SHA1=g.extend({_doReset:function(){this._hash=new l.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],s=n[1],r=n[2],o=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=(i<<5|i>>>27)+a+f[c];l+=c<20?1518500249+(s&r|~s&o):c<40?1859775393+(s^r^o):c<60?(s&r|s&o|r&o)-1894007588:(s^r^o)-899497514,a=o,o=r,r=s<<30|s>>>2,s=i,i=l}n[0]=n[0]+i|0,n[1]=n[1]+s|0,n[2]=n[2]+r|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=g.clone.call(this);return e._hash=this._hash.clone(),e}}),c.SHA1=g._createHelper(v),c.HmacSHA1=g._createHmacHelper(v),function(e){var t=a,n=t.lib,i=n.WordArray,s=n.Hasher,r=t.algo,o=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),i=2;i<=n;i++)if(!(t%i))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var i=2,s=0;s<64;)t(i)&&(s<8&&(o[s]=n(e.pow(i,.5))),c[s]=n(e.pow(i,1/3)),s++),i++}();var u=[],l=r.SHA256=s.extend({_doReset:function(){this._hash=new i.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],s=n[1],r=n[2],o=n[3],a=n[4],l=n[5],g=n[6],h=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var d=u[p-15],f=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,v=u[p-2],E=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[p]=f+u[p-7]+E+u[p-16]}var m=i&s^i&r^s&r,T=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),S=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&g)+c[p]+u[p];h=g,g=l,l=a,a=o+S|0,o=r,r=s,s=i,i=S+(T+m)|0}n[0]=n[0]+i|0,n[1]=n[1]+s|0,n[2]=n[2]+r|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0,n[5]=n[5]+l|0,n[6]=n[6]+g|0,n[7]=n[7]+h|0},_doFinalize:function(){var t=this._data,n=t.words,i=8*this._nDataBytes,s=8*t.sigBytes;return n[s>>>5]|=128<<24-s%32,n[14+(s+64>>>9<<4)]=e.floor(i/4294967296),n[15+(s+64>>>9<<4)]=i,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=s._createHelper(l),t.HmacSHA256=s._createHmacHelper(l)}(Math),function(){var e=a,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,i=[],s=0;s<n;s+=2){var r=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]|=e.charCodeAt(s)<<16-s%2*16;return t.create(i,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],r=0;r<n;r+=2){var o=i(t[r>>>2]>>>16-r%4*8&65535);s.push(String.fromCharCode(o))}return s.join("")},parse:function(e){for(var n=e.length,s=[],r=0;r<n;r++)s[r>>>1]|=i(e.charCodeAt(r)<<16-r%2*16);return t.create(s,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,i=[],s=0;s<n;s++)i[s>>>2]|=e[s]<<24-s%4*8;t.call(this,i,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,i=t.Hasher,s=e.algo,r=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]),o=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]),g=n.create([1352829926,1548603684,1836072691,2053994217,0]),h=s.RIPEMD160=i.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var i=t+n,s=e[i];e[i]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var a,h,T,S,y,I,_,b,C,M,U,O=this._hash.words,D=l.words,P=g.words,R=r.words,A=o.words,k=c.words,w=u.words;for(I=a=O[0],_=h=O[1],b=T=O[2],C=S=O[3],M=y=O[4],n=0;n<80;n+=1)U=a+e[t+R[n]]|0,U+=n<16?p(h,T,S)+D[0]:n<32?d(h,T,S)+D[1]:n<48?f(h,T,S)+D[2]:n<64?v(h,T,S)+D[3]:E(h,T,S)+D[4],U=(U=m(U|=0,k[n]))+y|0,a=y,y=S,S=m(T,10),T=h,h=U,U=I+e[t+A[n]]|0,U+=n<16?E(_,b,C)+P[0]:n<32?v(_,b,C)+P[1]:n<48?f(_,b,C)+P[2]:n<64?d(_,b,C)+P[3]:p(_,b,C)+P[4],U=(U=m(U|=0,w[n]))+M|0,I=M,M=C,C=m(b,10),b=_,_=U;U=O[1]+T+C|0,O[1]=O[2]+S+M|0,O[2]=O[3]+y+I|0,O[3]=O[4]+a+_|0,O[4]=O[0]+h+b|0,O[0]=U},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var s=this._hash,r=s.words,o=0;o<5;o++){var a=r[o];r[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return s},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,n){return e^t^n}function d(e,t,n){return e&t|~e&n}function f(e,t,n){return(e|~t)^n}function v(e,t,n){return e&n|t&~n}function E(e,t,n){return e^(t|~n)}function m(e,t){return e<<t|e>>>32-t}e.RIPEMD160=i._createHelper(h),e.HmacRIPEMD160=i._createHmacHelper(h)}(),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 i=e.blockSize,s=4*i;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var r=this._oKey=t.clone(),o=this._iKey=t.clone(),a=r.words,c=o.words,u=0;u<i;u++)a[u]^=1549556828,c[u]^=909522486;r.sigBytes=o.sigBytes=s,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,i=t.WordArray,s=e.algo,r=s.SHA1,o=s.HMAC,c=s.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:r,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,s=o.create(n.hasher,e),r=i.create(),a=i.create([1]),c=r.words,u=a.words,l=n.keySize,g=n.iterations;c.length<l;){var h=s.update(t).finalize(a);s.reset();for(var p=h.words,d=p.length,f=h,v=1;v<g;v++){f=s.finalize(f),s.reset();for(var E=f.words,m=0;m<d;m++)p[m]^=E[m]}r.concat(h),u[0]++}return r.sigBytes=4*l,r}});e.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)}}(),function(){var e=a,t=e.lib,n=t.Base,i=t.WordArray,s=e.algo,r=s.MD5,o=s.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:r,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,s=this.cfg,r=s.hasher.create(),o=i.create(),a=o.words,c=s.keySize,u=s.iterations;a.length<c;){n&&r.update(n),n=r.update(e).finalize(t),r.reset();for(var l=1;l<u;l++)n=r.finalize(n),r.reset();o.concat(n)}return o.sigBytes=4*c,o}});e.EvpKDF=function(e,t,n){return o.create(n).compute(e,t)}}(),function(){var e=a,t=e.lib.WordArray,n=e.algo,i=n.SHA256,s=n.SHA224=i.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=i._createHelper(s),e.HmacSHA224=i._createHmacHelper(s)}(),function(){var e=a,t=e.lib,n=t.Base,i=t.WordArray,s=e.x64={};s.Word=n.extend({init:function(e,t){this.high=e,this.low=t}}),s.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=[],s=0;s<t;s++){var r=e[s];n.push(r.high),n.push(r.low)}return i.create(n,this.sigBytes)},clone:function(){for(var e=n.clone.call(this),t=e.words=this.words.slice(0),i=t.length,s=0;s<i;s++)t[s]=t[s].clone();return e}})}(),function(e){var t=a,n=t.lib,i=n.WordArray,s=n.Hasher,r=t.x64.Word,o=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 i=(2*e+3*t)%5;e=t%5,t=i}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 s=1,o=0;o<24;o++){for(var a=0,g=0,h=0;h<7;h++){if(1&s){var p=(1<<h)-1;p<32?g^=1<<p:a^=1<<p-32}128&s?s=s<<1^113:s<<=1}l[o]=r.create(a,g)}}();var g=[];!function(){for(var e=0;e<25;e++)g[e]=r.create()}();var h=o.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new r.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,i=this.blockSize/2,s=0;s<i;s++){var r=e[t+2*s],o=e[t+2*s+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(O=n[s]).high^=o,O.low^=r}for(var a=0;a<24;a++){for(var h=0;h<5;h++){for(var p=0,d=0,f=0;f<5;f++)p^=(O=n[h+5*f]).high,d^=O.low;var v=g[h];v.high=p,v.low=d}for(h=0;h<5;h++){var E=g[(h+4)%5],m=g[(h+1)%5],T=m.high,S=m.low;for(p=E.high^(T<<1|S>>>31),d=E.low^(S<<1|T>>>31),f=0;f<5;f++)(O=n[h+5*f]).high^=p,O.low^=d}for(var y=1;y<25;y++){var I=(O=n[y]).high,_=O.low,b=c[y];b<32?(p=I<<b|_>>>32-b,d=_<<b|I>>>32-b):(p=_<<b-32|I>>>64-b,d=I<<b-32|_>>>64-b);var C=g[u[y]];C.high=p,C.low=d}var M=g[0],U=n[0];for(M.high=U.high,M.low=U.low,h=0;h<5;h++)for(f=0;f<5;f++){var O=n[y=h+5*f],D=g[y],P=g[(h+1)%5+5*f],R=g[(h+2)%5+5*f];O.high=D.high^~P.high&R.high,O.low=D.low^~P.low&R.low}O=n[0];var A=l[a];O.high^=A.high,O.low^=A.low}},_doFinalize:function(){var t=this._data,n=t.words,s=(this._nDataBytes,8*t.sigBytes),r=32*this.blockSize;n[s>>>5]|=1<<24-s%32,n[(e.ceil((s+1)/r)*r>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var o=this._state,a=this.cfg.outputLength/8,c=a/8,u=[],l=0;l<c;l++){var g=o[l],h=g.high,p=g.low;h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(h)}return new i.init(u,a)},clone:function(){for(var e=s.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=s._createHelper(h),t.HmacSHA3=s._createHmacHelper(h)}(Math),function(){var e=a,t=e.lib.Hasher,n=e.x64,i=n.Word,s=n.WordArray,r=e.algo;function o(){return i.create.apply(i,arguments)}var c=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=o()}();var l=r.SHA512=t.extend({_doReset:function(){this._hash=new s.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],s=n[1],r=n[2],o=n[3],a=n[4],l=n[5],g=n[6],h=n[7],p=i.high,d=i.low,f=s.high,v=s.low,E=r.high,m=r.low,T=o.high,S=o.low,y=a.high,I=a.low,_=l.high,b=l.low,C=g.high,M=g.low,U=h.high,O=h.low,D=p,P=d,R=f,A=v,k=E,w=m,N=T,L=S,x=y,j=I,G=_,V=b,B=C,F=M,H=U,$=O,K=0;K<80;K++){var Y,z,q=u[K];if(K<16)z=q.high=0|e[t+2*K],Y=q.low=0|e[t+2*K+1];else{var W=u[K-15],X=W.high,J=W.low,Z=(X>>>1|J<<31)^(X>>>8|J<<24)^X>>>7,Q=(J>>>1|X<<31)^(J>>>8|X<<24)^(J>>>7|X<<25),ee=u[K-2],te=ee.high,ne=ee.low,ie=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,se=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),re=u[K-7],oe=re.high,ae=re.low,ce=u[K-16],ue=ce.high,le=ce.low;z=(z=(z=Z+oe+((Y=Q+ae)>>>0<Q>>>0?1:0))+ie+((Y+=se)>>>0<se>>>0?1:0))+ue+((Y+=le)>>>0<le>>>0?1:0),q.high=z,q.low=Y}var ge,he=x&G^~x&B,pe=j&V^~j&F,de=D&R^D&k^R&k,fe=P&A^P&w^A&w,ve=(D>>>28|P<<4)^(D<<30|P>>>2)^(D<<25|P>>>7),Ee=(P>>>28|D<<4)^(P<<30|D>>>2)^(P<<25|D>>>7),me=(x>>>14|j<<18)^(x>>>18|j<<14)^(x<<23|j>>>9),Te=(j>>>14|x<<18)^(j>>>18|x<<14)^(j<<23|x>>>9),Se=c[K],ye=Se.high,Ie=Se.low,_e=H+me+((ge=$+Te)>>>0<$>>>0?1:0),be=Ee+fe;H=B,$=F,B=G,F=V,G=x,V=j,x=N+(_e=(_e=(_e=_e+he+((ge+=pe)>>>0<pe>>>0?1:0))+ye+((ge+=Ie)>>>0<Ie>>>0?1:0))+z+((ge+=Y)>>>0<Y>>>0?1:0))+((j=L+ge|0)>>>0<L>>>0?1:0)|0,N=k,L=w,k=R,w=A,R=D,A=P,D=_e+(ve+de+(be>>>0<Ee>>>0?1:0))+((P=ge+be|0)>>>0<ge>>>0?1:0)|0}d=i.low=d+P,i.high=p+D+(d>>>0<P>>>0?1:0),v=s.low=v+A,s.high=f+R+(v>>>0<A>>>0?1:0),m=r.low=m+w,r.high=E+k+(m>>>0<w>>>0?1:0),S=o.low=S+L,o.high=T+N+(S>>>0<L>>>0?1:0),I=a.low=I+j,a.high=y+x+(I>>>0<j>>>0?1:0),b=l.low=b+V,l.high=_+G+(b>>>0<V>>>0?1:0),M=g.low=M+F,g.high=C+B+(M>>>0<F>>>0?1:0),O=h.low=O+$,h.high=U+H+(O>>>0<$>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[30+(i+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(i+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,i=t.WordArray,s=e.algo,r=s.SHA512,o=s.SHA384=r.extend({_doReset:function(){this._hash=new i.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=r._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=r._createHelper(o),e.HmacSHA384=r._createHmacHelper(o)}(),a.lib.Cipher||function(){var e=a,t=e.lib,n=t.Base,i=t.WordArray,s=t.BufferedBlockAlgorithm,r=e.enc,o=(r.Utf8,r.Base64),c=e.algo.EvpKDF,u=t.Cipher=s.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(){s.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?m:v}return function(t){return{encrypt:function(n,i,s){return e(i).encrypt(t,n,i,s)},decrypt:function(n,i,s){return e(i).decrypt(t,n,i,s)}}}}()}),l=(t.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),g=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}}),h=l.CBC=function(){var e=g.extend();function t(e,t,n){var i,s=this._iv;s?(i=s,this._iv=void 0):i=this._prevBlock;for(var r=0;r<n;r++)e[t+r]^=i[r]}return e.Encryptor=e.extend({processBlock:function(e,n){var i=this._cipher,s=i.blockSize;t.call(this,e,n,s),i.encryptBlock(e,n),this._prevBlock=e.slice(n,n+s)}}),e.Decryptor=e.extend({processBlock:function(e,n){var i=this._cipher,s=i.blockSize,r=e.slice(n,n+s);i.decryptBlock(e,n),t.call(this,e,n,s),this._prevBlock=r}}),e}(),p=(e.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,s=n-e.sigBytes%n,r=s<<24|s<<16|s<<8|s,o=[],a=0;a<s;a+=4)o.push(r);var c=i.create(o,s);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},d=(t.BlockCipher=u.extend({cfg:u.cfg.extend({mode:h,padding:p}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(i,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?i.create([1398893684,1701076831]).concat(n).concat(t):t).toString(o)},parse:function(e){var t,n=o.parse(e),s=n.words;return 1398893684==s[0]&&1701076831==s[1]&&(t=i.create(s.slice(2,4)),s.splice(0,4),n.sigBytes-=16),d.create({ciphertext:n,salt:t})}},v=t.SerializableCipher=n.extend({cfg:n.extend({format:f}),encrypt:function(e,t,n,i){i=this.cfg.extend(i);var s=e.createEncryptor(n,i),r=s.finalize(t),o=s.cfg;return d.create({ciphertext:r,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,n,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(n,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),E=(e.kdf={}).OpenSSL={execute:function(e,t,n,s){s||(s=i.random(8));var r=c.create({keySize:t+n}).compute(e,s),o=i.create(r.words.slice(t),4*n);return r.sigBytes=4*t,d.create({key:r,iv:o,salt:s})}},m=t.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:E}),encrypt:function(e,t,n,i){var s=(i=this.cfg.extend(i)).kdf.execute(n,e.keySize,e.ivSize);i.iv=s.iv;var r=v.encrypt.call(this,e,t,s.key,i);return r.mixIn(s),r},decrypt:function(e,t,n,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var s=i.kdf.execute(n,e.keySize,e.ivSize,t.salt);return i.iv=s.iv,v.decrypt.call(this,e,t,s.key,i)}})}(),a.mode.CFB=function(){var e=a.lib.BlockCipherMode.extend();function t(e,t,n,i){var s,r=this._iv;r?(s=r.slice(0),this._iv=void 0):s=this._prevBlock,i.encryptBlock(s,0);for(var o=0;o<n;o++)e[t+o]^=s[o]}return e.Encryptor=e.extend({processBlock:function(e,n){var i=this._cipher,s=i.blockSize;t.call(this,e,n,s,i),this._prevBlock=e.slice(n,n+s)}}),e.Decryptor=e.extend({processBlock:function(e,n){var i=this._cipher,s=i.blockSize,r=e.slice(n,n+s);t.call(this,e,n,s,i),this._prevBlock=r}}),e}(),a.mode.ECB=((s=a.lib.BlockCipherMode.extend()).Encryptor=s.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),s.Decryptor=s.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),s),a.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,i=4*t,s=i-n%i,r=n+s-1;e.clamp(),e.words[r>>>2]|=s<<24-r%4*8,e.sigBytes+=s},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,i=n-e.sigBytes%n;e.concat(a.lib.WordArray.random(i-1)).concat(a.lib.WordArray.create([i<<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=(i=(n=a.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,s=this._iv,r=this._keystream;s&&(r=this._keystream=s.slice(0),this._iv=void 0),n.encryptBlock(r,0);for(var o=0;o<i;o++)e[t+o]^=r[o]}}),n.Decryptor=i,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 i=n.parse(e);return t.create({ciphertext:i})}}}(),function(){var e=a,t=e.lib.BlockCipher,n=e.algo,i=[],s=[],r=[],o=[],c=[],u=[],l=[],g=[],h=[],p=[];!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 d=a^a<<1^a<<2^a<<3^a<<4;d=d>>>8^255&d^99,i[n]=d,s[d]=n;var f=e[n],v=e[f],E=e[v],m=257*e[d]^16843008*d;r[n]=m<<24|m>>>8,o[n]=m<<16|m>>>16,c[n]=m<<8|m>>>24,u[n]=m,m=16843009*E^65537*v^257*f^16843008*n,l[d]=m<<24|m>>>8,g[d]=m<<16|m>>>16,h[d]=m<<8|m>>>24,p[d]=m,n?(n=f^e[e[e[E^f]]],a^=e[e[a]]):n=a=1}}();var d=[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,s=4*((this._nRounds=n+6)+1),r=this._keySchedule=[],o=0;o<s;o++)o<n?r[o]=t[o]:(u=r[o-1],o%n?n>6&&o%n==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=d[o/n|0]<<24),r[o]=r[o-n]^u);for(var a=this._invKeySchedule=[],c=0;c<s;c++){if(o=s-c,c%4)var u=r[o];else u=r[o-4];a[c]=c<4||o<=4?u:l[i[u>>>24]]^g[i[u>>>16&255]]^h[i[u>>>8&255]]^p[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,r,o,c,u,i)},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,g,h,p,s),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,i,s,r,o,a){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],g=e[t+2]^n[2],h=e[t+3]^n[3],p=4,d=1;d<c;d++){var f=i[u>>>24]^s[l>>>16&255]^r[g>>>8&255]^o[255&h]^n[p++],v=i[l>>>24]^s[g>>>16&255]^r[h>>>8&255]^o[255&u]^n[p++],E=i[g>>>24]^s[h>>>16&255]^r[u>>>8&255]^o[255&l]^n[p++],m=i[h>>>24]^s[u>>>16&255]^r[l>>>8&255]^o[255&g]^n[p++];u=f,l=v,g=E,h=m}f=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[g>>>8&255]<<8|a[255&h])^n[p++],v=(a[l>>>24]<<24|a[g>>>16&255]<<16|a[h>>>8&255]<<8|a[255&u])^n[p++],E=(a[g>>>24]<<24|a[h>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^n[p++],m=(a[h>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&g])^n[p++],e[t]=f,e[t+1]=v,e[t+2]=E,e[t+3]=m},keySize:8});e.AES=t._createHelper(f)}(),function(){var e=a,t=e.lib,n=t.WordArray,i=t.BlockCipher,s=e.algo,r=[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],o=[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],g=s.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var i=r[n]-1;t[n]=e[i>>>5]>>>31-i%32&1}for(var s=this._subKeys=[],a=0;a<16;a++){var u=s[a]=[],l=c[a];for(n=0;n<24;n++)u[n/6|0]|=t[(o[n]-1+l)%28]<<31-n%6,u[4+(n/6|0)]|=t[28+(o[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 g=this._invSubKeys=[];for(n=0;n<16;n++)g[n]=s[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],h.call(this,4,252645135),h.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),h.call(this,1,1431655765);for(var i=0;i<16;i++){for(var s=n[i],r=this._lBlock,o=this._rBlock,a=0,c=0;c<8;c++)a|=u[c][((o^s[c])&l[c])>>>0];this._lBlock=o,this._rBlock=r^a}var g=this._lBlock;this._lBlock=this._rBlock,this._rBlock=g,h.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function p(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}e.DES=i._createHelper(g);var d=s.TripleDES=i.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),i=e.length<4?e.slice(0,2):e.slice(2,4),s=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=g.createEncryptor(n.create(t)),this._des2=g.createEncryptor(n.create(i)),this._des3=g.createEncryptor(n.create(s))},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=i._createHelper(d)}(),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,i=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,i=this._S=[],s=0;s<256;s++)i[s]=s;s=0;for(var r=0;s<256;s++){var o=s%n,a=t[o>>>2]>>>24-o%4*8&255;r=(r+i[s]+a)%256;var c=i[s];i[s]=i[r],i[r]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=s.call(this)},keySize:8,ivSize:0});function s(){for(var e=this._S,t=this._i,n=this._j,i=0,s=0;s<4;s++){n=(n+e[t=(t+1)%256])%256;var r=e[t];e[t]=e[n],e[n]=r,i|=e[(e[t]+e[n])%256]<<24-8*s}return this._i=t,this._j=n,i}e.RC4=t._createHelper(i);var r=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)s.call(this)}});e.RC4Drop=t._createHelper(r)}(),
|
||
/** @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,i=255&e;255===t?(t=0,255===n?(n=0,255===i?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}return e}var n=e.Encryptor=e.extend({processBlock:function(e,n){var i,s=this._cipher,r=s.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),0===((i=a)[0]=t(i[0]))&&(i[1]=t(i[1]));var c=a.slice(0);s.encryptBlock(c,0);for(var u=0;u<r;u++)e[n+u]^=c[u]}});return e.Decryptor=n,e}(),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,i=[],s=[],r=[],o=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 i=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],s=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++)s[n]^=i[n+4&7];if(t){var r=t.words,o=r[0],a=r[1],u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),g=u>>>16|4294901760&l,h=l<<16|65535&u;for(s[0]^=u,s[1]^=g,s[2]^=l,s[3]^=h,s[4]^=u,s[5]^=g,s[6]^=l,s[7]^=h,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var s=0;s<4;s++)i[s]=16711935&(i[s]<<8|i[s]>>>24)|4278255360&(i[s]<<24|i[s]>>>8),e[t+s]^=i[s]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)s[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<s[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<s[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<s[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<s[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<s[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<s[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<s[6]>>>0?1:0)|0,this._b=t[7]>>>0<s[7]>>>0?1:0,n=0;n<8;n++){var i=e[n]+t[n],o=65535&i,a=i>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,u=((4294901760&i)*i|0)+((65535&i)*i|0);r[n]=c^u}e[0]=r[0]+(r[7]<<16|r[7]>>>16)+(r[6]<<16|r[6]>>>16)|0,e[1]=r[1]+(r[0]<<8|r[0]>>>24)+r[7]|0,e[2]=r[2]+(r[1]<<16|r[1]>>>16)+(r[0]<<16|r[0]>>>16)|0,e[3]=r[3]+(r[2]<<8|r[2]>>>24)+r[1]|0,e[4]=r[4]+(r[3]<<16|r[3]>>>16)+(r[2]<<16|r[2]>>>16)|0,e[5]=r[5]+(r[4]<<8|r[4]>>>24)+r[3]|0,e[6]=r[6]+(r[5]<<16|r[5]>>>16)+(r[4]<<16|r[4]>>>16)|0,e[7]=r[7]+(r[6]<<8|r[6]>>>24)+r[5]|0}e.Rabbit=t._createHelper(o)}(),a.mode.CTR=function(){var e=a.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,s=this._iv,r=this._counter;s&&(r=this._counter=s.slice(0),this._iv=void 0);var o=r.slice(0);n.encryptBlock(o,0),r[i-1]=r[i-1]+1|0;for(var a=0;a<i;a++)e[t+a]^=o[a]}});return e.Decryptor=t,e}(),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,i=[],s=[],r=[],o=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],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]];this._b=0;for(var s=0;s<4;s++)c.call(this);for(s=0;s<8;s++)i[s]^=n[s+4&7];if(t){var r=t.words,o=r[0],a=r[1],u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),g=u>>>16|4294901760&l,h=l<<16|65535&u;for(i[0]^=u,i[1]^=g,i[2]^=l,i[3]^=h,i[4]^=u,i[5]^=g,i[6]^=l,i[7]^=h,s=0;s<4;s++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var s=0;s<4;s++)i[s]=16711935&(i[s]<<8|i[s]>>>24)|4278255360&(i[s]<<24|i[s]>>>8),e[t+s]^=i[s]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)s[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<s[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<s[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<s[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<s[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<s[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<s[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<s[6]>>>0?1:0)|0,this._b=t[7]>>>0<s[7]>>>0?1:0,n=0;n<8;n++){var i=e[n]+t[n],o=65535&i,a=i>>>16,c=((o*o>>>17)+o*a>>>15)+a*a,u=((4294901760&i)*i|0)+((65535&i)*i|0);r[n]=c^u}e[0]=r[0]+(r[7]<<16|r[7]>>>16)+(r[6]<<16|r[6]>>>16)|0,e[1]=r[1]+(r[0]<<8|r[0]>>>24)+r[7]|0,e[2]=r[2]+(r[1]<<16|r[1]>>>16)+(r[0]<<16|r[0]>>>16)|0,e[3]=r[3]+(r[2]<<8|r[2]>>>24)+r[1]|0,e[4]=r[4]+(r[3]<<16|r[3]>>>16)+(r[2]<<16|r[2]>>>16)|0,e[5]=r[5]+(r[4]<<8|r[4]>>>24)+r[3]|0,e[6]=r[6]+(r[5]<<16|r[5]>>>16)+(r[4]<<16|r[4]>>>16)|0,e[7]=r[7]+(r[6]<<8|r[6]>>>24)+r[5]|0}e.RabbitLegacy=t._createHelper(o)}(),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)},u(l={exports:{}},l.exports),l.exports);return function(){function e(n){t(this,e);var i=n.isArray,s=n.isMap,r=n.isDevMode;this._isArray=i,this._isMap=s,this._isDevMode=r,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===r&&console.log("".concat(this._n,".VERSION:").concat("1.1.0"))}return i(e,[{key:"onToken",value:function(e){this._key=f.enc.Utf8.parse(e.slice(0,32)),this._iv=this._key,this._decryptOptions={iv:this._iv,mode:f.mode.CBC,padding:f.pad.Pkcs7}}},{key:"onLexiconSliced",value:function(e){if(this._isArray(e)&&0!==e.length){var t,n,i,s=c(e);try{for(s.s();!(i=s.n()).done;){var r=i.value,o=r.filterType,a=r.profanityType,u=r.profanity,l=r.replacement;t=this._getDecryptedString(u),n=this._getDecryptedString(l),1===o?1===a?this._interceptProfanityList.push(t):2===a&&this._interceptRegExpList.push(t):2===o&&(1===a?this._replacingProfanityMap.set(t,n):2===a&&this._replacingRegExpMap.set(t,n))}}catch(g){s.e(g)}finally{s.f()}}}},{key:"_getDecryptedString",value:function(e){var t=f.AES.decrypt(e,this._key,this._decryptOptions);return f.enc.Utf8.stringify(t).toLowerCase()}},{key:"onLexiconCompleted",value:function(e){this.onLexiconSliced(e),this._interceptFilter=new h({input:this._interceptProfanityList,isArray:this._isArray,isMap:this._isMap}),this._replacingFilter=new h({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,r=this._interceptRegExpList.length;i<r;i++)if(new RegExp(this._interceptRegExpList[i],"gi").test(e.toLowerCase())){n=!0;break}if(n)return t.type=1,t;var o=this._replacingFilter.filter({text:e,replacingEnabled:!0});!0===o.isMatched&&(t.type=2,t.modifiedText=o.modifiedText);var a,u=t.modifiedText,l=null,g=c(this._replacingRegExpMap);try{for(g.s();!(a=g.n()).done;){var h=s(a.value,2),p=h[0],d=h[1];l=new RegExp(p,"gi"),u=u.replace(l,d)}}catch(f){g.e(f)}finally{g.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()}}]),e}()}();const m=t(E.exports);function T(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}function S(e,t,n,i){return new(n||(n=Promise))((function(s,r){function o(e){try{c(i.next(e))}catch(t){r(t)}}function a(e){try{c(i.throw(e))}catch(t){r(t)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;let y=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)}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 I,_,b,C,M,U,O,D,P,R;(R=I||(I={})).TUIStore="TUIStore",R.TUITranslate="TUITranslate",R.TUIConversation="TUIConversation",R.TUIChat="TUIChat",R.TUIGroup="TUIGroup",R.TUIUser="TUIUser",R.TUIFriend="TUIFriend",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"}(_||(_={})),function(e){e[e.UNSUB_USER=-1]="UNSUB_USER"}(b||(b={})),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"}(C||(C={})),function(e){e.ADD="add",e.REMOVE="remove"}(M||(M={})),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"}(U||(U={})),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"}(O||(O={})),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,消息不存在."}(D||(D={})),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 不匹配."}(P||(P={}));const A=function(e){return void 0===e},k=function(e){return e.startsWith("_")},w=function(e){return/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)},N=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},L=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},x={"[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"},j={"[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]":"[赞]"},G={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)},V=["messageList","conversationList","newMessageList"],B=["translateTextInfo","voiceToTextInfo"],F="undefined"!=typeof wx&&"function"==typeof n&&Boolean(n().fontSizeSetting),H="undefined"!=typeof uni&&"undefined"==typeof window,$=F||H,K="undefined"!=typeof uni,Y=("undefined"!=typeof uni||"undefined"!=typeof window)&&!$,z=F?wx:K?uni:window,q=Y&&window&&window.navigator&&window.navigator.userAgent||"",W=/Android/i.test(q),X=/(?:Windows Phone)/.test(q),J=/(?:SymbianOS)/.test(q),Z=/iPad/i.test(q)||/iPhone/i.test(q)||/iPod/i.test(q),Q=W||X||J||Z,ee=Y&&!Q;class te{constructor(){this.global=z,this.isOfficial=!1}static getInstance(){return te.instance||(te.instance=new te),te.instance}initOfficial(e){this.isOfficial=e}getPlatform(){let e="";return ee?e="pc":Q?e="h5":F?e="wechat":H&&!F&&(e="app"),e}}class ne{constructor(){this.EVENT=i.EVENT,this.TYPES=i.TYPES,this.loginStatusPromise=new Map,this.userID="",this.isInited=!1}static getInstance(){return ne.instance||(ne.instance=new ne),ne.instance}mount(e,t){this[e]=t}login(e){const{chat:t,SDKAppID:n,userID:s}=e,r=1400187352===n||1400188366===n;return this.createChat(e),this.userID=s,te.getInstance().initOfficial(r),this.TUIStore.update(_.APP,"isOfficial",r),this.TUIStore.update(_.APP,"SDKVersion",i.VERSION),this.eventCenter=new y(this),this.eventCenter.removeEvents(),this.initStore(),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.chat.logout()}isReady(){var e;return(null===(e=this.chat)||void 0===e?void 0:e.isReady())||!1}setLogLevel(e){if(this.chat)return this.chat.setLogLevel(e);console.warn("TUIChatEngine 初始化未完成,请确认 TUIChatEngine.login 接口调用是否正常。")}destroy(){return this.eventCenter.unbindIMEvents(),this.isInited=!1,this.chat.destroy()}getMyUserID(){return this.userID}initStore(){this.TUIStore.reset(_.CHAT),this.TUIStore.reset(_.CONV),this.TUIStore.reset(_.GRP),this.TUIStore.reset(_.USER),this.TUIStore.reset(_.SEARCH),console.log("TUIChatEngine.initStore ok.")}initService(){this.TUIChat.init(),this.TUIConversation.init(),this.TUIUser.init(),this.initOptionalServices(),this.isInited=!0,console.log("TUIChatEngine.initService ok.")}initOptionalServices(){const e=i.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=T(e,["chat"]);A(t)?this.chat=i.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,i)=>{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:i,imResponse:t})})).catch((e=>{i(e)}))}))}registerPlugin(e){const{useUploadPlugin:t=!1,useProfanityFilterPlugin:n=!1,TIMPush:i,pushConfig:r,TUIOfflinePush:o,offlinePushConfig:a}=e;!0===t&&this.chat.registerPlugin({"tim-upload-plugin":s}),!0===n&&this.chat.registerPlugin({"tim-profanity-filter-plugin":m}),!H||F||A(i)||A(r)||this.chat.registerPlugin({"tim-push":i,pushConfig:r}),!H||F||A(o)||A(a)||this.chat.registerPlugin({"tim-offline-push-plugin":o,offlinePushConfig:a})}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")}checkCommercialAbility(){Object.keys(G).forEach((e=>{const t=G[e];this.chat.callExperimentalAPI("isCommercialAbilityEnabled",t).then((t=>{const{enabled:n=!1}=t.data;this.TUIStore.update(_.APP,e,n)}))}))}}class ie{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 se{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:i=""}=e;n===b.UNSUB_USER?this.store.userStatusList.delete(t):this.store.userStatusList.set(t,{statusType:n,customStatus:i})})):this.store.userStatusList.clear()}}class re{getEngine(){return ne.getInstance()}}const oe=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},ae=["[图片]","[语音]","[视频]","[文件]","[位置]","[地理位置]","[动画表情]","[自定义消息]","[群提示消息]","[聊天记录]"];class ce extends re{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=>{k(t)||(this[t]=e[t])}))}updateProperties(e){Object.keys(e).forEach((t=>{k(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,i,s,r;const o=this.getEngine();let a="";switch(this.type){case o.TYPES.CONV_C2C:a=w(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_21.png";break;case o.TYPES.CONV_GROUP:a=w(null===(n=this.groupProfile)||void 0===n?void 0:n.avatar)?null===(i=this.groupProfile)||void 0===i?void 0:i.avatar:"https://web.sdk.qcloud.com/im/demo/TUIkit/web/img/constomer.svg";break;case o.TYPES.CONV_SYSTEM:a=w(null===(s=this.groupProfile)||void 0===s?void 0:s.avatar)?null===(r=this.groupProfile)||void 0===r?void 0:r.avatar:"https://web.sdk.qcloud.com/component/TUIKit/assets/group_avatar.png"}return a}getShowName(){var e,t,n,i;const s=this.getEngine();let r="";switch(this.type){case s.TYPES.CONV_C2C:r=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 s.TYPES.CONV_GROUP:r=(null===(n=this.groupProfile)||void 0===n?void 0:n.name)||(null===(i=this.groupProfile)||void 0===i?void 0:i.groupID)||"";break;case s.TYPES.CONV_SYSTEM:r=s.TUITranslate.t("系统通知")}return r}getGroupAtInfo(){const e=this.getEngine(),t=e.TUITranslate.t.bind(e.TUITranslate),n=[`[${t("TUIConversation.有人@我")}]`,`[${t("TUIConversation.@所有人")}]`,`[${t("TUIConversation.@所有人")}][${t("TUIConversation.有人@我")}]`];let i="";for(let s=0;s<this.groupAtInfoList.length;s++)this.groupAtInfoList[s].atTypeArray[0]&&this.unreadCount>0&&(i=n[this.groupAtInfoList[s].atTypeArray[0]-1]);return i}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,i=24*n,s=7*i,r=(new Date).getTime()-e;let o="";if(r<0)return o;const a=r/6e4,c=r/n,u=r/i,l=r/s;if(l>=1&&l<=4)o=` ${parseInt(`${l}`,10)} ${t("time.周")}${t("time.前")}`;else if(u>=1&&u<=6)o=` ${parseInt(`${u}`,10)} ${t("time.天")}${t("time.前")}`;else if(c>=1&&c<=23)o=` ${parseInt(`${c}`,10)} ${t("time.小时")}${t("time.前")}`;else if(a>=1&&a<=59)o=` ${parseInt(`${a}`,10)} ${t("time.分钟")}${t("time.前")}`;else if(r>=0&&r<=6e4)o=`${t("time.刚刚")}`;else{const t=new Date;t.setTime(e),o=`${t.getFullYear()}-${t.getMonth()+1<10?`0${t.getMonth()+1}`:t.getMonth()+1}-${t.getDate()<10?`0${t.getDate()}`:t.getDate()}`}return o}(1e3*this.lastMessage.lastTime,t.TUITranslate.t.bind(t.TUITranslate))),n}getLastMessageText(){var e;if(this.draftText)return N(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 i=this._conversation,s=this.lastMessage;let r="",o="";const a=i.unreadCount>0&&i.messageRemindType===t.TYPES.MSG_REMIND_ACPT_NOT_NOTE?`[${i.unreadCount>99?"99+":i.unreadCount}${n("TUIConversation.条")}]`:"";if(i.type===t.TYPES.CONV_GROUP)if(s.fromAccount===t.getMyUserID())r=n("TUIConversation.我");else{const e=s.fromAccount;r=t.TUIFriend.getFriendRemark([e])[e]||s.nameCard||s.nick||e}if(s.type===t.TYPES.MSG_TEXT)o=this.decodeTextMessage(s.payload.text);else if(s.type===t.TYPES.MSG_CUSTOM){const i=N(null===(e=null==s?void 0:s.payload)||void 0===e?void 0:e.data);if(1===(null==i?void 0:i.businessID))return o=t.TUIChat.messageHandler.handleCallKitSignaling(s),o;o=ae.includes(s.messageForShow)?n(`TUIChat.${s.messageForShow}`):s.messageForShow}else o=ae.includes(s.messageForShow)?n(`TUIChat.${s.messageForShow}`):s.messageForShow;return s.isRevoked&&(o=n("TUIChat.撤回了一条消息")),i.type===t.TYPES.CONV_GROUP&&s.type===t.TYPES.MSG_GRP_TIP?o:`${a}${r?`${r}:`:""}${o}`}decodeTextMessage(e){if(oe(e))return e;const t=/(\[.+?\])/g;let n=e;if(t.test(e)){const i=this.getEngine(),s=i.TUITranslate.t.bind(i.TUITranslate);n=e.replace(t,(e=>{const t=s(`Emoji.${e}`);return F||!t||t.startsWith("Emoji.")?j[e]||e:t}))}return n}}class ue{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 ce?n.updateProperties(e):n=new ce(e);const i=this.getOperationType(e);n.updateOperationType(i),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 le extends re{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=>{k(t)||(this[t]=e[t])}))}updateProperties(e){this._message=e,Object.keys(e).forEach((t=>{k(t)||(this[t]=e[t])}))}getMessage(){return this._message}modifyMessage(e){return e.type&&this._message.type!==e.type&&!e.payload?Promise.reject({code:O.MISMATCH_TYPE_AND_PAYLOAD,message:P.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:A(this._signalingInfo)?(this._signalingInfo=this.getEngine().chat.getSignalingInfo(this._message),this._signalingInfo):this._signalingInfo}getMessageContent(){const e=this.messageHandlers[this.type];if(A(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 ge{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=>!B.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 le||(n=this.getModel(e.ID),n?n.updateProperties(e):n=new le(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:i,visible:s=!1}=t;this.store[e]||(this.store[e]=new Map),this.store[e].has(n)||this.store[e].set(n,[]);const r=this.store[e].get(n)||[];let o=!0;for(let a=0;a<r.length;a++)if(r[a].messageID===i){r[a].visible=s,o=!1;break}o&&r.push({messageID:i,visible:s}),this.store[e].set(n,r)}}class he{constructor(e){this.groupAttributes={},this.groupCounters={},this.initProxy(e)}initProxy(e){Object.keys(e).forEach((t=>{k(t)||(this[t]=e[t])}))}}class pe{constructor(){this.defaultStore={currentGroupID:"",currentGroup:{},currentGroupAttributes:{},currentGroupCounters:{},currentGroupMemberList:[],groupList:[],groupSystemNoticeList:[]},this.store={currentGroupID:"",currentGroup:void 0,currentGroupAttributes:{},currentGroupCounters:{},currentGroupMemberList:[],groupList:[],groupSystemNoticeList:[]}}update(e,t){switch(e){case"groupList":this.updateGroupList(t);break;case"currentGroup":this.store.currentGroup=t instanceof he?t:new he(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 he?e:new he(e)))}}class de{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 fe{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 ve{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 Ee{constructor(){this.storeMap={[_.APP]:new ie,[_.USER]:new se,[_.CONV]:new ue,[_.CHAT]:new ge,[_.GRP]:new pe,[_.FRIEND]:new fe,[_.SEARCH]:new ve},this.task={}}static getInstance(){return Ee.instance||(Ee.instance=new Ee),Ee.instance}watch(e,t){this.task[e]||(this.task[e]={});const n=this.task[e];Object.keys(t).forEach((i=>{const s=t[i];n[i]||(n[i]=new Map),n[i].set(s,1),this.notifyOnWatch(e,i,s)}))}unwatch(e,t){if(!this.task[e])return;const n=this.task[e];Object.keys(t).forEach((e=>{var i;null===(i=n[e])||void 0===i||i.delete(t[e])}))}update(e,t,n){var i;e!==_.CUSTOM||this.storeMap[e]||(this.storeMap[e]=new de),null===(i=this.storeMap[e])||void 0===i||i.update(t,n),this.notify(e,t)}getData(e,t){var n;return e!==_.CUSTOM||this.storeMap[e]||(this.storeMap[e]=new de),null===(n=this.storeMap[e])||void 0===n?void 0:n.getData(t)}getConversationModel(e){var t;return null===(t=this.storeMap[_.CONV])||void 0===t?void 0:t.getModel(e)}getMessageModel(e){var t;return null===(t=this.storeMap[_.CHAT])||void 0===t?void 0:t.getModel(e)}reset(e,t=[],n=!1){if(e in this.storeMap){const i=this.storeMap[e];0===t.length&&(t=Object.keys(null==i?void 0:i.store)),i.reset(t),n&&t.forEach((t=>{this.notify(e,t)}))}}notifyOnWatch(e,t,n){const i=this.getData(e,t);V.indexOf(t)>-1&&0===i.length||n&&n.call(this,i)}notify(e,t){if(!this.task[e])return;const n=this.task[e];if(n[t]){const i=n[t],s=this.getData(e,t);for(const[e]of i.entries())e.call(this,s)}}}function me(e){return(me="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 Te(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Se(e){var t=function(e){if("object"!=me(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==me(t)?t:t+""}function ye(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Se(i.key),i)}}function Ie(e,t,n){return t&&ye(e.prototype,t),n&&ye(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function be(e,t){return(be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Ce(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&&be(e,t)}function Me(e,t){if(t&&("object"==me(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _e(e)}function Ue(e){return(Ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Oe(e,t,n){return(t=Se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function De(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function Pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pe(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ae={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)}},ke=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Te(this,e),this.init(t,n)}return Ie(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||Ae,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,i){return i&&!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,Re(Re({},{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}()),we=function(){function e(){Te(this,e),this.observers={}}return Ie(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),i=1;i<t;i++)n[i-1]=arguments[i];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 Ne(){var e,t,n=new Promise((function(n,i){e=n,t=i}));return n.resolve=e,n.reject=t,n}function Le(e){return null==e?"":""+e}function xe(e,t,n){function i(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function s(){return!e||"string"==typeof e}for(var r="string"!=typeof t?[].concat(t):t.split(".");r.length>1;){if(s())return{};var o=i(r.shift());!e[o]&&n&&(e[o]=new n),e=Object.prototype.hasOwnProperty.call(e,o)?e[o]:{}}return s()?{}:{obj:e,k:i(r.shift())}}function je(e,t,n){var i=xe(e,t,Object);i.obj[i.k]=n}function Ge(e,t){var n=xe(e,t),i=n.obj,s=n.k;if(i)return i[s]}function Ve(e,t,n){for(var i in t)"__proto__"!==i&&"constructor"!==i&&(i in e?"string"==typeof e[i]||e[i]instanceof String||"string"==typeof t[i]||t[i]instanceof String?n&&(e[i]=t[i]):Ve(e[i],t[i],n):e[i]=t[i]);return e}function Be(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Fe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function He(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Fe[e]})):e}var $e="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Ke=[" ",",","?","!",";"];function Ye(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var i=t.split(n),s=e,r=0;r<i.length;++r){if(!s)return;if("string"==typeof s[i[r]]&&r+1<i.length)return;if(void 0===s[i[r]]){for(var o=2,a=i.slice(r,r+o).join(n),c=s[a];void 0===c&&i.length>r+o;)o++,c=s[a=i.slice(r,r+o).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=i.slice(r+o).join(n);return u?Ye(c,u,n):void 0}s=s[i[r]]}return s}}function ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ze(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var We=function(){Ce(t,we);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,i=Ue(e);if(t){var s=Ue(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return Me(this,n)}}(t);function t(n){var i,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Te(this,t),i=e.call(this),$e&&we.call(_e(i)),i.data=n||{},i.options=s,void 0===i.options.keySeparator&&(i.options.keySeparator="."),void 0===i.options.ignoreJSONStructure&&(i.options.ignoreJSONStructure=!0),i}return Ie(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 i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,r=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure,o=[e,t];n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(o=e.split("."));var a=Ge(this.data,o);return a||!r||"string"!=typeof n?a:Ye(this.data&&this.data[e]&&this.data[e][t],n,s)}},{key:"addResource",value:function(e,t,n,i){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},r=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=[e,t];n&&(o=o.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(i=t,t=(o=e.split("."))[1]),this.addNamespaces(t),je(this.data,o,i),s.silent||this.emit("added",e,t,n,i)}},{key:"addResources",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var s in n)"string"!=typeof n[s]&&"[object Array]"!==Object.prototype.toString.apply(n[s])||this.addResource(e,t,s,n[s],{silent:!0});i.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,i,s){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},o=[e,t];e.indexOf(".")>-1&&(i=n,n=t,t=(o=e.split("."))[1]),this.addNamespaces(t);var a=Ge(this.data,o)||{};i?Ve(a,n,s):a=qe(qe({},a),n),je(this.data,o,a),r.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?qe(qe({},{}),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}(),Xe={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,i,s){var r=this;return e.forEach((function(e){r.processors[e]&&(t=r.processors[e].process(t,n,i,s))})),t}};function Je(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Je(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qe={},et=function(){Ce(t,we);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,i=Ue(e);if(t){var s=Ue(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return Me(this,n)}}(t);function t(n){var i,s,r,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Te(this,t),i=e.call(this),$e&&we.call(_e(i)),s=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r=n,o=_e(i),s.forEach((function(e){r[e]&&(o[e]=r[e])})),i.options=a,void 0===i.options.keySeparator&&(i.options.keySeparator="."),i.logger=ke.create("translator"),i}return Ie(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 i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=t.ns||this.options.defaultNS||[],r=n&&e.indexOf(n)>-1,o=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var i=Ke.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===i.length)return!0;var s=new RegExp("(".concat(i.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),r=!s.test(e);if(!r){var o=e.indexOf(n);o>0&&!s.test(e.substring(0,o))&&(r=!0)}return r}(e,n,i));if(r&&!o){var a=e.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:e,namespaces:s};var c=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(c[0])>-1)&&(s=c.shift()),e=c.join(i)}return"string"==typeof s&&(s=[s]),{key:e,namespaces:s}}},{key:"translate",value:function(e,n,i){var s=this;if("object"!==me(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"===me(n)&&(n=Ze({},n)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var r=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=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],g=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&"cimode"===g.toLowerCase()){if(h){var p=n.nsSeparator||this.options.nsSeparator;return r?{res:"".concat(l).concat(p).concat(c),usedKey:c,exactUsedKey:c,usedLng:g,usedNS:l}:"".concat(l).concat(p).concat(c)}return r?{res:c,usedKey:c,exactUsedKey:c,usedLng:g,usedNS:l}:c}var d=this.resolve(e,n),f=d&&d.res,v=d&&d.usedKey||c,E=d&&d.exactUsedKey||c,m=Object.prototype.toString.apply(f),T=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject;if(S&&f&&"string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f&&["[object Number]","[object Function]","[object RegExp]"].indexOf(m)<0&&("string"!=typeof T||"[object Array]"!==m)){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var y=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,f,Ze(Ze({},n),{},{ns:u})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return r?(d.res=y,d):y}if(o){var I="[object Array]"===m,_=I?[]:{},b=I?E:v;for(var C in f)if(Object.prototype.hasOwnProperty.call(f,C)){var M="".concat(b).concat(o).concat(C);_[C]=this.translate(M,Ze(Ze({},n),{joinArrays:!1,ns:u})),_[C]===M&&(_[C]=f[C])}f=_}}else if(S&&"string"==typeof T&&"[object Array]"===m)(f=f.join(T))&&(f=this.extendTranslation(f,e,n,i));else{var U=!1,O=!1,D=void 0!==n.count&&"string"!=typeof n.count,P=t.hasDefaultValue(n),R=D?this.pluralResolver.getSuffix(g,n.count,n):"",A=n["defaultValue".concat(R)]||n.defaultValue;!this.isValidLookup(f)&&P&&(U=!0,f=A),this.isValidLookup(f)||(O=!0,f=c);var k=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&O?void 0:f,w=P&&A!==f&&this.options.updateMissing;if(O||U||w){if(this.logger.log(w?"updateKey":"missingKey",g,l,c,w?A:f),o){var N=this.resolve(c,Ze(Ze({},n),{},{keySeparator:!1}));N&&N.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 L=[],x=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&x&&x[0])for(var j=0;j<x.length;j++)L.push(x[j]);else"all"===this.options.saveMissingTo?L=this.languageUtils.toResolveHierarchy(n.lng||this.language):L.push(n.lng||this.language);var G=function(e,t,i){var r=P&&i!==f?i:k;s.options.missingKeyHandler?s.options.missingKeyHandler(e,l,t,r,w,n):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(e,l,t,r,w,n),s.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?L.forEach((function(e){s.pluralResolver.getSuffixes(e,n).forEach((function(t){G([e],c+t,n["defaultValue".concat(t)]||A)}))})):G(L,c,A))}f=this.extendTranslation(f,e,n,d,i),O&&f===c&&this.options.appendNamespaceToMissingKey&&(f="".concat(l,":").concat(c)),(O||U)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(c):c,U?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(d.res=f,d):f}},{key:"extendTranslation",value:function(e,t,n,i,s){var r=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,Ze(Ze({},this.options.interpolation.defaultVariables),n),i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Ze(Ze({},n),{interpolation:Ze(Ze({},this.options.interpolation),n.interpolation)}));var o,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);o=c&&c.length}var u=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(u=Ze(Ze({},this.options.interpolation.defaultVariables),u)),e=this.interpolator.interpolate(e,u,n.lng||this.language,n),a){var l=e.match(this.interpolator.nestingRegexp);o<(l&&l.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&i&&i.res&&(n.lng=i.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return s&&s[0]===i[0]&&!n.context?(r.logger.warn("It seems you are nesting recursively key: ".concat(i[0]," in key: ").concat(t[0])),null):r.translate.apply(r,i.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var g=n.postProcess||this.options.postProcess,h="string"==typeof g?[g]:g;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=Xe.handle(h,e,t,this.options&&this.options.postProcessPassResolved?Ze({i18nResolved:i},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,i,s,r,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!o.isValidLookup(t)){var c=o.extractFromKey(e,a),u=c.key;n=u;var l=c.namespaces;o.options.fallbackNS&&(l=l.concat(o.options.fallbackNS));var g=void 0!==a.count&&"string"!=typeof a.count,h=g&&!a.ordinal&&0===a.count&&o.pluralResolver.shouldUseIntlApi(),p=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,d=a.lngs?a.lngs:o.languageUtils.toResolveHierarchy(a.lng||o.language,a.fallbackLng);l.forEach((function(e){o.isValidLookup(t)||(r=e,!Qe["".concat(d[0],"-").concat(e)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(r)&&(Qe["".concat(d[0],"-").concat(e)]=!0,o.logger.warn('key "'.concat(n,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(r,'" 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!!!")),d.forEach((function(n){if(!o.isValidLookup(t)){s=n;var r,c=[u];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(c,u,n,e,a);else{var l;g&&(l=o.pluralResolver.getSuffix(n,a.count,a));var d="".concat(o.options.pluralSeparator,"zero");if(g&&(c.push(u+l),h&&c.push(u+d)),p){var f="".concat(u).concat(o.options.contextSeparator).concat(a.context);c.push(f),g&&(c.push(f+l),h&&c.push(f+d))}}for(;r=c.pop();)o.isValidLookup(t)||(i=r,t=o.getResource(n,e,r,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:i,usedLng:s,usedNS:r}}},{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 i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,i):this.resourceStore.getResource(e,t,n,i)}}],[{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 tt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var nt=function(){function e(t){Te(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ke.create("languageUtils")}return Ie(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]=tt(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]=tt(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=tt(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 i=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(i)||(t=i)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var i=n.getLanguagePartFromCode(e);if(n.isSupportedCode(i))return t=i;t=n.options.supportedLngs.find((function(e){return e===i?e:e.indexOf("-")<0&&i.indexOf("-")<0?void 0:0===e.indexOf(i)?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,i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),s=[],r=function(e){e&&(n.isSupportedCode(e)?s.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&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLanguageCode(e)),i.forEach((function(e){s.indexOf(e)<0&&r(n.formatLanguageCode(e))})),s}}]),e}(),it=[{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}],st={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)}},rt=["v1","v2","v3"],ot={zero:0,one:1,two:2,few:3,many:4,other:5},at=function(){function e(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Te(this,e),this.languageUtils=t,this.options=i,this.logger=ke.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={},it.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:st[e.fc]}}))})),n)}return Ie(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]:{},i=this.getRule(e,n);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((function(e,t){return ot[e]-ot[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):i.numbers.map((function(i){return t.getSuffix(e,i,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.getRule(e,n);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(t)):this.getSuffixRetroCompatible(i,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,i=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),s=e.numbers[i];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===s?s="plural":1===s&&(s=""));var r=function(){return n.options.prepend&&s.toString()?n.options.prepend+s.toString():s.toString()};return"v1"===this.options.compatibilityJSON?1===s?"":"number"==typeof s?"_plural_".concat(s.toString()):r():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?r():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!rt.includes(this.options.compatibilityJSON)}}]),e}();function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lt(e,t,n){var i,s,r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=(i=t,void 0!==(r=Ge(e,s=n))?r:Ge(i,s));return!c&&a&&"string"==typeof n&&void 0===(c=Ye(e,n,o))&&(c=Ye(t,n,o)),c}var gt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Te(this,e),this.logger=ke.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return Ie(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:He,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Be(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Be(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?Be(t.nestingPrefix):t.nestingPrefixEscaped||Be("$t("),this.nestingSuffix=t.nestingSuffix?Be(t.nestingSuffix):t.nestingSuffixEscaped||Be(")"),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,i){var s,r,o,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 s=lt(t,c,e,a.options.keySeparator,a.options.ignoreJSONStructure);return a.alwaysFormat?a.format(s,void 0,n,ut(ut(ut({},i),t),{},{interpolationkey:e})):s}var r=e.split(a.formatSeparator),o=r.shift().trim(),u=r.join(a.formatSeparator).trim();return a.format(lt(t,c,o,a.options.keySeparator,a.options.ignoreJSONStructure),u,n,ut(ut(ut({},i),t),{},{interpolationkey:o}))};this.resetRegExp();var g=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,h=i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.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(o=0;s=t.regex.exec(e);){var n=s[1].trim();if(void 0===(r=l(n)))if("function"==typeof g){var c=g(e,s,i);r="string"==typeof c?c:""}else if(i&&Object.prototype.hasOwnProperty.call(i,n))r="";else{if(h){r=s[0];continue}a.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),r=""}else"string"==typeof r||a.useRawValueToEscape||(r=Le(r));var u=t.safeValue(r);if(e=e.replace(s[0],u),h?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=s[0].length):t.regex.lastIndex=0,++o>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,i,s,r=this,o=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 i=e.split(new RegExp("".concat(n,"[ ]*{"))),r="{".concat(i[1]);e=i[0];var o=(r=this.interpolate(r,s)).match(/'/g),a=r.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(r=r.replace(/'/g,'"'));try{s=JSON.parse(r),t&&(s=ut(ut({},t),s))}catch(c){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),c),"".concat(e).concat(n).concat(r)}return delete s.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var c=[];(s=(s=ut({},o)).replace&&"string"!=typeof s.replace?s.replace:s).applyPostProcessor=!1,delete s.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((i=t(a.call(this,n[1].trim(),s),s))&&n[0]===e&&"string"!=typeof i)return i;"string"!=typeof i&&(i=Le(i)),i||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),i=""),u&&(i=c.reduce((function(e,t){return r.format(e,t,o.lng,ut(ut({},o),{},{interpolationkey:n[1].trim()}))}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}]),e}();function ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function pt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ht(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dt(e){var t={};return function(n,i,s){var r=i+JSON.stringify(s),o=t[r];return o||(o=e(i,s),t[r]=o),o(n)}}var ft=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Te(this,e),this.logger=ke.create("formatter"),this.options=t,this.formats={number:dt((function(e,t){var n=new Intl.NumberFormat(e,pt({},t));return function(e){return n.format(e)}})),currency:dt((function(e,t){var n=new Intl.NumberFormat(e,pt(pt({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:dt((function(e,t){var n=new Intl.DateTimeFormat(e,pt({},t));return function(e){return n.format(e)}})),relativetime:dt((function(e,t){var n=new Intl.RelativeTimeFormat(e,pt({},t));return function(e){return n.format(e,t.range||"day")}})),list:dt((function(e,t){var n=new Intl.ListFormat(e,pt({},t));return function(e){return n.format(e)}}))},this.init(t)}return Ie(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()]=dt(t)}},{key:"format",value:function(e,t,n){var i=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce((function(e,t){var r=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var i=e.split("(");t=i[0].toLowerCase().trim();var s=i[1].substring(0,i[1].length-1);"currency"===t&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):"relativetime"===t&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.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 De(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)?De(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(":")),i=t[0],s=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[i.trim()]||(n[i.trim()]=s),"false"===s&&(n[i.trim()]=!1),"true"===s&&(n[i.trim()]=!0),isNaN(s)||(n[i.trim()]=parseInt(s,10))}}))}return{formatName:t,formatOptions:n}}(t),o=r.formatName,a=r.formatOptions;if(i.formats[o]){var c=e;try{var u=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},l=u.locale||u.lng||s.locale||s.lng||n;c=i.formats[o](e,l,pt(pt(pt({},a),s),u))}catch(g){i.logger.warn(g)}return c}return i.logger.warn("there was no format function for ".concat(o)),e}),e)}}]),e}();function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var mt=function(){Ce(t,we);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,i=Ue(e);if(t){var s=Ue(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return Me(this,n)}}(t);function t(n,i,s){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Te(this,t),r=e.call(this),$e&&we.call(_e(r)),r.backend=n,r.store=i,r.services=s,r.languageUtils=s.languageUtils,r.options=o,r.logger=ke.create("backendConnector"),r.waitingReads=[],r.maxParallelReads=o.maxParallelReads||10,r.readingCalls=0,r.maxRetries=o.maxRetries>=0?o.maxRetries:5,r.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(s,o.backend,o),r}return Ie(t,[{key:"queueLoad",value:function(e,t,n,i){var s=this,r={},o={},a={},c={};return e.forEach((function(e){var i=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&s.store.hasResourceBundle(e,t)?s.state[a]=2:s.state[a]<0||(1===s.state[a]?void 0===o[a]&&(o[a]=!0):(s.state[a]=1,i=!1,void 0===o[a]&&(o[a]=!0),void 0===r[a]&&(r[a]=!0),void 0===c[t]&&(c[t]=!0)))})),i||(a[e]=!0)})),(Object.keys(r).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(e,t,n){var i=e.split("|"),s=i[0],r=i[1];t&&this.emit("failedLoading",s,r,t),n&&this.store.addResourceBundle(s,r,n),this.state[e]=t?-1:2;var o={};this.queue.forEach((function(n){var i,a,c,u,l,g,h;i=n.loaded,a=r,(u=(c=xe(i,[s],Object)).obj)[l=c.k]=u[l]||[],u[l].push(a),h=e,void 0!==(g=n).pending[h]&&(delete g.pending[h],g.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){o[e]||(o[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===o[e][t]&&(o[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",o),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var i=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:r,callback:o});else{this.readingCalls++;var a=function(a,c){if(i.readingCalls--,i.waitingReads.length>0){var u=i.waitingReads.shift();i.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}a&&c&&s<i.maxRetries?setTimeout((function(){i.read.call(i,e,t,n,s+1,2*r,o)}),r):o(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,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=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."),s&&s();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var r=this.queueLoad(e,t,i,s);if(!r.toLoad.length)return r.pending.length||s(),null;r.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]:"",i=e.split("|"),s=i[0],r=i[1];this.read(s,r,"read",void 0,void 0,(function(i,o){i&&t.logger.warn("".concat(n,"loading namespace ").concat(r," for language ").concat(s," failed"),i),!i&&o&&t.logger.log("".concat(n,"loaded namespace ").concat(r," for language ").concat(s),o),t.loaded(e,i,o)}))}},{key:"saveMissing",value:function(e,t,n,i,s){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=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=Et(Et({},r),{},{isUpdate:s}),c=this.backend.create.bind(this.backend);if(c.length<6)try{var u;(u=5===c.length?c(e,t,n,i,a):c(e,t,n,i))&&"function"==typeof u.then?u.then((function(e){return o(null,e)})).catch(o):o(null,u)}catch(l){o(l)}else c(e,t,n,i,o,a)}e&&e[0]&&this.store.addResource(e[0],t,n,i)}}}]),t}();function Tt(){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"===me(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===me(e[2])||"object"===me(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,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function St(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 yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function It(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yt(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _t(){}var bt=function(){Ce(t,we);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,i=Ue(e);if(t){var s=Ue(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return Me(this,n)}}(t);function t(){var n,i,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(Te(this,t),n=e.call(this),$e&&we.call(_e(n)),n.options=St(s),n.services={},n.logger=ke,n.modules={external:[]},i=_e(n),Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((function(e){"function"==typeof i[e]&&(i[e]=i[e].bind(i))})),r&&!n.isInitialized&&!s.isClone){if(!n.options.initImmediate)return n.init(s,r),Me(n,_e(n));setTimeout((function(){n.init(s,r)}),0)}return n}return Ie(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 i=Tt();function s(e){return e?"function"==typeof e?new e:e:null}if(this.options=It(It(It({},i),this.options),St(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=It(It({},i.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 r;this.modules.logger?ke.init(s(this.modules.logger),this.options):ke.init(null,this.options),this.modules.formatter?r=this.modules.formatter:"undefined"!=typeof Intl&&(r=ft);var o=new nt(this.options);this.store=new We(this.options.resources,this.options);var a=this.services;a.logger=ke,a.resourceStore=this.store,a.languageUtils=o,a.pluralResolver=new at(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!r||this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format||(a.formatter=s(r),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new gt(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new mt(s(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];e.emit.apply(e,[t].concat(i))})),this.modules.languageDetector&&(a.languageDetector=s(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=s(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new et(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),s=1;s<n;s++)i[s-1]=arguments[s];e.emit.apply(e,[t].concat(i))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=_t),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=Ne(),l=function(){var t=function(t,i){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(i),n(t,i)};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]:_t,i="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return n();var s=[],r=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){s.indexOf(e)<0&&s.push(e)}))};i?r(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return r(e)})),this.options.preload&&this.options.preload.forEach((function(e){return r(e)})),this.services.backendConnector.load(s,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 i=Ne();return e||(e=this.languages),t||(t=this.options.ns),n||(n=_t),this.services.backendConnector.reload(e,t,(function(e){i.resolve(),n(e)})),i}},{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&&Xe.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 i=Ne();this.emit("languageChanging",e);var s=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},r=function(r){e||r||!n.services.languageDetector||(r=[]);var o="string"==typeof r?r:n.services.languageUtils.getBestMatchFromCodes(r);o&&(n.language||s(o),n.translator.language||n.translator.changeLanguage(o),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(o)),n.loadResources(o,(function(e){var r,a;r=e,(a=o)?(s(a),n.translator.changeLanguage(a),n.isLanguageChangingTo=void 0,n.emit("languageChanged",a),n.logger.log("languageChanged",a)):n.isLanguageChangingTo=void 0,i.resolve((function(){return n.t.apply(n,arguments)})),t&&t(r,(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(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),i}},{key:"getFixedT",value:function(e,t,n){var i=this,s=function e(t,s){var r;if("object"!==me(s)){for(var o=arguments.length,a=new Array(o>2?o-2:0),c=2;c<o;c++)a[c-2]=arguments[c];r=i.options.overloadTranslationOptionHandler([t,s].concat(a))}else r=It({},s);r.lng=r.lng||e.lng,r.lngs=r.lngs||e.lngs,r.ns=r.ns||e.ns,r.keyPrefix=r.keyPrefix||n||e.keyPrefix;var u,l=i.options.keySeparator||".";return u=r.keyPrefix&&Array.isArray(t)?t.map((function(e){return"".concat(r.keyPrefix).concat(l).concat(e)})):r.keyPrefix?"".concat(r.keyPrefix).concat(l).concat(t):t,i.t(u,r)};return"string"==typeof e?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}},{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 i=n.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;var o=function(e,n){var i=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===i||2===i};if(n.precheck){var a=n.precheck(this,o);if(void 0!==a)return a}return!(!this.hasResourceBundle(i,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(i,e)||s&&!o(r,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,i=Ne();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){i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Ne();"string"==typeof e&&(e=[e]);var i=this.options.preload||[],s=e.filter((function(e){return i.indexOf(e)<0}));return s.length?(this.options.preload=i.concat(s),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 nt(Tt());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]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_t,s=It(It(It({},this.options),n),{isClone:!0}),r=new t(s);return void 0===n.debug&&void 0===n.prefix||(r.logger=r.logger.clone(n)),["store","services","language"].forEach((function(t){r[t]=e[t]})),r.services=It({},this.services),r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r.translator=new et(r.services,r.options),r.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r.emit.apply(r,[e].concat(n))})),r.init(s,i),r.translator.options=r.options,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}();Oe(bt,"createInstance",(function(){return new bt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var Ct=bt.createInstance();Ct.createInstance=bt.createInstance,Ct.createInstance,Ct.dir,Ct.init,Ct.loadResources,Ct.reloadResources,Ct.use,Ct.changeLanguage,Ct.getFixedT,Ct.t,Ct.exists,Ct.setDefaultNamespace,Ct.hasLoadedNamespace,Ct.loadNamespaces,Ct.loadLanguages;class Mt extends re{constructor(){super(),this.languages=null}static getInstance(){return Mt.instance||(Mt.instance=new Mt),Mt.instance}provideLanguages(e){F||(this.languages=e,console.log("TUITranslateService.provideLanguages ok."))}useI18n(e){if(F)return;if(!this.languages)return void console.warn("TUITranslateService.useI18next not have messages.");const t={};for(const[n,i]of Object.entries(this.languages))t["zh_cn"===n?"zh":n]={translation:i};Ct.init({compatibilityJSON:"v3",lng:e||"zh",fallbackLng:"zh",detection:{order:["querystring","navigator"],caches:["localStorage","cookie"]},resources:t})}changeLanguage(e){return Ct.changeLanguage(e)}t(e){if(!this.languages){let t=e;return!A(e)&&e.indexOf(".")>-1&&(t=e.split(".").pop()||""),t}return Ct.t(e)}}class Ut extends re{constructor(){super(),this.serv="TUIConversationService"}static getInstance(){return Ut.instance||(Ut.instance=new Ut),Ut.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(_.CONV,"conversationList",t),this.updateCurrentConversation()}onTotalUnreadCountUpdated(e){this.getEngine().TUIStore.update(_.CONV,"totalUnreadCount",e)}onMessageReceived(e){const t=this.getEngine(),n=this.getEngine().TUIStore.getData(_.CONV,"conversationList");let i=!1;for(let s=0;s<e.length;s++){if(e[s].type!==t.TYPES.MSG_GRP_SYS_NOTICE)continue;const{operationType:r}=e[s].payload,o=`GROUP${e[s].to}`,a=4===r||5===r||8===r,c=2===r||6===r||7===r;if(a||c)for(let e=0;e<n.length;e++)if(n[e].type!==t.TYPES.CONV_C2C&&n[e].conversationID===o){if(a){this.getEngine().TUIStore.update(_.CONV,"operationTypeMap",{conversationID:o,operationType:r}),i=!0;break}if(c&&n[e].operationType>0){this.getEngine().TUIStore.update(_.CONV,"operationTypeMap",{conversationID:o,operationType:0}),i=!0;break}}}if(i){this.getEngine().TUIStore.update(_.CONV,"conversationList",n);const e=this.getEngine().TUIStore.getData(_.CONV,"currentConversationID")||"",t=this.findConversation(e);t&&this.getEngine().TUIStore.update(_.CONV,"currentConversation",t)}}getConversationInitData(){const e=this.getEngine();e.chat.isReady()&&e.chat.getConversationList().then((t=>{const{conversationList:n,isSyncCompleted:i}=t.data;if(console.log(`${this.serv}.init, getConversationList count:${n.length} isSyncCompleted:${i}`),n.length>0){this.onConversationListUpdated(n);const t=e.chat.getTotalUnreadMessageCount();this.onTotalUnreadCountUpdated(t)}}))}switchConversation(e){return S(this,void 0,void 0,(function*(){const t=`${this.serv}.switchConversation`,n=this.getEngine();if(!e)return n.TUIStore.reset(_.CHAT,["messageList","isCompleted","nextReqMessageID"]),n.TUIStore.update(_.CONV,"currentConversationID",""),n.TUIStore.update(_.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:O.INVALID_CONV_ID,message:P.INVALID_CONV_ID});const i=n.TUIStore.getData(_.CONV,"currentConversationID");if(i&&i===e)return this.setMessageRead(i),console.warn(`${t} please check conversationID, conversationID:${e}`),Promise.resolve({code:O.CONV_ID_SAME,message:P.CONV_ID_SAME});const s=yield this.getConversationModel(e);return A(s)?(console.warn(`${t} target conversation is not exist, conversationID:${e}`),Promise.reject({code:O.CONV_NOT_EXIST,message:P.CONV_NOT_EXIST})):(i&&this.setMessageRead(i),e&&this.setMessageRead(e),n.TUIStore.reset(_.CHAT,["messageList","isCompleted","nextReqMessageID"]),n.TUIStore.update(_.CONV,"currentConversationID",e),n.TUIStore.update(_.CONV,"currentConversation",s),Promise.resolve(s))}))}getConversationModel(e){return S(this,void 0,void 0,(function*(){let t=this.findConversation(e);if(A(t))try{const n=yield this.getConversationProfile(e);n.data&&n.data.conversation&&(t=new ce(n.data.conversation))}catch(n){t=void 0}return t}))}findConversation(e){let t;const n=this.getEngine().TUIStore.getData(_.CONV,"conversationList");for(let i=0;i<n.length;i++)if(n[i].conversationID===e){t=n[i];break}return t}updateCurrentConversation(){const e=this.getEngine(),t=e.TUIStore.getData(_.CONV,"currentConversationID"),n=this.findConversation(t);n&&e.TUIStore.update(_.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(_.CONV,"currentConversationID");return console.log(`${this.serv}.deleteConversation conversationID:${e} currentConversationID:${n}`),e===n&&(this.getEngine().TUIStore.update(_.CONV,"currentConversationID",""),this.getEngine().TUIStore.update(_.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(_.CHAT,"messageList",[]),this.getEngine().TUIStore.update(_.CHAT,"nextReqMessageID",""),this.getEngine().TUIStore.update(_.CHAT,"isCompleted",!0),e)))}setMessageRead(e){return this.getEngine().chat.setMessageRead({conversationID:e})}setConversationDraft(e){const{conversationID:t,draftInfo:n}=e;let i="";return n&&(i=JSON.stringify(n)),this.getEngine().chat.setConversationDraft({conversationID:t,draftText:i}).then((e=>{const{conversation:t}=e.data;this.updateConversation(t)}))}updateConversation(e){let t=!1;const n=this.getEngine().TUIStore.getData(_.CONV,"conversationList");for(let i=0;i<n.length;i++)if(n[i].conversationID===e.conversationID){n[i]=e,t=!0;break}t&&this.getEngine().TUIStore.update(_.CONV,"conversationList",n)}filterSystemConversation(e){return e.filter((e=>e.type!==this.getEngine().TYPES.CONV_SYSTEM))}}class Ot{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(_.USER,"userProfile");e.forEach((e=>{e.userID===n.userID&&t.TUIStore.update(_.USER,"userProfile",e)}))}onBlacklistUpdated(e){const t=this.getEngine();this.getBlacklistProfile(e).then((e=>{t.TUIStore.update(_.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 i=[];t.forEach((e=>{i.push(this.TUIUserService.getUserProfile({userIDList:e}))}));const s=[];return Promise.all(i).then((e=>(e.forEach((e=>{const t=e.data.map((e=>{const{userID:t,nick:n,avatar:i}=e;return{userID:t,nick:n,avatar:i}}));s.push(...t)})),s)))}getUserProfile(e){const t=this.getEngine();return A(e)?t.chat.getMyProfile().then((e=>(t.TUIStore.update(_.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 Dt(e,t,n=!0){var i,s;i=n?Rt(e):e,s=t,$?z.setStorageSync(i,s):At()&&localStorage.setItem(i,JSON.stringify(s))}function Pt(e,t=!0){try{return function(e){if($)return z.getStorageSync(e);if(At()){const t=localStorage.getItem(e);if("undefined"!==t)return JSON.parse(t)}}(t?Rt(e):e)}catch(n){return void console.warn("Storage.getStorageItem error:",n)}}function Rt(e){return`chat_engine_${e}`}function At(){return navigator&&navigator.cookieEnabled&&localStorage}class kt{constructor(e){this.TUIUserService=e}getEngine(){return this.TUIUserService.getEngine()}init(){const e=this.getEngine(),t=Pt("displayOnlineStatus")||!1;e.TUIStore.update(_.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(_.CONV,{conversationList:()=>{const t=e.TUIStore.getData(_.APP,"enabledOnlineStatus"),n=e.TUIStore.getData(_.USER,"displayOnlineStatus");t&&n&&this.startToSubscribe()}})}onUserStatusUpdated(e){this.getEngine().TUIStore.update(_.USER,"userStatusList",e)}switchUserStatus(e){const t=this.getEngine(),{displayOnlineStatus:n=!1}=e;t.TUIStore.update(_.USER,"displayOnlineStatus",n),Dt("displayOnlineStatus",n);const i=t.TUIStore.getData(_.APP,"enabledOnlineStatus");i?!0===n?this.startToSubscribe():this.unsubscribeUserStatus():console.warn(`UserStatusHandler.switchUserStatus enabledOnlineStatus:${i} 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(_.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:i}=e.data,s=[];return n.forEach((e=>{i.includes(e)||s.push({userID:e,statusType:b.UNSUB_USER})})),t.TUIStore.update(_.USER,"userStatusList",s),e})).catch((e=>Promise.reject(e)))}startToSubscribe(){const e=this.getEngine(),t=e.TUIStore.getData(_.CONV,"conversationList"),n=e.TUIStore.getData(_.USER,"userStatusList"),i=[];t.forEach((t=>{if(t.type===e.TYPES.CONV_C2C){const s=t.conversationID.replace(e.TYPES.CONV_C2C,"");n.has(s)||i.push(s)}})),0!==i.length&&e.chat.isReady()&&(this.subscribeUserStatus({userIDList:i}),this.getUserStatus({userIDList:i}))}}class wt extends re{constructor(){super(),this.userProfileHandler=new Ot(this),this.userStatusHandler=new kt(this)}static getInstance(){return wt.instance||(wt.instance=new wt),wt.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(_.USER,"kickedOut",e.type)}onNetStateChange(e){this.getEngine().TUIStore.update(_.USER,"netStateChange",e.state)}initMessageReadReceipt(){const e=Pt("displayMessageReadReceipt")||!0;this.getEngine().TUIStore.update(_.USER,"displayMessageReadReceipt",e)}switchUserStatus(e){return this.userStatusHandler.switchUserStatus(e)}switchMessageReadStatus(e){this.getEngine().TUIStore.update(_.USER,"displayMessageReadReceipt",e),Dt("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 Nt{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:L(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("message.custom.自定义消息")}]`,businessID:n?"group_create":""}}handleMergeMessage(e){return Object.assign({},e.payload)}handleGroupTipsMessage(e){var t,n,i,s,r,o;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===(s=null===(i=null==e?void 0:e.payload)||void 0===i?void 0:i.memberList)||void 0===s?void 0:s.length)>0&&(u="",null===(o=null===(r=null==e?void 0:e.payload)||void 0===r?void 0:r.memberList)||void 0===o||o.map((e=>{const t=(null==e?void 0:e.nick)||(null==e?void 0:e.userID);u+=`${this.substringByLength(t)},`})),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,i,s,r,o,a,c,u,l;const g=N(e.payload.data);if(1!==(null==g?void 0:g.businessID))return"";const h=N(null==g?void 0:g.data),p=e.fromAccount||e.from,d=this.getEngine().TUIFriend.getFriendRemark([p]),f=this.getEngine().getMyUserID();let v=d[p]||e.nameCard||e.nick||p;switch(v=this.substringByLength(v),null==g?void 0:g.actionType){case 1:return"audioCall"!==(null===(t=null==h?void 0:h.data)||void 0===t?void 0:t.cmd)&&"videoCall"!==(null===(n=null==h?void 0:h.data)||void 0===n?void 0:n.cmd)||!(null==g?void 0:g.groupID)?"hangup"===(null===(i=null==h?void 0:h.data)||void 0===i?void 0:i.cmd)?(null==g?void 0:g.groupID)?`${this.t("message.custom.通话结束")}`:`${this.t("message.custom.通话时长")}:${function(e){const t=e;let n,i,s,r="";return t>=3600?(n=parseInt(""+t/3600,10)<10?`0${parseInt(""+t/3600,10)}`:parseInt(""+t/3600,10),i=parseInt(""+t%60/60,10)<10?`0${parseInt(""+t%60/60,10)}`:parseInt(""+t%60/60,10),s=t%3600<10?"0"+t%3600:t%3600,s>60&&(i=parseInt(""+s/60,10)<10?`0${parseInt(""+s/60,10)}`:parseInt(""+s/60,10),s=s%60<10?"0"+s%60:s%60),r=`${n}:${i}:${s}`):t>=60&&t<3600?(i=parseInt(""+t/60,10)<10?`0${parseInt(""+t/60,10)}`:parseInt(""+t/60,10),s=t%60<10?"0"+t%60:t%60,r=`00:${i}:${s}`):t<60&&(s=t<10?`0${t}`:t,r=`00:00:${s}`),r}(null==h?void 0:h.call_end)}`:"switchToAudio"===(null===(s=null==h?void 0:h.data)||void 0===s?void 0:s.cmd)?`${this.t("message.custom.切换语音通话")}`:"switchToVideo"===(null===(r=null==h?void 0:h.data)||void 0===r?void 0:r.cmd)?`${this.t("message.custom.切换视频通话")}`:`${this.t("message.custom.发起通话")}`:`${v} ${this.t("message.custom.发起通话")}`;case 2:return(null==g?void 0:g.groupID)?`${v} ${this.t("message.custom.取消通话")}`:this.isOldUIKit("message.custom.已取消")?this.t("message.custom.取消通话"):(null==g?void 0:g.inviter)===f?this.t("message.custom.已取消"):this.t("message.custom.对方已取消");case 3:return"switchToAudio"===(null===(o=null==h?void 0:h.data)||void 0===o?void 0:o.cmd)?`${this.t("message.custom.切换语音通话")}`:"switchToVideo"===(null===(a=null==h?void 0:h.data)||void 0===a?void 0:a.cmd)?`${this.t("message.custom.切换视频通话")}`:(null==g?void 0:g.groupID)?`${v} ${this.t("message.custom.已接听")}`:this.t("message.custom.已接听");case 4:return(null==g?void 0:g.groupID)?`${v} ${this.t("message.custom.拒绝通话")}`:this.isOldUIKit("message.custom.已拒绝")?this.t("message.custom.拒绝通话"):"line_busy"===(null==h?void 0:h.line_busy)||"lineBusy"===(null==h?void 0:h.data.message)?(null==g?void 0:g.inviter)===f?this.t("message.custom.对方忙线中"):this.t("message.custom.忙线未接听"):(null==g?void 0:g.inviter)===f?this.t("message.custom.对方已拒绝"):this.t("message.custom.已拒绝");case 5:if("switchToAudio"===(null===(c=null==h?void 0:h.data)||void 0===c?void 0:c.cmd))return`${this.t("message.custom.切换语音通话")}`;if("switchToVideo"===(null===(u=null==h?void 0:h.data)||void 0===u?void 0:u.cmd))return`${this.t("message.custom.切换视频通话")}`;if(null==g?void 0:g.groupID){if(p===(null==g?void 0:g.inviter)){this.handleCallkitTimeoutSignaling(g.inviteeList);let e="";return null===(l=g.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`${v} ${this.t("message.custom.无应答")}`}return this.isOldUIKit("message.custom.对方无应答")?this.t("message.custom.无应答"):(null==g?void 0:g.inviter)===f?this.t("message.custom.对方无应答"):this.t("message.custom.超时无应答");default:return""}}handleCreateGroupCustomMessage(e){let t;const n=N(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,i=-1,s=-1;for(;""!==n;)switch(i=n.indexOf("["),s=n.indexOf("]"),i){case 0:if(-1===s)t.push({name:"text",text:n}),n="";else{const e=n.slice(0,s+1);e.indexOf("@custom")>-1?(t.push({name:"img",src:"",type:"custom",emojiKey:e}),n=n.substring(s+1)):x[e]?(t.push({name:"img",src:"https://web.sdk.qcloud.com/im/assets/emoji-plugin/"+x[e],emojiKey:e}),n=n.substring(s+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,i)}),n=n.substring(i)}return t}handleGroupProfileUpdated(e){const{nick:t,payload:n}=e,{newGroupProfile:i,memberList:s,operatorID:r}=n;let o="";const a=t||r,c=Object.keys(i)[0];switch(c){case"muteAllMembers":o=i[c]?`${this.t("message.tip.管理员")} ${a} ${this.t("message.tip.开启全员禁言")}`:`${this.t("message.tip.管理员")} ${a} ${this.t("message.tip.取消全员禁言")}`;break;case"ownerID":o=`${s[0].nick||s[0].userID} ${this.t("message.tip.成为新的群主")}`;break;case"groupName":o=`${a} ${this.t("message.tip.修改群名为")} ${i[c]}`;break;case"notification":o=this.isOldUIKit("message.tip.把群公告修改为")?`${a} ${this.t("message.tip.发布新公告")}`:`${a} ${this.t("message.tip.把群公告修改为")} "${i[c]}"`}return o}handleCallkitTimeoutSignaling(e=[]){if(0===e.length)return;const t=this.getEngine().TUIFriend.getFriendRemark(e),n=[];e.forEach((e=>{const i=t[e];i?this.userShowNameMap.set(e,i):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,i=n||t;this.userShowNameMap.set(t,i)}))})).catch((e=>{}))}substringByLength(e,t=12){return e.length>t?`${e.slice(0,t)}...`:e}isOldUIKit(e){var t;const n=e.lastIndexOf("."),i=e.slice(0,n+1);return null===(t=this.t(e))||void 0===t?void 0:t.startsWith(i)}}class Lt{constructor(e){this.TUIChatService=e,this.typingTo="",this.timer=null}getEngine(){return this.TUIChatService.getEngine()}clearTypingStatus(){this.getEngine().TUIStore.getData(_.CHAT,"typingStatus")&&this.getEngine().TUIStore.update(_.CHAT,"typingStatus",!1),this.timer&&clearTimeout(this.timer),this.timer=null}handleLastMessage(e){const t=this.getEngine(),n=t.TUIStore.getData(_.CHAT,"typingStatus");if(e.type===this.getEngine().TYPES.MSG_CUSTOM&&"in"===e.flow){const i=N(e.payload.data);if(i.businessID===C.BUSINESS_ID){const{typingStatus:e,userAction:s}=i;if(e===C.STATUS_START||s===C.ACTION_START_ID)return n?(this.timer&&clearTimeout(this.timer),this.timer=null):t.TUIStore.update(_.CHAT,"typingStatus",!0),this.timer=setTimeout((()=>{this.clearTypingStatus()}),3e4),t.TUIStore.getData(_.CHAT,"typingStatus");e!==C.STATUS_END&&s!==C.ACTION_END_ID||this.clearTypingStatus()}}}filterTypingMessage(e=[]){return 0===e.length?[]:(this.getEngine().TUIStore.getData(_.APP,"enableTyping")&&this.handleLastMessage(e[e.length-1]),e.filter((e=>e.type!==this.getEngine().TYPES.MSG_CUSTOM||N(e.payload.data).businessID!==C.BUSINESS_ID)))}createTypingMessage(e=C.STATUS_END,t=""){const{BUSINESS_ID:n,STATUS_START:i,VERSION:s,ACTION_START_ID:r,ACTION_END_ID:o,ACTION_START:a,ACTION_END:c,NEED_TYPING:u}=C;return{to:t,conversationType:this.getEngine().TYPES.CONV_C2C,payload:{data:JSON.stringify({businessID:n,typingStatus:e,version:s,userAction:e===i?r:o,actionParam:e===i?a:c}),description:"",extension:""},cloudCustomData:JSON.stringify({messageFeature:{needTyping:u,version:s}})}}sendTyping(e=!1,t=""){if(e){this.typingTo=t;const e=this.createTypingMessage(C.STATUS_START,t);this.getEngine().TUIChat.sendCustomMessage(e,{onlineUserOnly:!0})}else this.sendTypingEnd()}sendTypingEnd(){if(this.typingTo){const e=this.createTypingMessage(C.STATUS_END,this.typingTo);this.getEngine().TUIChat.sendCustomMessage(e,{onlineUserOnly:!0})}this.typingTo=""}}class xt{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(_.CONV,"currentConversationID"),i=[];e.forEach((e=>{const{messageID:s}=e,r=t.chat.findMessage(s);r&&n===r.conversationID&&i.push(r)})),i.length>0&&t.TUIChat.updateMessageList(i,"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(_.APP,"enabledMessageReadReceipt"),i=t.TUIStore.getData(_.USER,"displayMessageReadReceipt");!n||!i||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 jt extends re{constructor(){super(),this.serv="TUIChatService",this.messageHandler=new Nt(this),this.typingHandler=new Lt(this),this.readReceiptHandler=new xt(this),this.isSwitching=!0,this.delayGetHoppingFunction=void 0,this.hoppingConfigMap=new Map}static getInstance(){return jt.instance||(jt.instance=new jt),jt.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,"push"),this.getEngine().TUIStore.update(_.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(_.CONV,{currentConversationID:t=>{this.isSwitching=!0,this.delayGetHoppingFunction=void 0,this.hoppingConfigMap.clear(),e.TUIStore.reset(_.CHAT),this.typingHandler.clearTypingStatus(),this.typingHandler.sendTypingEnd(),oe(t)||this.getMessageList().finally((()=>{this.isSwitching=!1,this.delayGetHoppingFunction&&this.delayGetHoppingFunction()}))}})}onMessageSource(){const e=this.getEngine();e.TUIStore.watch(_.CHAT,{messageSource:t=>{const n=this.getStoreData(_.CONV,"currentConversationID");if(!n||t&&t.conversationID!==n)return;if(A(t))return this.hoppingConfigMap.clear(),e.TUIStore.update(_.CHAT,"messageList",[]),e.TUIStore.update(_.CHAT,"nextReqMessageID",""),e.TUIStore.update(_.CHAT,"isCompleted",!1),void this.getMessageList();const i=this.getStoreData(_.CHAT,"messageList");i&&i.find((e=>t&&e.ID===t.ID))||(this.isSwitching?this.delayGetHoppingFunction=this.getMessageListHoppingForDown:this.getMessageListHoppingForDown())}})}getMessageListHoppingForDown(){const e=this.getStoreData(_.CHAT,"messageList"),{conversationID:t,sequence:n,time:i,ID:s}=this.getStoreData(_.CHAT,"messageSource");if(e&&e.find((e=>s&&e.ID===s)))return;const r=this.getEngine();r.TUIStore.update(_.CHAT,"messageList",[]),r.TUIStore.update(_.CHAT,"nextReqMessageID",""),r.TUIStore.update(_.CHAT,"isCompleted",!1),this.getMessageListHopping({conversationID:t,sequence:n,time:i,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(_.CHAT,"messageSource")&&"unshift"!==t&&"edit"!==t)return;const n=this.getStoreData(_.CHAT,"messageList"),i=this.updateTargetMessageList(e,n,t);this.getEngine().TUIStore.update(_.CHAT,"messageList",i)}updateTargetMessageList(e,t,n=""){const i=this.getStoreData(_.CONV,"currentConversationID");let s=e.filter((e=>e.conversationID===i));if(s=this.handleC2CCallSignaling(s),!n||0===s.length)return t;const r=t||[];let o=[];if("send"===n||"push"===n){const e=this.getStoreData(_.CHAT,"userInfo");Object.keys(e).length>0&&this.updateLocalMessage(s,e)}switch(n){case"edit":for(const e of t){const t=s.find((t=>t.ID===e.ID));o.push(t||e)}break;case"resend":o=r.filter((e=>e.ID!==s[0].ID)).concat(s);break;case"send":o=r.concat(this.typingHandler.filterTypingMessage(s));break;case"push":o=r.concat(this.typingHandler.filterTypingMessage(s)),this.getEngine().chat.setMessageRead({conversationID:i});break;case"unshift":o=s.filter((e=>0===r.length||!r.find((t=>t.ID===e.ID)))),o.push(...r)}return o}enterTypingState(){this.getStoreData(_.APP,"enableTyping")&&this.sendTyping(!0)}leaveTypingState(){this.getStoreData(_.APP,"enableTyping")&&this.sendTyping(!1)}sendTyping(e){const t=this.getEngine(),n=this.getStoreData(_.CONV,"currentConversationID");if(!n.startsWith(t.TYPES.CONV_C2C))return;const i=n.replace(t.TYPES.CONV_C2C,"");if(e){const e=this.getStoreData(_.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,i)}quoteMessage(e){return this.getEngine().TUIStore.update(_.CHAT,"quoteMessage",{message:e,type:"quote"}),e}replyMessage(e){return this.getEngine().TUIStore.update(_.CHAT,"quoteMessage",{message:e,type:"reply"}),e}getCurrentConvInfo(){const{conversationID:e="",type:t}=this.getStoreData(_.CONV,"currentConversation")||{};return{to:e.replace(t,""),conversationType:t}}t(e){return this.getEngine().TUITranslate.t(e)||e}getMessageAbstractAndType(e){var t,n;const i=this.getEngine(),s={abstract:"",type:0};switch(e.type){case i.TYPES.MSG_TEXT:s.abstract=null===(t=null==e?void 0:e.payload)||void 0===t?void 0:t.text,s.type=1;break;case i.TYPES.MSG_CUSTOM:s.abstract="[自定义消息]",s.type=2;break;case i.TYPES.MSG_IMAGE:s.abstract="[图片]",s.type=3;break;case i.TYPES.MSG_AUDIO:s.abstract="[语音]",s.type=4;break;case i.TYPES.MSG_VIDEO:s.abstract="[视频]",s.type=5;break;case i.TYPES.MSG_FILE:s.abstract="[文件]",s.type=6;break;case i.TYPES.MSG_LOCATION:s.type=7;break;case i.TYPES.MSG_FACE:s.abstract="[表情]",s.type=8;break;case i.TYPES.MSG_GRP_TIP:s.type=9;break;case i.TYPES.MSG_MERGER:s.abstract=null===(n=null==e?void 0:e.payload)||void 0===n?void 0:n.title,s.type=10}return s}genMessageReply(e,t){if("reply"!==t&&"quote"!==t)return{};const{abstract:n,type:i}=this.getMessageAbstractAndType(e),s={messageAbstract:n,messageSender:e.nick||e.from,messageID:e.ID},r=Object.assign(Object.assign({},s),{messageType:i,messageTime:null==e?void 0:e.time,messageSequence:null==e?void 0:e.sequence,version:1});if("reply"===t&&(r.messageRootID=e.ID,e.cloudCustomData)){const t=N(e.cloudCustomData);t.messageReply&&t.messageReply.messageRootID&&(r.messageRootID=t.messageReply.messageRootID)}return{messageReply:r,messageReplyRoot:s}}getMessageInfo(e,t,n){const{messageReply:i,messageReplyRoot:s}=this.genMessageReply(t,n),r=e.cloudCustomData?N(e.cloudCustomData):{};let o;if(r.messageReply?r.messageReply=Object.assign(Object.assign({},i),r.messageReply):r.messageReply=i,"reply"===n){const{messageRootID:e}=i;o=this.getEngine().chat.findMessage(e);const t=(null==o?void 0:o.cloudCustomData)?N(o.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(s),o.cloudCustomData=JSON.stringify(t)}var a;return{cloudCustomData:JSON.stringify(r),rootMessage:o}}sendTextMessage(e,t){const n=this.getEngine(),{message:i,type:s}=this.getStoreData(_.CHAT,"quoteMessage");let r={cloudCustomData:e.cloudCustomData||"",rootMessage:void 0};i&&(r=this.getMessageInfo(e,i,s));const o=n.chat.createTextMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{cloudCustomData:r.cloudCustomData}));return this.sendMessage(o,t).then((e=>(r.rootMessage&&this.modifyMessage(r.rootMessage),n.TUIStore.reset(_.CHAT,["quoteMessage"],!0),e)))}sendTextAtMessage(e,t){const n=this.getEngine(),{message:i,type:s}=this.getStoreData(_.CHAT,"quoteMessage");let r={cloudCustomData:e.cloudCustomData||"",rootMessage:void 0};i&&(r=this.getMessageInfo(e,i,s));const o=n.chat.createTextAtMessage(Object.assign(Object.assign(Object.assign({},this.getCurrentConvInfo()),e),{cloudCustomData:r.cloudCustomData}));return this.sendMessage(o,t).then((e=>(r.rootMessage&&this.modifyMessage(r.rootMessage),n.TUIStore.reset(_.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 i="";switch(e.type){case t.TYPES.MSG_TEXT:i=e.payload.text||"",i.length>20&&(i=i.slice(0,20));break;case t.TYPES.MSG_MERGER:i=`${this.t("TUIChat.[聊天记录]")}`;break;case t.TYPES.MSG_IMAGE:i=`${this.t("TUIChat.[图片]")}`;break;case t.TYPES.MSG_AUDIO:i=`${this.t("TUIChat.[音频]")}`;break;case t.TYPES.MSG_VIDEO:i=`${this.t("TUIChat.[视频]")}`;break;case t.TYPES.MSG_CUSTOM:i=`${this.t("TUIChat.[自定义消息]")}`;break;case t.TYPES.MSG_FILE:i=`${this.t("TUIChat.[文件]")}`;break;case t.TYPES.MSG_FACE:i=`${this.t("TUIChat.[动画表情]")}`}return`${n}: ${i}`}genMergerForwardPayload(e,t){const{abstractList:n=[],compatibleText:i="",title:s}=t;return 0===n.length&&e.forEach((e=>{n.push(this.setAbstractList(e))})),{messageList:e,title:s,abstractList:n,compatibleText:i||this.t("TUIChat.请升级IMSDK到v2.10.1或更高版本查看此消息")}}genSendMergerForwardMessage(e){const{conversationList:t,messageList:n,params:i,mergeInfo:s,sendMessageOptions:r}=e,o=[];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,s)},i),l=this.getEngine().chat.createMergerMessage(u);o.push(this.sendMessage(l,r))}return o}genTitle(e,t){const{nick:n,from:i,to:s}=e;return`${n||i} ${this.t("TUIChat.和")} ${t||s} ${this.t("TUIChat.的聊天记录")}`}genMergeInfo(e){var t;return S(this,void 0,void 0,(function*(){const{messageList:n,mergeInfo:i}=e;if(i.title)return i;if(n[0].conversationType===this.getEngine().TYPES.CONV_GROUP)return i.title=this.t("TUIChat.群聊的聊天记录"),i;try{const{data:e=[]}=yield this.getEngine().TUIUser.getUserProfile({userIDList:[n[0].to]});i.title=this.genTitle(n[0],null===(t=e[0])||void 0===t?void 0:t.nick)}catch(s){i.title=this.genTitle(n[0])}return i}))}sendMergerForwardMessage(e){return S(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 le?e.getMessage():e))}sendForwardMessage(e,t,n){t=this.getOriginMessageList(t);const i=n||{},{needMerge:s=!1,params:r={},mergeInfo:o={}}=i,a=T(i,["needMerge","params","mergeInfo"]);if(s)return this.sendMergerForwardMessage({conversationList:e,messageList:t,params:r,mergeInfo:o,sendMessageOptions:a});const c=[];for(let u=0;u<e.length;u++){const{conversationID:n,type:i}=e[u],s=Object.assign({to:n.replace(`${i}`,""),conversationType:i},r),o=a[n]||a;for(let e=0;e<t.length;e++){Reflect.set(s,"payload",t[e]);const n=this.getEngine().chat.createForwardMessage(s);c.push(this.sendMessage(n,o))}}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===U.MSG_MODIFY_CONFLICT?console.warn(`${D.MSG_MODIFY_CONFLICT} data.message: ${null==n?void 0:n.message}`):t===U.MSG_MODIFY_DISABLED_IN_AVCHATROOM?console.warn(D.MSG_MODIFY_DISABLED_IN_AVCHATROOM):t===U.MODIFY_MESSAGE_NOT_EXIST&&console.warn(D.MODIFY_MESSAGE_NOT_EXIST),e}))}getMessageList(e={conversationID:this.getStoreData(_.CONV,"currentConversationID"),nextReqMessageID:this.getStoreData(_.CHAT,"nextReqMessageID")}){const t=this.getEngine();if(!t.chat.isReady())return Promise.reject({code:O.GET_MSG_LIST_ERROR,message:P.GET_MSG_LIST_ERROR});if(this.getStoreData(_.CHAT,"isCompleted"))return Promise.resolve({data:{messageList:[],nextReqMessageID:"",isCompleted:!0}});const n=this.getStoreData(_.CHAT,"messageSource"),i=this.hoppingConfigMap.get("nextMessageSeq"),s=this.hoppingConfigMap.get("nextMessageTime"),r=i||s;return n&&n.conversationID===e.conversationID&&r?this.getMessageListHopping():t.chat.getMessageList(e).then((e=>{var n;const{messageList:i,nextReqMessageID:s,isCompleted:r}=e.data,o=this.getStoreData(_.CHAT,"userInfo");Object.keys(o).length>0&&this.updateLocalMessage(i,o),this.updateMessageList(i,"unshift"),t.TUIStore.update(_.CHAT,"nextReqMessageID",s),t.TUIStore.update(_.CHAT,"isCompleted",r);const a=null===(n=i[0])||void 0===n?void 0:n.conversationID,{operationType:c=0}=this.getEngine().TUIStore.getConversationModel(a)||{};return 0===c&&(this.getMessageReactions({messageList:i}),this.readReceiptHandler.getMessageReadReceiptList(i)),e})).catch((e=>Promise.reject(e)))}getMessageListHopping(e){var t;void 0===e&&(e={conversationID:null===(t=this.getStoreData(_.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:i,nextMessageSeq:s,nextMessageTime:r,isCompleted:o}=t.data,a=1===e.direction?e.sequence:s,c=1===e.direction?e.time:r;return this.updateMessageList(i,"unshift"),this.delayGetHoppingFunction=void 0,this.hoppingConfigMap.set("nextMessageSeq",a),this.hoppingConfigMap.set("nextMessageTime",c),n.TUIStore.update(_.CHAT,"isCompleted",o),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:i,unreadUserIDList:s,readUserIDList:r}=e.data,o={code:0,data:{cursor:n,isCompleted:t,messageID:i,unreadUserInfoList:[],readUserInfoList:[]}},a=[...s,...r];return 0===a.length?o:this.getEngine().TUIUser.getUserProfile({userIDList:a}).then((e=>(s.length>0?e.data.forEach((e=>{const{userID:t,nick:n="",avatar:i=""}=e;o.data.unreadUserInfoList.push({userID:t,nick:n,avatar:i})})):e.data.forEach((e=>{const{userID:t,nick:n="",avatar:i=""}=e;o.data.readUserInfoList.push({userID:t,nick:n,avatar:i})})),o)))}))}downloadMergedMessages(e){return this.getEngine().chat.downloadMergerMessage(e)}setTranslationLanguage(e){this.getEngine().TUIStore.update(_.USER,"targetLanguage",e)}translateText(e){const t=this.getStoreData(_.USER,"targetLanguage"),n=Object.assign({targetLanguage:t,sourceLanguage:"auto"},e);return this.getEngine().chat.translateText(n)}searchCloudMessages(e){const t=this.getStoreData(_.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:i}=e,s=T(e,["messageList","conversationID"]),r=n.map((e=>new le(e))),o=t.find((e=>e.conversationID===i));return Object.assign(Object.assign({},s),{messageList:r.sort(((e,t)=>t.time-e.time)),conversation:o})})),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(_.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((e=>{}))}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:i}=e,s=this.getEngine().TUIStore.getMessageModel(n);if(s){const e=[];for(let t=0;t<i.length;t++){let n=!0;for(let e=0;e<s.reactionList.length;e++)if(i[t].reactionID===s.reactionList[e].reactionID){s.reactionList[e]=i[t],n=!1;break}n&&e.push(i[t])}s.reactionList.push(...e),e.length=0,t.push(s)}})),t.length>0&&this.updateMessageList(t,"edit")}convertVoiceToText(e){const{message:t,language:n="zh"}=e,i=t.getMessage();return this.getEngine().chat.convertVoiceToText({message:i,language:n})}updateMessageInfo(e){const t=this.getStoreData(_.CHAT,"userInfo");this.getEngine().TUIStore.update(_.CHAT,"userInfo",Object.assign(t,e));const n=this.getStoreData(_.CHAT,"messageList");n.length>0&&this.updateLocalMessage(n,e)&&this.getEngine().TUIStore.update(_.CHAT,"messageList",n)}updateLocalMessage(e,t){let n=!1;return e.forEach((e=>{if(t[e.from]){const{nick:i,nameCard:s,avatar:r}=t[e.from];i&&(e.nick=i,n=!0),s&&(e.nameCard=s,n=!0),r&&(e.avatar=r,n=!0)}})),n}handleC2CCallSignaling(e){const t=this.getEngine(),n=t.getMyUserID();return e.filter((e=>{var i,s,r,o,a;const{conversationType:c,type:u,payload:l}=e;let g=!0;if(c===t.TYPES.CONV_C2C&&u===t.TYPES.MSG_CUSTOM&&t.chat.getSignalingInfo(e)){const t=N(l.data);if(1===(null==t?void 0:t.businessID)){const c=N(t.data);if(g=!(e._isExcludedFromUnreadCount&&e._isExcludedFromLastMessage),g&&!0!==(null===(i=null==c?void 0:c.data)||void 0===i?void 0:i.consumed)){let i=null===(s=null==c?void 0:c.data)||void 0===s?void 0:s.inviter;"line_busy"!==(null==c?void 0:c.line_busy)&&"lineBusy"!==(null===(r=null==c?void 0:c.data)||void 0===r?void 0:r.message)||(i=t.inviter);const{from:u,to:l}=e;if(i!==n&&e.from===n){const t=this.getStoreData(_.CONV,"currentConversation");e.from=l,e.to=u,e.flow="in",e.avatar=(null===(o=null==t?void 0:t.userProfile)||void 0===o?void 0:o.avatar)||""}if(i===n&&e.from!==n){const t=this.getStoreData(_.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 g}))}}class Gt extends re{constructor(){super(),this.groupMap=new Map}static getInstance(){return Gt.instance||(Gt.instance=new Gt),Gt.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(_.GRP,"groupList",e);const n=t.TUIStore.getData(_.GRP,"currentGroupID");e.forEach((e=>{e.groupID===n&&t.TUIStore.update(_.GRP,"currentGroup",e)}))}onGroupAttributesUpdated(e){const t=this.getEngine(),n=t.TUIStore.getData(_.GRP,"currentGroupID");let i=t.TUIStore.getData(_.GRP,"groupList");const{groupID:s,groupAttributes:r}=e;n===s&&t.TUIStore.update(_.GRP,"currentGroupAttributes",r),i=i.map((e=>(e.groupID===s&&(e.groupAttributes=r),e))),t.TUIStore.update(_.GRP,"groupList",i)}onGroupCounterUpdated(e){const t=this.getEngine(),n=t.TUIStore.getData(_.GRP,"currentGroupID"),i=t.TUIStore.getData(_.GRP,"currentGroupCounters")||{};let s=t.TUIStore.getData(_.GRP,"groupList");const{groupID:r,key:o,value:a}=e;n===r&&(i[o]=a,t.TUIStore.update(_.GRP,"currentGroupCounters",i)),s=s.map((e=>(e.groupID===r&&(e.groupCounters=Object.assign(Object.assign({},e.groupCounters),{[o]:a})),e))),t.TUIStore.update(_.GRP,"groupList",s)}onMessageReceived(e){const t=this.getEngine(),n=[];e.forEach((e=>{if(e.type===t.TYPES.MSG_GRP_TIP){const{payload:n}=e,{operationType:i,userIDList:s}=n,r=t.TUIStore.getData(_.GRP,"currentGroupID");switch(i){case t.TYPES.GRP_TIP_MBR_JOIN:this.addMemberList(s);break;case t.TYPES.GRP_TIP_MBR_QUIT:case t.TYPES.GRP_TIP_MBR_KICKED_OUT:this.removeMemberList(s);break;case t.TYPES.GRP_TIP_MBR_SET_ADMIN:case t.TYPES.GRP_TIP_MBR_CANCELED_ADMIN:this.updateGroupMember(s);break;case t.TYPES.GRP_TIP_GRP_PROFILE_UPDATED:this.getGroupProfile({groupID:r});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(s)}}e.type===t.TYPES.MSG_GRP_SYS_NOTICE&&n.push(e)})),n.length>0&&t.TUIStore.update(_.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 S(this,void 0,void 0,(function*(){const t=this.getEngine().TUIStore.getData(_.GRP,"currentGroupID");if(t){const n=yield this.getGroupMemberProfile({groupID:t,userIDList:e}),{memberList:i}=n.data;this.updateMemberList(i)}}))}resetCurrentStore(){this.getEngine().TUIStore.reset(_.GRP,["currentGroupID","currentGroup","currentGroupAttributes","currentGroupCounters","currentGroupMemberList"],!0)}switchGroup(e){return S(this,void 0,void 0,(function*(){const t=this.getEngine(),n=t.TUIStore.getConversationModel(`GROUP${e}`);if((null==n?void 0:n.operationType)>0){const e=t.TUIStore.getData(_.GRP,"currentGroup");return Promise.resolve(e)}const i=t.TUIStore.getData(_.GRP,"currentGroupID");if(!e)return this.resetCurrentStore(),Promise.resolve({});if(i===e){const e=t.TUIStore.getData(_.GRP,"currentGroup");return Promise.resolve(e)}this.resetCurrentStore(),t.TUIStore.update(_.GRP,"currentGroupID",e);try{yield this.getGroupInfo(e)}catch(o){Promise.reject(o)}const s=setTimeout((()=>{this.groupMap.delete(e),clearTimeout(s)}),5e3),r=t.TUIStore.getData(_.GRP,"currentGroup");return Promise.resolve(r)}))}getGroupInfo(e){return S(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(_.GRP,"currentGroup",n.group),t.TUIStore.update(_.GRP,"currentGroupAttributes",n.groupAttributes||{}),void t.TUIStore.update(_.GRP,"currentGroupCounters",n.counters||{});const i={group:{},memberList:[],groupAttributes:void 0,counters:void 0},{data:{group:s}}=yield this.getGroupProfile({groupID:e});i.group=s;const{data:{memberList:r}}=yield this.getGroupMemberList({groupID:e});i.memberList=r;const o=yield this.getGroupAttributes({groupID:e,keyList:[]}),{groupAttributes:a}=o.data;i.groupAttributes=a,t.TUIStore.update(_.GRP,"currentGroupAttributes",a);try{const n=yield this.getGroupCounters({groupID:e,keyList:[]}),{counters:s}=n.data;i.counters=s,t.TUIStore.update(_.GRP,"currentGroupCounters",s)}catch(c){console.warn(null==c?void 0:c.message)}this.groupMap.set(e,i)}))}getGroupProfile(e){const t=this.getEngine();return t.chat.getGroupProfile(e).then((n=>S(this,void 0,void 0,(function*(){if(t.TUIStore.getData(_.GRP,"currentGroupID")===e.groupID){const{group:e}=n.data;t.TUIStore.update(_.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,i=t.TUIStore.getData(_.GRP,"groupList");return e.data.group.isJoinedGroup=i.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(_.GRP,"currentGroupMemberList")||[]).filter((t=>!e.find((e=>e.userID===t.userID)))),...e];t.TUIStore.update(_.GRP,"currentGroupMemberList",n)}addMemberList(e){return S(this,void 0,void 0,(function*(){const t=this.getEngine().TUIStore.getData(_.GRP,"currentGroupID");if(t)try{const n=yield this.getGroupMemberProfile({groupID:t,userIDList:e}),{memberList:i}=n.data;this.updateMemberList(i)}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(_.GRP,"currentGroupMemberList").filter((t=>-1===e.indexOf(t.userID)));t.TUIStore.update(_.GRP,"currentGroupMemberList",n)}getGroupMemberList(e){const t=this.getEngine();return t.chat.getGroupMemberList(e).then((n=>{if(t.TUIStore.getData(_.GRP,"currentGroupID")===e.groupID){const{memberList:e}=n.data;this.updateMemberList(e)}return n}))}getGroupMemberProfile(e){return this.getEngine().chat.getGroupMemberProfile(e)}addGroupMember(e){const t=this.getEngine();return t.chat.addGroupMember(e).then((n=>S(this,void 0,void 0,(function*(){if(t.TUIStore.getData(_.GRP,"currentGroupID")===e.groupID){const{successUserIDList:e,group:i}=n.data;t.TUIStore.update(_.GRP,"currentGroup",i),this.addMemberList(e)}return n}))))}deleteGroupMember(e){const t=this.getEngine();return t.chat.deleteGroupMember(e).then((n=>{if(t.TUIStore.getData(_.GRP,"currentGroupID")===e.groupID){const{userIDList:e,group:i}=n.data;this.removeMemberList(e),t.TUIStore.update(_.GRP,"currentGroup",i)}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 Vt extends re{constructor(){super()}static getInstance(){return Vt.instance||(Vt.instance=new Vt),Vt.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(_.FRIEND,"friendList",e)}onFriendApplicationListUpdated(e){const{friendApplicationList:t,unreadCount:n=0}=e,i=this.getEngine();i.TUIStore.update(_.FRIEND,"friendApplicationList",t),i.TUIStore.update(_.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(_.FRIEND,"friendList"),n={};return e.forEach((e=>{for(let i=0;i<t.length;i++)t[i].userID!==e||(n[e]=t[i].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 Bt{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((function(e){return e})),this.options=e,this.next()}}function Ft(e,t,n){const i=Object.create(null);Object.keys(n).forEach((n=>{if(!t[n])return;i[n]=t[n];const s=new Bt;t[n]=function(){const r=Array.from(arguments);return s.use((function(t,i){return e.isInited?i():Promise.reject({code:O.NOT_INIT,message:`${n} | ${P.NOT_INIT}`})})).use((function(e,s){return i[n].apply(t,e)})),s.run(r)}}))}console.log("TUIChatEngine.VERSION:2.2.9");const Ht=ne.getInstance();te.getInstance();const $t=Ee.getInstance(),Kt=Mt.getInstance(),Yt=Ut.getInstance(),zt=wt.getInstance(),qt=jt.getInstance(),Wt=Gt.getInstance(),Xt=Vt.getInstance();Ht.mount(I.TUIStore,$t),Ht.mount(I.TUITranslate,Kt),Ht.mount(I.TUIConversation,Yt),Ht.mount(I.TUIUser,zt),Ht.mount(I.TUIChat,qt),Ht.mount(I.TUIGroup,Wt),Ht.mount(I.TUIFriend,Xt),Ft(Ht,Ht,{logout:1,destroy:1}),Ft(Ht,Yt,{deleteConversation:1,pinConversation:1,muteConversation:1,switchConversation:1,getConversationProfile:1,clearHistoryMessage:1}),Ft(Ht,qt,{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}),Ft(Ht,Wt,{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}),Ft(Ht,zt,{switchUserStatus:1,switchMessageReadStatus:1,getUserProfile:1,updateMyProfile:1,addToBlacklist:1,removeFromBlacklist:1}),Ft(Ht,Xt,{getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,getFriendProfile:1,updateFriend:1,acceptFriendApplication:1,refuseFriendApplication:1,deleteFriendApplication:1,setFriendApplicationRead:1});const Jt="pc"===d(),Zt="h5"===d(),Qt="wechat"===d(),en="app"===d(),tn="undefined"!=typeof uni,nn=Zt||Qt||en,sn=r({__name:"Icon",props:{file:{default:""},size:{},width:{default:"20px"},height:{default:"20px"},hotAreaSize:{}},emits:["onClick"],setup(e,{emit:t}){const n=t,i=e,s=o((()=>{if(i.hotAreaSize)return isNaN(Number(i.hotAreaSize))?String(i.hotAreaSize):`${i.hotAreaSize}px`})),r=o((()=>i.size?i.size:i.width)),d=o((()=>i.size?i.size:i.height)),f=e=>{n("onClick",e)};return(e,t)=>{const n=p;return a(),c("div",{class:h(["common-icon-container",!u(Jt)&&"common-icon-container-mobile"]),style:g({padding:u(s)}),onClick:f},[u(en)?(a(),l(n,{key:0,class:"common-icon",src:i.file,style:g({width:u(r),height:u(d)})},null,8,["src","style"])):(a(),c("img",{key:1,class:"common-icon",src:i.file,style:g({width:u(r),height:u(d)})},null,12,["src"]))],6)}}}),rn=v(sn,[["__scopeId","data-v-fea828e0"]]),on={SUCCESS:"success",WARNING:"warning",ERROR:"error",NORMAL:"normal"},an=e=>{f.showToast({title:e.message||"Toast",duration:e.duration||1500,icon:cn(e.type)})},cn=e=>{if(!e)return"none";switch(e){case on.ERROR:case on.WARNING:return"none";case on.SUCCESS:return"success";default:return"none"}};class un{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:i,callback:s}=e,r=this.getService(t);if(console.log(`TUIServiceManager.callService serviceName:${t}, service:`,r),r)return r.onCall(n,i,s)}}class ln{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),i=n.indexOf(t);i>-1&&n.splice(i,1)}}getExtensionList(e,t){const n=t?`params:${JSON.stringify(t)}`:"";console.log(`TUIExtensionManager.getExtensionList extensionID:${e} ${n}`);let i=[],s=[];if(this.extensionMap.has(e)){i=this.extensionMap.get(e);for(let n=0;n<i.length;n++){const r=i[n].onGetExtension(e,t);s=s.concat(r)}}return s}}const gn=["vue2","vue3"],hn={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"}}},pn="undefined"!=typeof wx&&"function"==typeof n&&Boolean(n().fontSizeSetting),dn="undefined"!=typeof uni&&"undefined"==typeof window,fn="undefined"!=typeof uni,vn=("undefined"!=typeof uni||"undefined"!=typeof window)&&!(pn||dn);pn?wx:fn?uni:window;const En=vn&&window&&window.navigator&&window.navigator.userAgent||"",mn=/Android/i.test(En),Tn=/(?:Windows Phone)/.test(En),Sn=/(?:SymbianOS)/.test(En),yn=/iPad/i.test(En)||/iPhone/i.test(En)||/iPod/i.test(En),In=mn||Tn||Sn||yn,_n=vn&&!In,bn=dn&&!pn,Cn={[hn.TUITranslatePlugin.SERVICE.NAME]:Math.pow(2,38),[hn.TUIVoiceToTextPlugin.SERVICE.NAME]:Math.pow(2,39),[hn.TUICustomerServicePlugin.SERVICE.NAME]:Math.pow(2,40),[hn.TUIPushPlugin.SERVICE.NAME]:Math.pow(2,41),[hn.TUIChatbotPlugin.SERVICE.NAME]:Math.pow(2,42),[hn.TUIEmojiPlugin.SERVICE.NAME]:Math.pow(2,48)};class Mn{constructor(e){this.loginStatusPromise=new Map,this.SDKAppID=0,this.userID="",this.userSig="",this.TUICore=e,this.isOnChatEvent=!1}static getInstance(e){return!Mn.instance&&e&&(Mn.instance=new Mn(e)),Mn.instance}login(e){const{SDKAppID:t,userID:n,userSig:s,framework:r}=e;return this.chat=i.create(Object.assign(Object.assign({},e),{scene:this.getStatScene(r)})),this.EVENT=i.EVENT,this.TYPES=i.TYPES,this.SDKAppID=t,this.userID=n,this.userSig=s,this.offChatEvent(),this.onChatEvent(),this.registerPlugin(e),this.loginChat(e)}logout(){return this.chat.logout().then((e=>(this.userID="",this.userSig="",this.TUICore.notifyEvent(hn.TUILogin.EVENT.LOGIN_STATE_CHANGED,hn.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}destroy(){return this.chat.destroy().then((e=>(this.userID="",this.userSig="",this.TUICore.notifyEvent(hn.TUILogin.EVENT.LOGIN_STATE_CHANGED,hn.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 Cn)this.TUICore.getService(t)&&(null===(e=this.chat.callExperimentalAPI("isFeatureEnabledForStat",Cn[t]))||void 0===e||e.catch((e=>{})))}loginChat(e){const{userID:t,userSig:n}=e;return new Promise(((e,i)=>{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:i,imResponse:t})})).catch((e=>{i(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(hn.TUILogin.EVENT.LOGIN_STATE_CHANGED,hn.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(hn.TUILogin.EVENT.LOGIN_STATE_CHANGED,hn.TUILogin.EVENT_SUB_KEY.USER_KICKED_OFFLINE):this.TUICore.notifyEvent(hn.TUILogin.EVENT.LOGIN_STATE_CHANGED,hn.TUILogin.EVENT_SUB_KEY.USER_SIG_EXPIRED)}registerPlugin(e){const{useUploadPlugin:t=!1,useProfanityFilterPlugin:n=!1,TUIOfflinePush:i,offlinePushConfig:r,TIMPush:o,pushConfig:a}=e;!0===t&&this.chat.registerPlugin({"tim-upload-plugin":s}),!0===n&&this.chat.registerPlugin({"tim-profanity-filter-plugin":m}),bn&&o&&a&&this.chat.registerPlugin({"tim-push":o,pushConfig:a}),bn&&i&&r&&this.chat.registerPlugin({"tim-offline-push-plugin":i,offlinePushConfig:r})}getStatScene(e){let t;return e&&gn.indexOf(e)>-1&&(t=this.genStatScene(e)),t}genStatScene(e){let t="";return fn?(_n&&(t=`k-${e}-pc-uni`),In&&(t=`k-${e}-h5-uni`),bn&&(t=`k-${e}-app-uni`),pn&&(t=`k-${e}-mp-uni`),t):(_n&&(t=`k-${e}-pc`),In&&(t=`k-${e}-h5`),t)}}class Un{constructor(){this.eventMap=new Map}registerEvent(e,t,n){const i=this.getKey(e,t);if(console.log(`TUIEventManager.registerEvent eventName:${e} subKey:${t}`),!this.eventMap.has(i)){const e=[];this.eventMap.set(i,e)}const s=this.eventMap.get(i);-1===s.indexOf(n)&&(s.push(n),this.renotify(e,t,n))}unregisterEvent(e,t,n){console.log(`TUIEventManager.unregisterEvent eventName:${e} subKey:${t}`);const i=this.getKey(e,t);if(this.eventMap.has(i)){const e=this.eventMap.get(i),t=e.indexOf(n);t>-1&&e.splice(t,1)}}notifyEvent(e,t,n){const i=this.getKey(e,t),s=n?`params:${JSON.stringify(n)}`:"";console.log(`TUIEventManager.notifyEvent eventName:${e} subKey:${t} ${s}`),this.eventMap.has(i)&&this.eventMap.get(i).forEach((i=>{i.onNotifyEvent(e,t,n)}))}getKey(e,t){let n=e;return t&&(n=`${e}-${n}`),n}renotify(e,t,n){if(e===hn.TUILogin.EVENT.LOGIN_STATE_CHANGED&&t===hn.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS){const{chat:e}=Mn.getInstance().getContext();e&&e.isReady()&&(n.onNotifyEvent(hn.TUILogin.EVENT.LOGIN_STATE_CHANGED,hn.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS),console.log("TUIEventManager.renotify success."))}}}class On{constructor(){this.serviceManager=new un,this.extensionManager=new ln,this.eventManager=new Un}static getInstance(){return On.instance||(console.log("TUICore.getInstance ok."),On.instance=new On),On.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)}}console.log("TUICore.VERSION:2.2.9");const Dn=On.getInstance(),Pn=Mn.getInstance(Dn);export{Pn as A,hn as E,rn as I,Kt as J,Ht as K,Wt as Q,Dn as R,an as T,Yt as W,zt as X,qt as Z,Jt as a,Zt as b,nn as c,on as d,Qt as e,en as f,Xt as g,tn as i,_ as o,$t as z};
|