UNPKG

zego-express-engine-webrtc

Version:

zego webrtc express sdk

1 lines 1.65 MB
!function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i(require("long"),require("protobufjs/minimal"),require("zego-express-logger"),require("localforage"));else if("function"==typeof define&&define.amd)define(["long","protobufjs/minimal","zego-express-logger","localforage"],i);else{var e="object"==typeof exports?i(require("long"),require("protobufjs/minimal"),require("zego-express-logger"),require("localforage")):i(t.long,t["protobufjs/minimal"],t["zego-express-logger"],t.localforage);for(var n in e)("object"==typeof exports?exports:t)[n]=e[n]}}("undefined"!=typeof self?self:this,(function(t,i,e,n){return function(){var s={955:function(t,i,e){var n;t.exports=(n=e(9021),e(754),e(4636),e(9506),e(7165),function(){var t=n,i=t.lib.BlockCipher,e=t.algo,s=[],r=[],o=[],u=[],a=[],c=[],h=[],f=[],l=[],d=[];!function(){for(var t=[],i=0;i<256;i++)t[i]=i<128?i<<1:i<<1^283;var e=0,n=0;for(i=0;i<256;i++){var v=n^n<<1^n<<2^n<<3^n<<4;s[e]=v=v>>>8^255&v^99,r[v]=e;var m,p=t[e],g=t[p],b=t[g];o[e]=(m=257*t[v]^16843008*v)<<24|m>>>8,u[e]=m<<16|m>>>16,a[e]=m<<8|m>>>24,c[e]=m,h[v]=(m=16843009*b^65537*g^257*p^16843008*e)<<24|m>>>8,f[v]=m<<16|m>>>16,l[v]=m<<8|m>>>24,d[v]=m,e?(e=p^t[t[t[b^p]]],n^=t[t[n]]):e=n=1}}();var v=[0,1,2,4,8,16,32,64,128,27,54],m=e.AES=i.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,i=t.words,e=t.sigBytes/4,n=4*((this._nRounds=e+6)+1),r=this._keySchedule=[],o=0;o<n;o++)o<e?r[o]=i[o]:(c=r[o-1],o%e?e>6&&o%e==4&&(c=s[c>>>24]<<24|s[c>>>16&255]<<16|s[c>>>8&255]<<8|s[255&c]):(c=s[(c=c<<8|c>>>24)>>>24]<<24|s[c>>>16&255]<<16|s[c>>>8&255]<<8|s[255&c],c^=v[o/e|0]<<24),r[o]=r[o-e]^c);for(var u=this._invKeySchedule=[],a=0;a<n;a++){if(o=n-a,a%4)var c=r[o];else c=r[o-4];u[a]=a<4||o<=4?c:h[s[c>>>24]]^f[s[c>>>16&255]]^l[s[c>>>8&255]]^d[s[255&c]]}}},encryptBlock:function(t,i){this._doCryptBlock(t,i,this._keySchedule,o,u,a,c,s)},decryptBlock:function(t,i){var e=t[i+1];t[i+1]=t[i+3],t[i+3]=e,this._doCryptBlock(t,i,this._invKeySchedule,h,f,l,d,r),e=t[i+1],t[i+1]=t[i+3],t[i+3]=e},_doCryptBlock:function(t,i,e,n,s,r,o,u){for(var a=this._nRounds,c=t[i]^e[0],h=t[i+1]^e[1],f=t[i+2]^e[2],l=t[i+3]^e[3],d=4,v=1;v<a;v++){var m=n[c>>>24]^s[h>>>16&255]^r[f>>>8&255]^o[255&l]^e[d++],p=n[h>>>24]^s[f>>>16&255]^r[l>>>8&255]^o[255&c]^e[d++],g=n[f>>>24]^s[l>>>16&255]^r[c>>>8&255]^o[255&h]^e[d++],b=n[l>>>24]^s[c>>>16&255]^r[h>>>8&255]^o[255&f]^e[d++];c=m,h=p,f=g,l=b}m=(u[c>>>24]<<24|u[h>>>16&255]<<16|u[f>>>8&255]<<8|u[255&l])^e[d++],p=(u[h>>>24]<<24|u[f>>>16&255]<<16|u[l>>>8&255]<<8|u[255&c])^e[d++],g=(u[f>>>24]<<24|u[l>>>16&255]<<16|u[c>>>8&255]<<8|u[255&h])^e[d++],b=(u[l>>>24]<<24|u[c>>>16&255]<<16|u[h>>>8&255]<<8|u[255&f])^e[d++],t[i]=m,t[i+1]=p,t[i+2]=g,t[i+3]=b},keySize:8});t.AES=i._createHelper(m)}(),n.AES)},7165:function(t,i,e){var n;t.exports=(n=e(9021),e(9506),void(n.lib.Cipher||function(t){var i=n,e=i.lib,s=e.Base,r=e.WordArray,o=e.BufferedBlockAlgorithm,u=i.enc,a=u.Base64,c=i.algo.EvpKDF,h=e.Cipher=o.extend({cfg:s.extend(),createEncryptor:function(t,i){return this.create(this._ENC_XFORM_MODE,t,i)},createDecryptor:function(t,i){return this.create(this._DEC_XFORM_MODE,t,i)},init:function(t,i,e){this.cfg=this.cfg.extend(e),this._xformMode=t,this._key=i,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?_:g}return function(i){return{encrypt:function(e,n,s){return t(n).encrypt(i,e,n,s)},decrypt:function(e,n,s){return t(n).decrypt(i,e,n,s)}}}}()}),f=(e.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),i.mode={}),l=e.BlockCipherMode=s.extend({createEncryptor:function(t,i){return this.Encryptor.create(t,i)},createDecryptor:function(t,i){return this.Decryptor.create(t,i)},init:function(t,i){this._cipher=t,this._iv=i}}),d=f.CBC=function(){var i=l.extend();function e(i,e,n){var s,r=this._iv;r?(s=r,this._iv=t):s=this._prevBlock;for(var o=0;o<n;o++)i[e+o]^=s[o]}return i.Encryptor=i.extend({processBlock:function(t,i){var n=this._cipher,s=n.blockSize;e.call(this,t,i,s),n.encryptBlock(t,i),this._prevBlock=t.slice(i,i+s)}}),i.Decryptor=i.extend({processBlock:function(t,i){var n=this._cipher,s=n.blockSize,r=t.slice(i,i+s);n.decryptBlock(t,i),e.call(this,t,i,s),this._prevBlock=r}}),i}(),v=(i.pad={}).Pkcs7={pad:function(t,i){for(var e=4*i,n=e-t.sigBytes%e,s=n<<24|n<<16|n<<8|n,o=[],u=0;u<n;u+=4)o.push(s);var a=r.create(o,n);t.concat(a)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},m=(e.BlockCipher=h.extend({cfg:h.cfg.extend({mode:d,padding:v}),reset:function(){var t;h.reset.call(this);var i=this.cfg,e=i.iv,n=i.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,e&&e.words):(this._mode=t.call(n,this,e&&e.words),this._mode.__creator=t)},_doProcessBlock:function(t,i){this._mode.processBlock(t,i)},_doFinalize:function(){var t,i=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(i.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),i.unpad(t)),t},blockSize:4}),e.CipherParams=s.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),p=(i.format={}).OpenSSL={stringify:function(t){var i=t.ciphertext,e=t.salt;return(e?r.create([1398893684,1701076831]).concat(e).concat(i):i).toString(a)},parse:function(t){var i,e=a.parse(t),n=e.words;return 1398893684==n[0]&&1701076831==n[1]&&(i=r.create(n.slice(2,4)),n.splice(0,4),e.sigBytes-=16),m.create({ciphertext:e,salt:i})}},g=e.SerializableCipher=s.extend({cfg:s.extend({format:p}),encrypt:function(t,i,e,n){n=this.cfg.extend(n);var s=t.createEncryptor(e,n),r=s.finalize(i),o=s.cfg;return m.create({ciphertext:r,key:e,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,i,e,n){return n=this.cfg.extend(n),i=this._parse(i,n.format),t.createDecryptor(e,n).finalize(i.ciphertext)},_parse:function(t,i){return"string"==typeof t?i.parse(t,this):t}}),b=(i.kdf={}).OpenSSL={execute:function(t,i,e,n,s){if(n||(n=r.random(8)),s)o=c.create({keySize:i+e,hasher:s}).compute(t,n);else var o=c.create({keySize:i+e}).compute(t,n);var u=r.create(o.words.slice(i),4*e);return o.sigBytes=4*i,m.create({key:o,iv:u,salt:n})}},_=e.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:b}),encrypt:function(t,i,e,n){var s=(n=this.cfg.extend(n)).kdf.execute(e,t.keySize,t.ivSize,n.salt,n.hasher);n.iv=s.iv;var r=g.encrypt.call(this,t,i,s.key,n);return r.mixIn(s),r},decrypt:function(t,i,e,n){n=this.cfg.extend(n),i=this._parse(i,n.format);var s=n.kdf.execute(e,t.keySize,t.ivSize,i.salt,n.hasher);return n.iv=s.iv,g.decrypt.call(this,t,i,s.key,n)}})}()))},9021:function(t,i,e){var n;t.exports=(n=n||function(t,i){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==e.g&&e.g.crypto&&(n=e.g.crypto),!n)try{n=e(477)}catch(t){}var s=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function t(){}return function(i){var e;return t.prototype=i,e=new t,t.prototype=null,e}}(),o={},u=o.lib={},a=u.Base={extend:function(t){var i=r(this);return t&&i.mixIn(t),i.hasOwnProperty("init")&&this.init!==i.init||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=u.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=e!=i?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var i=this.words,e=t.words,n=this.sigBytes,s=t.sigBytes;if(this.clamp(),n%4)for(var r=0;r<s;r++)i[n+r>>>2]|=(e[r>>>2]>>>24-r%4*8&255)<<24-(n+r)%4*8;else for(var o=0;o<s;o+=4)i[n+o>>>2]=e[o>>>2];return this.sigBytes+=s,this},clamp:function(){var i=this.words,e=this.sigBytes;i[e>>>2]&=4294967295<<32-e%4*8,i.length=t.ceil(e/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var i=[],e=0;e<t;e+=4)i.push(s());return new c.init(i,t)}}),h=o.enc={},f=h.Hex={stringify:function(t){for(var i=t.words,e=t.sigBytes,n=[],s=0;s<e;s++){var r=i[s>>>2]>>>24-s%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(t){for(var i=t.length,e=[],n=0;n<i;n+=2)e[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new c.init(e,i/2)}},l=h.Latin1={stringify:function(t){for(var i=t.words,e=t.sigBytes,n=[],s=0;s<e;s++)n.push(String.fromCharCode(i[s>>>2]>>>24-s%4*8&255));return n.join("")},parse:function(t){for(var i=t.length,e=[],n=0;n<i;n++)e[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new c.init(e,i)}},d=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},v=u.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(i){var e,n=this._data,s=n.words,r=n.sigBytes,o=this.blockSize,u=r/(4*o),a=(u=i?t.ceil(u):t.max((0|u)-this._minBufferSize,0))*o,h=t.min(4*a,r);if(a){for(var f=0;f<a;f+=o)this._doProcessBlock(s,f);e=s.splice(0,a),n.sigBytes-=h}return new c.init(e,h)},clone:function(){var t=a.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),m=(u.Hasher=v.extend({cfg:a.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){v.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(i,e){return new t.init(e).finalize(i)}},_createHmacHelper:function(t){return function(i,e){return new m.HMAC.init(t,e).finalize(i)}}}),o.algo={});return o}(Math),n)},754:function(t,i,e){var n;t.exports=(n=e(9021),function(){var t=n.lib.WordArray;function i(i,e,n){for(var s=[],r=0,o=0;o<e;o++)if(o%4){var u=n[i.charCodeAt(o-1)]<<o%4*2,a=n[i.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=(u|a)<<24-r%4*8,r++}return t.create(s,r)}n.enc.Base64={stringify:function(t){var i=t.words,e=t.sigBytes,n=this._map;t.clamp();for(var s=[],r=0;r<e;r+=3)for(var o=(i[r>>>2]>>>24-r%4*8&255)<<16|(i[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|i[r+2>>>2]>>>24-(r+2)%4*8&255,u=0;u<4&&r+.75*u<e;u++)s.push(n.charAt(o>>>6*(3-u)&63));var a=n.charAt(64);if(a)for(;s.length%4;)s.push(a);return s.join("")},parse:function(t){var e=t.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var r=0;r<n.length;r++)s[n.charCodeAt(r)]=r}var o=n.charAt(64);if(o){var u=t.indexOf(o);-1!==u&&(e=u)}return i(t,e,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},5178:function(t,i,e){var n;t.exports=(n=e(9021),n.enc.Utf8)},9506:function(t,i,e){var n,s,r,o,u,a,c;t.exports=(c=e(9021),e(5471),e(1025),o=(s=(n=c).lib).WordArray,a=(u=n.algo).EvpKDF=(r=s.Base).extend({cfg:r.extend({keySize:4,hasher:u.MD5,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,i){for(var e,n=this.cfg,s=n.hasher.create(),r=o.create(),u=r.words,a=n.keySize,c=n.iterations;u.length<a;){e&&s.update(e),e=s.update(t).finalize(i),s.reset();for(var h=1;h<c;h++)e=s.finalize(e),s.reset();r.concat(e)}return r.sigBytes=4*a,r}}),n.EvpKDF=function(t,i,e){return a.create(e).compute(t,i)},c.EvpKDF)},1025:function(t,i,e){var n,s;t.exports=(n=e(9021),s=n.enc.Utf8,void(n.algo.HMAC=n.lib.Base.extend({init:function(t,i){t=this._hasher=new t.init,"string"==typeof i&&(i=s.parse(i));var e=t.blockSize,n=4*e;i.sigBytes>n&&(i=t.finalize(i)),i.clamp();for(var r=this._oKey=i.clone(),o=this._iKey=i.clone(),u=r.words,a=o.words,c=0;c<e;c++)u[c]^=1549556828,a[c]^=909522486;r.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var i=this._hasher,e=i.finalize(t);return i.reset(),i.finalize(this._oKey.clone().concat(e))}})))},6440:function(t,i,e){var n;t.exports=(n=e(9021),function(){if("function"==typeof ArrayBuffer){var t=n.lib.WordArray,i=t.init,e=t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,n=[],s=0;s<e;s++)n[s>>>2]|=t[s]<<24-s%4*8;i.call(this,n,e)}else i.apply(this,arguments)};e.prototype=t}}(),n.lib.WordArray)},4636:function(t,i,e){var n;t.exports=(n=e(9021),function(t){var i=n,e=i.lib,s=e.WordArray,r=e.Hasher,o=i.algo,u=[];!function(){for(var i=0;i<64;i++)u[i]=4294967296*t.abs(t.sin(i+1))|0}();var a=o.MD5=r.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,i){for(var e=0;e<16;e++){var n=i+e,s=t[n];t[n]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r=this._hash.words,o=t[i+0],a=t[i+1],d=t[i+2],v=t[i+3],m=t[i+4],p=t[i+5],g=t[i+6],b=t[i+7],_=t[i+8],y=t[i+9],w=t[i+10],S=t[i+11],E=t[i+12],O=t[i+13],T=t[i+14],k=t[i+15],R=r[0],I=r[1],N=r[2],C=r[3];R=c(R,I,N,C,o,7,u[0]),C=c(C,R,I,N,a,12,u[1]),N=c(N,C,R,I,d,17,u[2]),I=c(I,N,C,R,v,22,u[3]),R=c(R,I,N,C,m,7,u[4]),C=c(C,R,I,N,p,12,u[5]),N=c(N,C,R,I,g,17,u[6]),I=c(I,N,C,R,b,22,u[7]),R=c(R,I,N,C,_,7,u[8]),C=c(C,R,I,N,y,12,u[9]),N=c(N,C,R,I,w,17,u[10]),I=c(I,N,C,R,S,22,u[11]),R=c(R,I,N,C,E,7,u[12]),C=c(C,R,I,N,O,12,u[13]),N=c(N,C,R,I,T,17,u[14]),R=h(R,I=c(I,N,C,R,k,22,u[15]),N,C,a,5,u[16]),C=h(C,R,I,N,g,9,u[17]),N=h(N,C,R,I,S,14,u[18]),I=h(I,N,C,R,o,20,u[19]),R=h(R,I,N,C,p,5,u[20]),C=h(C,R,I,N,w,9,u[21]),N=h(N,C,R,I,k,14,u[22]),I=h(I,N,C,R,m,20,u[23]),R=h(R,I,N,C,y,5,u[24]),C=h(C,R,I,N,T,9,u[25]),N=h(N,C,R,I,v,14,u[26]),I=h(I,N,C,R,_,20,u[27]),R=h(R,I,N,C,O,5,u[28]),C=h(C,R,I,N,d,9,u[29]),N=h(N,C,R,I,b,14,u[30]),R=f(R,I=h(I,N,C,R,E,20,u[31]),N,C,p,4,u[32]),C=f(C,R,I,N,_,11,u[33]),N=f(N,C,R,I,S,16,u[34]),I=f(I,N,C,R,T,23,u[35]),R=f(R,I,N,C,a,4,u[36]),C=f(C,R,I,N,m,11,u[37]),N=f(N,C,R,I,b,16,u[38]),I=f(I,N,C,R,w,23,u[39]),R=f(R,I,N,C,O,4,u[40]),C=f(C,R,I,N,o,11,u[41]),N=f(N,C,R,I,v,16,u[42]),I=f(I,N,C,R,g,23,u[43]),R=f(R,I,N,C,y,4,u[44]),C=f(C,R,I,N,E,11,u[45]),N=f(N,C,R,I,k,16,u[46]),R=l(R,I=f(I,N,C,R,d,23,u[47]),N,C,o,6,u[48]),C=l(C,R,I,N,b,10,u[49]),N=l(N,C,R,I,T,15,u[50]),I=l(I,N,C,R,p,21,u[51]),R=l(R,I,N,C,E,6,u[52]),C=l(C,R,I,N,v,10,u[53]),N=l(N,C,R,I,w,15,u[54]),I=l(I,N,C,R,a,21,u[55]),R=l(R,I,N,C,_,6,u[56]),C=l(C,R,I,N,k,10,u[57]),N=l(N,C,R,I,g,15,u[58]),I=l(I,N,C,R,O,21,u[59]),R=l(R,I,N,C,m,6,u[60]),C=l(C,R,I,N,S,10,u[61]),N=l(N,C,R,I,d,15,u[62]),I=l(I,N,C,R,y,21,u[63]),r[0]=r[0]+R|0,r[1]=r[1]+I|0,r[2]=r[2]+N|0,r[3]=r[3]+C|0},_doFinalize:function(){var i=this._data,e=i.words,n=8*this._nDataBytes,s=8*i.sigBytes;e[s>>>5]|=128<<24-s%32;var r=t.floor(n/4294967296),o=n;e[15+(s+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),i.sigBytes=4*(e.length+1),this._process();for(var u=this._hash,a=u.words,c=0;c<4;c++){var h=a[c];a[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return u},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,i,e,n,s,r,o){var u=t+(i&e|~i&n)+s+o;return(u<<r|u>>>32-r)+i}function h(t,i,e,n,s,r,o){var u=t+(i&n|e&~n)+s+o;return(u<<r|u>>>32-r)+i}function f(t,i,e,n,s,r,o){var u=t+(i^e^n)+s+o;return(u<<r|u>>>32-r)+i}function l(t,i,e,n,s,r,o){var u=t+(e^(i|~n))+s+o;return(u<<r|u>>>32-r)+i}i.MD5=r._createHelper(a),i.HmacMD5=r._createHmacHelper(a)}(Math),n.MD5)},5471:function(t,i,e){var n,s,r,o,u,a,c;t.exports=(c=e(9021),r=(s=(n=c).lib).WordArray,u=[],a=n.algo.SHA1=(o=s.Hasher).extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,i){for(var e=this._hash.words,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],c=0;c<80;c++){if(c<16)u[c]=0|t[i+c];else{var h=u[c-3]^u[c-8]^u[c-14]^u[c-16];u[c]=h<<1|h>>>31}var f=(n<<5|n>>>27)+a+u[c];f+=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=n,n=f}e[0]=e[0]+n|0,e[1]=e[1]+s|0,e[2]=e[2]+r|0,e[3]=e[3]+o|0,e[4]=e[4]+a|0},_doFinalize:function(){var t=this._data,i=t.words,e=8*this._nDataBytes,n=8*t.sigBytes;return i[n>>>5]|=128<<24-n%32,i[14+(n+64>>>9<<4)]=Math.floor(e/4294967296),i[15+(n+64>>>9<<4)]=e,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),n.SHA1=o._createHelper(a),n.HmacSHA1=o._createHmacHelper(a),c.SHA1)},2799:function(t,i,e){var n;"undefined"!=typeof self&&self,n=(t,i)=>(()=>{var e={955:function(t,i,e){var n;t.exports=(n=e(21),e(754),e(636),e(506),e(165),function(){var t=n,i=t.lib.BlockCipher,e=t.algo,s=[],r=[],o=[],u=[],a=[],c=[],h=[],f=[],l=[],d=[];!function(){for(var t=[],i=0;i<256;i++)t[i]=i<128?i<<1:i<<1^283;var e=0,n=0;for(i=0;i<256;i++){var v=n^n<<1^n<<2^n<<3^n<<4;s[e]=v=v>>>8^255&v^99,r[v]=e;var m=t[e],p=t[m],g=t[p],b=257*t[v]^16843008*v;o[e]=b<<24|b>>>8,u[e]=b<<16|b>>>16,a[e]=b<<8|b>>>24,c[e]=b,h[v]=(b=16843009*g^65537*p^257*m^16843008*e)<<24|b>>>8,f[v]=b<<16|b>>>16,l[v]=b<<8|b>>>24,d[v]=b,e?(e=m^t[t[t[g^m]]],n^=t[t[n]]):e=n=1}}();var v=[0,1,2,4,8,16,32,64,128,27,54],m=e.AES=i.extend({t:function(){if(!this.i||this.u!==this.h){for(var t=this.u=this.h,i=t.words,e=t.sigBytes/4,n=4*((this.i=e+6)+1),r=this._=[],o=0;o<n;o++)o<e?r[o]=i[o]:(c=r[o-1],o%e?e>6&&o%e==4&&(c=s[c>>>24]<<24|s[c>>>16&255]<<16|s[c>>>8&255]<<8|s[255&c]):(c=s[(c=c<<8|c>>>24)>>>24]<<24|s[c>>>16&255]<<16|s[c>>>8&255]<<8|s[255&c],c^=v[o/e|0]<<24),r[o]=r[o-e]^c);for(var u=this.l=[],a=0;a<n;a++){if(o=n-a,a%4)var c=r[o];else c=r[o-4];u[a]=a<4||o<=4?c:h[s[c>>>24]]^f[s[c>>>16&255]]^l[s[c>>>8&255]]^d[s[255&c]]}}},encryptBlock:function(t,i){this.v(t,i,this._,o,u,a,c,s)},decryptBlock:function(t,i){var e=t[i+1];t[i+1]=t[i+3],t[i+3]=e,this.v(t,i,this.l,h,f,l,d,r),e=t[i+1],t[i+1]=t[i+3],t[i+3]=e},v:function(t,i,e,n,s,r,o,u){for(var a=this.i,c=t[i]^e[0],h=t[i+1]^e[1],f=t[i+2]^e[2],l=t[i+3]^e[3],d=4,v=1;v<a;v++){var m=n[c>>>24]^s[h>>>16&255]^r[f>>>8&255]^o[255&l]^e[d++],p=n[h>>>24]^s[f>>>16&255]^r[l>>>8&255]^o[255&c]^e[d++],g=n[f>>>24]^s[l>>>16&255]^r[c>>>8&255]^o[255&h]^e[d++],b=n[l>>>24]^s[c>>>16&255]^r[h>>>8&255]^o[255&f]^e[d++];c=m,h=p,f=g,l=b}m=(u[c>>>24]<<24|u[h>>>16&255]<<16|u[f>>>8&255]<<8|u[255&l])^e[d++],p=(u[h>>>24]<<24|u[f>>>16&255]<<16|u[l>>>8&255]<<8|u[255&c])^e[d++],g=(u[f>>>24]<<24|u[l>>>16&255]<<16|u[c>>>8&255]<<8|u[255&h])^e[d++],b=(u[l>>>24]<<24|u[c>>>16&255]<<16|u[h>>>8&255]<<8|u[255&f])^e[d++],t[i]=m,t[i+1]=p,t[i+2]=g,t[i+3]=b},keySize:8});t.AES=i.p(m)}(),n.AES)},165:function(t,i,e){var n;t.exports=(n=e(21),e(506),void(n.lib.Cipher||function(){var t=n,i=t.lib,e=i.Base,s=i.WordArray,r=i.BufferedBlockAlgorithm,o=t.enc,u=o.Base64,a=t.algo.EvpKDF,c=i.Cipher=r.extend({cfg:e.extend(),createEncryptor:function(t,i){return this.create(this.S,t,i)},createDecryptor:function(t,i){return this.create(this.T,t,i)},init:function(t,i,e){this.cfg=this.cfg.extend(e),this.C=t,this.h=i,this.reset()},reset:function(){r.reset.call(this),this.t()},process:function(t){return this.m(t),this.O()},finalize:function(t){return t&&this.m(t),this.R()},keySize:4,ivSize:4,S:1,T:2,p:function(){function t(t){return"string"==typeof t?b:p}return function(i){return{encrypt:function(e,n,s){return t(n).encrypt(i,e,n,s)},decrypt:function(e,n,s){return t(n).decrypt(i,e,n,s)}}}}()}),h=(i.StreamCipher=c.extend({R:function(){return this.O(!0)},blockSize:1}),t.mode={}),f=i.BlockCipherMode=e.extend({createEncryptor:function(t,i){return this.Encryptor.create(t,i)},createDecryptor:function(t,i){return this.Decryptor.create(t,i)},init:function(t,i){this.A=t,this.P=i}}),l=h.CBC=function(){var t=f.extend();function i(t,i,e){var n,s=this.P;s?(n=s,this.P=void 0):n=this.I;for(var r=0;r<e;r++)t[i+r]^=n[r]}return t.Encryptor=t.extend({processBlock:function(t,e){var n=this.A,s=n.blockSize;i.call(this,t,e,s),n.encryptBlock(t,e),this.I=t.slice(e,e+s)}}),t.Decryptor=t.extend({processBlock:function(t,e){var n=this.A,s=n.blockSize,r=t.slice(e,e+s);n.decryptBlock(t,e),i.call(this,t,e,s),this.I=r}}),t}(),d=(t.pad={}).Pkcs7={pad:function(t,i){for(var e=4*i,n=e-t.sigBytes%e,r=n<<24|n<<16|n<<8|n,o=[],u=0;u<n;u+=4)o.push(r);var a=s.create(o,n);t.concat(a)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},v=(i.BlockCipher=c.extend({cfg:c.cfg.extend({mode:l,padding:d}),reset:function(){var t;c.reset.call(this);var i=this.cfg,e=i.iv,n=i.mode;this.C==this.S?t=n.createEncryptor:(t=n.createDecryptor,this.N=1),this.D&&this.D.M==t?this.D.init(this,e&&e.words):(this.D=t.call(n,this,e&&e.words),this.D.M=t)},H:function(t,i){this.D.processBlock(t,i)},R:function(){var t,i=this.cfg.padding;return this.C==this.S?(i.pad(this.U,this.blockSize),t=this.O(!0)):(t=this.O(!0),i.unpad(t)),t},blockSize:4}),i.CipherParams=e.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),m=(t.format={}).OpenSSL={stringify:function(t){var i=t.ciphertext,e=t.salt;return(e?s.create([1398893684,1701076831]).concat(e).concat(i):i).toString(u)},parse:function(t){var i,e=u.parse(t),n=e.words;return 1398893684==n[0]&&1701076831==n[1]&&(i=s.create(n.slice(2,4)),n.splice(0,4),e.sigBytes-=16),v.create({ciphertext:e,salt:i})}},p=i.SerializableCipher=e.extend({cfg:e.extend({format:m}),encrypt:function(t,i,e,n){n=this.cfg.extend(n);var s=t.createEncryptor(e,n),r=s.finalize(i),o=s.cfg;return v.create({ciphertext:r,key:e,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,i,e,n){return n=this.cfg.extend(n),i=this.G(i,n.format),t.createDecryptor(e,n).finalize(i.ciphertext)},G:function(t,i){return"string"==typeof t?i.parse(t,this):t}}),g=(t.kdf={}).OpenSSL={execute:function(t,i,e,n){n||(n=s.random(8));var r=a.create({keySize:i+e}).compute(t,n),o=s.create(r.words.slice(i),4*e);return r.sigBytes=4*i,v.create({key:r,iv:o,salt:n})}},b=i.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:g}),encrypt:function(t,i,e,n){var s=(n=this.cfg.extend(n)).kdf.execute(e,t.keySize,t.ivSize);n.iv=s.iv;var r=p.encrypt.call(this,t,i,s.key,n);return r.mixIn(s),r},decrypt:function(t,i,e,n){n=this.cfg.extend(n),i=this.G(i,n.format);var s=n.kdf.execute(e,t.keySize,t.ivSize,i.salt);return n.iv=s.iv,p.decrypt.call(this,t,i,s.key,n)}})}()))},21:function(t,i,e){var n;t.exports=(n=n||function(t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(i=globalThis.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==e.g&&e.g.crypto&&(i=e.g.crypto),!i)try{i=e(477)}catch(t){}var n=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function t(){}return function(i){var e;return t.prototype=i,e=new t,t.prototype=null,e}}(),r={},o=r.lib={},u=o.Base={extend:function(t){var i=s(this);return t&&i.mixIn(t),i.hasOwnProperty("init")&&this.init!==i.init||(i.init=function(){i.$super.init.apply(this,arguments)}),i.init.prototype=i,i.$super=this,i},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=o.WordArray=u.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=null!=i?i:4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var i=this.words,e=t.words,n=this.sigBytes,s=t.sigBytes;if(this.clamp(),n%4)for(var r=0;r<s;r++)i[n+r>>>2]|=(e[r>>>2]>>>24-r%4*8&255)<<24-(n+r)%4*8;else for(var o=0;o<s;o+=4)i[n+o>>>2]=e[o>>>2];return this.sigBytes+=s,this},clamp:function(){var i=this.words,e=this.sigBytes;i[e>>>2]&=4294967295<<32-e%4*8,i.length=t.ceil(e/4)},clone:function(){var t=u.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var i=[],e=0;e<t;e+=4)i.push(n());return new a.init(i,t)}}),c=r.enc={},h=c.Hex={stringify:function(t){for(var i=t.words,e=t.sigBytes,n=[],s=0;s<e;s++){var r=i[s>>>2]>>>24-s%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(t){for(var i=t.length,e=[],n=0;n<i;n+=2)e[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new a.init(e,i/2)}},f=c.Latin1={stringify:function(t){for(var i=t.words,e=t.sigBytes,n=[],s=0;s<e;s++)n.push(String.fromCharCode(i[s>>>2]>>>24-s%4*8&255));return n.join("")},parse:function(t){for(var i=t.length,e=[],n=0;n<i;n++)e[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new a.init(e,i)}},l=c.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},d=o.BufferedBlockAlgorithm=u.extend({reset:function(){this.U=new a.init,this.k=0},m:function(t){"string"==typeof t&&(t=l.parse(t)),this.U.concat(t),this.k+=t.sigBytes},O:function(i){var e,n=this.U,s=n.words,r=n.sigBytes,o=this.blockSize,u=r/(4*o),c=(u=i?t.ceil(u):t.max((0|u)-this.N,0))*o,h=t.min(4*c,r);if(c){for(var f=0;f<c;f+=o)this.H(s,f);e=s.splice(0,c),n.sigBytes-=h}return new a.init(e,h)},clone:function(){var t=u.clone.call(this);return t.U=this.U.clone(),t},N:0}),v=(o.Hasher=d.extend({cfg:u.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){d.reset.call(this),this.t()},update:function(t){return this.m(t),this.O(),this},finalize:function(t){return t&&this.m(t),this.R()},blockSize:16,p:function(t){return function(i,e){return new t.init(e).finalize(i)}},V:function(t){return function(i,e){return new v.HMAC.init(t,e).finalize(i)}}}),r.algo={});return r}(Math),n)},754:function(t,i,e){var n;t.exports=(n=e(21),function(){var t=n.lib.WordArray;function i(i,e,n){for(var s=[],r=0,o=0;o<e;o++)if(o%4){var u=n[i.charCodeAt(o-1)]<<o%4*2|n[i.charCodeAt(o)]>>>6-o%4*2;s[r>>>2]|=u<<24-r%4*8,r++}return t.create(s,r)}n.enc.Base64={stringify:function(t){var i=t.words,e=t.sigBytes,n=this.B;t.clamp();for(var s=[],r=0;r<e;r+=3)for(var o=(i[r>>>2]>>>24-r%4*8&255)<<16|(i[r+1>>>2]>>>24-(r+1)%4*8&255)<<8|i[r+2>>>2]>>>24-(r+2)%4*8&255,u=0;u<4&&r+.75*u<e;u++)s.push(n.charAt(o>>>6*(3-u)&63));var a=n.charAt(64);if(a)for(;s.length%4;)s.push(a);return s.join("")},parse:function(t){var e=t.length,n=this.B,s=this.Y;if(!s){s=this.Y=[];for(var r=0;r<n.length;r++)s[n.charCodeAt(r)]=r}var o=n.charAt(64);if(o){var u=t.indexOf(o);-1!==u&&(e=u)}return i(t,e,s)},B:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),n.enc.Base64)},178:function(t,i,e){t.exports=e(21).enc.Utf8},506:function(t,i,e){var n,s,r,o,u,a,c;t.exports=(c=e(21),e(471),e(25),s=(n=c).lib,o=s.WordArray,a=(u=n.algo).EvpKDF=(r=s.Base).extend({cfg:r.extend({keySize:4,hasher:u.MD5,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,i){for(var e,n=this.cfg,s=n.hasher.create(),r=o.create(),u=r.words,a=n.keySize,c=n.iterations;u.length<a;){e&&s.update(e),e=s.update(t).finalize(i),s.reset();for(var h=1;h<c;h++)e=s.finalize(e),s.reset();r.concat(e)}return r.sigBytes=4*a,r}}),n.EvpKDF=function(t,i,e){return a.create(e).compute(t,i)},c.EvpKDF)},25:function(t,i,e){var n,s,r;t.exports=(s=(n=e(21)).lib.Base,r=n.enc.Utf8,void(n.algo.HMAC=s.extend({init:function(t,i){t=this.L=new t.init,"string"==typeof i&&(i=r.parse(i));var e=t.blockSize,n=4*e;i.sigBytes>n&&(i=t.finalize(i)),i.clamp();for(var s=this.j=i.clone(),o=this.q=i.clone(),u=s.words,a=o.words,c=0;c<e;c++)u[c]^=1549556828,a[c]^=909522486;s.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var t=this.L;t.reset(),t.update(this.q)},update:function(t){return this.L.update(t),this},finalize:function(t){var i=this.L,e=i.finalize(t);return i.reset(),i.finalize(this.j.clone().concat(e))}})))},636:function(t,i,e){var n;t.exports=(n=e(21),function(t){var i=n,e=i.lib,s=e.WordArray,r=e.Hasher,o=i.algo,u=[];!function(){for(var i=0;i<64;i++)u[i]=4294967296*t.abs(t.sin(i+1))|0}();var a=o.MD5=r.extend({t:function(){this.F=new s.init([1732584193,4023233417,2562383102,271733878])},H:function(t,i){for(var e=0;e<16;e++){var n=i+e,s=t[n];t[n]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var r=this.F.words,o=t[i+0],a=t[i+1],d=t[i+2],v=t[i+3],m=t[i+4],p=t[i+5],g=t[i+6],b=t[i+7],_=t[i+8],y=t[i+9],w=t[i+10],S=t[i+11],E=t[i+12],O=t[i+13],T=t[i+14],k=t[i+15],R=r[0],I=r[1],N=r[2],C=r[3];R=c(R,I,N,C,o,7,u[0]),C=c(C,R,I,N,a,12,u[1]),N=c(N,C,R,I,d,17,u[2]),I=c(I,N,C,R,v,22,u[3]),R=c(R,I,N,C,m,7,u[4]),C=c(C,R,I,N,p,12,u[5]),N=c(N,C,R,I,g,17,u[6]),I=c(I,N,C,R,b,22,u[7]),R=c(R,I,N,C,_,7,u[8]),C=c(C,R,I,N,y,12,u[9]),N=c(N,C,R,I,w,17,u[10]),I=c(I,N,C,R,S,22,u[11]),R=c(R,I,N,C,E,7,u[12]),C=c(C,R,I,N,O,12,u[13]),N=c(N,C,R,I,T,17,u[14]),R=h(R,I=c(I,N,C,R,k,22,u[15]),N,C,a,5,u[16]),C=h(C,R,I,N,g,9,u[17]),N=h(N,C,R,I,S,14,u[18]),I=h(I,N,C,R,o,20,u[19]),R=h(R,I,N,C,p,5,u[20]),C=h(C,R,I,N,w,9,u[21]),N=h(N,C,R,I,k,14,u[22]),I=h(I,N,C,R,m,20,u[23]),R=h(R,I,N,C,y,5,u[24]),C=h(C,R,I,N,T,9,u[25]),N=h(N,C,R,I,v,14,u[26]),I=h(I,N,C,R,_,20,u[27]),R=h(R,I,N,C,O,5,u[28]),C=h(C,R,I,N,d,9,u[29]),N=h(N,C,R,I,b,14,u[30]),R=f(R,I=h(I,N,C,R,E,20,u[31]),N,C,p,4,u[32]),C=f(C,R,I,N,_,11,u[33]),N=f(N,C,R,I,S,16,u[34]),I=f(I,N,C,R,T,23,u[35]),R=f(R,I,N,C,a,4,u[36]),C=f(C,R,I,N,m,11,u[37]),N=f(N,C,R,I,b,16,u[38]),I=f(I,N,C,R,w,23,u[39]),R=f(R,I,N,C,O,4,u[40]),C=f(C,R,I,N,o,11,u[41]),N=f(N,C,R,I,v,16,u[42]),I=f(I,N,C,R,g,23,u[43]),R=f(R,I,N,C,y,4,u[44]),C=f(C,R,I,N,E,11,u[45]),N=f(N,C,R,I,k,16,u[46]),R=l(R,I=f(I,N,C,R,d,23,u[47]),N,C,o,6,u[48]),C=l(C,R,I,N,b,10,u[49]),N=l(N,C,R,I,T,15,u[50]),I=l(I,N,C,R,p,21,u[51]),R=l(R,I,N,C,E,6,u[52]),C=l(C,R,I,N,v,10,u[53]),N=l(N,C,R,I,w,15,u[54]),I=l(I,N,C,R,a,21,u[55]),R=l(R,I,N,C,_,6,u[56]),C=l(C,R,I,N,k,10,u[57]),N=l(N,C,R,I,g,15,u[58]),I=l(I,N,C,R,O,21,u[59]),R=l(R,I,N,C,m,6,u[60]),C=l(C,R,I,N,S,10,u[61]),N=l(N,C,R,I,d,15,u[62]),I=l(I,N,C,R,y,21,u[63]),r[0]=r[0]+R|0,r[1]=r[1]+I|0,r[2]=r[2]+N|0,r[3]=r[3]+C|0},R:function(){var i=this.U,e=i.words,n=8*this.k,s=8*i.sigBytes;e[s>>>5]|=128<<24-s%32;var r=t.floor(n/4294967296),o=n;e[15+(s+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),i.sigBytes=4*(e.length+1),this.O();for(var u=this.F,a=u.words,c=0;c<4;c++){var h=a[c];a[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return u},clone:function(){var t=r.clone.call(this);return t.F=this.F.clone(),t}});function c(t,i,e,n,s,r,o){var u=t+(i&e|~i&n)+s+o;return(u<<r|u>>>32-r)+i}function h(t,i,e,n,s,r,o){var u=t+(i&n|e&~n)+s+o;return(u<<r|u>>>32-r)+i}function f(t,i,e,n,s,r,o){var u=t+(i^e^n)+s+o;return(u<<r|u>>>32-r)+i}function l(t,i,e,n,s,r,o){var u=t+(e^(i|~n))+s+o;return(u<<r|u>>>32-r)+i}i.MD5=r.p(a),i.HmacMD5=r.V(a)}(Math),n.MD5)},471:function(t,i,e){var n,s,r,o,u,a,c;t.exports=(s=(n=c=e(21)).lib,r=s.WordArray,u=[],a=n.algo.SHA1=(o=s.Hasher).extend({t:function(){this.F=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},H:function(t,i){for(var e=this.F.words,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],c=0;c<80;c++){if(c<16)u[c]=0|t[i+c];else{var h=u[c-3]^u[c-8]^u[c-14]^u[c-16];u[c]=h<<1|h>>>31}var f=(n<<5|n>>>27)+a+u[c];f+=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=n,n=f}e[0]=e[0]+n|0,e[1]=e[1]+s|0,e[2]=e[2]+r|0,e[3]=e[3]+o|0,e[4]=e[4]+a|0},R:function(){var t=this.U,i=t.words,e=8*this.k,n=8*t.sigBytes;return i[n>>>5]|=128<<24-n%32,i[14+(n+64>>>9<<4)]=Math.floor(e/4294967296),i[15+(n+64>>>9<<4)]=e,t.sigBytes=4*i.length,this.O(),this.F},clone:function(){var t=o.clone.call(this);return t.F=this.F.clone(),t}}),n.SHA1=o.p(a),n.HmacSHA1=o.V(a),c.SHA1)},994:i=>{"use strict";i.exports=t},788:t=>{"use strict";t.exports=i},477:()=>{}},n={};function s(t){var i=n[t];if(void 0!==i)return i.exports;var r=n[t]={exports:{}};return e[t].call(r.exports,r,r.exports,s),r.exports}s.n=t=>{var i=t&&t.J?()=>t.default:()=>t;return s.d(i,{a:i}),i},s.d=(t,i)=>{for(var e in i)s.o(i,e)&&!s.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"J",{value:!0})};var r={};return(()=>{"use strict";var t,i,e,n,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y;s.r(r),s.d(r,{BrokenType:()=>k,BusinessService:()=>m,ConnectedType:()=>T,DisconnectedType:()=>O,Method:()=>E,Mode:()=>g,NET_ACCESS_CONFIG:()=>Tt,NetAgentHttpRequest:()=>li,NetAgentPCRequest:()=>ri,ZegoConnectionAgent:()=>_i}),function(t){t[t.Normal=0]="Normal",t[t.Private=1]="Private"}(t||(t={})),function(t){t[t.IPv4Only=0]="IPv4Only",t[t.IPv4Prefer=1]="IPv4Prefer",t[t.IPv6Prefer=2]="IPv6Prefer"}(i||(i={})),function(t){t[t.Default=0]="Default",t[t.Detail=1]="Detail"}(e||(e={})),function(t){t[t.IPv4=0]="IPv4",t[t.IPv6=1]="IPv6"}(n||(n={})),function(t){t[t.unreachable=0]="unreachable",t[t.unknown=1]="unknown",t[t.reachable=2]="reachable"}(o||(o={})),function(t){t[t.probed=0]="probed",t[t.noProbe=1]="noProbe",t[t.probing=2]="probing"}(u||(u={})),function(t){t[t.fail=0]="fail",t[t.connecting=1]="connecting",t[t.success=2]="success",t[t.timeout=3]="timeout"}(a||(a={})),function(t){t[t.WebSocket=0]="WebSocket",t[t.WebTransport=1]="WebTransport"}(c||(c={})),function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(h||(h={})),function(t){t[t.offline=0]="offline",t[t.online=1]="online"}(f||(f={})),function(t){t[t.PB=0]="PB",t[t.JSON=1]="JSON"}(l||(l={})),function(t){t[t.MSG_TYPE_STREAM_CLOSED=2]="MSG_TYPE_STREAM_CLOSED",t[t.MSG_TYPE_CLOSE_CONNECTION=3]="MSG_TYPE_CLOSE_CONNECTION",t[t.MSG_TYPE_HTTP_REQUEST=4]="MSG_TYPE_HTTP_REQUEST",t[t.MSG_TYPE_HTTP_RESPONSE=5]="MSG_TYPE_HTTP_RESPONSE",t[t.MSG_TYPE_HB_REQUEST=12]="MSG_TYPE_HB_REQUEST",t[t.MSG_TYPE_HB_RESPONSE=13]="MSG_TYPE_HB_RESPONSE",t[t.MSG_TYPE_GET_CONFIG_REQUEST=14]="MSG_TYPE_GET_CONFIG_REQUEST",t[t.MSG_TYPE_GET_CONFIG_RESPONSE=15]="MSG_TYPE_GET_CONFIG_RESPONSE",t[t.MSG_TYPE_HTTP_REQUEST_ACK=16]="MSG_TYPE_HTTP_REQUEST_ACK",t[t.MSG_TYPE_PC_UPWARD_MESSAGE=17]="MSG_TYPE_PC_UPWARD_MESSAGE",t[t.MSG_TYPE_PC_UPWARD_MESSAGE_ACK=18]="MSG_TYPE_PC_UPWARD_MESSAGE_ACK",t[t.MSG_TYPE_PC_ESTABLISHED=19]="MSG_TYPE_PC_ESTABLISHED",t[t.MSG_TYPE_PC_BROKEN=20]="MSG_TYPE_PC_BROKEN",t[t.MSG_TYPE_PC_DOWNWARD_MESSAGE=21]="MSG_TYPE_PC_DOWNWARD_MESSAGE",t[t.MSG_TYPE_REDIRECT=22]="MSG_TYPE_REDIRECT",t[t.MSG_TYPE_GET_APPCONFIG_REQUEST=23]="MSG_TYPE_GET_APPCONFIG_REQUEST",t[t.MSG_TYPE_GET_APPCONFIG_RESPONSE=24]="MSG_TYPE_GET_APPCONFIG_RESPONSE",t[t.MSG_TYPE_PUSH_APPCONFIG=25]="MSG_TYPE_PUSH_APPCONFIG",t[t.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST=26]="MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST",t[t.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE=27]="MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE",t[t.MSG_TYPE_PUSH_EXCEPTION=30]="MSG_TYPE_PUSH_EXCEPTION",t[t.MSG_TYPE_HTTP_REQUEST2=33]="MSG_TYPE_HTTP_REQUEST2",t[t.MSG_TYPE_REDIRECT2=34]="MSG_TYPE_REDIRECT2",t[t.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2=35]="MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2",t[t.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2=36]="MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2",t[t.MSG_TYPE_GET_SVRADDR_REQUEST=39]="MSG_TYPE_GET_SVRADDR_REQUEST",t[t.MSG_TYPE_GET_SVRADDR_RESPONSE=40]="MSG_TYPE_GET_SVRADDR_RESPONSE"}(d||(d={})),function(t){t[t.ACCESSHUB_INVALID_FRAME=2e4]="ACCESSHUB_INVALID_FRAME",t[t.ACCESSHUB_NEED_ENCRYPT=20001]="ACCESSHUB_NEED_ENCRYPT",t[t.ACCESSHUB_DECRYPT=20002]="ACCESSHUB_DECRYPT",t[t.ACCESSHUB_MSGTYPE=20003]="ACCESSHUB_MSGTYPE",t[t.ACCESSHUB_UNMARSHAL=20004]="ACCESSHUB_UNMARSHAL",t[t.ACCESSHUB_TIMEOUT=20005]="ACCESSHUB_TIMEOUT",t[t.ACCESSHUB_CONNECT=20006]="ACCESSHUB_CONNECT",t[t.ACCESSHUB_BROKEN=20007]="ACCESSHUB_BROKEN",t[t.ACCESSHUB_INTERNAL_ERROR=20008]="ACCESSHUB_INTERNAL_ERROR",t[t.ACCESSHUB_MARSHAL=20009]="ACCESSHUB_MARSHAL",t[t.ACCESSHUB_UNSUPPORTED_SERVICE=20010]="ACCESSHUB_UNSUPPORTED_SERVICE",t[t.ACCESSHUB_TOO_FREQUENTLY=20011]="ACCESSHUB_TOO_FREQUENTLY",t[t.ACCESSHUB_INVALID_APPID=20012]="ACCESSHUB_INVALID_APPID",t[t.ACCESSHUB_HB_TIMEOUT=20013]="ACCESSHUB_HB_TIMEOUT",t[t.ACCESSHUB_INVALID_SIGNATURE=20014]="ACCESSHUB_INVALID_SIGNATURE"}(v||(v={})),function(t){t[t.SERVICE_UNSET=0]="SERVICE_UNSET",t[t.SERVICE_MEDIAGW=1]="SERVICE_MEDIAGW",t[t.SERVICE_LIVEROOM=2]="SERVICE_LIVEROOM",t[t.SERVICE_MIX=3]="SERVICE_MIX",t[t.SERVICE_ZEUS=4]="SERVICE_ZEUS",t[t.SERVICE_ZPUSH=5]="SERVICE_ZPUSH",t[t.SERVICE_L3=6]="SERVICE_L3",t[t.SERVICE_TALKLINE=7]="SERVICE_TALKLINE",t[t.SERVICE_EDUSUITE=8]="SERVICE_EDUSUITE",t[t.SERVICE_ZIM=9]="SERVICE_ZIM",t[t.SERVICE_ClOUD_SETTING=10]="SERVICE_ClOUD_SETTING",t[t.SERVICE_ZEUSHB=11]="SERVICE_ZEUSHB",t[t.SERVICE_USER_LOGIC=12]="SERVICE_USER_LOGIC",t[t.SERVICE_UNIFYDISPATCH=13]="SERVICE_UNIFYDISPATCH",t[t.SERVICE_QUALITY=14]="SERVICE_QUALITY",t[t.SERVICE_SECURITY=15]="SERVICE_SECURITY",t[t.SERVICE_KTVCPR=16]="SERVICE_KTVCPR",t[t.SERVICE_SWITCH4LIVEROOM=17]="SERVICE_SWITCH4LIVEROOM",t[t.SERVICE_WEBRTC_SIGNAL=18]="SERVICE_WEBRTC_SIGNAL",t[t.SERVICE_L3_WEBRTC_SIGNAL=19]="SERVICE_L3_WEBRTC_SIGNAL",t[t.SERVICE_VIDEOCPR=20]="SERVICE_VIDEOCPR",t[t.SERVICE_CDN=21]="SERVICE_CDN",t[t.SERVICE_CLOUDRECORD=22]="SERVICE_CLOUDRECORD",t[t.SERVICE_INNER_ECHO=23]="SERVICE_INNER_ECHO",t[t.SERVICE_OUTER_ECHO=24]="SERVICE_OUTER_ECHO",t[t.SERVICE_LOCALHOST_ECHO=25]="SERVICE_LOCALHOST_ECHO",t[t.SERVICE_ECHO=26]="SERVICE_ECHO",t[t.SERVICE_DOCSERVICE=27]="SERVICE_DOCSERVICE",t[t.SERVICE_AUTHSVR=28]="SERVICE_AUTHSVR"}(m||(m={})),function(t){t[t.ZEGOCONN_RUN_ENV_UNSET=0]="ZEGOCONN_RUN_ENV_UNSET",t[t.ZEGOCONN_RUN_ENV_BROWSER=1]="ZEGOCONN_RUN_ENV_BROWSER",t[t.ZEGOCONN_RUN_ENV_APPLET=2]="ZEGOCONN_RUN_ENV_APPLET"}(p||(p={})),function(t){t[t.Mode_UNSET=0]="Mode_UNSET",t[t.MODE_ONLINE=1]="MODE_ONLINE",t[t.MODE_TEST=2]="MODE_TEST",t[t.MODE_ALPHA=3]="MODE_ALPHA"}(g||(g={})),function(t){t[t.HTTP=0]="HTTP",t[t.PC=1]="PC",t[t.OTHER=2]="OTHER"}(b||(b={})),function(t){t[t.NONE=0]="NONE",t[t.BROKEN=1]="BROKEN",t[t.DISCONNECT=2]="DISCONNECT"}(_||(_={})),function(t){t[t.CONNECTED=0]="CONNECTED",t[t.DISCONNECT=1]="DISCONNECT",t[t.BROKEN=2]="BROKEN"}(y||(y={}));var w,S,E,O,T,k,R,I=[v.ACCESSHUB_INVALID_APPID,v.ACCESSHUB_INVALID_SIGNATURE];!function(t){t[t.offline=0]="offline",t[t.online=1]="online"}(w||(w={})),function(t){t[t.ACTION_RESERVED=0]="ACTION_RESERVED",t[t.ACTION_DISPATCH=1]="ACTION_DISPATCH",t[t.ACTION_RETRY=2]="ACTION_RETRY",t[t.ACTION_NEXT_NODE=3]="ACTION_NEXT_NODE",t[t.ACTION_ABORT=4]="ACTION_ABORT",t[t.ACTION_NEXT_GROUP=5]="ACTION_NEXT_GROUP",t[t.ACTION_IDLE=6]="ACTION_IDLE"}(S||(S={})),function(t){t[t.METHOD_UNSET=0]="METHOD_UNSET",t[t.METHOD_GET=1]="METHOD_GET",t[t.METHOD_POST=2]="METHOD_POST",t[t.METHOD_PUT=3]="METHOD_PUT",t[t.METHOD_PATCH=4]="METHOD_PATCH",t[t.METHOD_DELETE=5]="METHOD_DELETE",t[t.METHOD_HEAD=6]="METHOD_HEAD",t[t.METHOD_OPTIONS=7]="METHOD_OPTIONS"}(E||(E={})),function(t){t[t.CLOSE=0]="CLOSE",t[t.TEMP=1]="TEMP",t[t.TIMEOUT=2]="TIMEOUT"}(O||(O={})),function(t){t[t.AUTO=0]="AUTO",t[t.MANUAL=1]="MANUAL"}(T||(T={})),function(t){t[t.EMPTY=0]="EMPTY",t[t.CLOSE=1]="CLOSE"}(k||(k={})),function(t){t[t.single=0]="single",t[t.detail=1]="detail"}(R||(R={}));var N={2:"stream_closed",3:"close_connection",4:"http_request",5:"http_response",12:"hb_request",13:"hb_response",14:"get_config_request",15:"get_config_response",16:"http_request_ack",17:"pc_upward_message",18:"pc_upward_message_ack",19:"pc_established",20:"pc_broken",21:"pc_downward_message",22:"redirect",23:"get_appconfig_request",24:"get_appconfig_response",25:"push_appconfig",26:"accesshub_dispatch_request",27:"accesshub_dispatch_response",30:"push_exception",33:"http_request2",34:"redirect2",35:"accesshub_dispatch_request2",36:"accesshub_dispatch_response2",39:"get_svraddr_request",40:"get_svraddr_response"},C=s(994);const z=C.default||C;var D=s(788),P=s(788);const A=s(994);(P=P.default||P).util.Long=A.default||A,P.util.Long.fromBits=P.util.Long.fromBits||function(){return 0};for(var M=P.roots,x=P.types?P.types.basic:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0,string:2,bytes:2},j=P.types?P.types.packed:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0},L=Object.keys(x),q={$:function(t){return q[t]?q[t].call(this):M[t].decode?M[t].decode(this,this.uint32()):q.$.call(this,"int32")}},U={$:function(t,i,e){var n=x[t];return void 0===n?M[t].encode?(this.uint32(e<<3|2).fork(),M[t].encode(i,this).ldelim()):U.$.call(this,"int32",i,e):U[t].call(this.uint32(e<<3|n),i)}},B=0;B<L.length;B++)q[L[B]]=P.Reader.prototype[L[B]],U[L[B]]=P.Writer.prototype[L[B]];!function t(i,e,n,s){for(var r=0,o=Object.keys(i);r<o.length;r++){var u=o[r];i[u].$m&&Object.keys(i[u].$m).every((function(t){return Number(t)}))?n[u]=function(i,n){function s(t){for(var e in i){var n=i[e];"{"===n[1].charAt(0)?this[n[0]]={}:"["!==n[1].charAt(0)&&"<"!==n[1].charAt(0)||(this[n[0]]=[])}if(t)for(var s=Object.keys(t),r=0;r<s.length;++r)null!=t[s[r]]&&(this[s[r]]=t[s[r]])}var r={};for(var o in i){var u=i[o],a=u[1];"{"===a.charAt(0)?(s.prototype[u[0]]=P.util.emptyObject,r[a]={$m:a.substring(1).split(",").map((function(t,i){return[`$${i+1}`,t,null]})).reduce((function(t,i,e){return t[e+1]=i,t}),{})}):s.prototype[u[0]]="["===a.charAt(0)||"<"===a.charAt(0)?P.util.emptyArray:"bytes"===a?P.util.newBuffer([]):u[2]&&u[2].hasOwnProperty("low")&&u[2].hasOwnProperty("high")?P.util.Long.fromBits(u[2].low,u[2].high,u[2].unsigned):u[2]}return s.create=function(t){return new s(t)},s.decode=function(t,e){t instanceof P.Reader||(t=P.Reader.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new s;t.pos<n;){var o=t.uint32(),u=o>>>3;if(u>0&&i[u]){var a=i[u][0],c=i[u][1];if("{"===c.charAt(0)){r[a]===P.util.emptyObject&&(r[a]={});var h=s.$namespace[c].decode(t,t.uint32());r[a][h.$1]=h.$2}else if("["===c.charAt(0)||"<"===c.charAt(0))if(c=c.substring(1),r[a]&&r[a].length||(r[a]=[]),void 0!==j[c=q[c]||M[c].decode?c:"int32"]&&2==(7&o))for(var f=t.uint32()+t.pos;t.pos<f;)r[a].push(q.$.call(t,c));else r[a].push(q.$.call(t,c));else r[a]=q.$.call(t,c)}else t.skipType(7&o)}return r},s.encode=function(t,e){for(var n in e||(e=P.Writer.create()),i){var r=i[n][0],o=i[n][1];if("{"===o.charAt(0)){if(null!=t[r]&&t.hasOwnProperty(r))for(var u=0,a=Object.keys(t[r]);u<a.length;++u)e.uint32(n<<3|2).fork(),s.$namespace[o].encode({$1:a[u],$2:t[r][a[u]]},e).ldelim()}else if("["===o.charAt(0)||"<"===o.charAt(0)){var c="<"===o.charAt(0);o=o.substring(1);var h=t[r];if(null!=h&&h.length)if(o=void 0!==x[o]||M[o].encode?o:"int32",c&&void 0!==j[o]){for(e.uint32(n<<3|2).fork(),u=0;u<h.length;u++)U[o].call(e,h[u]);e.ldelim()}else for(u=0;u<h.length;u++)U.$.call(e,o,h[u],n)}else null!=t[r]&&t.hasOwnProperty(r)&&U.$.call(e,o,t[r],n)}return e},Object.keys(r).length&&(s.$namespace=t(r,e+"."+n,s.$namespace||{},!0)),s}(i[u].$m,u):i[u].$s?n[u]=function(t,i){function n(t,i,e){P.rpc.Service.call(this,t,i,e)}return(n.prototype=Object.create(P.rpc.Service.prototype)).constructor=n,n.create=function(t,i,e){return new n(t,i,e)},Object.keys(t).forEach((function(s){var r=t[s];function o(t,i){return this.rpcCall(o,M[r[0]],M[r[1]],t,i)}Object.defineProperty(o,"name",{value:s}),Object.defineProperty(o,"path",{value:`${e}.${i}`}),n.prototype[s]=o})),n}(i[u].$s,u):i[u].$e&&Object.values(i[u].$e).every((function(t){return Number(t)===t}))&&(n[u]=function(t){for(var i=Object.keys(t),e={},n=0;n<i.length;n++)e[e[i[n]]=t[i[n]]]=i[n];return e}(i[u].$e)),n[u]&&!s&&(M[`${e}.${u}`]=n[u]),delete i[u].$m,delete i[u].$s,delete i[u].$e,n[u]=t(i[u],Boolean(e)?`${e}.${u}`:u,n[u]||{})}return n}({zego_connection:{proto_accesshub:{AccesshubAddr:{$m:{1:["ipv4","fixed32",0],2:["ipv6","zego_connection.proto_accesshub.IPV6Addr",null],3:["quic_port","uint32",0],4:["wss_port","uint32",0]}},AccesshubDispatchGroup:{$m:{1:["group","string",""],2:["quic_nodes","<string",null],3:["mtcp_nodes","<string",null],4:["wss_nodes","<string",null]}},AccesshubDispatchGroup2:{$m:{1:["group","string",""],2:["nodes","<zego_connection.proto_accesshub.AccesshubAddr",null],3:["nodes_dual","<zego_connection.proto_accesshub.AccesshubAddr",null],4:["weight","uint32",0],5:["gid","uint32",0]}},AccesshubDispatchRequest2:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode_no","zego_connection.proto_accesshub.Mode",0],5:["id_name","string",""],6:["sdk_type","zego_connection.proto_accesshub.SdkType",0],7:["zegoconn_version","uint32",0],8:["zegoconn_run_env","zego_connection.proto_accesshub.ZegoconnRunEnv",0],9:["device_id","string",""],10:["client_ip","string",""],11:["geofencing_type","uint32",0],12:["geofencings","[uint32",null],13:["addr_type","uint32",0],14:["net_mode","uint32",0],15:["dispatch_tag","uint32",0]}},AccesshubDispatchResponse2:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","zego_connection.proto_accesshub.AccesshubDispatchResponseData2",null]}},AccesshubDispatchResponseData2:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["rand","string",""],3:["secret","string",""],4:["groups","<zego_connection.proto_accesshub.AccesshubDispatchGroup2",null],5:["wss_groups","<zego_connection.proto_accesshub.WssAccesshubDispatchGroup",null],6:["ttl","uint32",0],7:["http3_groups","<zego_connection.proto_accesshub.Http3AccesshubDispatchGroup",null],8:["wss_v6_groups","<zego_connection.proto_accesshub.WssAccesshubDispatchGroup",null],9:["http3_v6_groups","<zego_connection.proto_accesshub.Http3AccesshubDispatchGroup",null]}},BackendConnType:{$e:{BACKEND_CONN_TYPE_UNSET:0,BACKEND_CONN_TYPE_TCP:1,BACKEND_CONN_TYPE_WSS:2}},CheckServiceAreaRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","zego_connection.proto_accesshub.Mode",0],5:["id_name","string",""],6:["sdk_type","zego_connection.proto_accesshub.SdkType",0],7:["zegoconn_run_env","zego_connection.proto_accesshub.ZegoconnRunEnv",0],8:["zegoconn_version","uint32",0],9:["device_id","string",""],10:["user_agent","string",""],11:["language","string",""],12:["timezone","string",""],13:["carrier","string",""],14:["dns_result","zego_connection.proto_accesshub.IPAddr",null]}},CheckServiceAreaResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","zego_connection.proto_accesshub.CheckServiceAreaResponseData",null]}},CheckServiceAreaResponseData:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}]}},CloseConnection:{$m:{1:["reason","int32",0],2:["msg","string",""],3:["action","int32",0]},Action:{$e:{ACTION_RESERVED:0,ACTION_DISPATCH:1,ACTION_RETRY:2,ACTION_NEXT_NODE:3,ACTION_ABORT:4,ACTION_NEXT_GROUP:5,ACTION_IDLE:6}}},ConnectionClosed:{$m:{1:["code","int32",0],2:["msg","string",""]}},ErrorCode:{$e:{OK:0,DISPATCH_NO_AVAILABLE_NODE:1e4,DISPATCH_INTERNAL_ERROR:10001,DISPATCH_INVALID_FRAME:10002,DISPATCH_UNMARSHAL:10003,DISPATCH_MSGTYPE:10004,DISPATCH_MARSHAL:10005,DISPATCH_TOO_FREQUENTLY:10006,DISPATCH_EMPTY_GEOFENCING:10007,ACCESSHUB_INVALID_FRAME:2e4,ACCESSHUB_NEED_ENCRYPT:20001,ACCESSHUB_DECRYPT:20002,ACCESSHUB_MSGTYPE:20003,ACCESSHUB_UNMARSHAL:20004,ACCESSHUB_TIMEOUT:20005,ACCESSHUB_CONNECT:20006,ACCESSHUB_BROKEN:20007,ACCESSHUB_INTERNAL_ERROR:20008,ACCESSHUB_MARSHAL:20009,ACCESSHUB_UNSUPPORTED_SERVICE:20010,ACCESSHUB_TOO_FREQUENTLY:20011,ACCESSHUB_INVALID_APPID:20012,ACCESSHUB_HB_TIMEOUT:20013,ACCESSHUB_INVALID_SIGNATURE:20014,ACCESSHUB_AUTH_FAILED:20015,ACCESSHUB_UNSUPPORTED_INTERFACE:20016,ACCESSHUB_EMPTY_GEOFENCING:20017,ACCESSHUB_ACCESS_DENIED:20018,ACCESSHUB_SPECIAL_CUSTOMER:20019,ACCESSHUB_IDLE_CONNECTION:20020,ACCESSHUB_APPID_OFFLINE:20021,ACCESSHUB_GET_STREAM_FAILED:3e4,ACCESSHUB_GET_CONN_FAILED:30001,ACCESSHUB_DO_HTTP_REQUEST_FAILED:30002,ACCESSHUB_UNMARSHAL_HB_FAILED:30003,ACCESSHUB_DO_BACKEND_DISPATCH_FAILED:30004}},GeoFencing:{$e:{CN:2,NA:3,EU:4,AS:5,IN:6,NCN:7}},GeoFencingType:{$e:{NONE:0,UNION:1,EXCLUDE:2}},GetAppConfigRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode_no","zego_connection.proto_accesshub.Mode",0],5:["id_name","string",""],6:["config_key","string",""],7:["ts","uint64",{low:0,high:0,unsigned:!0}],8:["signature","bytes",[]],9:["lite_sign","string",""],10:["token","string",""],11:["sdk_type","zego_connection.proto_accesshub.SdkType",0],12:["zegoconn_version","uint32",0],13:["zegoconn_run_env","zego_connection.proto_accesshub.ZegoconnRunEnv",0],14:["device_id","string",""],15:["etag","uint32",0],16:["is_special_customer","uint32",0]}},GetAppConfigResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","zego_connection.proto_accesshub.GetAppConfigResponseData",null]}},GetAppConfigResponseData:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["data","bytes",[]],3:["ts","uint64",{low:0,high:0,unsigned:!0}],4:["etag","uint32",0]}},GetConfigRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","string",""],5:["id_name","string",""],6:["reqid","string",""],7:["zegoconn_version","uint32",0],8:["sdk_type","zego_connection.proto_accesshub.SdkType",0],9:["zegoconn_run_env","zego_connection.proto_accesshub.ZegoconnRunEnv",0],10:["device_id","string",""],11:["mode_no","zego_connection.proto_accesshub.Mode",0],12:["geofencing_type","uint32",0],13:["geofencings","[uint32",null],14:["dispatch_tag","uint32",0]}},GetConfigResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","zego_connection.proto_accesshub.GetConfigResponseData",null]}},GetConfigResponseData:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["quic_hb_interval","uint32",0],3:["quic_hb_timeout","uint32",0],4:["logic_hb_interval","uint32",0],5:["logic_hb_timeout","uint32",0],6:["pc_establish_timeout","uint32",0],7:["sdk_link_detect_interval","uint32",0],8:["sdk_link_detect_duration","uint32",0],9:["client_outer_ip","string",""],10:["ntp_time","uint64",{low:0,high:0,unsigned:!0}],11:["root_rsa_certs_ver","uint32",0],12:["geofencing_id","uint32",0],13:["svraddr_ver","uint32",0],14:["root_ecc_certs_ver","uint32",0]}},GetSvraddrRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","zego_connection.proto_accesshub.Mode",0],5:["id_name","string",""],6:["sdk_type","zego_connection.proto_accesshub.SdkType",0],7:["zegoconn_run_env","zego_connection.proto_accesshub.ZegoconnRunEnv",0],8:["zegoconn_version","uint32",0],9:["device_id","string",""],10:["geofencing_type","uint32",0],11:["geofencings","[uint32",null],12:["addr_type","uint32",0],13:["dispatch_tag","uint32",0]}},GetSvraddrResponse:{$m:{1:["code","int32",0],2:["msg","string",""],3:["data","zego_connection.proto_accesshub.GetSvraddrResponseData",null]}},GetSvraddrResponseData:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["geofencing_id","uint32",0],3:["svraddr_ver","uint32",0],4:["anycast_ips","<zego_connection.proto_accesshub.IPAddr",null],5:["zegons_domain","string",""],6:["zegons_ips","<zego_connection.proto_accesshub.IPAddr",null],7:["accesshub_domain","string",""],8:["accesshub_ips","<zego_connection.proto_accesshub.IPAddr",null],9:["logreport_domain","string",""],10:["logreport_ips","<zego_connection.proto_accesshub.IPAddr",null],11:["detaillog_domain","string",""],12:["detaillog_ips","<zego_connection.proto_accesshub.IPAddr",null],13:["stunsvr_domain","string",""],14:["stunsvr_ips","<zego_connection.proto_accesshub.IPAddr",null],15:["zimfile_domain","string",""],16:["zimfile_ips","<zego_connection.proto_accesshub.IPAddr",null],17:["accesshub_sni","string",""],18:["detectsvr_domain","string",""],19:["accesscube_domain","string",""],20:["wslog_domain","string",""],21:["wslog_ips","<zego_connection.proto_accesshub.IPAddr",null],22:["http3_domain","string",""],23:["accesshub_v6_domain","string",""],24:["http3_v6_domain","string",""],25:["logreport_v6_domain","string",""],26:["detaillog_v6_domain","string",""]}},HBRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["ts","int64",{low:0,high:0,unsigned:!1}]}},HBResponse:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["ts","int64",{low:0,high:0,unsigned:!1}],3:["ntp_time","uint64",{low:0,high:0,unsigned:!0}]}},Http3AccesshubDispatchGroup:{$m:{1:["group","string",""],2:["host","string",""]}},HTTPRequest:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","string",""],5:["id_name","string",""],6:["reqid","string",""],7:["stick","string",""],8:["service","string",""],9:["location","string",""],10:["method","string",""],11:["headers","<zego_connection.proto_accesshub.HTTPRequest.HTTPHeader",null],12:["body","bytes",[]],13:["ack","bool",!1],14:["mode_no","zego_connection.proto_accesshub.Mode",0],15:["service_no","zego_connection.proto_accesshub.Service",0],16:["method_no","zego_connection.proto_accesshub.Method",0],17:["sdk_type","zego_connection.proto_accesshub.SdkType",0],18:["zegoconn_run_env","zego_connection.proto_accesshub.ZegoconnRunEnv",0],19:["zegoconn_version","uint32",0],20:["device_id","string",""],21:["reduce_resp_header","uint32",0]},HTTPHeader:{$m:{1:["name","string",""],2:["val","string",""]}}},HTTPRequest2:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode","zego_connection.proto_accesshub.Mode",0],5:["id_name","string",""],6:["sdk_type","zego_connection.proto_accesshub.SdkType",0],7:["zegoconn_run_env","zego_connection.proto_accesshub.ZegoconnRunEnv",0],8:["zegoconn_version","uint32",0],9:["headers","<zego_connection.proto_accesshub.HTTPRequest.HTTPHeader",null],10:["method","zego_connection.proto_accesshub.Method",0],11:["interface_id","uint32",0],12:["res_id","string",""],13:["params","string",""],14:["body","bytes",[]],15:["ack","bool",!1],16:["device_id","string",""],17:["ts","uint64",{low:0,high:0,unsigned:!0}],18:["signature","bytes",[]],19:["token","string",""],20:["lite_sign","string",""],21:["reduce_resp_header","uint32",0]}},HTTPRequestAck:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}]}},HTTPRequestDroped:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["reason","int32",0],3:["msg","string",""]}},HTTPResponse:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["headers","<zego_connection.proto_accesshub.HTTPRequest.HTTPHeader",null],3:["status_code","int32",0],4:["body","bytes",[]]}},IPAddr:{$m:{1:["ipv4","fixed32",0],2:["ipv6","zego_connection.proto_accesshub.IPV6Addr",null]}},IPV6Addr:{$m:{1:["high","fixed64",{low:0,high:0,unsigned:!1}],2:["low","fixed64",{low:0,high:0,unsigned:!1}]}},MessageType:{$e:{MSG_TYPE_EMPTY:0,MSG_TYPE_CONNECTION_CLOSED:1,MSG_TYPE_STREAM_CLOSED:2,MSG_TYPE_CLOSE_CONNECTION:3,MSG_TYPE_HTTP_REQUEST:4,MSG_TYPE_HTTP_RESPONSE:5,MSG_TYPE_HTTP_REQUEST_DROPED:6,MSG_TYPE_PROXY_CONNECT:7,MSG_TYPE_PROXY_CONNECTED:8,MSG_TYPE_PROXY_CONNECTION_CLOSED:9,MSG_TYPE_PROXY_SEND_DATA:10,MSG_TYPE_PROXY_RECV_DATA:11,MSG_TYPE_HB_REQUEST:12,MSG_TYPE_HB_RESPONSE:13,MSG_TYPE_GET_CONFIG_REQUEST:14,MSG_TYPE_GET_CONFIG_RESPONSE:15,MSG_TYPE_HTTP_REQUEST_ACK:16,MSG_TYPE_PC_UPWARD_MESSAGE:17,MSG_TYPE_PC_UPWARD_MESSAGE_ACK:18,MSG_TYPE_PC_ESTABLISHED:19,MSG_TYPE_PC_BROKEN:20,MSG_TYPE_PC_DOWNWARD_MESSAGE:21,MSG_TYPE_REDIRECT:22,MSG_TYPE_GET_APPCONFIG_REQUEST:23,MSG_TYPE_GET_APPCONFIG_RESPONSE:24,MSG_TYPE_PUSH_APPCONFIG:25,MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST:26,MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE:27,MSG_TYPE_GET_IM_CONFIG_REQUEST:28,MSG_TYPE_GET_IM_CONFIG_RESPONSE:29,MSG_TYPE_PUSH_EXCEPTION:30,MSG_TYPE_RESOLVE_DOMAIN_REQUEST:31,MSG_TYPE_RESOLVE_DOMAIN_RESPONSE:32,MSG_TYPE_HTTP_REQUEST2:33,MSG_TYPE_REDIRECT2:34,MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2:35,MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2:36,MSG_TYPE_GET_ROOTCERTS_REQUEST:37,MSG_TYPE_GET_ROOTCERTS_RESPONSE:38,MSG_TYPE_GET_SVRADDR_REQUEST:39,MSG_TYPE_GET_SVRADDR_RESPONSE:40,MSG_TYPE_CHECK_SERVICEAREA_REQUEST:41,MSG_TYPE_CHECK_SERVICEAREA_RESPONSE:42,MSG_TYPE_UA_DISPATCH_REQUEST:50,MSG_TYPE_UA_DISPATCH_RESPONSE:51,MSG_TYPE_UA_ECHO_REQUEST:52,MSG_TYPE_UA_ECHO_RESPONSE:53,MSG_TYPE_NODE_REGISTER_REQUEST:100,MSG_TYPE_NODE_REGISTER_RESPONSE:101,MSG_TYPE_NODE_HB_REQUEST:102,MSG_TYPE_NODE_HB_RESPONSE:103}},Method:{$e:{METHOD_UNSET:0,METHOD_GET:1,METHOD_POST:2,METHOD_PUT:3,METHOD_PATCH:4,METHOD_DELETE:5,METHOD_HEAD:6,METHOD_OPTIONS:7}},Mode:{$e:{Mode_UNSET:0,MODE_ONLINE:1,MODE_TEST:2,MODE_ALPHA:3}},PCBroken:{$m:{}},PCDownwardMessage:{$m:{1:["payload","bytes",[]],2:["wss_message_type","uint32",0],3:["ts","uint64",{low:0,high:0,unsigned:!0}]}},PCEstablished:{$m:{1:["elapse","uint32",0],2:["from","uint32",0]}},PCUpwardMessage:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}],2:["appid","uint32",0],3:["biz_type","uint32",0],4:["mode_no","zego_connection.proto_accesshub.Mode",0],5:["id_name","string",""],6:["service_no","zego_connection.proto_accesshub.Service",0],7:["ack","bool",!1],8:["payload","bytes",[]],9:["sdk_type","zego_connection.proto_accesshub.SdkType",0],10:["wss_message_type","uint32",0],11:["wss_path","string",""],12:["wss_raw_query","string",""],13:["zegoconn_version","uint32",0],14:["zegoconn_run_env","zego_connection.proto_accesshub.ZegoconnRunEnv",0],15:["backend_conn_type","zego_connection.proto_accesshub.BackendConnType",0],16:["device_id","string",""],17:["geofencing_type","uint32",0],18:["geofencings","[uint32",null],19:["addr_type","uint32",0],20:["net_mode","uint32",0]}},PCUpwardMessageAck:{$m:{1:["txid","uint64",{low:0,high:0,unsigned:!0}]}},ProxyConnectionClosed:{$m:{1:["code","int32",0],2:["msg","string",""],3:["connected","int32",0]}},PushAppConfig:{$m:{1:["config_key","string",""],2:["data","bytes",[]]}},PushException:{$m:{1:["reason","int32",0],2:["msg","string",""],3:["txid","uint64",{low:0,high:0,unsigned:!0}]}},Redirect2:{$m:{1:["rand","string",""],2:["secret","string",""],3:["groups","<zego_connection.proto_accesshub.AccesshubDispatchGroup2",null],4:["wss_groups","<zego_connection.proto_accesshub.WssAccesshubDispatchGroup",null],5:["ttl","uint32",0],6:["http3_groups","<zego_connection.proto_accesshub.Http3AccesshubDispatchGroup",null],7:["wss_v6_groups","<zego_connection.proto_accesshub.WssAccesshubDispatchGroup",null],8:["http3_v6_groups","<zego_connection.proto_accesshub.Http3AccesshubDispatchGroup",null]}},SdkType:{$e:{SDK_TYPE_UNSET:0,SDK_TYPE_NATIVE:1,SDK_TYPE_WSS_WEB:3,SDK_TYPE_ZIM_WEB:4}},Service:{$e:{SERVICE_UNSET:0,SERVICE_MEDIAGW:1,SERVICE_LIVEROOM:2,SERVICE_MIX:3,SERVICE_ZEUS:4,SERVICE_ZPUSH:5,SERVICE_L3:6,SERVICE_TALKLINE:7,SERVICE_EDUSUITE:8,SERVICE_ZIM:9,SERVICE_ClOUD_SETTING:10,SERVICE_ZEUSHB:11,SERVICE_USER_LOGIC:12,SERVICE_UNIFYDISPATCH:13,SERVICE_QUALITY:14,SERVICE_SECURITY:15,SERVICE_KTVCPR:16,SERVICE_SWITCH4LIVEROOM:17,SERVICE_WEBRTC_SIGNAL:18,SERVICE_L3_WEBRTC_SIGNAL:19,SERVICE_VIDEOCPR:20,SERVICE_CDN:21,SERVICE_CLOUDRECORD:22,SERVICE_INNER_ECHO:23,SERVICE_OUTER_ECHO:24,SERVICE_LOCALHOST_ECHO:25,SERVICE_ECHO:26,SERVICE_DOCSERVICE:27,SERVICE_AUTHSVR:28,SERVICE_WEBLIVEROOM:29,SERVICE_WHITEBOARD:30,SERVICE_METAWORLD:31,SERVICE_ZEGOLAND:32}},StreamClosed:{$m:{1:["code","int32",0],2:["msg","string",""]}},WssAccesshubDispatchGroup:{$m:{1:["group","string",""],2:["host","string",""],3:["main_domain","string",""]}},ZegoconnRunEnv:{$e:{ZEGOCONN_RUN_ENV_UNSET:0,ZEGOCONN_RUN_ENV_BROWSER:1,ZEGOCONN_RUN_ENV_APPLET:2}}},proto_initconfig:{AppConfig:{$m:{1:["test_id","int32",0],2:["domain","string",""],3:["flexible_domain","string",""],4:["replace_flexible_domain","string",""]}},InitConfig:{$m:{1:["app_config","zego_connection.proto_initconfig.AppConfig",null],4:["speedlog_config","zego_connection.proto_initconfig.SpeedlogConfig",null],5:["media_config","zego_connection.proto_initconfig.MediaConfig",null]}},MediaConfig:{$m:{1:["play_config","zego_connection.proto_initconfig.MediaPlayConfig",null],2:["publish_config","zego_connection.proto_initconfig.MediaPublishConfig",null]}},MediaPlayConfig:{$m:{5:["resource_info","<zego_connection.proto_initconfig.MediaResourceInfo",null],16:["transcoding","zego_connection.proto_initconfig.TranscodingConfig",null],19:["enable_codec_template","int32",0],20:["codec_template_postfix_pattern","string",""]}},MediaPublishConfig:{$m:{2:["resource_info","<zego_connection.proto_initconfig.MediaResourceInfo",null],5:["enable_subject_segmentation","int32",0],6:["object_segmentation_platform","int32",0]}},MediaResourceInfo:{$m:{1:["resource_type","zego_connection.proto_initconfig.ResourceType",0],2:["service_info","<zego_connection.proto_initconfig.MediaServiceProtocolInfo",null]}},MediaServiceProtocolInfo:{$m:{1:["config_id","string",""],2:["protocol","zego_connection.proto_initconfig.ProtocolType",0],3:["url_template","string",""],4:["resolve_type","zego_connection.proto_initconfig.ResolveType",0],5:["push_cdn_authentication","int32",0],6:["cdn_quic_version","<int32",null]}},ProtocolType:{$e:{UDP:0,RTMP:1,FLV:2,HLS:3,WEBRTC:4}},ResolveType:{$e:{LOCAL_DNS:0,DISPATCH:1}},ResourceType:{$e:{CDN:0,RTC:1,L3:2,CDN_PLUS:3,CDN_PLUS_BACKUP:4}},SpeedlogConfig:{$m:{1:["report_count","int32",0],2:["report_retry_interval","int32",0],3:["push_quality_sample_count","int32",0],4:["pull_quality_sample_count","int32",0],5:["hardware_report_cycle","int32",0],6:["room_user_max_count","int32",0],7:["room_stream_max_count","int32",0],8:["charge_info_report_cycle","int32",0],9:["charge_info_report_mode","int32",0],10:["disable_report_pull","<zego_connection.proto_initconfig.ResourceType",null],11:["report_max_bytes","int32",0],12:["push_quality_report_freq","int32",0],13:["pull_quality_report_freq","int32",0],14:["charge_info_report_no_playing","int32",0]}},TranscodingConfig:{$m:{1:["video_codec_h264","string",""]}}}}},"",M,!1);const J=M.zego_connection;var V=function(){return V=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},V.apply(this,arguments)};D.util.Long=z,D.configure();var H,G=function(){function i(t){var i;this.stateCenter=t,this.W=J,this.K=((i={})[d.MSG_TYPE_STREAM_CLOSED]=["proto_accesshub","ConnectionClosed"],i[d.MSG_TYPE_CLOSE_CONNECTION]=["proto_accesshub","CloseConnection"],i[d.MSG_TYPE_HTTP_REQUEST]=["proto_accesshub","HTTPRequest"],i[d.MSG_TYPE_HTTP_RESPONSE]=["proto_accesshub","HTTPResponse"],i[d.MSG_TYPE_HTTP_REQUEST2]=["proto_accesshub","HTTPRequest2"],i[d.MSG_TYPE_HB_REQUEST]=["proto_accesshub","HBRequest"],i[d.MSG_TYPE_HB_RESPONSE]=["proto_accesshub","HBResponse"],i[d.MSG_TYPE_GET_CONFIG_REQUEST]=["proto_accesshub","GetConfigRequest"],i[d.MSG_TYPE_GET_CONFIG_RESPONSE]=["proto_accesshub","GetConfigResponse"],i[d.MSG_TYPE_GET_SVRADDR_REQUEST]=["proto_accesshub","GetSvraddrRequest"],i[d.MSG_TYPE_GET_SVRADDR_RESPONSE]=["proto_accesshub","GetSvraddrResponse"],i[d.MSG_TYPE_HTTP_REQUEST_ACK]=["proto_accesshub","HTTPRequestAck"],i[d.MSG_TYPE_PC_UPWARD_MESSAGE]=["proto_accesshub","PCUpwardMessage"],i[d.MSG_TYPE_PC_UPWARD_MESSAGE_ACK]=["proto_accesshub","PCUpwardMessageAck"],i[d.MSG_TYPE_PC_ESTABLISHED]=["proto_accesshub","PCEstablished"],i[d.MSG_TYPE_PC_BROKEN]=["proto_accesshub","PCBroken"],i[d.MSG_TYPE_PC_DOWNWARD_MESSAGE]=["proto_accesshub","PCDownwardMessage"],i[d.MSG_TYPE_REDIRECT]=["proto_accesshub","Redirect"],i[d.MSG_TYPE_REDIRECT2]=["proto_accesshub","Redirect2"],i[d.MSG_TYPE_GET_APPCONFIG_REQUEST]=["proto_accesshub","GetAppConfigRequest"],i[d.MSG_TYPE_GET_APPCONFIG_RESPONSE]=["proto_accesshub","GetAppConfigResponse"],i[d.MSG_TYPE_PUSH_APPCONFIG]=["proto_accesshub","PushAppConfig"],i[d.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST]=["proto_accesshub","AccesshubDispatchRequest"],i[d.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE]=["proto_accesshub","AccesshubDispatchResponse"],i[d.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2]=["proto_accesshub","AccesshubDispatchRequest2"],i[d.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2]=["proto_accesshub","AccesshubDispatchResponse2"],i[d.MSG_TYPE_PUSH_EXCEPTION]=["proto_accesshub","PushException"],i)}return i.prototype.encodeRequest=function(i,e,n,s){var r,o=this.K[i],u=this.Z(this.W[o[0]][o[1]],e),a=u.length,h=13;return this.stateCenter.appInfo.model===t.Private?((r=new Uint8Array(13+a))[0]=172,r[1]=0,r[2]=0,r.set(new Uint8Array(Int32Array.from([n]).buffer).reverse(),3),r[7]=i>>8,r[8]=i-(r[2]<<8),r.set(new Uint8Array(Int32Array.from([a]).buffer).reverse(),9)):s===c.WebTransport?((r=new Uint8Array(9+a))[0]=175,r[1]=0,r[2]=i>>8,r[3]=i-(r[2]<<8),r.set(new Uint8Array(Int32Array.from([a]).buffer).reverse(),4),r[8]=0,h=9):((r=new Uint8Array(13+a))[0]=175,r[1]=0,r[2]=i>>8,r[3]=i-(r[2]<<8),r.set(new Uint8Array(Int32Array.from([a]).buffer).reverse(),4),r.set(new Uint8Array(Int32Array.from([n]).buffer).reverse(),8),r[12]=0),r.set(u,h),r},i.prototype.decodeResponse=function(i,e){var n,s,r,o=13,u=0;if(this.stateCenter.appInfo.model===t.Private)n=(i[7]<<8)+i[8],r=(s=new DataView(i.buffer)).getUint32(3),u=s.getUint32(9);else if(e===c.WebTransport){if(i.length<9)return[0,0,null,0];if(n=(i[2]<<8)+i[3],r=0,o=9,u=i[4]*Math.pow(256,3)+i[5]*Math.pow(256,2)+256*i[6]+i[7],i.length-o<u)return[0,0,null,0]}else n=(i[2]<<8)+i[3],u=(s=new DataView(i.buffer)).getUint32(4),r=s.getUint32(8);var a=o+u,h=i.slice(o,a);return[r,n,this.decodeBody(h,n),a]},i.prototype.decodeBody=function(t,i){try{var e=this.K[i];return this.X(this.W[e[0]][e[1]],t)}catch(t){return{code:1}}},i.prototype.decodeConfigMessage=function(t){return this.X(this.W.proto_initconfig.InitConfig,t)},i.prototype.Z=function(t,i){return t.encode(new t(i)).finish()},i.prototype.X=function(t,i){return V({},t.decode(i))},i}(),F=function(){function t(t,i){void 0===t&&(t=null),void 0===i&&(i=null),this.next=null,this.prev=null,this.tt=t,this.U=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this.tt?this.tt:null},set:function(t){this.tt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.U},set:function(t){this.U=t},enumerable:!1,configurable:!0}),t.prototype.hasNext=function(){return this.next&&this.next.id},t.prototype.hasPrev=function(){return this.prev&&this.prev.id},t}(),Y=function(){function t(){this.start=new F,this.end=new F,this.it=1,this.nt=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}return t.prototype.insertBefore=function(t,i){var e=new F(this.it,i);return e.next=t,e.prev=t.prev,t.prev&&(t.prev.next=e),t.prev=e,++this.it,++this.nt,e},t.prototype.addLast=function(t){return this.insertBefore(this.end,t)},t.prototype.add=function(t){return this.addLast(t)},t.prototype.getFirst=function(){return 0===this.nt?null:this.start.next},t.prototype.getLast=function(){return 0===this.nt?null:this.end.prev},t.prototype.size=function(){return this.nt},t.prototype.getFromFirst=function(t){var i=0,e=this.start.next;if(t>=0)for(;i<t&&null!==e;)e=e.next,++i;else e=null;if(null===e)throw"Index out of bounds.";return e},t.prototype.get=function(t){return 0===t?this.getFirst():t===this.nt-1?this.getLast():this.getFromFirst(t)},t.prototype.remove=function(t){return t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),--this.nt,t},t.prototype.removeFirst=function(){var t=null;return this.nt>0&&this.start.next&&(t=this.remove(this.start.next)),t},t.prototype.removeLast=function(){var t=null;return this.nt>0&&this.end.prev&&(t=this.remove(this.end.prev)),t},t.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this.nt=0,this.it=1},t.prototype.each=function(t){for(var i=this.start;i.hasNext();)t(i=i.next)},t.prototype.forEach=function(t){for(var i=this.start;i.hasNext()&&!t(i=i.next););},t.prototype.find=function(t){for(var i=this.start,e=!1,n=null;i.hasNext()&&!e;)t(i=i.next)&&(n=i,e=!0);return n},t.prototype.map=function(t){for(var i=this.start,e=[];i.hasNext();)t(i=i.next)&&e.push(i);return e},t.prototype.push=function(t){return this.addLast(t)},t.prototype.unshift=function(t){this.insertBefore(this.nt>0?this.start.next:this.end,t)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(){return this.removeFirst()},t}(),Z="zn.zca.gc",Q="zn.zca.oce",X="zn.zca.gac",W="zn.zca.rd",K="zn.zca.cc",$="zn.zca.ir.0",tt="zn.sai.0",it="zn.shq.0",et="zn.nab.gsa",nt="zn.nab.du",st="zn.nab.gac",rt="zn.nhb.s",ot="zn.rlh.at",ut="zn.rlh.sm",at="zn.wl.cs.0",ct="zn.wl.om",ht="zn.wl.h3.g",ft="zn.wl.h3.t.2",lt="zn.wl.h3.s",dt="zn.wl.h3.s.0",vt="zn.wl.sls",mt="zn.wl.sidr",pt="zn.wl.c.0",gt="zn.wl.gbi.0",bt="zn.sm.cs.0",_t="zn.sm.bsh",yt="zn.sm.cps",wt="zn.napr.sr",St="zn.napr.ope",Et="zn.nahr.sr",Ot="zn.nahr.sr2",Tt={domains:["accesshub-wss.zego.im"],mode:"online",modeNo:g.MODE_ONLINE,sdkType:3,connectVer:33,pcEstablishTimeout:15,scheme:"wss",location:"accesshub",wssMessageType:1,model:t.Normal},kt="0c9e6e0f8c0a8f4e",Rt=2e4,It=s(955),Nt=s.n(It),Ct=s(178),zt=s.n(Ct),Dt=new TextDecoder("utf-8"),Pt=new TextEncoder,At=function(t){return Pt.encode(t)},Mt=function(t){return Dt.decode(t)},xt=function(){return new Promise((function(t,i){t(Math.random())}))};function jt(t,i,e){var n=function(t,i){try{return localStorage.getItem(i)}catch(t){}}(0,"".concat(t,"_").concat(e,"_").concat(i));if(!n)return null;var s=function(t,i){try{return Nt().decrypt(t,i).toString(zt())}catch(t){return""}}(n,kt);return s&&JSON.parse(s)||null}function Lt(t,i,e,n,s){var r=n;if(s){var o=jt(t,i,e);o&&(r=Object.assign(o,n))}var u,a,c=JSON.stringify(r);0===i&&(u=JSON.stringify(r),a=kt,c=Nt().encrypt(u,a).toString()),function(t,i,e){try{localStorage.setItem(i,e)}catch(t){}}(0,"".concat(t,"_").concat(e,"_").concat(i),c)}!function(t){t[t.NotSupport=0]="NotSupport",t[t.LinkFailed=1]="LinkFailed",t[t.CreateStreamFailed=2]="CreateStreamFailed",t[t.WriteDataFailed=3]="WriteDataFailed",t[t.ReadDataFailed=4]="ReadDataFailed",t[t.GetConfigFailed=5]="GetConfigFailed",t[t.NoUseableHttp3Server=6]="NoUseableHttp3Server",t[t.ClosedTooOften=7]="ClosedTooOften",t[t.LinkTimeout=8]="LinkTimeout",t[t.Unknown=100]="Unknown"}(H||(H={}));var qt,Ut={code:1100002,msg:"network timeout."},Bt={code:1100004,msg:"net agent timeout"},Jt={code:1100006,msg:"net connect timeout"},Vt={code:1100007,msg:"the user breaks the network connection"},Ht=1100009;!function(t){t[t.BROWSER=0]="BROWSER",t[t.WEIXINMINI=1]="WEIXINMINI"}(qt||(qt={}));var Gt=function(){function t(t,i){this.url=t,this.readyState=h.CLOSED,this.et=wx.connectSocket({url:t}),this.init()}return t.prototype.init=function(){var t=this;this.et&&(this.readyState=h.CONNECTING,this.et.onOpen((function(i){t.readyState=t.et.readyState,"function"==typeof t.onopen&&(t.onopen(i),t.et.onClose((function(i){t.readyState=t.et.readyState,"function"==typeof t.onclose&&t.onclose(i)})),t.et.onMessage((function(i){"function"==typeof t.onmessage&&t.onmessage(i)})))})),this.et.onError((function(i){t.readyState=t.et.readyState,"function"==typeof t.onerror&&t.onerror(i)})))},t.prototype.onopen=function(t){},t.prototype.onerror=function(t){},t.prototype.onclose=function(t){},t.prototype.onmessage=function(t){},t.prototype.send=function(t,i,e,n){t instanceof Uint8Array&&(t=new Uint8Array(t).buffer),this.et&&this.et.send({data:t})},t.prototype.close=function(){this.et&&this.et.close()},t}(),Ft=function(){function t(){this.st={}}return t.prototype.addEventHandler=function(t,i){if(this.st[t]||(this.st[t]=[]),"function"!=typeof i)throw new Error("Params callBack is not a Function");return this.st[t]&&-1==this.st[t].indexOf(i)&&this.st[t].push(i),!0},t.prototype.removeEventHandler=function(t,i){return!!this.st[t]&&(this.st[t]=i?this.st[t].filter((function(t){return t!==i})):[],!0)},t.prototype.emit=function(t){for(var i=[],e=1;e<arguments.length;e++)i[e-1]=arguments[e];this.st[t]&&this.st[t].forEach((function(e){try{e.apply(void 0,i)}catch(i){console.error('Fail to execute callback of event "'.concat(t,'" : ').concat(i))}}))},t}(),Yt=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Zt=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};const Qt=function(){function t(t){this.ot=t,this.readyState=h.CLOSED,this.rt=null,this.ct=[],this.ut=[],this.ht={}}return t.isSupport=function(){var t,i;return window&&!!window.WebTransport&&!!(null===(i=null===(t=window.WebTransport)||void 0===t?void 0:t.prototype)||void 0===i?void 0:i.createBidirectionalStream)},t.prototype.getStreamByID=function(t){return this.ct.find((function(i){return i.streamID===t}))||null},t.prototype.startConnect=function(t){var i=this;try{this.rt=new WebTransport(t),this.readyState=h.CONNECTING,this.rt.ready.then((function(t){i.readyState=h.OPEN,i.onopen(t),i.onTransportClosed()})).catch((function(t){i.readyState=h.CLOSED,i.ft(H.LinkFailed,t),i.close()}))}catch(t){this.readyState=h.CLOSED,this.ft(H.NotSupport,t)}},t.prototype.onTransportClosed=function(){return Yt(this,void 0,void 0,(function(){var t;return Zt(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.rt.closed];case 1:return i.sent(),this.readyState!==h.CLOSED&&this.onclose&&this.onclose({code:0,message:"server-side h3 closed"}),[3,3];case 2:return t=i.sent(),this.readyState!==h.CLOSED&&this.onclose&&this.onclose(t),[3,3];case 3:return this.readyState=h.CLOSED,this.rt=null,this.ct=[],this.ut=[],this.ht={},[2]}}))}))},t.prototype.onopen=function(t){},t.prototype.onerror=function(t){},t.prototype.onclose=function(t){},t.prototype.onmessage=function(t,i){},t.prototype.onBackToWebSocket=function(t,i){},t.prototype.ft=function(t,i){this.rt&&this.onBackToWebSocket(t,i)},t.prototype.send=function(t,i,e,n){var s;return Yt(this,void 0,void 0,(function(){var r,o=this;return Zt(this,(function(u){switch(u.label){case 0:return this.rt&&i?(null==(r=this.getStreamByID(i))?void 0:r.stream)?[3,2]:(null==r?void 0:r.isCreating)?(this.ut.push({msg:t,streamID:i,type:e,streamType:n}),[2]):[4,this.createStream(n,i)]:[2];case 1:r=u.sent(),u.label=2;case 2:if(r&&(null==r?void 0:r.stream))try{null===(s=null==r?void 0:r.writer)||void 0===s||s.write(t).then((function(){e===d.MSG_TYPE_STREAM_CLOSED&&o.closeStream(r.streamID),o.ut=o.ut.filter((function(t){var n;return t.streamID!==i||(null===(n=null==r?void 0:r.writer)||void 0===n||n.write(t.msg).then((function(){})).catch((function(t){o.ot.info("zn.zwt.s.0 unsend write fail ".concat(null==t?void 0:t.message))})),e===d.MSG_TYPE_STREAM_CLOSED&&o.closeStream(t.streamID),!1)}))})).catch((function(t){var i;o.ot.info("zn.zwt.s.0 write fail ".concat(null==t?void 0:t.message)),-1===(null===(i=null==t?void 0:t.message)||void 0===i?void 0:i.indexOf("Connection lost"))&&(o.ft(H.WriteDataFailed,t),o.close())}))}catch(t){this.ft(H.WriteDataFailed,t),this.close()}return[2]}}))}))},t.prototype.close=function(){return Yt(this,void 0,void 0,(function(){var t,i,e=this;return Zt(this,(function(n){return this.readyState=h.CLOSED,this.rt&&(t=Object.values(this.ht),i=function(){var t;null===(t=e.rt)||void 0===t||t.close(),e.rt=null,e.ht={}},t.length>0?Promise.all(t).then((function(){i()})).catch((function(t){i()})):i()),this.ct=[],this.ut=[],[2]}))}))},t.prototype.createStream=function(t,i){return Yt(this,void 0,void 0,(function(){var e,n,s;return Zt(this,(function(r){switch(r.label){case 0:if(!this.rt)return[2,null];(e=this.getStreamByID(i))||this.ct.push(e={streamID:i,streamType:t,stream:null,writer:null,reader:null,isCreating:!0}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.rt.createBidirectionalStream()];case 2:return n=r.sent(),e.stream=n,e.writer=n.writable.getWriter(),e.reader=n.readable.getReader(),e.isCreating=!1,this.initReader(e.reader,e.streamID),[2,e];case 3:return s=r.sent(),this.ft(H.CreateStreamFailed,s),this.close(),[3,4];case 4:return[2,null]}}))}))},t.prototype.closeStream=function(t){var i;return Yt(this,void 0,void 0,(function(){var e,n;return Zt(this,(function(s){switch(s.label){case 0:if(e=this.getStreamByID(t),this.ct=this.ct.filter((function(i){return i.streamID!==t})),!(null==e?void 0:e.stream))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),e.stream.writable.locked&&(null===(i=e.writer)||void 0===i||i.releaseLock()),n=e.stream.writable.close(),this.ht[t]=n,[4,n];case 2:return s.sent(),delete this.ht[t],[3,4];case 3:return s.sent(),[3,4];case 4:return[2]}}))}))},t.prototype.initReader=function(t,i){var e,n;return Yt(this,void 0,void 0,(function(){var s,r,o,u,a;return Zt(this,(function(c){switch(c.label){case 0:c.label=1;case 1:return c.trys.push([1,3,,4]),[4,t.read()];case 2:return s=c.sent(),r=s.value,o=s.done,u=this.getStreamByID(i),o||!u?(this.ot.info("zn.zwt.rd h3 stream not found ".concat(i," ").concat(!!o," ").concat(!u)),this.closeStream(i),t.releaseLock(),[2]):(this.onmessage&&this.onmessage(r,u.streamID),[3,4]);case 3:return a=c.sent(),-1!==(null===(e=null==a?void 0:a.message)||void 0===e?void 0:e.indexOf("RESET_STREAM"))?(this.ct=this.ct.filter((function(t){return t.streamID!==i})),[2]):(-1===(null===(n=null==a?void 0:a.message)||void 0===n?void 0:n.indexOf("closed"))&&(this.ot.warn("zn.zwt.rd error ".concat(null==a?void 0:a.message)),this.ft(H.ReadDataFailed,a),this.close()),[2]);case 4:return[3,0];case 5:return[2]}}))}))},t}();var Xt,Wt=function(){function t(t,i,e){this._t=t,this.ot=i,this.proxyCtrl=e,this.lt=null,this.server="",this.type=c.WebSocket,this.dt=null,this.retryTimer=null,this.ENV=t.env,this.eventManager=new Ft}return t.prototype.createSocket=function(t,i,e){var n=this;this.ot.info("zn.nss.0 ".concat(t," ").concat(e)),this.server=t,this.type=i,this.type===c.WebTransport?(this.lt=new Qt(this.ot),this.lt.onBackToWebSocket=function(t,i){n.type===c.WebTransport&&(n.resetConnectTimer(),n.onBackToWebSocket&&n.onBackToWebSocket(t,i))},this.lt.startConnect(t)):(this.type=c.WebSocket,this.lt=function(t,i,e){return i%2===qt.BROWSER?function(t,i){return i?i.createSocket(t,0):new WebSocket(t)}(t,e):new Gt(t)}(t,this.ENV%2,this.proxyCtrl)),this.bindSocketHandler(),this.startConnectCheck(e)},t.prototype.bindSocketHandler=function(){var t=this;this.lt&&(this.lt.onopen=function(i){t.type===c.WebSocket&&(t.lt.binaryType="arraybuffer"),t.responseHandler(),t.resetConnectTimer(),t.eventManager.emit("open",i)},this.lt.onclose=function(i){t.resetConnectTimer(),t.eventManager.emit("close",i)},this.lt.onerror=function(i){t.resetConnectTimer(),t.eventManager.emit("error",i)})},t.prototype.startConnectCheck=function(t){var i=this;this.resetConnectTimer(),this.dt=setTimeout((function(){i.type===c.WebTransport&&i._t.networkState===f.online?(i.resetConnectTimer(),i.onBackToWebSocket&&i.onBackToWebSocket(H.LinkTimeout,{message:"connect timeout"})):i.eventManager.emit("timeout")}),t)},t.prototype.resetConnectTimer=function(){this.dt&&(clearTimeout(this.dt),this.dt=null)},t.prototype.responseHandler=function(){var t=this;this.lt&&(this.lt.onmessage=function(i,e,n){var s=i;t.type===c.WebSocket&&(s="string"==typeof i.data?JSON.parse(i.data):i.data),t.eventManager.emit("message",s,e,n)})},t.prototype.closeSocket=function(){this.lt&&(this.lt.onclose=null,this.lt.onerror=null,this.lt.close(),this.lt=null),this.resetConnectTimer()},t.prototype.isNotConnected=function(){return!this.lt||this.lt.readyState!==h.OPEN},t.prototype.sendMessage=function(t,i,e,n){this.isNotConnected()||this.lt&&this.lt.send(t,i,e,n)},t.prototype.onBackToWebSocket=function(t,i){},t.prototype.closeStream=function(t){var i;this.type===c.WebTransport&&(null===(i=this.lt)||void 0===i||i.closeStream(t))},t.prototype.hasStream=function(t){var i,e;return this.type===c.WebTransport&&!!(null===(e=null===(i=this.lt)||void 0===i?void 0:i.getStreamByID(t))||void 0===e?void 0:e.stream)},t.prototype.on=function(t,i){return this.eventManager.addEventHandler(t,i)},t.prototype.off=function(t,i){this.eventManager.removeEventHandler(t,i)},t}(),Kt=function(){function t(t,i,e){this._t=t,this.vt=i,this.proxyCtrl=e,this.ipStackRules=[],this.Et=null,this.gt=u.noProbe,this.St=2}return Object.defineProperty(t.prototype,"Tt",{get:function(){var t=this._t.customConfig,n=t.accesshubBypassConnectTime;return"number"==typeof n&&0!==n?n:t.probeByPassStrategy===e.Default||t.ipStackMode===i.IPv4Prefer?3e3:500},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isIpv4Prefer",{get:function(){return this._t.customConfig.ipStackMode===i.IPv4Prefer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ct",{get:function(){return this._t.logger},enumerable:!1,configurable:!0}),t.prototype.createSockets=function(t,i){var e=this;this.Ct.info("".concat(bt," call ").concat(JSON.stringify(t)," ").concat(JSON.stringify(i))),this.gt=u.noProbe;var s=this._t.isIpStackDetected?1e4:Rt;this.Ct.info("".concat(bt," interval ").concat(s)),(null==t?void 0:t.server)&&(this.bt=t,this.Ot||(this.Ot=new Wt(this._t,this.Ct,this.proxyCtrl)),this.bindServiceHandler(this.Ot,this.bt),this.Ot.createSocket(t.server,t.linkType,s)),(null==i?void 0:i.server)?(this.Rt=i,this.At||(this.At=new Wt(this._t,this.Ct,this.proxyCtrl)),this.Ct.info("".concat(yt," bypass time ").concat(this.Tt)),this.Et=setTimeout((function(){e.bindServiceHandler(e.At,e.Rt),e.At.createSocket(i.server,i.linkType,Rt)}),this.Tt)):this.onIPStackDetection({ipStackType:this.bt.ipStackType===n.IPv4?n.IPv6:n.IPv4,detection:o.unreachable}),this.gt=u.probing},t.prototype.bindServiceHandler=function(t,i){var s=this;this.Ct.info("".concat(_t," call ").concat(i.server));var r=function(t){s.onIPStackDetection({ipStackType:i.ipStackType,detection:t})},c=function(e,c){var h=performance.now();if(s.Ct.info("".concat(_t," fail ").concat(i.server," ").concat(e," ").concat(c.massage?JSON.stringify(c.massage):JSON.stringify(c.code))),!(h-i.failTime<100)){var f;if(i.failTime=h,i.tryCount++,s.isIpv4Prefer&&i.ipStackType===n.IPv6&&s._t.retryLevel===R.single&&s.bt.svrConnectState===a.success)s.Ct.info("".concat(_t," only retry once"));else if(s.vt.Pt==u.probing&&i.tryCount<s.St)return s.Ct.info("".concat(_t," server ").concat(i.server," retry ").concat(i.tryCount)),t.retryTimer&&(clearTimeout(t.retryTimer),t.retryTimer=null),void(t.retryTimer=setTimeout((function(){t.createSocket(i.server,i.linkType,Rt)}),3e3));(null==c?void 0:c.code)===Jt.code?(f=o.unknown,i.svrConnectState=a.timeout):(f=o.unreachable,i.svrConnectState=a.fail),r(f),s.removeServiceListener(t),t.closeSocket(),s.checkProbeState()}};t.off("open"),t.on("open",(function(){s.Ct.info("".concat(_t," ").concat(i.server," open ").concat(u[s.gt])),i.svrConnectState=a.success,r(o.reachable),s.gt===u.probing?(s.gt=u.probed,s.removeServiceListener(t),s.onSocketOpen&&s.onSocketOpen(t,i)):s.onNextSocketOpen&&s.onNextSocketOpen(t,i),s._t.customConfig.probeByPassStrategy===e.Default&&s.isIpv4Prefer&&i.ipStackType===n.IPv4&&s.Et&&s.clearByPassProbe()})),t.off("close"),t.on("close",(function(t){c("close",t)})),t.off("error"),t.on("error",(function(t){c("error",t)})),t.off("timeout"),t.on("timeout",(function(){c("timeout",Jt)})),t.onBackToWebSocket=function(e,n){if(s._t.networkState===f.online){var r={message:n.message||""};s.Ct.info("".concat(_t," back to wss reason: ").concat(e," ").concat(r.message)),r.message.includes("Connection lost")?c("error",r):(t.closeSocket(),i.backToWss=!0,i.backToWssInfo={reason:e,error:r},s.checkIfBackToWss())}else c("error",n)}},t.prototype.checkProbeState=function(){var t,i;void 0!==(null===(t=this.bt)||void 0===t?void 0:t.svrConnectState)&&[a.fail,a.timeout].includes(this.bt.svrConnectState)&&(!this.Rt||void 0!==(null===(i=this.Rt)||void 0===i?void 0:i.svrConnectState)&&[a.fail,a.timeout].includes(this.Rt.svrConnectState))&&(this.Ct.info("".concat(yt," sockets fail")),this.onSocketsFail&&this.onSocketsFail())},t.prototype.checkIfBackToWss=function(){var t,i,e,n,s,r,o,u;this.bt&&this.bt.backToWss&&(this.onSocketBackToWebSocket&&this.onSocketBackToWebSocket(this.bt,(null===(i=null===(t=this.bt)||void 0===t?void 0:t.backToWssInfo)||void 0===i?void 0:i.reason)||H.Unknown,(null===(n=null===(e=this.bt)||void 0===e?void 0:e.backToWssInfo)||void 0===n?void 0:n.error)||{}),this.Rt&&this.Rt.backToWss&&this.onSocketBackToWebSocket&&this.onSocketBackToWebSocket(this.Rt,(null===(r=null===(s=this.Rt)||void 0===s?void 0:s.backToWssInfo)||void 0===r?void 0:r.reason)||H.Unknown,(null===(u=null===(o=this.Rt)||void 0===o?void 0:o.backToWssInfo)||void 0===u?void 0:u.error)||{}))},t.prototype.removeServiceListener=function(t){t.off("open"),t.off("close"),t.off("error"),t.off("timeout"),t.onBackToWebSocket=function(){},t.retryTimer&&(clearTimeout(t.retryTimer),t.retryTimer=null)},t.prototype.stopTask=function(){this.gt==u.probing&&this.destroySockets()},t.prototype.destroySockets=function(){var t;this.Ct.info("".concat("zn.sm.ds.0"," call")),this.Ot&&(this.removeServiceListener(this.Ot),this.Ot.closeSocket()),this.At&&(this.removeServiceListener(this.At),null===(t=this.At)||void 0===t||t.closeSocket()),this.clearByPassProbe()},t.prototype.clearByPassProbe=function(){this.Et&&(clearTimeout(this.Et),this.Et=null)},t.prototype.onSocketOpen=function(t,i){},t.prototype.onNextSocketOpen=function(t,i){},t.prototype.onSocketBackToWebSocket=function(t,i,e){},t.prototype.onSocketsFail=function(){},t.prototype.onIPStackDetection=function(t){},t}(),$t=function(){return $t=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},$t.apply(this,arguments)},ti=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},ii=function(){function i(t,i,e){var s,r=this;this.It=t,this._t=i,this.proxyCtrl=e,this.txid=0,this.linkRetryTime=60,this.updatedMsgTime=0,this.connectServer="",this.ipStackRules=[],this.urlIndex=0,this.http3Servers=[],this.byPassUrlIndex=0,this.Pt=u.noProbe,this.serversGroup={wss:[],http3:[],wssV6:[],http3V6:[]},this.unUpdateMsgTimeTypes=[d.MSG_TYPE_HB_REQUEST,d.MSG_TYPE_HB_RESPONSE,d.MSG_TYPE_GET_CONFIG_REQUEST,d.MSG_TYPE_GET_CONFIG_RESPONSE,d.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2,d.MSG_TYPE_ACCESSHUB_DISPATCH_RESPONSE2,d.MSG_TYPE_GET_SVRADDR_REQUEST,d.MSG_TYPE_GET_SVRADDR_RESPONSE,d.MSG_TYPE_GET_APPCONFIG_REQUEST,d.MSG_TYPE_GET_APPCONFIG_RESPONSE,d.MSG_TYPE_CLOSE_CONNECTION],this.netLinkState=0,this.sendCommandList=new Y,this.unSendCommandList=new Y,this.sendCommandMap={},this.unSendCommandMap={},this.Nt=100,this.Dt=15e3,this.yt=1e3,this.wt=5e3,this.connectInterval=1e4,this.connectRsp={},this.unlogTypes=[12,13],this.tryServers=[],this.tryConnectEvents=[],this.connectStartTime=0,this.isTestedWebTransport=((s={})[n.IPv4]=!1,s[n.IPv6]=!1,s),this.msgCache={},this.zt=0,this.Tt=500,this.Mt="",this.Ht=function(){var t,i;r.Ct.info("zn.wl.ssoh.0 server connected: ".concat(null===(t=r.socketService)||void 0===t?void 0:t.server," open time: ").concat(Date.now()-r.zt)),r.socketService&&r.connectServer!==(null===(i=r.socketService)||void 0===i?void 0:i.server)&&(r.connectServer=r.socketService.server,r.tryServers.push(r.connectServer)),2!==r.netLinkState&&r.Ut()},this.Gt=function(t){r.closeCallback("close",t)},this.kt=function(t){r.closeCallback("error",t)},this.Vt=function(){var t;r.Ct.info(at+" timeout"),r.Bt(r.connectServer,Jt.code),null===(t=r.Yt)||void 0===t||t.call(r,!0,{code:Jt.code,msg:""}),r.netLinkState=0,r.connectRsp.fail&&r.connectRsp.fail()},this.onUpdateMsgTimeChanged=void 0,this.updatedMsgTime=Date.now(),this.socketDetectManager=new Kt(this._t,this,this.proxyCtrl),this.socketDetectManager.onSocketOpen=function(t,i){r.Ct.info("".concat(pt," main server ").concat(i.server," open socket")),r.socketService=t,r.setIPStackDetectedInfo(i),r.bindSocketServiceEvent(),r.Ht()},this.socketDetectManager.onIPStackDetection=function(t){r.Ct.info("".concat(pt," ip stack detection ").concat(JSON.stringify(t))),r.Lt(t)},this.socketDetectManager.onNextSocketOpen=function(t,i){r.Ct.info("".concat(pt," next server ").concat(i.server," open socket")),r.getByPassIp(t,i)},this.socketDetectManager.onSocketBackToWebSocket=function(t,i,e){var n,s={message:e.message||""};if(r.Ct.info("".concat(pt," backToWss reason: ").concat(i,", error: ").concat(s.message)),r._t.enableHttp3){var o=t.server,u=t.ipStackType,a=r.$t(u),c=jt(a,r._t.env,r._t.appID);if(r.Ct.info("".concat(pt," backToWss server: ").concat(o," stack: ").concat(u)),r._t.enableHttp3=!1,c){var h=!1;if(Object.keys(c).find((function(t){return t===o}))){var f=c[o].time;Date.now()-f>864e5&&(h=!0)}else h=!0;h&&(r.Ct.info("".concat(pt," backToWss http3 fail")),Lt(a,r._t.env,r._t.appID,((n={})[o]={status:!1,time:i===H.LinkTimeout?0:Date.now()},n),!0))}r.closeSocket(),r.netLinkState=0,r.clearMessageList(r.sendCommandList,r.sendCommandMap),r.clearMessageList(r.unSendCommandList,r.unSendCommandMap),r.ft&&r.ft(i,s)}},this.socketDetectManager.onSocketsFail=function(){r.Ct.info("".concat(pt," socket fail")),r.Pt=u.noProbe,r.netLinkState=0,r.connectRsp.fail&&r.connectRsp.fail()}}return Object.defineProperty(i.prototype,"linkServerStorageKey",{get:function(){return this.$t(this._t.currentIpStackType)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"byPassStackType",{get:function(){return this._t.currentIpStackType===n.IPv4?n.IPv6:n.IPv4},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Ct",{get:function(){return this._t.logger},enumerable:!1,configurable:!0}),i.prototype.setIPStackDetectedInfo=function(t){this._t.isIpStackDetected=!0;var i=t.ipStackType;this._t.currentIpStackType=i,i===n.IPv4?(this.servers=this.serversGroup.wss,this.http3Servers=this.serversGroup.http3):(this.servers=this.serversGroup.wssV6,this.http3Servers=this.serversGroup.http3V6)},Object.defineProperty(i.prototype,"HBHandler",{set:function(t){this.xt=t},enumerable:!1,configurable:!0}),i.prototype.initEvent=function(t,i,e,n,s,r){this.jt=t,this.Yt=i,this.qt=e,this.Ft=n,this.ft=s,this.Jt=r},i.prototype.onSocketClose=function(){},i.prototype.setServers=function(t,i,e,n){void 0===t&&(t=[]),void 0===i&&(i=[]),void 0===e&&(e=[]),void 0===n&&(n=[]),this.Ct.info("".concat("zn.wl.ss"," ").concat(JSON.stringify(t)," ").concat(JSON.stringify(i)," ").concat(JSON.stringify(e)," ").concat(JSON.stringify(n))),this.serversGroup.wss=t,this.serversGroup.http3=i,this.serversGroup.wssV6=e,this.serversGroup.http3V6=n,this.urlIndex=0,this.ipStackRules.length>0&&this.setLinkServers()},i.prototype.setHttp3Servers=function(t,i){this.Ct.info("".concat("zn.wl.shs"," ").concat(JSON.stringify(t)," ").concat(JSON.stringify(i))),(null==t?void 0:t.length)>0&&(this.serversGroup.http3=t),(null==i?void 0:i.length)>0&&(this.serversGroup.http3V6=i),this.ipStackRules.length>0&&this.setLinkServers()},i.prototype.setIpStrategy=function(t){t.length>0&&(this.Ct.info("".concat("zn.wl.sis"," rules: ").concat(JSON.stringify(t))),this.ipStackRules=t,this.setLinkServers())},i.prototype.setLinkServers=function(){this.ipStackRules.length>0&&this.ipStackRules[0]===n.IPv6?(this.Ct.info("".concat(vt," set ipv6")),this.servers=this.serversGroup.wssV6,this.http3Servers=this.serversGroup.http3V6,this._t.currentIpStackType=n.IPv6):(this.Ct.info("".concat(vt," set ipv4")),this.servers=this.serversGroup.wss,this.http3Servers=this.serversGroup.http3,this._t.currentIpStackType=n.IPv4)},i.prototype.isNeedTestWebTransport=function(t,i){return!!this.isEnableHttp3()&&0!==(null==t?void 0:t.length)&&!this.isTestedWebTransport[i]},i.prototype.destroySocket=function(t,i){this.Ct.info("zn.wl.ds.0 call "+t),this.closeSocket(),t!==_.NONE&&(i&&this.Bt(this.connectServer||"",i.code,!0),this.Yt&&this.Yt(t===_.BROKEN,i,this.tryServers,this.tryConnectEvents))},i.prototype.refreshServers=function(t){this.servers=ti(ti([],t,!0),this.servers,!0)},i.prototype.isEnableHttp3=function(){return!!this._t.enableHttp3&&!!this._t.customConfig.enableHttp3&&this._t.appInfo.model!==t.Private&&!this.proxyCtrl},i.prototype.connectSocket=function(t,i,e){var n,s,r=this;if(void 0===t&&(t=!0),this.Ct.info(at+" call"),!this.servers||!(null===(n=this.servers)||void 0===n?void 0:n.length))return this.Ct.warn(at+" no servers"),!1;this.connectRsp.suc=i;var o=!1;this.connectRsp.fail=function(){e&&(o?r.Ct.info(at+" fail cb has exec"):(e(),o=!0))},t&&(this.urlIndex=(this.urlIndex+1)%this.servers.length),this.closeSocket(),this.connectStartTime=Date.now(),this.netLinkState=1,this.zt=Date.now();var a=this.getConnectServers(),c=a.mainSvrInfo,h=a.byPassSvrInfo;return this.Pt===u.noProbe?(this.Ct.info("".concat(at," probe")),this.socketDetectManager.createSockets(c,h),this.Pt=u.probing):(this.Ct.info("".concat(at," createSocket")),null===(s=this.socketService)||void 0===s||s.createSocket(c.server,c.linkType,1e4),this.connectServer=c.server,this.tryServers.push(this.connectServer)),this.qt&&this.qt(!0),!0},i.prototype.getServersByStackType=function(t){var i,e;return t===n.IPv4?(i=this.serversGroup.wss,e=this.serversGroup.http3):(i=this.serversGroup.wssV6,e=this.serversGroup.http3V6),[i,e]},i.prototype.getConnectServers=function(){var t,i=this.Wt(this.servers,this.http3Servers,this._t.currentIpStackType,this.urlIndex,"main");if(this.ipStackRules.length>1){var e=this.getServersByStackType(this.byPassStackType),n=e[0];(null==n?void 0:n.length)>0&&(t=this.Wt(n,e[1],this.byPassStackType,this.byPassUrlIndex,"bypass"))}return{mainSvrInfo:i,byPassSvrInfo:t}},i.prototype.Wt=function(t,i,e,n,s){var r,o="",u=c.WebSocket;return this.Ct.info(at+" "+s+" enableHttp3:"+this.isEnableHttp3()),(r=this.isEnableHttp3()?this.getUseableHttp3Server(i,e):"").length>0&&(u=c.WebTransport,o=r,this.Ct.info("".concat(at," h3 connect ").concat(s," server ").concat(o))),r||(u=c.WebSocket,o=t[n],this.Ct.info("".concat(at," wss connect ").concat(s," server ").concat(o))),{server:o,linkType:u,ipStackType:e,tryCount:0,failTime:0}},i.prototype.Lt=function(t){this.Ct.info("".concat(mt," ").concat(JSON.stringify(t)));var i=t.ipStackType,e=t.detection,s=!1;i===n.IPv4?(this._t.linkIpStackDetection.IPv4!==e&&(s=!0),this._t.linkIpStackDetection.IPv4=e):i===n.IPv6&&(this._t.linkIpStackDetection.IPv6!==e&&(s=!0),this._t.linkIpStackDetection.IPv6=e),s&&(this.Ct.info("".concat(mt," res ").concat(JSON.stringify(this._t.linkIpStackDetection))),this.Jt($t({},this._t.linkIpStackDetection)));var r=this._t.linkIpStackDetection;this.Pt===u.probing&&r.IPv4!==o.unknown&&r.IPv6!==o.unknown&&(this.Pt=u.probed)},i.prototype.getByPassIp=function(t,i){var e=this,n=Date.now(),s=i.server,r=i.linkType,o=i.ipStackType;null==t||t.on("message",(function(i){var u,a;try{if(Date.now()-n>e.connectInterval)e.Ct.info("".concat(gt," failed:").concat(s," reason:").concat(H.LinkTimeout," time:").concat(Date.now()-n,"ms"));else{var h=new Uint8Array(i),f=e.It.decodeResponse(h,r),l=f[2];if(f[1]===d.MSG_TYPE_GET_CONFIG_RESPONSE&&0===l.code){e.Ct.info("".concat(gt," success:").concat(s," time: ").concat(Date.now()-n,"ms")),(null===(u=l.data)||void 0===u?void 0:u.client_outer_ip)&&(e._t.byPassClientIP=null===(a=l.data)||void 0===a?void 0:a.client_outer_ip);var v=e.getServersByStackType(o),m=v[1];r===c.WebSocket&&e.isNeedTestWebTransport(m,o)&&e.testWebTransport(m,o)}e.Jt($t({},e._t.linkIpStackDetection)),e.socketDetectManager.removeServiceListener(t),t.off("message"),t.closeSocket()}}catch(t){e.Ct.info("".concat(gt," failed:").concat(s," reason:").concat(H.GetConfigFailed," error:").concat(JSON.stringify(t),"  time:").concat(Date.now()-n,"ms"))}}));var u=this.Qt(r);null==t||t.sendMessage(u.buf,u.streamID,u.type,b.OTHER)},i.prototype.closeCallback=function(t,i){var e;this.Ct.info("".concat("zn.wl.cc.0"," ").concat(t," ").concat(JSON.stringify(i)));var n=(null===(e=this.socketService)||void 0===e?void 0:e.type)===c.WebTransport?"zn.wl.bse.h3":"zn.wl.bse.wss";this.Ct.warn("".concat(n," ").concat(t," ").concat(JSON.stringify(i.code?i.code:i))),this.Kt(i)},i.prototype.Kt=function(t){var i=(null==t?void 0:t.code)||Jt.code;this.Bt(this.connectServer,i),this.Yt&&this.Yt(!0,{code:i,msg:""}),this.netLinkState=0,this.connectRsp.fail&&this.connectRsp.fail()},i.prototype.bindSocketServiceEvent=function(){var t=this;this.socketService?(this.socketService.on("open",this.Ht.bind(this)),this.socketService.on("close",this.Gt.bind(this)),this.socketService.on("error",this.kt.bind(this)),this.socketService.on("timeout",this.Vt.bind(this)),this.socketService.onBackToWebSocket=function(i,e){var n,s={message:e.message||""};if(t.Ct.info(dt+" call reason:"+i+" error:"+s.message+" h3 "+t._t.enableHttp3+" service: "+!!t.socketService),t._t.networkState===f.online)if(s.message.includes("Connection lost"))t.closeCallback("error",s);else{if(!t._t.enableHttp3)return;if(!t.socketService)return;t.Ct.info(lt+" server ".concat(t.socketService.server," fail")),t._t.enableHttp3=!1;var r=jt(t.linkServerStorageKey,t._t.env,t._t.appID);if(r){var o=!1;if(Object.keys(r).find((function(i){return i===t.socketService.server}))){var u=r[t.socketService.server].time;Date.now()-u>864e5&&(o=!0)}else o=!0;o&&(t.Ct.info(lt+" http3 fail"),Lt(t.linkServerStorageKey,t._t.env,t._t.appID,((n={})[t.socketService.server]={status:!1,time:i===H.LinkTimeout?0:Date.now()},n),!0))}t.closeSocket(),t.netLinkState=0,t.clearMessageList(t.sendCommandList,t.sendCommandMap),t.clearMessageList(t.unSendCommandList,t.unSendCommandMap),t.ft&&t.ft(i,s)}else t.closeCallback("error",s)}):this.Ct.warn(dt+" no service")},i.prototype.removeSocketServiceEvent=function(){this.Ct.info("zn.wl.rsse.0 call ".concat(!!this.socketService)),this.socketService&&(this.socketService.off("open"),this.socketService.off("close"),this.socketService.off("error"),this.socketService.off("timeout"),this.socketService.off("message"),this.socketService=null)},i.prototype.releaseSocketDetectTask=function(){this.Ct.info("zn.wl.rsdt.0 call"),this.socketDetectManager&&this.socketDetectManager.stopTask(),this.closeSocket(),this.netLinkState=0},i.prototype.Ut=function(){this.Ct.info("zn.wl.osso.0 call"),this.connectRsp.suc&&this.connectRsp.suc(),this.netLinkState=2,this.connectServer&&this.Bt(this.connectServer,0),this.jt&&this.jt(this.tryServers,this.tryConnectEvents),this.tryConnectEvents=[],this.checkUnSendMsgs(this.unSendCommandList,this.unSendCommandMap),this.onMessage()},i.prototype.closeSocket=function(){var t,i,e=null===(t=this.socketService)||void 0===t?void 0:t.isNotConnected();this.Ct.info("zn.wl.cs.1"+" call ".concat(e," ").concat(this.netLinkState)),e&&0===this.netLinkState||(null===(i=this.socketService)||void 0===i||i.closeSocket(),this.netLinkState=0,this.onSocketClose&&this.onSocketClose())},i.prototype.Bt=function(t,i,e){if(t&&(this.connectStartTime||e)){var n=this.connectStartTime?Date.now()-this.connectStartTime:0,s=t.includes("https")?1:3;this.tryConnectEvents.push({url:t,time_consumed:n,connect_type:s,error:i})}},i.prototype.release=function(){this.socketDetectManager.destroySockets(),this.stopCheck(),this.sendCommandList=new Y,this.unSendCommandList=new Y,this.sendCommandMap={},this.unSendCommandMap={},this.msgCache={}},i.prototype.isConnect=function(){return 2===this.netLinkState},i.prototype.isDisConnect=function(){return!this.socketService||this.socketService.isNotConnected()},i.prototype.isConnecting=function(){return 1===this.netLinkState},i.prototype.setState=function(t){this.netLinkState=t},i.prototype.sendMessage=function(t,i,e,n,s,r,o,u,a){var h,f,l;void 0===n&&(n=!0),void 0===s&&(s=null),void 0===r&&(r=null),void 0===o&&(o=null),void 0===u&&(u={}),(void 0===u.timeout||u.timeout<=0)&&(u.timeout=this.wt),void 0===u.isInSendMap&&(u.isInSendMap=!0),void 0===u.isMsgCache&&(u.isMsgCache=!0),this.txid++;var v={appid:this._t.appID,biz_type:0,mode_no:this._t.appInfo.mode,sdk_type:Tt.sdkType,zegoconn_run_env:0===this._t.env?p.ZEGOCONN_RUN_ENV_BROWSER:p.ZEGOCONN_RUN_ENV_APPLET,zegoconn_version:this._t.appInfo.connVer};(null===(h=this._t.appInfo)||void 0===h?void 0:h.deviceID)&&(v.device_id=this._t.appInfo.deviceID),(null===(f=this.socketService)||void 0===f?void 0:f.type)===c.WebTransport&&((null===(l=this.socketService)||void 0===l?void 0:l.hasStream(i))||(n=!0));var m=$t({id_name:this._t.userId},n?v:{}),g=$t($t({txid:this.txid},m),e),b=Date.now(),_={data:g,txid:this.txid,sendTime:b,streamID:i,type:t,timeOut:b+u.timeout,ack:e.ack,success:s,error:r,ackFunc:o,isSend:!0,isCheck:t!==d.MSG_TYPE_PC_UPWARD_MESSAGE,extras:u.extras,streamType:a};if(u.isInSendMap){var y=this.sendCommandList.push(_);this.sendCommandMap[this.txid]=y,!this.Zt&&this.startCheck()}if(!(10===g.service||14===g.interface_id)&&this.unUpdateMsgTimeTypes.includes(t)||(this.updatedMsgTime=Date.now(),this.onUpdateMsgTimeChanged&&this.onUpdateMsgTimeChanged(this.updatedMsgTime)),-1===this.unlogTypes.indexOf(t)&&this.Ct.info("zn.wl.sm type: "+t+"-"+N[t]+" streamID: "+i+" txid: "+this.txid+" no1: ".concat(n)),this.isConnect())this.sendUint8Data(t,g,i,a);else if(u.isMsgCache){_.isSend=!1;var w=this.unSendCommandList.push(_);this.unSendCommandMap[this.txid]=w}},i.prototype.checkUnSendMsgs=function(t,i){var e=this;t.forEach((function(n){return!n||(t.remove(n),!!n.U&&(delete i[n.U.txid],!1===n.U.isSend&&n.U.type&&n.U.streamID&&n.U.data&&(e.sendUint8Data(n.U.type,n.U.data,n.U.streamID,n.U.streamType),n.U.isSend=!0),!1))}))},i.prototype.clearUnsentMsgs=function(t){var i=this;this.unSendCommandList.forEach((function(e){var n;(null===(n=null==e?void 0:e.U)||void 0===n?void 0:n.streamID)===t&&(i.unSendCommandList.remove(e),delete i.unSendCommandMap[e.U.txid])}))},i.prototype.Xt=function(t){return t.buffer.slice(t.byteOffset,t.byteLength+t.byteOffset)},i.prototype.sendUint8Data=function(t,i,e,n){var s,r,o=this.It.encodeRequest(t,i,e,this.socketService.type);null===(s=this.socketService)||void 0===s||s.sendMessage(this.Xt(o),e,t,n),null===(r=this.xt)||void 0===r||r.startHB()},i.prototype.notifyMessage=function(t,i,e,n){var s;(null==t?void 0:t.txid)&&z.isLong(t.txid)&&t.txid.toNumber&&(t.txid=t.txid.toNumber()),this.unUpdateMsgTimeTypes.includes(i)||(this.updatedMsgTime=Date.now(),this.onUpdateMsgTimeChanged&&this.onUpdateMsgTimeChanged(this.updatedMsgTime));var r=(null==t?void 0:t.txid)||(null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.txid);if(-1===this.unlogTypes.indexOf(i)){var o=r?", txid: ".concat(r):"";this.Ct.info(ct+" streamID: ".concat(n,", msgType: ").concat(i,"-").concat(N[i])+o)}r&&this.isRspMsg(r)?this.handleSendCommandMsgRsp(i,r,t,{size:e}):this.Ft(n,i,t,{size:e})},i.prototype.onMessage=function(){var t=this;this.msgCache={},this.socketService&&(this.socketService.off("message"),this.socketService.on("message",(function(i,e){var n;t._t.lastRecvMsgTime=Date.now();var s,r=new Uint8Array(i),o=t.msgCache[e];if(o){var u=new Uint8Array(o.data.byteLength+r.byteLength);u.set(o.data,0),u.set(r,o.data.byteLength),r=u,s=o.streamID,delete t.msgCache[e]}for(;r.byteLength;){var a=t.It.decodeResponse(r,t.socketService.type),h=a[0],f=a[1],l=a[2],v=a[3];if(s=0===h?e:h,!(v>0)){t.msgCache[e]={streamID:e,data:r};break}v>r.byteLength&&t.Ct.warn(ct+" streamID: ".concat(s,", msg decode error, ").concat(r.byteLength," ").concat(v)),r=r.slice(v,r.byteLength),(null===(n=t.socketService)||void 0===n?void 0:n.type)===c.WebSocket&&f===d.MSG_TYPE_GET_CONFIG_RESPONSE&&t.isNeedTestWebTransport(t.http3Servers,t._t.currentIpStackType)&&t.testWebTransport(t.http3Servers,t._t.currentIpStackType),t.notifyMessage(l,f,v,s)}})))},i.prototype.isRspMsg=function(t){return void 0!==this.sendCommandMap[t]},i.prototype.startCheck=function(){var t=this;this.ti(this.sendCommandList,this.sendCommandMap,this.unSendCommandList,this.unSendCommandMap),this.Zt=setTimeout((function(){t.startCheck()}),this.yt)},i.prototype.stopCheck=function(){this.ii(this.sendCommandList),this.Zt&&(clearTimeout(this.Zt),this.Zt=null)},i.prototype.ti=function(t,i,e,n){var s=this,r=Date.now(),o=0;t.forEach((function(u){if(!u)return!0;if(!u.U)return!1;if(u.U.timeOut<=r){t.remove(u),delete i[u.U.txid];var a=n[u.U.txid];if(a&&(e.remove(a),delete n[u.U.txid]),null==u.U.error||u.U.sendTime+s.Dt<r);else{var c=u.U.error;u.U.isCheck&&c&&c({},u.U.txid,Ut)}if(++o>=s.Nt)return!0}return!1}))},i.prototype.ii=function(t){t.forEach((function(i){if(!i)return!0;if(t.remove(i),!i.U)return!1;if(i.U.isSend&&i.U.error){var e=i.U.error,n=i.U.txid;i.U.isCheck&&setTimeout((function(){e({},n,Ut)}),0)}return!1}))},i.prototype.clearMessageList=function(t,i){t.forEach((function(e){if(!e)return!0;if(t.remove(e),!e.U)return!1;if(e.U.error){var n=e.U.error,s=e.U.txid;e.U.isCheck&&setTimeout((function(){i[e.U.txid]&&delete i[e.U.txid],n({},s,Ut)}),0)}return!1}))},i.prototype.handleSendCommandMsgRsp=function(t,i,e,n){var s=this.sendCommandMap[i];if(null!=s){var r=s.U;(null==r?void 0:r.ack)||(delete this.sendCommandMap[i],this.sendCommandList.remove(s)),e.code&&0!==e.code?r&&null!=r.error&&(r.error(e,i),r.success=null,r.error=null):t===d.MSG_TYPE_PUSH_EXCEPTION?(e.code=e.reason,e.message=e.msg,delete e.reason,delete e.msg,r&&null!=r.error&&(r.error(e,i),r.success=null,r.error=null)):t===d.MSG_TYPE_HTTP_REQUEST_ACK?r&&null!=r.ackFunc&&r.ackFunc(e,i):r&&null!=r.success&&(r.success(e,i,n),r.success=null,r.error=null)}},i.prototype.ft=function(t,i){},i.prototype.Jt=function(t){},i.prototype.$t=function(t){return t===n.IPv4?"z_net_http3_servers_status":"z_net_http3_v6_servers_status"},i.prototype.Qt=function(t){var i,e;this.txid++;var n={appid:this._t.appID,biz_type:0,mode_no:this._t.appInfo.mode,sdk_type:Tt.sdkType,zegoconn_run_env:0===this._t.env?p.ZEGOCONN_RUN_ENV_BROWSER:p.ZEGOCONN_RUN_ENV_APPLET,zegoconn_version:this._t.appInfo.connVer};(null===(i=this._t.appInfo)||void 0===i?void 0:i.deviceID)&&(n.device_id=null===(e=this._t.appInfo)||void 0===e?void 0:e.deviceID);var s=$t({id_name:this._t.userId},n),r=this._t.appInfo.geoFencing,o=$t($t({txid:this.txid},s),{geofencing_type:null==r?void 0:r.type,geofencings:null==r?void 0:r.list}),u=d.MSG_TYPE_GET_CONFIG_REQUEST,a=Date.now(),c=this.It.encodeRequest(u,o,a,t);return{buf:this.Xt(c),streamID:a,type:u}},i.prototype.getUseableHttp3Server=function(t,i){var e="",n=jt(this.$t(i),this._t.env,this._t.appID);if(this.Ct.info(ht+" cache:"+JSON.stringify(n)),n)for(var s=0,r=Object.keys(n);s<r.length;s++){var o=r[s];if(n[o].status&&t.includes(o)){e=o;break}}return this.Ct.info(ht+" "+e),e},i.prototype.ni=function(t,i){if(!t.length)return[];var e=t,n=jt(i,this._t.env,this._t.appID);if(n){for(var s=0,r=Object.keys(n);s<r.length;s++){var o=r[s];if(t.includes(o)){var u=n[o].time;Date.now()-u>864e5&&delete n[o]}else delete n[o]}Lt(i,this._t.env,this._t.appID,n),e=t.filter((function(t){return!n[t]}))}return Array.from(new Set(e))},i.prototype.testWebTransport=function(t,i){this.isTestedWebTransport[i]=!0;var e=this.$t(i),n=this.ni(t,e);this.Ct.info("zn.wl.h3.t servers:"+JSON.stringify(n)+" ip "+i),this.startTestHttp3Server(n,e)},i.prototype.startTestHttp3Server=function(t,i){var e=this;if(t.length){var n=t.shift();this.Ct.info("zn.wl.h3.t.0 start:"+n);var s=new Qt(this.Ct),r=Date.now();s.onBackToWebSocket=function(s){var o;e.Ct.info("".concat(ft," failed:").concat(n," reason:").concat(s," time:").concat(Date.now()-r,"ms")),Lt(i,e._t.env,e._t.appID,((o={})[n]={status:!1,time:Date.now()},o),!0),e.startTestHttp3Server(t,i)},s.onopen=function(t){var i=e.Qt(c.WebTransport);s.send(i.buf,i.streamID,i.type,b.OTHER)},s.onmessage=function(o){var u,a;try{if(Date.now()-r>e.connectInterval)e.Ct.info("".concat(ft," failed:").concat(n," reason:").concat(H.LinkTimeout," time:").concat(Date.now()-r,"ms"));else{var h=new Uint8Array(o),f=e.It.decodeResponse(h,c.WebTransport);if(f[1]===d.MSG_TYPE_GET_CONFIG_RESPONSE&&0===f[2].code)return e.Ct.info("".concat("zn.wl.h3.t.1"," success:").concat(n," time: ").concat(Date.now()-r,"ms storageKey: ").concat(i)),Lt(i,e._t.env,e._t.appID,((u={})[n]={status:!0,time:Date.now()},u),!0),void s.close()}}catch(t){e.Ct.info("".concat(ft," failed:").concat(n," reason:").concat(H.GetConfigFailed," error:").concat(JSON.stringify(t),"  time:").concat(Date.now()-r,"ms"))}s.close(),s=null,Lt(i,e._t.env,e._t.appID,((a={})[n]={status:!1,time:Date.now()},a),!0),e.startTestHttp3Server(t,i)},s.startConnect(n)}},i}(),ei=function(){function t(t,i,e){this.ei=t,this.It=i,this.stateCenter=e}return Object.defineProperty(t.prototype,"appInfo",{get:function(){return this.stateCenter.appInfo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ct",{get:function(){return this.stateCenter.logger},enumerable:!1,configurable:!0}),t.prototype.getConfig=function(t,i){this.Ct.info("zn.nab.gc call");var e=this.ei.getFreeStream(b.OTHER),n=this.appInfo.geoFencing;e.sendMessage(d.MSG_TYPE_GET_CONFIG_REQUEST,{geofencing_type:null==n?void 0:n.type,geofencings:null==n?void 0:n.list,dispatch_tag:this.stateCenter.customConfig.dispatchTag},t,i)},t.prototype.dispatchURL=function(t,i){var e=this;this.Ct.info(nt+" call");var n=this.ei.getFreeStream(b.OTHER),s=this.appInfo.geoFencing;n.sendMessage(d.MSG_TYPE_ACCESSHUB_DISPATCH_REQUEST2,{geofencing_type:null==s?void 0:s.type,geofencings:null==s?void 0:s.list,dispatch_tag:this.stateCenter.customConfig.dispatchTag,addr_type:0===this.stateCenter.customConfig.ipStackMode?0:1},(function(i){e.Ct.info(nt+" suc "),t&&t(i)}),(function(t,n,s){e.Ct.info(nt+" fail"),i&&i(s||t)}))},t.prototype.getAppConfig=function(t,i,e,n,s,r){var o=this;return new Promise((function(u,a){o.Ct.info(st+" call");var c={id_name:i,config_key:t,token:e,mode_no:o.appInfo.mode,etag:s,is_special_customer:(null==r?void 0:r.isSpecial)?1:0},h=function(t,i,e){if(e)return o.Ct.error(st+" fail "+JSON.stringify(e)),void a(e);if(0===t.code){o.Ct.info(st+" suc");var n=o.decodeConfigMessage(t.data.data);u({code:0,data:n,etag:t.data.etag})}else o.Ct.error(st+" fail "+t.code),a({code:t.code})};o.ei.getFreeStream(b.OTHER).sendMessage(d.MSG_TYPE_GET_APPCONFIG_REQUEST,c,h,h,null,{timeout:n})}))},t.prototype.decodeConfigMessage=function(t){return this.It.decodeConfigMessage(t)},t.prototype.getSvrAddr=function(){var t=this;return new Promise((function(i,e){t.Ct.info("".concat(et," call"));var n=t.ei.getFreeStream(b.OTHER),s=t.appInfo.geoFencing;n.sendMessage(d.MSG_TYPE_GET_SVRADDR_REQUEST,{geofencing_type:null==s?void 0:s.type,geofencings:null==s?void 0:s.list,dispatch_tag:t.stateCenter.customConfig.dispatchTag,addr_type:0===t.stateCenter.customConfig.ipStackMode?0:2},(function(e){t.Ct.info("".concat(et," suc")),i(e)}),(function(i,n,s){t.Ct.info("".concat(et," fail")),e(s||i)}))}))},t}();!function(t){t.Lazy="lazy",t.Periodic="periodic"}(Xt||(Xt={}));var ni=function(){function t(t,i){this.ei=t,this._t=i,this.si=null,this.oi=5,this.ri=10,this.ci=0,this.ui=0,this.hi=0,this.mode=Xt.Lazy}return Object.defineProperty(t.prototype,"ai",{get:function(){return this.ei.getHbStream()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ct",{get:function(){return this._t.logger},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fi",{get:function(){var t=this._t.lastRecvMsgTime;return!!t&&Date.now()-t>1e3*this.oi},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_i",{get:function(){var t=this.hi;return!!t&&Date.now()-t>1e3*this.ri},enumerable:!1,configurable:!0}),t.prototype.init=function(t){this.Ct.info("zn.nhb.ii call. "),t.data.logic_hb_interval>=1&&t.data.logic_hb_interval<=10&&(this.oi=t.data.logic_hb_interval),t.data.logic_hb_timeout>=3&&t.data.logic_hb_timeout<=30&&(this.ri=t.data.logic_hb_timeout),this.ui=0,this.ci=this.ri/this.oi,this.startHB()},t.prototype.startHB=function(){var t=this;if(this.ai){var i=this.fi;if(this.Ct.debug("zn.nhb.rs call "+i),!i&&this.hi&&(this.Ct.info(rt+" stop check."),this.hi=0),null!==this.si){if(i||this.mode===Xt.Periodic)return;clearTimeout(this.si)}var e=this.si=setTimeout((function(){t.si===e&&(t.si=null),t.fi&&!t.hi&&(t.Ct.info(rt+" start check."),t.hi=Date.now()),t._i&&(t.Ct.warn(rt+" over max hb timeout. "),t.onHBTimeout&&t.onHBTimeout()),t.li()}),1e3*this.oi)}},t.prototype.li=function(){var t=this;if(this.ai){this.Ct.debug(rt+" call "+this.ui++);var i=(new Date).getTime(),e=function(e,n,s){var r=(new Date).getTime()-i;if(t.Ct.debug(rt+" hb callback "+r),s&&0!==(null==s?void 0:s.code))t.Ct.warn(rt+" fail "+JSON.stringify(s));else{if(t.hi&&(t.Ct.info(rt+" hb rsp to stop check."),t.hi=0),null==e?void 0:e.ntp_time){var o=e.ntp_time,u="number"==typeof o?o:o.toNumber(),a=(new Date).getTime();0===t._t.appInfo.env&&t._t.updateNTP(i,u,a)}t.ui=0}},n={ts:Date.now()};this.ai.sendMessage(d.MSG_TYPE_HB_REQUEST,n,e,e,null)}},t.prototype.onHBTimeout=function(){},t.prototype.stop=function(){this.si&&(clearTimeout(this.si),this.si=null),this.ui=0},t}(),si=function(){return si=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},si.apply(this,arguments)},ri=function(){function t(t,i,e,n,s,r){this.Ct=t,this.di=i,this.ei=e,this.Ei=n,this._t=s,this.pi=r,this.connectState=y.DISCONNECT,this.lastConnectState=y.DISCONNECT,this.brokenTimer=null,this.listenerList={connected:[],broken:[]},this.pcEmitState=-1,this.gi=null,this.eventManager=new Ft,this.pi&&(this.pi.isMsgCache=!1)}return Object.defineProperty(t.prototype,"service",{get:function(){return this.di},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"netPcStream",{get:function(){return this.gi||this.createPcStream()},enumerable:!1,configurable:!0}),t.prototype.createPcStream=function(){var t=this.ei.createStream(b.PC);return this.gi=t,t.onPushEvent=this.onPushEvent.bind(this),t},t.prototype.sendRequest=function(t,i,e,n){var s,r,o,u,a,c,h=this;this.gi||this.Ct.info(wt+" create pc ".concat(this.di," ").concat(this.netPcStream.StreamID));var f=t.payload;(null===(s=this.pi)||void 0===s?void 0:s.encode)&&(f=At(t.payload));var l={service_no:this.di,ack:t.ack,payload:f,wss_message_type:null!==(o=null===(r=this.pi)||void 0===r?void 0:r.messageType)&&void 0!==o?o:Tt.wssMessageType,wss_path:null===(u=this.pi)||void 0===u?void 0:u.path,wss_raw_query:null===(a=this.pi)||void 0===a?void 0:a.query,zegoconn_version:Tt.connectVer,addr_type:0===this._t.customConfig.ipStackMode?0:1};this.netPcStream.isConnect()||(this.Ct.info(wt+" pc is not connect"),this.eventManager.emit("connectStart")),this.netPcStream.sendMessage(d.MSG_TYPE_PC_UPWARD_MESSAGE,l,(function(){h.Ct.info(wt+" suc"),e&&e()}),(function(t){h.Ct.error(wt+" fail"),i&&i(t)}),null,{isInSendMap:"boolean"==typeof t.isInSendMap&&t.isInSendMap,extras:n,isMsgCache:null===(c=this.pi)||void 0===c?void 0:c.isMsgCache})},t.prototype.onPushEvent=function(t,i,e){var n;switch(this.Ct.info(St+" msgType: ".concat(t)),t){case d.MSG_TYPE_PC_ESTABLISHED:this.netPcStream.isFirst=!1,this.pcEstablished(i,this.netPcStream.StreamID);break;case d.MSG_TYPE_PC_BROKEN:this.pcBroken();break;case d.MSG_TYPE_PC_DOWNWARD_MESSAGE:this.Ct.info(St+" ".concat(this.di," down ").concat((null==i?void 0:i.ts)&&i.ts.toNumber&&i.ts.toNumber()||i.ts));var s=i.payload;(null===(n=this.pi)||void 0===n?void 0:n.encode)&&(s=Mt(i.payload)),this.eventManager.emit("downLoadMessage",s,e);break;case d.MSG_TYPE_PUSH_EXCEPTION:this.Ct.info(St+" ".concat(this.di," exception ").concat(JSON.stringify(i))),this.eventManager.emit("exception",i,e)}},t.prototype.on=function(t,i){return this.eventManager.addEventHandler(t,i)},t.prototype.off=function(t,i){this.eventManager.removeEventHandler(t,i)},t.prototype.pcEstablished=function(t,i){this.Ct.info("zn.napr.pe call "+JSON.stringify(t)),this.setConnectState(y.CONNECTED);var e=T.MANUAL;this.lastConnectState===y.BROKEN&&this.connectState===y.CONNECTED&&(e=T.AUTO),this.stateChanged(y.CONNECTED,e,void 0,{proxy_link_sources:null==t?void 0:t.from,connect_stream:i}),this.brokenTimer&&clearTimeout(this.brokenTimer)},t.prototype.pcBroken=function(){var t=this;this.Ct.info("zn.napr.pb call"),this.setConnectState(y.BROKEN),this.stateChanged(y.BROKEN),this.brokenTimer=setTimeout((function(){t.stateChanged(y.DISCONNECT,O.TEMP,void 0,{code:Ht})}),1e3*this.Ei)},t.prototype.resetBrokenTimer=function(){this.brokenTimer&&clearTimeout(this.brokenTimer)},t.prototype.Si=function(t,i,e){var n;this.Ct.info("zn.napr.cr"+" close pc ".concat(this.di," ").concat((null===(n=this.gi)||void 0===n?void 0:n.StreamID)||-1," ").concat(t," ").concat(this.connectState," ").concat(i," ").concat(e||"")),this.connectState===y.DISCONNECT&&"disconnected"!==t||(this.gi&&(this.gi.closeStream(0,""),this.gi.destroyed(),this.gi=null),this.resetBrokenTimer(),"broken"===t?this.stateChanged(y.BROKEN,e,void 0,{code:i}):"disconnected"===t&&this.stateChanged(y.DISCONNECT,void 0,void 0,{code:i}),this.setConnectState(y.DISCONNECT))},t.prototype.closePc=function(t,i){this.connectState!==y.DISCONNECT&&this.Si("broken",t,i)},t.prototype.closeRequest=function(){this.Si("disconnected",0,O.CLOSE)},t.prototype.setConnectState=function(t){this.connectState!==t&&(this.lastConnectState=this.connectState,this.connectState=t)},t.prototype.reportEvent=function(t,i){this.eventManager.emit(t,si({service_no:this.di},i))},t.prototype.stateChanged=function(t,i,e,n){this.Ct.info("zn.napr.sc ".concat(t," ").concat(i," ").concat(JSON.stringify(e))),this.pcEmitState===t?this.Ct.info("zn.napr.sc same"):(this.pcEmitState=t,t===y.BROKEN?(this.eventManager.emit("broken"),this.reportEvent("pcBrokenEvent",n)):t===y.DISCONNECT?(this.eventManager.emit("disconnected",i,{code:null==e?void 0:e.code}),this.reportEvent("pcDisconnectedEvent",n)):t===y.CONNECTED&&(this.eventManager.emit("connected",i),this.reportEvent("pcConnectedEvent",n)))},t}(),oi=function(){function t(t,i){this.ei=t,this._t=i,this.pcStreamRequests=[],this.pcEstablishTimeout=Tt.pcEstablishTimeout}return Object.defineProperty(t.prototype,"Ct",{get:function(){return this._t.logger},enumerable:!1,configurable:!0}),t.prototype.getRequest=function(t,i){var e=new ri(this.Ct,t,this.ei,this.pcEstablishTimeout,this._t,i);return this.pcStreamRequests.push(e),e},t.prototype.updateConnectState=function(t,i,e){this.Ct.info("zn.naprm.ucs call "+t+" "+i),this.pcStreamRequests.forEach((function(n){n.stateChanged(t,i,e,{code:(null==e?void 0:e.code)||0})}))},t.prototype.closePCs=function(t,i){this.pcStreamRequests.forEach((function(e){e.closePc(t,i)}))},t.prototype.setEstablishTimeout=function(t){this.pcEstablishTimeout=t},t}(),ui=function(){function t(t,i){this.Ct=t,this._t=i,this.RETRY_START_TIME_INTERVAL=4,this.RETRY_CONTINUE_COUNT=2,this.RETRY_MAX_TIME_INTERVAL=32,this.retryTimer=null,this.maxTimer=null,this.Ti=1,this.Ci=0,this.bi=3,this.isOverTime=!1,this.RETRY_MAX_TIME=90,this.h3ClosedTimes=[],this.retryIPMaxTimes=2}return t.prototype.initLink=function(t){this.link=t},t.prototype.startMaxTime=function(){var t=this;this.Ct.info(ut+" call"),this.maxTimer||(this.Ct.info(ut+" start max timer"),this.maxTimer=setTimeout((function(){t.Ct.warn(ut+" over max time ".concat(t.RETRY_MAX_TIME,"s, stop retry")),t.isOverTime=!0,t.link.destroySocket(_.NONE),t.stopMaxTime(),t.invalid(),t.onactive(!1,Bt)}),1e3*this.RETRY_MAX_TIME))},t.prototype.stopMaxTime=function(){this.Ct.info("zn.rlh.sm.1 call"),this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},t.prototype.active=function(t,i,e){var n=this;if(void 0===i&&(i=!1),void 0===e&&(e=!1),this.Ct.info(ot+" call "+t+" "+i+" "+e+" "+this.Ti),this._t.isDestroyed)return!1;if(this.retryTimer)return this.Ct.info(ot+" has actived, ignore"),!1;var s=this._t.networkState==f.offline;if(s){if(this.Ct.info(ot+" check if really offline. "+this.Ci),this.Ci>=this.bi)return this.Ct.warn(ot+" network is broken, stop retry"),!1}else this.Ci=0;if(this.link.isConnecting()&&!e)return this.Ct.info(ot+" link is connecting, ignore"),!1;if(this.isOverTime)return this.Ct.info(ot+" retry over time, stop retry"),!1;if(this.Ti>this.retryIPMaxTimes)return this.invalid(),this.onRetryBeyondLimit(),!1;var r=function(){n.Ct.info(ot+" interval "+n.mi),n.retryTimer=setTimeout((function(){i||n.link.destroySocket(_.BROKEN),n.link.connectSocket(t,(function(){n.Ct.info(ot+" suc"),n._t.networkState=f.online,n.stopMaxTime(),n.invalid(),n.onactive(!0)}),(function(){var t,i;if((null===(i=n.link.socketService)||void 0===i?void 0:i.type)===c.WebTransport&&n._t.networkState===f.online&&(n.h3ClosedTimes.push(Date.now()),3===n.h3ClosedTimes.length)){if(n.h3ClosedTimes[2]-n.h3ClosedTimes[0]<=15e3)return n.h3ClosedTimes=[],n.Ct.info(lt+" reason:"+H.ClosedTooOften+" error:Links break too often"),Lt(n.link.linkServerStorageKey,n._t.env,n._t.appID,((t={})[n.link.connectServer]={status:!1,time:Date.now()},t),!0),n._t.enableHttp3=!1,!n.maxTimer&&n.startMaxTime(),void n.active(!1,!0);n.h3ClosedTimes.shift()}n.Ct.info(ot+" fail"),!n.maxTimer&&n.startMaxTime(),n.active(!0,!1,!0)})),n.retryTimer&&clearTimeout(n.retryTimer),n.retryTimer=null,s?n.Ci++:n.Ti++}),i?0:1e3*n.mi)};if(1==this.Ti)xt().then((function(t){n.mi=Math.floor(t*(1-n.RETRY_START_TIME_INTERVAL)+n.RETRY_START_TIME_INTERVAL),r()})).catch((function(){n.mi=.5*n.RETRY_START_TIME_INTERVAL,r()}));else{var o=Math.pow(2,Math.round(this.Ti/this.RETRY_CONTINUE_COUNT+1));this.mi=o>this.RETRY_MAX_TIME_INTERVAL?this.RETRY_MAX_TIME_INTERVAL:o,r()}return!0},t.prototype.onactive=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i]},t.prototype.onRetryBeyondLimit=function(){},t.prototype.init=function(t,i,e,n){this.invalid(),this.stopMaxTime(),this.isOverTime=!1,"number"==typeof t&&t<3600&&(this.RETRY_MAX_TIME=t),"number"==typeof i&&(this.RETRY_START_TIME_INTERVAL=i),"number"==typeof e&&(this.RETRY_CONTINUE_COUNT=e),"number"==typeof n&&(this.RETRY_MAX_TIME_INTERVAL=n)},t.prototype.invalid=function(){this.Ct.info("zn.rlh.ivd end retry"),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this.Ti=1,this.Ci=0},t}(),ai=function(){function t(){this.networkState=f.online,this.appInfo={appID:0,env:0,mode:Tt.modeNo,model:Tt.model,connVer:Tt.connectVer},this.useNetAgent=!0,this.specified=!1,this.clientIP="",this.byPassClientIP="",this.timeOffset=0,this.networkRTT=0,this.enableHttp3=!1,this.isDestroyed=!1,this.lastRecvMsgTime=0,this.customConfig={enableHttp3:!1,ipStackMode:1,probeByPassStrategy:0},this.linkIpStackDetection={IPv4:o.unknown,IPv6:o.unknown},this.isIpStackDetected=!1,this.currentIpStackType=n.IPv4,this.ipList={ipv4:[],ipv6:[]},this.enableHttp3=Qt.isSupport()}return Object.defineProperty(t.prototype,"appID",{get:function(){return this.appInfo.appID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"env",{get:function(){return this.appInfo.env},enumerable:!1,configurable:!0}),t.prototype.updateNTP=function(t,i,e){if(!(t>e)){var n=e-t;this.timeOffset=Math.round((i-t+(i-e))/2);var s=Math.round(i+n/2);(!this.networkRTT||n<this.networkRTT)&&(this.networkRTT=n,this.ntpTimeInfo={performanceTime:Math.round(performance.now()),ntp:s})}},t}(),ci=function(){function t(){this.level=1}return t.prototype.setLogLevel=function(t){var i;return this.level=null!==(i=hi[t])&&void 0!==i?i:this.level,!0},t.prototype.log=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(!(this.level>1)){var e=t.join(" ");console.log(e)}},t.prototype.debug=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(!(this.level>0)){var e=t.join(" ");console.debug(e)}},t.prototype.info=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(!(this.level>1)){var e=t.join(" ");console.info(e)}},t.prototype.warn=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(!(this.level>2)){var e=t.join(" ");console.warn(e)}},t.prototype.error=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(!(this.level>3)){var e=t.join(" ");console.error(e)}},t}(),hi={debug:0,info:1,warn:2,error:3,report:99,disable:100},fi=function(){return fi=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},fi.apply(this,arguments)},li=function(){function t(t,i,e){this.Ct=t,this.ei=i,this.di=e}return Object.defineProperty(t.prototype,"netHttpStream",{get:function(){return this.ei.getFreeStream(b.HTTP)},enumerable:!1,configurable:!0}),t.prototype.sendRequest=function(t,i,e,n,s){var r=this,o=t.disableLog,u={service_no:this.di,ack:t.ack,headers:t.headers,body:At(JSON.stringify(t.body)),id_name:t.idName,method_no:t.method_no,stick:t.stick,location:t.location,reduce_resp_header:t.reduceRspHeaders?1:0};this.netHttpStream.sendMessage(d.MSG_TYPE_HTTP_REQUEST,u,(function(t){var e=(null==t?void 0:t.headers).find((function(t){return"Content-Encoding"===(null==t?void 0:t.name)}));if("gzip"===(null==e?void 0:e.val))!o&&r.Ct.info(Et+" gzip");else if(t.body){var n=Mt(t.body);t.body=n}var s=fi(fi({},t),{body:void 0});!o&&r.Ct.info(Et+" suc "+JSON.stringify(s)),i&&i(t)}),(function(t,i,n){!o&&r.Ct.error(Et+" fail"),e&&e(n||t)}),(function(t){!o&&r.Ct.error(Et+" ack"),n&&n(t)}),s)},t.prototype.sendRequest2=function(t,i,e,n,s){var r=this,o=1===t.format?At(JSON.stringify(t.body)):t.body,u={ack:t.ack,body:o,id_name:t.idName,method:t.method,interface_id:t.interfaceID,token:t.token,reduce_resp_header:t.reduceRspHeaders?1:0};t.headers&&(u.headers=t.headers),t.resID&&(u.res_id=t.resID),t.urlParams&&(u.params=t.urlParams),t.mode&&(u.mode=t.mode),this.netHttpStream.sendMessage(d.MSG_TYPE_HTTP_REQUEST2,u,(function(n,s){var o=(null==n?void 0:n.headers).find((function(t){return"Content-Encoding"===(null==t?void 0:t.name)}));if(200===n.status_code){if("gzip"===(null==o?void 0:o.val))r.Ct.info(Ot+" gzip");else if(n.body&&1===t.format)try{a=Mt(n.body),n.body=a}catch(t){r.Ct.info(Ot+" decode "+JSON.stringify(t))}var u=fi(fi({},n),{body:void 0});r.Ct.info(Ot+" suc "+JSON.stringify(u)),i&&i(n,s)}else{try{var a=Mt(n.body);n.body=a}catch(t){r.Ct.info(Ot+" status "+n.status_code+" "+JSON.stringify(t))}e&&e(n)}}),(function(t,i,n){r.Ct.error(Ot+" fail"),e&&e(n||t)}),(function(t){r.Ct.error(Ot+" ack"),n&&n(t)}),s)},t}(),di=function(){function t(t,i,e){this.type=t,this.Oi=i,this.vt=e,this.isFree=!1,this.isFirst=!0,this.timestamp=0,this.id=Date.now()}return Object.defineProperty(t.prototype,"StreamID",{get:function(){return this.Oi},enumerable:!1,configurable:!0}),t.prototype.Ri=function(){this.timestamp=Date.now()},t.prototype.refresh=function(t){this.Oi=t,this.isFirst=!0,this.Ri()},t.prototype.sendMessage=function(t,i,e,n,s,r){var o=this;void 0===e&&(e=null),void 0===n&&(n=null),void 0===s&&(s=null),void 0===r&&(r={timeout:5e3,isInSendMap:!0}),this.isFree=!1,this.Ri();var u=this.Oi;this.vt.sendMessage(t,u,i,this.isFirst,(function(t,i,n){o.type!==b.PC&&(o.isFree=!0,o.Ri()),o.isFirst&&u===o.StreamID&&(o.isFirst=!1),e&&e(t,n)}),(function(t,i,e){o.type!==b.PC&&(o.isFree=!0,o.Ri()),1100002===(null==e?void 0:e.code)?o.destroyed():o.isFirst&&u===o.StreamID&&(o.isFirst=!1),n&&n(t,i,e)}),s,r,this.type)},t.prototype.onPushEvent=function(t,i,e){},t.prototype.closeStream=function(t,i){this.vt.sendMessage(d.MSG_TYPE_STREAM_CLOSED,this.Oi,{code:t,msg:i},void 0,void 0,void 0,void 0,{isInSendMap:!1},this.type)},t.prototype.destroyed=function(){var t,i;(null===(i=null===(t=this.vt)||void 0===t?void 0:t.socketService)||void 0===i?void 0:i.type)===c.WebTransport&&this.vt.socketService.closeStream(this.Oi),this.onDestroyed()},t.prototype.isConnect=function(){return this.vt.isConnect()},t.prototype.onDestroyed=function(){},t}(),vi=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},mi=function(){function t(t,i){var e=this;this.vt=t,this._t=i,this.streamID=1,this.pcStreams=[],this.streams=[],this.vt.onSocketClose=function(){e.refreshAllStream()}}return Object.defineProperty(t.prototype,"Ct",{get:function(){return this._t.logger},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.clearStreams()},t.prototype.createStream=function(t){var i=this,e=this.getNextStreamID(),n=new di(t,e,this.vt);return t===b.PC?this.pcStreams.push(n):this.streams.push(n),n.onDestroyed=function(){t===b.PC?i.pcStreams=i.pcStreams.filter((function(t){return t.StreamID!==e})):i.streams=i.streams.filter((function(t){return t.StreamID!==e}))},n},t.prototype.getHbStream=function(){var t=this;if(this.hbStream)return this.hbStream;var i=new di(b.OTHER,this.getNextStreamID(),this.vt);return i.onDestroyed=function(){t.hbStream=void 0},this.hbStream=i,i},t.prototype.getFreeStream=function(t){if(t!==b.PC){var i=this.streams.find((function(t){return t.isFree&&t.type!==b.PC}));if(i)return i.isFree=!1,i}return this.createStream(t)},t.prototype.onPushEvent=function(t,i,e,n){var s=this.pcStreams.find((function(i){return i.StreamID===t}));s&&s.onPushEvent(i,e,n)},t.prototype.getNextStreamID=function(){return this.streamID=this.streamID+2,this.streamID},t.prototype.refreshAllStream=function(){var t=this;this.Ct.info("zn.sm.ras call"),vi(vi(vi([],this.streams,!0),this.pcStreams,!0),[this.hbStream],!1).forEach((function(i){return null==i?void 0:i.refresh(t.getNextStreamID())}))},t.prototype.clearStreams=function(){this.streams=[],this.pcStreams=[],this.hbStream=void 0},t}(),pi=function(){return pi=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},pi.apply(this,arguments)},gi=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))};function bi(t,i){return void 0===i&&(i="setAppInfo"),Error("Failed to execute ".concat(t," before ").concat(i,"."))}var _i=function(){function t(t){var i=this;this.proxyCtrl=t,this.Ai=null,this.connectServers=[],this.http3Servers=[],this.wssV6Servers=[],this.http3V6Servers=[],this.specifiedServers=[],this.getAppConfigFailCount=0,this.getAppConfigTime=0,this.linkMsgMaxInterval=90,this.connectedTime=0,this.connectid="",this.reportSeq=0,this.connectSeq=0,this.listenNetworkState=!0,this.defaultConnectServers=[],this.Pi=0,this.lastLinkConnectState=0,this.ft=function(t,e){i.logger.warn("zn.zca.btws h333 back to ws. ".concat(t)),i.eventManager.emit("h3BackToWss",{url:i.zegoLink.connectServer,reason:t,err_msg:(null==e?void 0:e.message)||JSON.stringify(e)}),i.Yt(!0),i.Ii()},this.Jt=function(t){var e=i.stateCenter.ipList;i.stateCenter.clientIP&&i.Ni(i.stateCenter.clientIP),i.stateCenter.byPassClientIP&&i.Ni(i.stateCenter.byPassClientIP);var n={linkConnectDetection:t};(e.ipv4.length>0||e.ipv6.length>0)&&(n.ipList=e),i.eventManager.emit("ipDetection",n)},this.jt=function(t,e){if(i.linkConnectState=2,i.Di(),0===i.appInfo.env){var n=i.reportSeq++;i.eventManager.emit("dispatchEvent",n,"start"),i.yi().then((function(t){var e,s,r=t.servers,o=t.http3Servers,u=t.http3Domains,a=t.wssV6Servers,c=t.http3V6Servers,h=t.wssV6Domains,f=t.http3V6Domains,l=t.domains.map((function(t){return t.host})),d=u.map((function(t){return t.host})),v=h.map((function(t){return t.host})),m=f.map((function(t){return t.host}));i.http3Servers&&i.http3Servers.length||(i.http3Servers=o,null===(e=i.zegoLink)||void 0===e||e.setHttp3Servers(o,[])),i.http3V6Servers&&i.http3V6Servers.length||(i.http3V6Servers=c,null===(s=i.zegoLink)||void 0===s||s.setHttp3Servers([],c)),i.eventManager.emit("dispatchEvent",n,"end",{servers:r,domains:l,http3Servers:o,http3Domains:d,wssV6Domains:v,http3V6Domains:m}),r.length>0&&i.eventManager.emit("dispatchResultUpdate",{servers:r,http3Servers:o,domains:l,http3Domains:d,wssV6Servers:a,http3V6Servers:c})})).catch((function(t){})),i.wi().then((function(t){i.eventManager.emit("svrAddrResultUpdate",{accesshub_domain:t.accesshub_domain,logreport_domain:t.logreport_domain,detaillog_domain:t.detaillog_domain,geofencing_id:t.geofencing_id,accesshub_v6_domain:t.accesshub_v6_domain,http3_v6_domain:t.http3_v6_domain,logreport_v6_domain:t.logreport_v6_domain,detaillog_v6_domain:t.detaillog_v6_domain})})).catch((function(t){}))}var s=e[e.length-1],r=function(t,i){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&i.indexOf(n)<0&&(e[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)i.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(e[n[s]]=t[n[s]])}return e}(s,["error"]);i.eventManager.emit("connected",pi({},r)),i.zi(t,e)},this.qt=function(){i.logger.info(Q+" call"),i.linkConnectState=1},this.Yt=function(t,e,n,s){if(i.logger.info("zn.zca.ode"+" ".concat(t," ").concat(JSON.stringify(e))),1===i.linkConnectState){var r=i.zegoLink.connectServer.includes("https")?1:3;i.eventManager.emit("connectFailed",{url:i.zegoLink.connectServer,connect_type:r,error:null==e?void 0:e.code,err_msg:null==e?void 0:e.msg,online:i.stateCenter.networkState})}var o=i.linkConnectState;i.linkConnectState=0,t?i.Mi(null==e?void 0:e.code,O.TEMP):(1===o&&n&&s&&i.zi(n,s),0!==o&&(i.eventManager.emit("disconnected"),i.netAgentPCRequestMgr.updateConnectState(y.DISCONNECT,O.CLOSE,e),i.Hi((null==e?void 0:e.code)||0)))},this.Ft=function(t,e,n,s){switch(e){case d.MSG_TYPE_REDIRECT:case d.MSG_TYPE_REDIRECT2:i.Ui(n);break;case d.MSG_TYPE_CLOSE_CONNECTION:i.Gi(n);break;case d.MSG_TYPE_PC_BROKEN:case d.MSG_TYPE_PC_ESTABLISHED:case d.MSG_TYPE_PC_DOWNWARD_MESSAGE:case d.MSG_TYPE_PUSH_EXCEPTION:i.streamManager.onPushEvent(t,e,n,s);break;case d.MSG_TYPE_PUSH_APPCONFIG:i.businessRequestMgr.decodeConfigMessage(n.data)}},this.logger=new ci,this.stateCenter=new ai,this.stateCenter.logger=this.logger,this.protobuf=new G(this.stateCenter),this.eventManager=new Ft,this.zegoLink=new ii(this.protobuf,this.stateCenter,this.proxyCtrl),this.streamManager=new mi(this.zegoLink,this.stateCenter),this.businessRequestMgr=new ei(this.streamManager,this.protobuf,this.stateCenter),this.zegoLink.HBHandler=this.netHeartBeatHandler=new ni(this.streamManager,this.stateCenter),this.netAgentPCRequestMgr=new oi(this.streamManager,this.stateCenter),this.zegoLink.initEvent(this.jt,this.Yt,this.qt,this.Ft,this.ft,this.Jt),this.zegoLink.onUpdateMsgTimeChanged=function(t){i.ki()},this.ki(),this.Vi()}return Object.defineProperty(t.prototype,"isDestroy",{get:function(){return this.stateCenter.isDestroyed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Bi",{get:function(){return this.stateCenter.useNetAgent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientIP",{get:function(){return this.stateCenter.clientIP},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeOffset",{get:function(){return this.stateCenter.timeOffset},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectIPStackType",{get:function(){return this.stateCenter.currentIpStackType},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linkConnectState",{get:function(){return this.Pi},set:function(t){this.lastLinkConnectState=this.Pi,this.Pi=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"appInfo",{get:function(){return this.stateCenter.appInfo},enumerable:!1,configurable:!0}),t.prototype.init=function(){if(this.isDestroy)throw Error("instance have destroyed, invalid call")},t.prototype.unInit=function(){this.zegoLink.release()},t.prototype.setAppInfo=function(t){var i=tt+" ".concat(JSON.stringify(t)," ; ");if(this.stateCenter.appID>0)this.logger.warn(tt+" appInfo has exist, appID: ".concat(this.stateCenter.appID));else{if(t.appID<=0)throw Error("setAppInfo, invalid appID: ".concat(t.appID));this.stateCenter.appInfo=pi(pi({},this.stateCenter.appInfo),t),navigator&&(this.stateCenter.networkState=navigator.onLine?f.online:f.offline,i+=" oline: ".concat(navigator.onLine)),0===t.env?this.Yi():1===t.env&&this.Li(),this.logger.info(i)}},t.prototype.checkAndConnect=function(t){if(!this.stateCenter.appID)throw bi(t,"setAppInfo");if(this.connectServers.length<=0)throw bi(t,"setNetAgentDefaultServers or setDispatchConnectServers");if(this.isDestroy)throw Error("instance have destroyed, invalid call");this.retryLinkHandler||this.Ii()},t.prototype.setUserInfo=function(t){this.stateCenter.userId=t},t.prototype.setSettingConfig=function(t){this.logger.info("zn.zca.ssc"+" ".concat(JSON.stringify(t))),void 0!==t.enableHttp3&&(this.stateCenter.customConfig.enableHttp3=t.enableHttp3,Qt.isSupport()),void 0!==t.dispatchTag&&(this.stateCenter.customConfig.dispatchTag=t.dispatchTag),void 0!==t.ipStackMode&&(this.stateCenter.customConfig.ipStackMode=t.ipStackMode),void 0!==t.accesshubBypassConnectTime&&(this.stateCenter.customConfig.accesshubBypassConnectTime=t.accesshubBypassConnectTime),void 0!==t.probeByPassStrategy&&(this.stateCenter.customConfig.probeByPassStrategy=t.probeByPassStrategy)},t.prototype.setNetAgentDefaultServers=function(t,i){void 0===i&&(i=[]),0===this.connectServers.length&&(this.connectServers=gi([],t,!0)),0===this.wssV6Servers.length&&0!==i.length&&(this.wssV6Servers=gi([],i,!0))},t.prototype.setNetAgentSpecifiedServers=function(t){throw Error("not support")},t.prototype.setBackupDomains=function(t){throw Error("not support")},t.prototype.setDispatchConnectServers=function(t,i,e,n){void 0===i&&(i=[]),void 0===e&&(e=[]),void 0===n&&(n=[]),t.length>0&&(this.connectServers=gi([],t,!0)),i.length>0&&(this.http3Servers=gi([],i,!0)),e.length>0&&(this.wssV6Servers=gi([],e,!0)),n.length>0&&(this.http3V6Servers=gi([],n,!0)),this.stateCenter.appID>0&&this.Ii()},t.prototype.startHttpRequest=function(t,i,e,n,s){var r=this;if(this.checkAndConnect("startHttpRequest"),s&&"number"==typeof(null==s?void 0:s.timeout)&&((null==s?void 0:s.timeout)<1e3||(null==s?void 0:s.timeout)>1e4))throw Error("timeout must between 1 and 10 second");var o=this.reportSeq++;this.eventManager.emit("requestEvent",o,"start"),this.isConnect()||(this.logger.info(it+" link is not connect"),this.innerReconnect()),new li(this.logger,this.streamManager,t.service).sendRequest(t,(function(e){r.eventManager.emit("requestEvent",o,"end",{na_req_location:t.location,status_code:e.status_code,err_code:0}),i&&i(e)}),(function(i){r.eventManager.emit("requestEvent",o,"end",{na_req_location:t.location,err_code:i.code||0}),e&&e(i)}),n,s)},t.prototype.startHttpRequest2=function(t,i,e,n,s){var r=this;this.checkAndConnect("startHttpRequest2");var o=this.reportSeq++;this.eventManager.emit("requestEvent",o,"start"),this.isConnect()||(this.logger.info(it+" link is not connect"),this.innerReconnect()),new li(this.logger,this.streamManager).sendRequest2(t,(function(e,n){r.eventManager.emit("requestEvent",o,"end",{na_req_interface:t.interfaceID,status_code:e.status_code,err_code:0}),i&&i(e,n)}),(function(i){r.eventManager.emit("requestEvent",o,"end",{na_req_interface:t.interfaceID,err_code:i.code||0}),e&&e(i)}),n,s)},t.prototype.getAppConfigByAgent=function(t,i,e,n,s){if(this.checkAndConnect("getAppConfigByAgent"),!this.stateCenter.userId)throw bi("getAppConfigByAgent","setUserInfo");return this.isConnect()||(this.logger.info("zn.gab.0 link is not connect"),this.innerReconnect()),this.$i(t,this.stateCenter.userId,i,e,n,s)},t.prototype.getPCRequest=function(t,i){var e=this;if(!this.stateCenter.appInfo)throw bi("getPCRequest");var n=this.netAgentPCRequestMgr.getRequest(t,i);return n.on("disconnected",(function(i){e.logger.warn("zn.zca.gpr "+t+" disconnect "+i),i===O.TEMP&&(e.Mi(Ht),e.xi())})),n.on("connectStart",(function(){e.innerReconnect()})),n},t.prototype.connectUa=function(){this.checkAndConnect("connectUa"),this.logger.info("zn.zca.cua call"),this.retryLinkHandler&&(this.retryLinkHandler.init(),this.ji(!0))},t.prototype.destroyConnect=function(t){this.logger.info("zn.zca.dc.0 call"),this.qi(t)},t.prototype.destroy=function(){this.logger.info("zn.zca.dy.0 call"),this.destroyConnect(1===this.linkConnectState?Vt:void 0),this.Ai&&clearTimeout(this.Ai),this.retryLinkHandler&&this.retryLinkHandler.invalid(),this.retryLinkHandler&&this.retryLinkHandler.stopMaxTime(),this.zegoLink.onUpdateMsgTimeChanged=void 0,this.stateCenter.isDestroyed=!0,this.streamManager.destroy(),this.zegoLink.release()},t.prototype.isConnect=function(){return this.zegoLink.isConnect()},t.prototype.isDisConnect=function(){return this.zegoLink.isDisConnect()},t.prototype.on=function(t,i){return this.logger.debug("zn.zca.o.0 "+t),!!this.eventManager.addEventHandler(t,i)},t.prototype.off=function(t,i){this.logger.debug("zn.zca.o.1 "+t),this.eventManager.removeEventHandler(t,i)},t.prototype.setLogger=function(t){this.logger=t,this.stateCenter.logger=t},t.prototype.setAccess=function(t){this.stateCenter.useNetAgent=t},t.prototype.getVersion=function(){return"1.2.9"},t.prototype.reconnectUA=function(){this.retryLinkHandler&&(this.retryLinkHandler.startMaxTime(),this.Mi(),this.ji(!1,R.detail))},t.prototype.Vi=function(){var t=this;this.netHeartBeatHandler.onHBTimeout=function(){t.eventManager.emit("heartBeatTimeout")}},t.prototype.Yi=function(){var t=this;this.listenNetworkState&&(window.addEventListener("offline",(function(){t.Fi()})),window.addEventListener("online",(function(){t.Ji()})))},t.prototype.Li=function(){var t=this;wx.onNetworkStatusChange((function(i){i.isConnected?t.Ji():t.Fi()}))},t.prototype.Ji=function(){this.logger.info("zn.zca.noh.0 network is online"),this.stateCenter.networkState=f.online,this.Bi&&this.Wi()},t.prototype.Fi=function(){this.logger.info("zn.zca.noh.1 network is broken"),this.stateCenter.networkState=f.offline,this.Bi&&this.Qi()},t.prototype.ki=function(){var t=this;this.stateCenter.useNetAgent&&(this.Ai&&clearTimeout(this.Ai),this.Ai=setTimeout((function(){t.logger.info("zn.zca.clm interval: "+t.linkMsgMaxInterval+" ; start time:"+t.zegoLink.updatedMsgTime),t.qi()}),1e3*this.linkMsgMaxInterval))},t.prototype.Ii=function(){var t=this;this.connectServers.length<=0?this.logger.error(Q+" #### not server url"):(this.zegoLink.setServers(this.connectServers,this.http3Servers,this.wssV6Servers,this.http3V6Servers),this.retryLinkHandler||(this.retryLinkHandler=new ui(this.logger,this.stateCenter)),this.retryLinkHandler.init(),this.retryLinkHandler.initLink(this.zegoLink),this.retryLinkHandler.onactive=function(i,e){e===Bt&&(t.eventManager.emit("disconnected",e),t.Hi((null==e?void 0:e.code)||0),t.netAgentPCRequestMgr.updateConnectState(y.DISCONNECT,O.TIMEOUT,e))},this.retryLinkHandler.onRetryBeyondLimit=function(){t.ji(!0)},this.ji(!0))},t.prototype.ji=function(t,i){void 0===i&&(i=R.single),this.logger.info("zn.cna.cbd call"),this.zegoLink.releaseSocketDetectTask(),this.resetIPDetection();var e=this.getIpConnectRule();this.logger.info("zn.cna.cbd rules "+JSON.stringify(e)),this.stateCenter.retryLevel=i,this.zegoLink.setIpStrategy(e),this.xi(!1,t)},t.prototype.resetIPDetection=function(){this.stateCenter.linkIpStackDetection={IPv4:o.unknown,IPv6:o.unknown},this.stateCenter.ipList={ipv4:[],ipv6:[]},this.stateCenter.clientIP="",this.stateCenter.byPassClientIP="",this.stateCenter.isIpStackDetected=!1,this.zegoLink.Pt=u.noProbe,this.zegoLink.removeSocketServiceEvent()},t.prototype.Ni=function(t){var i=function(t){return function(t){return/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(t)}(t)?n.IPv4:function(t){var i=t.trim().replace(/^$$|$$$/g,"");return/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(:[0-9a-fA-F]{1,4}){1,7}|[0-9a-fA-F]{1,4}(:[0-9a-fA-F]{1,4}){1,7}:|::([0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:)$/.test(i)}(t)?n.IPv6:-1}(t),e=this.stateCenter.ipList,s=e.ipv4,r=e.ipv6;i===n.IPv4?!s.includes(t)&&s.push(t):i===n.IPv6&&!r.includes(t)&&r.push(t)},t.prototype.qi=function(t){var i;this.netHeartBeatHandler&&this.netHeartBeatHandler.stop(),null===(i=this.retryLinkHandler)||void 0===i||i.invalid(),this.zegoLink&&this.zegoLink.destroySocket(_.DISCONNECT,t)},t.prototype.Di=function(){var t=this,i=(new Date).getTime(),e=function(e,n,s){var r,o;if(s)return t.logger.info(Z+" fail "+JSON.stringify(s)),void((null===(o=t.zegoLink.socketService)||void 0===o?void 0:o.type)===c.WebTransport&&t.stateCenter.networkState===f.online&&(t.logger.info(lt+" reason:"+H.GetConfigFailed+" error: get config error "),t.stateCenter.enableHttp3=!1,Lt(t.zegoLink.linkServerStorageKey,t.stateCenter.env,t.stateCenter.appID,((r={})[t.zegoLink.connectServer]={status:!1,time:Date.now()},r),!0),t.ft(H.GetConfigFailed,"get config error")));0===e.code?(t.logger.info(Z+" suc "+JSON.stringify(e)),t.Ki(e,i)):t.logger.info(Z+" fail "+JSON.stringify(e))};this.businessRequestMgr.getConfig(e,e)},t.prototype.Ki=function(t,i){var e,n;if(this.netHeartBeatHandler.init(t),this.netAgentPCRequestMgr.setEstablishTimeout(t.data.pc_establish_timeout),(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.client_outer_ip)&&(this.stateCenter.clientIP=t.data.client_outer_ip,0===this.stateCenter.ipList.ipv4.length&&0===this.stateCenter.ipList.ipv6.length&&(this.stateCenter.clientIP&&this.Ni(this.stateCenter.clientIP),this.eventManager.emit("ipDetection",{ipList:this.stateCenter.ipList}))),null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.ntp_time){var s=t.data.ntp_time,r="number"==typeof s?s:s.toNumber(),o=(new Date).getTime();0===this.stateCenter.appInfo.env&&this.stateCenter.updateNTP(i,r,o)}this.eventManager.emit("clientInfo",{clientIP:this.clientIP,timeOffset:this.timeOffset,geofencingID:t.data.geofencing_id})},t.prototype.yi=function(){var t=this;return new Promise((function(i,e){t.businessRequestMgr.dispatchURL((function(e){var n,s=e.data,r=s.wss_groups,o=s.http3_groups,u=s.wss_v6_groups,a=s.http3_v6_groups;t.logger.info("".concat(nt," wss_groups: ").concat(JSON.stringify(r)," http3_groups:").concat(JSON.stringify(o)," wss_v6_groups:").concat(JSON.stringify(u)," http3_v6_groups:").concat(JSON.stringify(a)));var c=r.some((function(t){return t.host.includes("geo")})),h=o.some((function(t){return t.host.includes("geo")})),f=null==u?void 0:u.some((function(t){return t.host.includes("geo")})),l=null==a?void 0:a.some((function(t){return t.host.includes("geo")})),d=null===(n=t.appInfo)||void 0===n?void 0:n.geoFencing,v=d||c?r:t.Zi(r),m=d||h?o:t.Zi(o),p=d||f?u:t.Zi(u),g=d||l?a:t.Zi(a),b=t.Xi(v),_=t.Xi(m,"https"),y=t.Xi(p),w=t.Xi(g,"https");i({servers:b,http3Servers:_,wssV6Servers:y,http3V6Servers:w,domains:v,http3Domains:m,wssV6Domains:p,http3V6Domains:g})}),(function(t){e(t)}))}))},t.prototype.wi=function(){var t=this;return new Promise((function(i,e){t.businessRequestMgr.getSvrAddr().then((function(n){var s=n.code,r=n.msg,o=n.data;if(0===s){var u=o.accesshub_domain,a=o.logreport_domain,c=o.detaillog_domain,h=o.accesshub_v6_domain,f=o.http3_v6_domain,l=o.logreport_v6_domain,d=o.detaillog_v6_domain,v=o.geofencing_id;t.logger.info("".concat(et," domains: ").concat(u," ").concat(a," ").concat(c," ").concat(h," ").concat(f," ").concat(l," ").concat(d)),i({accesshub_domain:u,logreport_domain:a,detaillog_domain:c,geofencing_id:v,accesshub_v6_domain:h,http3_v6_domain:f,logreport_v6_domain:l,detaillog_v6_domain:d})}else e({code:s,msg:r})})).catch((function(t){e(t)}))}))},t.prototype.Xi=function(t,i){return void 0===i&&(i=Tt.scheme),Array.isArray(t)&&t.length>0?t.map((function(t){return i+"://"+t.host+"/"+Tt.location})):[]},t.prototype.Zi=function(t){var i=gi([],t,!0);return i.filter((function(t){return!!t.host}))},t.prototype.$i=function(t,i,e,n,s,r){var o=this;return new Promise((function(u,a){"string"==typeof i&&"string"==typeof e?o.businessRequestMgr.getAppConfig(t,i,e,n,s,r).then((function(t){u(pi(pi({},t),{retryCount:o.getAppConfigFailCount}))})).catch((function(n){if(o.logger.error(X+" "+JSON.stringify(n)),I.indexOf(n.code)>-1){var r=o.getAppConfigFailCount;return o.getAppConfigFailCount=0,void a(pi(pi({},n),{retryCount:r}))}o.getAppConfigFailCount++,(20008===n.code||1100002===n.code)&&o.getAppConfigFailCount<3?o.$i(t,i,e,s).then((function(t){return u(t)})).catch((function(t){return a(t)})):(r=o.getAppConfigFailCount,o.getAppConfigFailCount=0,a(pi(pi({},n),{retryCount:r})))})):o.logger.error(X+" userID or token must be string")}))},t.prototype.Hi=function(t){var i=(new Date).getTime()-this.connectedTime;this.connectid&&this.eventManager.emit("disConnectedEvent",{duration:i,server:this.zegoLink.connectServer,connectid:this.connectid,code:t})},t.prototype.Ui=function(t){var i=t.wss_groups,e=t.http3_groups,n=t.wss_v6_groups,s=t.http3_v6_groups;this.logger.info("".concat(W," wss_groups: ").concat(JSON.stringify(i)," http3_groups:").concat(JSON.stringify(e)," wss_v6_groups:").concat(JSON.stringify(n)," http3_v6_groups:").concat(JSON.stringify(s)));var r=this.Xi(i),o=this.Xi(e,"https"),u=this.Xi(n),a=this.Xi(s,"https");r&&Array.isArray(r)&&r.length>0?(this.Mi(1100010),this.stateCenter.specified&&(this.logger.info(W+" specified"),r=this.specifiedServers),this.zegoLink.setServers(r,o,u,a),this.xi(!1,!0)):this.logger.warn(W+" wss_groups null")},t.prototype.Gi=function(t){var i=this;switch(this.logger.info(K+" ".concat(t.reason," ").concat(t.msg," ").concat(t.action)),t.action){case S.ACTION_DISPATCH:var e=this.reportSeq++;this.eventManager.emit("dispatchEvent",e,"start"),this.yi().then((function(n){var s=n.servers,r=n.domains,o=n.http3Servers,u=n.http3Domains,a=n.wssV6Servers,c=n.http3V6Servers,h=n.wssV6Domains,f=n.http3V6Domains;if(i.eventManager.emit("dispatchEvent",e,"end",{domains:r.map((function(t){return t.host})),http3Domains:u.map((function(t){return t.host})),wssV6Domains:h.map((function(t){return t.host})),http3V6Domains:f.map((function(t){return t.host})),reason:"ConnectClosed"}),Array.isArray(s)&&s.length>0){i.eventManager.emit("dispatchResultUpdate",{servers:s,http3Servers:o,domains:r.map((function(t){return t.host})),http3Domains:u.map((function(t){return t.host})),wssV6Servers:a,http3V6Servers:c});var l=i.stateCenter.specified?i.specifiedServers:s;i.Mi(t.reason),i.zegoLink.setServers(l,o,a,c),i.xi(!1,!0)}})).catch((function(t){i.logger.info(K+" dispatch fail")}));break;case S.ACTION_IDLE:20020===t.reason&&(this.Mi(t.reason),this.xi(!1));break;case S.ACTION_RETRY:this.Mi(t.reason),this.xi(!1);break;case S.ACTION_NEXT_GROUP:this.netAgentPCRequestMgr.closePCs(t.reason),this.eventManager.emit("broken",k.CLOSE),this.xi()}},t.prototype.Wi=function(){this.retryLinkHandler&&(this.zegoLink.isConnect()?this.retryLinkHandler.stopMaxTime():this.ji(!1,R.detail))},t.prototype.Qi=function(){this.Mi(1100003),this.retryLinkHandler&&(this.retryLinkHandler.invalid(),this.retryLinkHandler.startMaxTime(),this.zegoLink.setState(0))},t.prototype.innerReconnect=function(){this.logger.info($+" call ".concat(!!this.retryLinkHandler)),this.isDestroy?this.logger.info($+" destroy"):this.retryLinkHandler&&(this.retryLinkHandler.startMaxTime(),this.xi())},t.prototype.xi=function(t,i){var e;(null===(e=this.retryLinkHandler)||void 0===e?void 0:e.active(t,i))&&this.tn()},t.prototype.tn=function(){var t=this.reportSeq++;this.connectSeq=t,this.eventManager.emit("connectedEvent",t,"start")},t.prototype.zi=function(t,i){var e,n=this;this.connectedTime=(new Date).getTime(),function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))}(void 0,void 0,void 0,(function(){var t,i,n,s,r,o;return function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((s=(s=o.trys).length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}(this,(function(u){switch(u.label){case 0:t="0123456789".split(""),i=[],e=t.length,n=0,u.label=1;case 1:return n<16?[4,xt()]:[3,4];case 2:s=u.sent(),i[n]=t[0|s*e],u.label=3;case 3:return n++,[3,1];case 4:return[3,9];case 5:r=void 0,i[8]=i[13]=i[18]=i[23]="-",i[14]="4",n=0,u.label=6;case 6:return n<36?i[n]?[3,8]:[4,xt()]:[3,9];case 7:o=u.sent(),r=0|16*o,i[n]=t[19==n?3&r|8:r],u.label=8;case 8:return n++,[3,6];case 9:return[2,i.join("")]}}))})).then((function(e){n.connectid=e,n.eventManager.emit("connectedEvent",n.connectSeq,"end",{servers:t,count:t.length,connectid:n.connectid,connectEvents:i})}))},t.prototype.Mi=function(t,i){void 0===t&&(t=0),this.logger.info("zn.zca.dc.1 call"),this.netAgentPCRequestMgr.closePCs(t,i),this.zegoLink.closeSocket(),this.eventManager.emit("broken"),2===this.lastLinkConnectState&&0===this.linkConnectState&&this.Hi(t)},t.prototype.getNetworkTimeInfo=function(){var t=Date.now()+this.stateCenter.timeOffset,i=Math.round(this.stateCenter.networkRTT/2),e=this.stateCenter.ntpTimeInfo;if(e){var n=performance.now()-e.performanceTime;t=Math.round(e.ntp+n)}return{timestamp:t,maxDeviation:i}},t.prototype.setHeartBeatMode=function(t){var i=this.netHeartBeatHandler.mode;i!==t&&(this.logger.info("zn.shbm"+" change mode from ".concat(i," to ").concat(t)),this.netHeartBeatHandler.mode=t)},t.prototype.setLogLevel=function(t){return this.logger.setLogLevel(t)},t.prototype.getIpConnectRule=function(){var t,i,e=[];if(this.proxyCtrl)e.push(n.IPv4);else{var s=0!==(null===(t=this.connectServers)||void 0===t?void 0:t.length),r=0!==(null===(i=this.wssV6Servers)||void 0===i?void 0:i.length);switch(this.stateCenter.customConfig.ipStackMode){case 0:default:s&&e.push(n.IPv4);break;case 1:s&&e.push(n.IPv4),r&&e.push(n.IPv6);break;case 2:r&&e.push(n.IPv6),s&&e.push(n.IPv4)}0===e.length&&e.push(n.IPv4)}return e},t}()})(),r})(),t.exports=n(e(6994),e(3788))},4883:function(t,i,e){"undefined"!=typeof self&&self,t.exports=function(t,i,e,n,s){return o=[function(t,i,e){Object.defineProperty(i,"__esModule",{value:!0}),i.SETTINGFETCHHANDLER_FETCHSETTING=i.SETTINGCACHEHANDLER_STORE_SETTING=i.SETTINGCACHEHANDLER_GET_CACHE_SETTING_SYNC=i.SETTINGCACHEHANDLER_GET_CACHE_SETTING=i.SETTING_POLLING_SETTING=i.SETTING_GET_CLOUD_SETTING=i.SETTING__FETCH_SETTING=i.SETTING_FETCH_SETTING=i.SETTING_INIT=i.constRUCTOR=void 0,i.constRUCTOR="zs.0",i.SETTING_INIT="zs.ii.0",i.SETTING_FETCH_SETTING="zs.fs.0",i.SETTING__FETCH_SETTING="zs.fs.1",i.SETTING_GET_CLOUD_SETTING="zs.gcs.0",i.SETTING_POLLING_SETTING="zs.ps.0",i.SETTINGCACHEHANDLER_GET_CACHE_SETTING="zs.sch.gcs.0",i.SETTINGCACHEHANDLER_GET_CACHE_SETTING_SYNC="zs.sch.gcss.0",i.SETTINGCACHEHANDLER_STORE_SETTING="zs.sch.ss.0",i.SETTINGFETCHHANDLER_FETCHSETTING="zs.sfh.fs.0"},function(t,i,e){var n=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},s=this&&this.__spread||function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(n(arguments[i]));return t},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},o=(Object.defineProperty(i,"__esModule",{value:!0}),i.decryptStores=i.encryptStores=i.decodeString=i.generateUUID=i.checkValidNumber=i.analyzeKey=i.getCurrentTime=i.getBrowser=void 0,r(e(13))),u=r(e(14));i.getBrowser=function(){var t=window.navigator.userAgent,i=null!=window.ActiveXObject&&-1!=t.indexOf("MSIE"),e=-1!=t.indexOf("Firefox"),n=null!=window.opr,s=t.indexOf("Chrome")&&window.chrome,r=-1!=t.indexOf("Safari")&&-1!=t.indexOf("Version");return t=t.toLowerCase().match(/MicroMessenger/i)&&"micromessenger"===t.toLowerCase().match(/MicroMessenger/i)[0],i?"IE":e?"FIREFOX":n?"OPERA":s?"CHROME":r?"SAFARI":t?"WEIXIN":"UNKOWN"};var a=["00","01","02","03","04","05","06","07","08","09"];i.getCurrentTime=function(){var t=new Date;return[t.getFullYear()+"/",(a[t.getMonth()+1]||t.getMonth()+1)+"/",(a[t.getDate()]||t.getDate())+" ",(a[t.getHours()]||t.getHours())+":",(a[t.getMinutes()]||t.getMinutes())+":",a[t.getSeconds()]||t.getSeconds(),"."+t.getTime()%1e3].join("")},i.analyzeKey=function(t){return t=t.split("_"),{level:Number(t[0]),timestamp:t[1],seq:t[2]}},i.checkValidNumber=function(t,i,e){return i=i||1,e=e||1e4,"number"==typeof t&&t%1==0&&i<=t&&t<=e},i.generateUUID=function(t){if(0===(t=void 0===t?0:t))try{e=localStorage.getItem("z_deviceID")}catch(t){}else wx.getStorageSync("z_deviceID");if(!e){var i=(new Date).getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=(i+16*Math.random())%16|0;return i=Math.floor(i/16),("x"==t?e:3&e|8).toString(36)}));if(0===t)try{localStorage.setItem("z_deviceID",e)}catch(t){}else wx.setStorageSync("z_deviceID",e)}return e},i.decodeString=function(t){return decodeURIComponent(window.escape(String.fromCharCode.apply(String,s(Array.from(t)))))},i.encryptStores=function(t,i){return o.default.encrypt(t,i).toString()},i.decryptStores=function(t,i){try{return o.default.decrypt(t,i).toString(u.default)}catch(t){return""}}},function(t,i,e){Object.defineProperty(i,"__esModule",{value:!0}),i.AUTH_FAIL=i.MULTI_FILE_NOT_EXIST=i.INFLATE_DATA_FAIL=i.FILE_REQUEST_FAIL=i.NOT_INIT=void 0,i.NOT_INIT={code:1001,msg:"not init"},i.FILE_REQUEST_FAIL={code:1002,msg:"fetch request fail"},i.INFLATE_DATA_FAIL={code:1003,msg:"inflate fail"},i.MULTI_FILE_NOT_EXIST={code:1004,msg:"get multi file fail"},i.AUTH_FAIL={code:1005,msg:"auth failed"}},function(t,i,e){Object.defineProperty(i,"__esModule",{value:!0}),e=(e=e(4)).default||e,i.default=e},function(i,e){i.exports=t},function(t,e){t.exports=i},function(t,i,e){Object.defineProperty(i,"__esModule",{value:!0}),i.INIT_CONFIG=void 0,i.INIT_CONFIG={env:0,compress:!0,p_version:1,unify:!0}},function(t,i,e){Object.defineProperty(i,"__esModule",{value:!0}),i.ZegoSetting=void 0;var n=e(8);Object.defineProperty(i,"ZegoSetting",{enumerable:!0,get:function(){return n.ZegoSetting}})},function(t,i,e){var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t}).apply(this,arguments)},s=this&&this.__awaiter||function(t,i,e,n){return new(e=e||Promise)((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):((i=t.value)instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},r=this&&this.__generator||function(t,i){var e,n,s,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o={next:u(0),throw:u(1),return:u(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){var a=[o,u];if(e)throw new TypeError("Generator is already executing.");for(;r;)try{if(e=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,(a=s?[2&a[0],s.value]:a)[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,n=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(s=0<(s=r.trys).length&&s[s.length-1])&&(6===a[0]||2===a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3]))r.label=a[1];else if(6===a[0]&&r.label<s[1])r.label=s[1],s=a;else{if(!(s&&r.label<s[2])){s[2]&&r.ops.pop(),r.trys.pop();continue}r.label=s[2],r.ops.push(a)}}a=i.call(t,r)}catch(u){a=[6,u],n=0}finally{e=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}},o=(Object.defineProperty(i,"__esModule",{value:!0}),i.ZegoSetting=void 0,e(2)),u=e(9),a=e(10),c=e(11),h=e(15),f=e(6),l=e(1),d=e(0);function v(){this.u=[],this.h={},this.v={},this.g=null,this._=300,this.O=!1,this.j=0,this.S=!1,this.log=new a.ZegoLog}Object.defineProperty(v.prototype,"envVariable",{get:function(){return Object.assign({},this.h,this.v)},enumerable:!1,configurable:!0}),v.prototype.init=function(t){var i,e=this;return t.pollingFreq&&!l.checkValidNumber(t.pollingFreq)?(this.log.error(d.SETTING_INIT+" pollingFreq must be integer number"),!1):t.inflate?(this.D=Object.assign({},f.INIT_CONFIG,t),this.N(),this.I=new h.SettingFetchHandler(this.D,this.log),this.I.setDataReport(this.D.reportNotify),t=Math.round(60*Math.random()),this.log.info(d.SETTING_INIT+" delay "+t),this.M&&(clearTimeout(this.M),this.M=null),this.D.pollingFreq&&60<=this.D.pollingFreq&&(this._=this.D.pollingFreq),this.M=setTimeout((function(){e.T(1e3*e._,!1)}),1e3*t),this.R=new c.SettingCacheHandler("setting_"+(this.D.online?"online_":"test_")+(t=this.D.product||this.D.productNum)+"_"+this.D.appID,this.log,this.D),[0,1,2,3,4,5].includes(t)&&(i=u.ProductMap[t])&&(1===t&&this.R.dropOldStore("setting_"+(this.D.online?"online_":"test_")+"undefined_"+this.D.appID),this.R.dropOldStore("setting_"+(this.D.online?"online_":"test_")+i+"_"+this.D.appID)),null!=(t=this.D)&&t.unify&&this.D.connection&&null!=(t=null==(i=this.D)?void 0:i.connection)&&t.on("connected",(function(){e.I.checkUnSendMsgs(e.I.unSendCommandList)})),this.C(),this.O=!0):(this.log.error(d.SETTING_INIT+" need input pako inflate function"),!1)},v.prototype.uninit=function(){this.g&&(clearTimeout(this.g),this.g=null)},v.prototype.setEnvVariable=function(t,i){this.v[t]=String(i)},v.prototype.getEnvVariable=function(t){return this.envVariable[t]},v.prototype.setEnvVariables=function(t){var i=this;Object.keys(t).forEach((function(e){"string"!=typeof t[e]&&"number"!=typeof t[e]&&i.log.error("zs.sev env "+e+" type error"),i.v[e]=String(t[e])}))},v.prototype.getEnvVariables=function(){return this.envVariable},v.prototype.enablePolling=function(t,i){var e=this;i?i.forEach((function(i){var n=e.u.find((function(t){return t.fileName===i}));n&&(n.needPolling=t)})):this.u.forEach((function(i){return i.needPolling=t}))},v.prototype.setToken=function(t){this.P!==t&&this.C(),this.P=t},v.prototype.setUserID=function(t){this.q!==t&&this.C(),this.q=t},v.prototype.getSettingCache=function(t){return s(this,void 0,void 0,(function(){var i,e;return r(this,(function(n){switch(n.label){case 0:return this.O?(i=this.u.find((function(i){return i.fileName===t})))?[2,Promise.resolve({setting:i.setting,versions:i.versions})]:[3,1]:[2,Promise.reject(o.NOT_INIT)];case 1:return[4,this.R.getCacheSetting(t)];case 2:return(i=n.sent())&&(this.u.find((function(i){return i.fileName===t}))||this.u.push({fileName:t,fetchedTime:0,needPolling:!1,setting:i.setting,versions:i.versions}),e={setting:i.setting,versions:i.versions}),[2,Promise.resolve(e)]}}))}))},v.prototype.fetchSetting=function(t,i,e){return void 0===i&&(i={}),void 0===e&&(e=!0),this.log.info(d.SETTING_FETCH_SETTING+" call "+t),this.O?(this.activePolling(),0<Object.keys(i).length?(this.log.info(d.SETTING_FETCH_SETTING+" get file with params"),this.k(t,n(n({},this.envVariable),i))):(i=this.u.find((function(i){return i.fileName===t})))?(this.log.info(d.SETTING_FETCH_SETTING+" file exist"),(new Date).getTime()-i.fetchedTime<1e3*this._?(this.log.info(d.SETTING_FETCH_SETTING+" fetch time interval in freq"),i.needPolling=e,Promise.resolve({setting:i.setting,versions:i.versions})):this.A(t,i,e)):(this.log.info(d.SETTING_FETCH_SETTING+" file not found"),this.A(t,i,e))):Promise.reject(o.NOT_INIT)},v.prototype.fetchMultiSetting=function(t,i,e){var u=this;return void 0===i&&(i={}),void 0===e&&(e=!0),this.log.info(d.SETTING_FETCH_SETTING+" call "+JSON.stringify(t)),this.O?(this.activePolling(),0<Object.keys(i).length?(this.log.info(d.SETTING_FETCH_SETTING+" get file with params"),this.k(t,n(n({},this.envVariable),i))):new Promise((function(i,n){var o={},a=[];if(t.forEach((function(t){return s(u,void 0,void 0,(function(){var i;return r(this,(function(e){return(i=this.u.find((function(i){return i.fileName===t})))&&(new Date).getTime()-i.fetchedTime<1e3*this._?(this.log.info(d.SETTING_FETCH_SETTING+" fetch time interval in freq"),o[t]={setting:i.setting,versions:i.versions}):a.push(t),[2]}))}))})),!(0<a.length))return i(o);u.k(a,u.envVariable).then((function(t){return u.J(t,e),Object.assign(o,t),i(o)})).catch((function(t){a.forEach((function(t){return s(u,void 0,void 0,(function(){var i;return r(this,(function(n){switch(n.label){case 0:return(i=this.u.find((function(i){return i.fileName==t})))?i.fetchedTime=(new Date).getTime():this.u.find((function(i){return i.fileName===t}))||this.u.push({fileName:t,fetchedTime:(new Date).getTime(),needPolling:e,setting:{},versions:{}}),[4,this.R.getCacheSetting(t)];case 1:return i=n.sent(),o[t]={setting:i.setting,versions:i.versions},[2]}}))}))})),0<Object.keys(o).length?i(o):n(t)}))}))):(this.log.info(d.SETTING_FETCH_SETTING+" not init"),Promise.reject(o.NOT_INIT))},v.prototype.setOptions=function(t){t&&"boolean"==typeof t.unify&&(this.D.unify=t.unify,this.I.setOptions(this.D))},v.prototype.setLog=function(t){this.log=t},v.prototype.k=function(t,i){var e=this;return new Promise((function(n,u){return s(e,void 0,void 0,(function(){var e,s,a,c,h,f,l,v,m,p=this;return r(this,(function(r){switch(r.label){case 0:if(r.trys.push([0,6,,7]),this.S)return this.log.warn(d.SETTING_GET_CLOUD_SETTING+" check fail"),u(o.AUTH_FAIL),[2];s=(e=t instanceof Array)?t:[t],a=[],c={},h=function(t){return t=t.map((function(t){return p.R.getCacheSetting(t)})),Promise.all(t)},r.label=1;case 1:return r.trys.push([1,3,,4]),[4,h(s)];case 2:return f=r.sent(),s.forEach((function(t,i){var e;a.push({file_name:t,hash:null==(e=f[i].versions)?void 0:e.hash,g_version:null==(e=f[i].versions)?void 0:e.g_version}),c[t]=f[i]})),[3,4];case 3:return r.sent(),s.forEach((function(t){a.push({file_name:t})})),[3,4];case 4:return[4,this.I.fetchSetting(a,i,this.P,this.q,!1)];case 5:return m=r.sent(),l=m.data,m=m.polling_interval,this.j=0,this.log.info(d.SETTING_GET_CLOUD_SETTING+" suc"),"number"==typeof m&&5<=m&&this._!==60*m&&(this.log.warn(d.SETTING_GET_CLOUD_SETTING+" polling interval change"),this._=60*m,this.uninit(),this.activePolling()),e?(v={},t.forEach((function(t){var i;0==(null==(i=l[t])?void 0:i.code)&&(l[t].hashChange?(p.log.info(d.SETTING_GET_CLOUD_SETTING+" file "+t+" changed"),v[t]={setting:null==(i=l[t])?void 0:i.data,versions:null==(i=l[t])?void 0:i.versions}):c[t]&&(v[t]={setting:null==(i=c[t])?void 0:i.setting,versions:null==(i=c[t])?void 0:i.versions}))})),0<Object.keys(v).length?n(v):u(o.MULTI_FILE_NOT_EXIST)):0===(null==(m=l[t])?void 0:m.code)&&null!=(m=l[t])&&m.data?n({setting:null==(m=l[t])?void 0:m.data,versions:null==(m=l[t])?void 0:m.versions}):u({code:null==(m=l[t])?void 0:m.code,msg:null==(m=l[t])?void 0:m.message}),[3,7];case 6:return m=r.sent(),this.log.error(d.SETTING_GET_CLOUD_SETTING+" fail "+JSON.stringify(m)),21002!==(null==m?void 0:m.code)&&401!==(null==m?void 0:m.status_code)||(this.j+=1),2<=this.j&&(this.S=!0),u(m),[3,7];case 7:return[2]}}))}))}))},v.prototype.J=function(t,i){var e=this;Object.keys(t).forEach((function(n){var s=((s=e.u.find((function(t){return t.fileName==n})))?(s.fetchedTime=(new Date).getTime(),s.setting=t[n].setting,s.versions=t[n].versions,s.needPolling=i):e.u.find((function(t){return t.fileName===n}))||e.u.push({fileName:n,fetchedTime:(new Date).getTime(),needPolling:i,setting:t[n].setting,versions:t[n].versions}),n);e.R.storeSetting(s,t[n])}))},v.prototype.A=function(t,i,e){var n=this;return new Promise((function(o,u){n.log.info(d.SETTING__FETCH_SETTING+" call"),n.k(t,n.envVariable).then((function(s){i?(i.fetchedTime=(new Date).getTime(),i.setting=s.setting,i.versions=s.versions,i.needPolling=e):n.u.find((function(i){return i.fileName===t}))||n.u.push({fileName:t,fetchedTime:(new Date).getTime(),needPolling:e,setting:s.setting,versions:s.versions}),n.R.storeSetting(t,s),o(s),n.log.info(d.SETTING__FETCH_SETTING+" call suc")})).catch((function(a){return s(n,void 0,void 0,(function(){var n,s;return r(this,(function(r){switch(r.label){case 0:i?i.fetchedTime=(new Date).getTime():this.u.find((function(i){return i.fileName===t}))||this.u.push({fileName:t,fetchedTime:(new Date).getTime(),needPolling:e,setting:{},versions:{}}),n=t,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.R.getCacheSetting(n)];case 2:return s=r.sent(),o(s),[3,4];case 3:return r.sent(),u(a),[3,4];case 4:return this.log.info(d.SETTING__FETCH_SETTING+" setting not contain or fetch file fail"),[2]}}))}))}))}))},v.prototype.N=function(){var t;0==this.D.env?(this.h.userAgent=navigator.userAgent,this.h.platform=navigator.platform,this.h.browser=l.getBrowser(),this.h.deviceid=l.generateUUID()):1==this.D.env&&(t=wx.getSystemInfoSync(),this.h.brand=t.brand,this.h.model=t.model,this.h.system=t.system,this.h.platform=t.platform,this.h.wechatVersion=t.version,this.h.wechatSDKVersion=t.SDKVersion,this.h.deviceid=l.generateUUID(this.D.env))},v.prototype.T=function(t,i){return void 0===i&&(i=!0),s(this,void 0,void 0,(function(){var e,n,o,u,a=this;return r(this,(function(c){switch(c.label){case 0:if(this.log.info(d.SETTING_POLLING_SETTING+" call "+t+" "+i),e=t,i){if(n=[],this.u.forEach((function(t){t.needPolling&&n.push({file_name:t.fileName,hash:t.versions.hash,g_version:t.versions.g_version})})),!this.S)return[3,1];this.log.warn(d.SETTING_GET_CLOUD_SETTING+" has checked fail")}return[3,7];case 1:if(!(0<n.length))return[3,6];c.label=2;case 2:return c.trys.push([2,4,,5]),[4,this.I.fetchSetting(n,this.envVariable,this.P,this.q)];case 3:return u=c.sent(),o=u.data,u=u.polling_interval,this.log.info(d.SETTING_POLLING_SETTING+" fetch suc"),this.j=0,"number"==typeof u&&5<=u&&this._!==60*u&&(this.log.warn(d.SETTING_POLLING_SETTING+" polling interval change"),this._=60*u,e=1e3*this._),this.u.forEach((function(t){return s(a,void 0,void 0,(function(){var i,e,n,s,u,a,c,h,f;return r(this,(function(r){switch(r.label){case 0:return t.fetchedTime=(new Date).getTime(),i=t.fileName,f=(s=o[t.fileName]).code,c=s.data,h=s.versions,e=s.message,n=s.hashChange,s&&0===f&&c?(s=JSON.stringify(c),u=JSON.stringify(t.setting),a={setting:c,versions:h,code:f,message:e},n&&u!==s&&(this.log.info(d.SETTING_POLLING_SETTING+" "+t.fileName+" setting changed"),t.setting=a.setting,t.versions=a.versions,this.D.pollingNotify(t.fileName,a)),[4,this.R.getCacheSetting(i)]):[3,2];case 1:c=r.sent(),h=JSON.stringify(c),f=JSON.stringify(a),n&&h!==f&&this.R.storeSetting(i,a),r.label=2;case 2:return[2]}}))}))})),[3,5];case 4:return u=c.sent(),this.log.error(d.SETTING_POLLING_SETTING+" fetch fail "+JSON.stringify(u)),21002!==(null==u?void 0:u.code)&&401!==(null==u?void 0:u.status_code)||(this.j+=1),2<=this.j&&(this.S=!0),[3,5];case 5:return[3,7];case 6:this.log.info(d.SETTING_POLLING_SETTING+" polling no file"),c.label=7;case 7:return this.g&&clearTimeout(this.g),this.g=setTimeout((function(){a.T(e)}),e),[2]}}))}))},v.prototype.activePolling=function(){this.g||this.T(1e3*this._)},v.prototype.C=function(){this.j=0,this.S=!1},i.ZegoSetting=v},function(t,i,e){var n;Object.defineProperty(i,"__esModule",{value:!0}),i.ProductMap=i.Product=i.SOCKET_DISCONNECT=i.ENUM_REMOTE_TYPE=i.ZEGO_BROWSER_TYPE=i.ZEGO_ENV=i.PROTO_VERSION=void 0,i.PROTO_VERSION="1.1.7",(n=i.ZEGO_ENV||(i.ZEGO_ENV={}))[n.BROWSER=0]="BROWSER",n[n.WEIXINMINI=1]="WEIXINMINI",(n=i.ZEGO_BROWSER_TYPE||(i.ZEGO_BROWSER_TYPE={}))[n.IE=0]="IE",n[n.FIREFOX=1]="FIREFOX",n[n.CHROME=2]="CHROME",n[n.SAFARI=3]="SAFARI",n[n.OPERA=4]="OPERA",n[n.WEIXIN=5]="WEIXIN",n[n.WEIXINMINI=6]="WEIXINMINI",n[n.UNKOWN=7]="UNKOWN",(n=i.ENUM_REMOTE_TYPE||(i.ENUM_REMOTE_TYPE={}))[n.DISABLE=0]="DISABLE",n[n.WEBSOCKET=1]="WEBSOCKET",n[n.HTTPS=2]="HTTPS",i.SOCKET_DISCONNECT=-1,(n=i.Product||(i.Product={}))[n.RTC=0]="RTC",n[n.WEB_RTC=1]="WEB_RTC",n[n.ZIM=2]="ZIM",n[n.ROOM_KIT=3]="ROOM_KIT",n[n.DOC_SHARE=4]="DOC_SHARE",n[n.WHITE_BOARD=5]="WHITE_BOARD",n[n.SELF_CHECK=999]="SELF_CHECK",n[n.TEST_ANOOUS=1e3]="TEST_ANOOUS",i.ProductMap={0:"rtc_sdk_native",1:"Web_SDK",2:"ZIM",3:"roomkitWeb",4:"docsshare",5:"WhiteBoard"}},function(t,i,e){function n(){}Object.defineProperty(i,"__esModule",{value:!0}),i.ZegoLog=void 0,n.prototype.log=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join(" ");console.log(e)},n.prototype.debug=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join(" ");console.debug(e)},n.prototype.info=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join(" ");console.info(e)},n.prototype.warn=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join(" ");console.warn(e)},n.prototype.error=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join(" ");console.error(e)},i.ZegoLog=n},function(t,i,e){var n=this&&this.__awaiter||function(t,i,e,n){return new(e=e||Promise)((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):((i=t.value)instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},s=this&&this.__generator||function(t,i){var e,n,s,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o={next:u(0),throw:u(1),return:u(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){var a=[o,u];if(e)throw new TypeError("Generator is already executing.");for(;r;)try{if(e=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,(a=s?[2&a[0],s.value]:a)[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,n=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(s=0<(s=r.trys).length&&s[s.length-1])&&(6===a[0]||2===a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3]))r.label=a[1];else if(6===a[0]&&r.label<s[1])r.label=s[1],s=a;else{if(!(s&&r.label<s[2])){s[2]&&r.ops.pop(),r.trys.pop();continue}r.label=s[2],r.ops.push(a)}}a=i.call(t,r)}catch(u){a=[6,u],n=0}finally{e=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},o=(Object.defineProperty(i,"__esModule",{value:!0}),i.SettingCacheHandler=void 0,r(e(12))),u=e(0),a=e(1),c="0c9e6e0f8c0a8f4e";function h(t,i,e){this._storeName=t,this._log=i}h.prototype.getStore=function(){this.store||(this.store=o.default.createInstance({name:this._storeName}))},h.prototype.getCacheSetting=function(t){return n(this,void 0,void 0,(function(){var i,e;return s(this,(function(n){switch(n.label){case 0:if(this._log.info(u.SETTINGCACHEHANDLER_GET_CACHE_SETTING+" call "+t),i=void 0,!(e=localStorage.getItem(this._storeName+"_"+t)))return[3,1];if(e=a.decryptStores(e,c))try{i=JSON.parse(e),this._log.info(u.SETTINGCACHEHANDLER_GET_CACHE_SETTING_SYNC+" res "+t)}catch(n){this._log.info(u.SETTINGCACHEHANDLER_GET_CACHE_SETTING_SYNC+" fail "+t+" "+(null==n?void 0:n.message))}return[3,3];case 1:return this._log.info(u.SETTINGCACHEHANDLER_GET_CACHE_SETTING+" get cache from db "+t),this.getStore(),[4,this.store.getItem(t)];case 2:i=n.sent(),n.label=3;case 3:return this._log.info(u.SETTINGCACHEHANDLER_GET_CACHE_SETTING+" res "+t),[2,i]}}))}))},h.prototype.storeSetting=function(t,i){return n(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:this._log.info(u.SETTINGCACHEHANDLER_STORE_SETTING+" call "+t),n.label=1;case 1:return n.trys.push([1,2,,4]),e=JSON.stringify(i),e=a.encryptStores(e,c),localStorage.setItem(this._storeName+"_"+t,e),[3,4];case 2:return e=n.sent(),this._log.info(u.SETTINGCACHEHANDLER_STORE_SETTING+" fail "+t+" "+(null==e?void 0:e.message)),localStorage.removeItem(this._storeName+"_"+t),this._log.info(u.SETTINGCACHEHANDLER_STORE_SETTING+" set data to db "+t),this.getStore(),[4,this.store.setItem(t,i)];case 3:return n.sent(),[3,4];case 4:return[2]}}))}))},h.prototype.dropOldStore=function(t){o.default.dropInstance({name:t}).then((function(){console.debug("Dropped ",t)})).catch((function(t){console.warn(t)}))},i.SettingCacheHandler=h},function(t,i){t.exports=e},function(t,i){t.exports=n},function(t,i){t.exports=s},function(t,i,e){var n,s,r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t}).apply(this,arguments)},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},u=(Object.defineProperty(i,"__esModule",{value:!0}),i.SettingFetchHandler=void 0,e(16)),a=e(1),c=e(17),h=e(6),f=o(e(3)),l=e(0),d=e(2);function v(t,i){this._options=t,this._log=i,this.seq=0,this.userID="",this.unSendCommandList=new u.LinkedList,this.testNetPackageSize=!1,this.protobuf=new c.CloudSettingProtoBuf}(n=n||{})[n.SERVICE_ClOUD_SETTING=10]="SERVICE_ClOUD_SETTING",(o=s=s||{})[o.METHOD_UNSET=0]="METHOD_UNSET",o[o.METHOD_GET=1]="METHOD_GET",o[o.METHOD_POST=2]="METHOD_POST",v.prototype.setOptions=function(t){this._options=t},v.prototype.setDataReport=function(t){this.W=t},v.prototype.setUserID=function(t){this.userID=t},v.prototype.fetchSetting=function(t,i,e,n,s){var o=this;return void 0===s&&(s=!0),new Promise((function(u,c){function f(t){var i,e=t.code,n=t.data,r=t.polling_interval;t=t.reportData,o._log.info(l.SETTINGFETCHHANDLER_FETCHSETTING+" suc "+e),n&&(i=[],Object.keys(n).forEach((function(t){var e;i.push({name:t,code:n[t].code,message:null==(e=n[t])?void 0:e.message,versions:JSON.stringify(null==(e=n[t])?void 0:e.versions),content:JSON.stringify(null==(e=n[t])?void 0:e.data)})}))),o.W&&o.W(g,"request_end",{code:e,reportData:t,params:p,requestKV:m,files:i,polling:s}),u({data:n,polling_interval:r})}function d(t){var i=t.code,e=t.msg,n=t.status_code;t=t.reportData,o._log.warn(l.SETTINGFETCHHANDLER_FETCHSETTING+" fail "+i),o.W&&o.W(g,"request_end",{code:i,params:p,requestKV:m,reportData:t,polling:s}),c({code:i,msg:e,status_code:n})}var v={product:o._options.product,files:t.map((function(t){return t.file_name})),param:r(r({},i),{deviceid:void 0}),appid:o._options.appID,token:e,id_name:n,timestamp:(new Date).getTime(),biztype:0,deviceid:i.deviceid||a.generateUUID(o._options.env),compress:!1,mode:o._options.online?"online":"test"},m=v.param,p={appid:v.appid,token:v.token,id_name:v.id_name,deviceid:v.deviceid},g=o.seq++;if(o.W&&o.W(g,"request_start",{polling:s}),!o._options.connection)throw Error("connection required");if(void 0!==o._options.productNum){var b,_=[];for(b in v.param)void 0!==v.param[b]&&_.push({key:b,value:v.param[b]});var y={product:o._options.productNum,response_compress:h.INIT_CONFIG.compress?0:1,files:t,param_list:_,p_version:h.INIT_CONFIG.p_version},w=(o._log.info(l.SETTINGFETCHHANDLER_FETCHSETTING+" files "+JSON.stringify(y.files)+" compress "+y.response_compress),o._options.online?1:2);o.sendCloudPBRequest(n,y,e,w,f,d)}else o.sendCloudRequest(n,v,"/cloud-setting/get",(function(t){f(t)}),(function(t){d(t)}))}))},v.prototype.sendCloudRequest=function(t,i,e,o,u,a,c){var h=this,f=(void 0===a&&(a=3),void 0===c&&(c=[]),(new Date).getTime());this.sendNetAgentHttpRequest({service:n.SERVICE_ClOUD_SETTING,body:i,ack:!1,idName:t,method_no:s.METHOD_POST,location:e},(function(n){var s,l,v,m,p;200===(null==n?void 0:n.status_code)?(s=(m=JSON.parse(n.body)).code,l=m.message,v=m.data,m=m.polling_interval,p=(new Date).getTime()-f,c.push({timestamp:f,url:e,error:s,duration:p}),0===s?o({code:s,msg:l,data:v,polling_interval:m,reportData:c}):u({code:s,msg:l,reportData:c})):(p=(new Date).getTime()-f,c.push({timestamp:f,url:e,error:null==n?void 0:n.status_code,duration:p}),0<a?(a--,h.sendCloudRequest(t,i,e,o,u,a,c)):u(r(r({},d.FILE_REQUEST_FAIL),{reportData:c})))}),(function(n){var s=(new Date).getTime()-f;c.push({timestamp:f,url:e,error:n.code,duration:s}),0<a?(a--,h.sendCloudRequest(t,i,e,o,u,a,c)):u(r(r({},d.FILE_REQUEST_FAIL),{reportData:c}))}),null,{timeout:4e3})},v.prototype.sendNetAgentHttpRequest=function(t,i,e,n,s){t={param:t,suc:i,err:e,ack:n,option:s},null!=(i=this._options.connection)&&i.isConnect()?this.sendNetUintData(t):this.unSendCommandList.push(t)},v.prototype.sendNetUintData=function(t){var i;null!=(i=this._options.connection)&&i.startHttpRequest(t.param,t.suc,t.err,t.ack,t.option)},v.prototype.checkUnSendMsgs=function(t){for(var i=t.getFirst();null!=i;)t.remove(i),i._data&&i._data.param&&this.sendNetUintData(i._data),i=t.getFirst()},v.prototype.sendCloudPBRequest=function(t,i,e,n,o,u,c,h){var v,m=this,p=(void 0===c&&(c=3),void 0===h&&(h=[]),(new Date).getTime()),g=this.protobuf.encodeCloudSettingReq(i);null!=(v=this._options.connection)&&v.startHttpRequest2({interfaceID:14,body:g,ack:!1,idName:t,method:s.METHOD_POST,token:e,mode:n,reduceRspHeaders:!0},(function(s,v){if(200===(null==s?void 0:s.status_code)){var g=m.protobuf.decodeCloudSettingRsp(s.body),b=g.message,_=g.polling_interval,y=g.code||0,w=(f.default.isLong(y)&&(y=y.toNumber()),(new Date).getTime()-p);if(h.push({timestamp:p,error:y,duration:w}),0===y){for(var S={},E=0;E<g.file_response.length;E++){var O=(N=g.file_response[E]).message,T=N.file_name,k=N.hash,R=N.g_version,I=N.json_data,N=(m._log.info(l.SETTINGFETCHHANDLER_FETCHSETTING+" file rsp "+T+" "+R+" "+k.toString()),N.code||0),C=(f.default.isLong(N)&&(N=N.toNumber()),{});if(0<(null==k?void 0:k.byteLength)&&0<(null==I?void 0:I.byteLength))try{var z=0===i.response_compress?m._options.inflate(I,{to:"string"}):a.decodeString(I);C=JSON.parse(z)}catch(s){m._log.info(l.SETTINGFETCHHANDLER_FETCHSETTING+" decode fail "+(null==s?void 0:s.message)?s.message:JSON.stringify(s))}S[T]={code:N,message:O,versions:{hash:k,g_version:R},data:C,hashChange:0===k.byteLength?0:1}}o({code:y,msg:b,data:S,polling_interval:_,reportData:h})}else u({code:y,msg:b,reportData:h})}else w=(new Date).getTime()-p,h.push({timestamp:p,error:null==s?void 0:s.status_code,duration:w}),0<c?(c--,m.sendCloudPBRequest(t,i,e,n,o,u,c,h)):u(r(r({},d.FILE_REQUEST_FAIL),{reportData:h,status_code:null==s?void 0:s.status_code}))}),(function(s){var a=(new Date).getTime()-p;h.push({timestamp:p,error:s.code,duration:a}),0<c?(c--,m.sendCloudPBRequest(t,i,e,n,o,u,c,h)):u(r(r({},d.FILE_REQUEST_FAIL),{reportData:h,status_code:null==s?void 0:s.status_code}))}),null,{timeout:4e3,extras:{protoCmd:"GetCloudSettingConfigRequest"}})},i.SettingFetchHandler=e=v},function(t,i,e){Object.defineProperty(i,"__esModule",{value:!0}),i.LinkedList=i.ListNode=void 0,Object.defineProperty(s.prototype,"id",{get:function(){return this._id||null},set:function(t){this._id=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t},enumerable:!1,configurable:!0}),s.prototype.hasNext=function(){return this.next&&this.next.id},s.prototype.hasPrev=function(){return this.prev&&this.prev.id};var n=s;function s(t,i){void 0===t&&(t=null),void 0===i&&(i=null),this.next=null,this.prev=null,this._id=t,this._data=i}function r(){this.start=new n,this.end=new n,this._idCounter=0,this._numNodes=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}i.ListNode=n,r.prototype.insertBefore=function(t,i){return(i=new n(this._idCounter,i)).next=t,i.prev=t.prev,t.prev&&(t.prev.next=i),t.prev=i,++this._idCounter,++this._numNodes,i},r.prototype.addLast=function(t){return this.insertBefore(this.end,t)},r.prototype.add=function(t){return this.addLast(t)},r.prototype.getFirst=function(){return 0===this._numNodes?null:this.start.next},r.prototype.getLast=function(){return 0===this._numNodes?null:this.end.prev},r.prototype.size=function(){return this._numNodes},r.prototype.getFromFirst=function(t){var i=0,e=this.start.next;if(0<=t)for(;i<t&&null!==e;)e=e.next,++i;else e=null;if(null===e)throw"Index out of bounds.";return e},r.prototype.get=function(t){return 0===t?this.getFirst():t===this._numNodes-1?this.getLast():this.getFromFirst(t)},r.prototype.remove=function(t){return t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),--this._numNodes,t},r.prototype.removeFirst=function(){var t=null;return 0<this._numNodes&&this.start.next?this.remove(this.start.next):t},r.prototype.removeLast=function(){var t=null;return 0<this._numNodes&&this.end.prev?this.remove(this.end.prev):t},r.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this._numNodes=0,this._idCounter=0},r.prototype.each=function(t){for(var i=this.start;i.hasNext();)t(i=i.next)},r.prototype.find=function(t){for(var i=this.start,e=!1,n=null;i.hasNext()&&!e;)t(i=i.next)&&(n=i,e=!0);return n},r.prototype.map=function(t){for(var i=this.start,e=[];i.hasNext();)t(i=i.next)&&e.push(i);return e},r.prototype.push=function(t){return this.addLast(t)},r.prototype.unshift=function(t){this.insertBefore(0<this._numNodes?this.start.next:this.end,t)},r.prototype.pop=function(){return this.removeLast()},r.prototype.shift=function(){return this.removeFirst()},i.LinkedList=r},function(t,i,e){var n=this&&this.__createBinding||(Object.create?function(t,i,e,n){void 0===n&&(n=e),Object.defineProperty(t,n,{enumerable:!0,get:function(){return i[e]}})}:function(t,i,e,n){t[n=void 0===n?e:n]=i[e]}),s=this&&this.__setModuleDefault||(Object.create?function(t,i){Object.defineProperty(t,"default",{enumerable:!0,value:i})}:function(t,i){t.default=i}),r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)"default"!==e&&Object.hasOwnProperty.call(t,e)&&n(i,t,e);return s(i,t),i},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},u=(Object.defineProperty(i,"__esModule",{value:!0}),i.CloudSettingProtoBuf=void 0,o(e(3))),a=(r=r(e(5)),o(e(18)).default.cloudsetting);function c(){}r.util.Long=u.default,r.configure(),c.prototype.encodeCloudSettingReq=function(t){var i=a.GetCloudSettingConfigRequest;return t=i.create(t),i.encode(t).finish()},c.prototype.decodeCloudSettingRsp=function(t){return a.GetCloudSettingConfigResponse.decode(t)},i.CloudSettingProtoBuf=c},function(t,i,e){e.r(i);var n=e(5);e=e(4),(n=n.default||n).util.Long=e.default||e;let s=n.util.Long.fromBits||function(){return 0};for(var r=n.roots,o=n.types?n.types.basic:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0,string:2,bytes:2},u=n.types?n.types.packed:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0},a=Object.keys(o),c={$:function(t){return c[t]?c[t].call(this):r[t].decode?r[t].decode(this,this.uint32()):c.$.call(this,"int32")}},h={$:function(t,i,e){var n=o[t];return void 0===n?r[t].encode?(this.uint32(e<<3|2).fork(),r[t].encode(i,this).ldelim()):h.$.call(this,"int32",i,e):h[t].call(this.uint32(e<<3|n),i)}},f=0;f<a.length;f++)c[a[f]]=n.Reader.prototype[a[f]],h[a[f]]=n.Writer.prototype[a[f]];!function t(i,e,a,f){for(var l=0,d=Object.keys(i);l<d.length;l++){var v=d[l];if(i[v].$m&&Object.keys(i[v].$m).every((function(t){return Number(t)}))){if(a[v])throw Error(`nested type ${a}.${v} has already exist`);a[v]=((i,a)=>{function f(t){for(var e in i)"{"===(e=i[e])[1].charAt(0)?this[e[0]]={}:"["!==e[1].charAt(0)&&"<"!==e[1].charAt(0)||(this[e[0]]=[]);if(t)for(var n=Object.keys(t),s=0;s<n.length;++s)null!=t[n[s]]&&(this[n[s]]=t[n[s]])}var l,d={};for(l in i){var v=i[l],m=v[1];"{"===m.charAt(0)?(f.prototype[v[0]]=n.util.emptyObject,d[m]={$m:m.substring(1).split(",").map((function(t,i){return["$"+(i+1),t,null]})).reduce((function(t,i,e){return t[e+1]=i,t}),{})}):f.prototype[v[0]]="["===m.charAt(0)||"<"===m.charAt(0)?n.util.emptyArray:"bytes"===m?n.util.newBuffer([]):v[2]&&v[2].hasOwnProperty("low")&&v[2].hasOwnProperty("high")?s(v[2].low,v[2].high,v[2].unsigned):v[2]}return f.create=function(t){return new f(t)},f.decode=function(t,e){t instanceof n.Reader||(t=n.Reader.create(t));for(var s=void 0===e?t.len:t.pos+e,o=new f;t.pos<s;){var a=t.uint32();if(0<(d=a>>>3)&&i[d]){var h=i[d][0];if("{"===(l=i[d][1]).charAt(0))o[h]===n.util.emptyObject&&(o[h]={}),d=f.$namespace[l].decode(t,t.uint32()),o[h][d.$1]=d.$2;else if("["===l.charAt(0)||"<"===l.charAt(0)){l=l.substring(1),o[h]&&o[h].length||(o[h]=[]);var l,d=!c[l]&&!r[l].decode;if(void 0!==u[l=d?"int32":l]&&2==(7&a))for(var v=t.uint32()+t.pos;t.pos<v;)o[h].push(c.$.call(t,l));else o[h].push(c.$.call(t,l))}else o[h]=c.$.call(t,l)}else t.skipType(7&a)}return o},f.encode=function(t,e){for(var s in e=e||n.Writer.create(),i){var a=i[s][0];if("{"===(m=i[s][1]).charAt(0)){if(null!=t[a]&&t.hasOwnProperty(a))for(var c=0,l=Object.keys(t[a]);c<l.length;++c)e.uint32(s<<3|2).fork(),f.$namespace[m].encode({$1:l[c],$2:t[a][l[c]]},e).ldelim()}else if("["===m.charAt(0)||"<"===m.charAt(0)){var d="<"===m.charAt(0),v=(m=m.substring(1),t[a]);if(null!=v&&v.length){var m=void 0!==o[m]||r[m].encode?m:"int32";if(d&&void 0!==u[m]){for(e.uint32(s<<3|2).fork(),c=0;c<v.length;c++)h[m].call(e,v[c]);e.ldelim()}else for(c=0;c<v.length;c++)h.$.call(e,m,v[c],s)}}else null!=t[a]&&t.hasOwnProperty(a)&&h.$.call(e,m,t[a],s)}return e},Object.keys(d).length&&(f.$namespace=t(d,e+"."+a,f.$namespace||{},!0)),f})(i[v].$m,v)}else i[v].$s?a[v]=((t,i)=>{function s(t,i,e){n.rpc.Service.call(this,t,i,e)}return((s.prototype=Object.create(n.rpc.Service.prototype)).constructor=s).create=function(t,i,e){return new s(t,i,e)},Object.keys(t).forEach((function(n){var o=t[n];function u(t,i){return this.rpcCall(u,r[o[0]],r[o[1]],t,i)}Object.defineProperty(u,"name",{value:n}),Object.defineProperty(u,"path",{value:e+"."+i}),s.prototype[n]=u})),s})(i[v].$s,v):i[v].$e&&Object.values(i[v].$e).every((function(t){return Number(t)===t}))&&(a[v]=(t=>{for(var i=Object.keys(t),e={},n=0;n<i.length;n++)e[e[i[n]]=t[i[n]]]=i[n];return e})(i[v].$e));a[v]&&!f&&(r[e+"."+v]=a[v]),delete i[v].$m,delete i[v].$s,delete i[v].$e,a[v]=t(i[v],Boolean(e)?e+"."+v:v,a[v]||{})}return a}({cloudsetting:{cloudsetting:{CloudSettingFileResponse:{$m:{1:["code","int64",{low:0,high:0,unsigned:!1}],2:["message","string",""],3:["file_name","string",""],4:["global_version","string",""],5:["version","string",""],6:["app_version","string",""],7:["json_data","bytes",[]],8:["hash","bytes",[]],9:["g_version","uint32",0]}},File:{$m:{1:["file_name","string",""],2:["hash","bytes",[]],3:["g_version","uint32",0]}},GetCloudSettingConfigRequest:{$m:{1:["product","cloudsetting.cloudsetting.Product",0],2:["response_compress","int32",0],3:["file_list","<string",null],4:["param_list","<cloudsetting.cloudsetting.Param",null],5:["files","<cloudsetting.cloudsetting.File",null],6:["p_version","uint32",0]}},GetCloudSettingConfigResponse:{$m:{1:["code","int64",{low:0,high:0,unsigned:!1}],2:["message","string",""],3:["polling_interval","int32",0],4:["file_response","<cloudsetting.cloudsetting.CloudSettingFileResponse",null]}},Param:{$m:{1:["key","string",""],2:["value","string",""]}},Product:{$e:{RTC:0,WEB_RTC:1,ZIM:2,ROOM_KIT:3,DOC_SHARE:4,WHITE_BOARD:5,SELF_CHECK:999,TEST_ANOOUS:1e3}}}}},"",r,!1),n.util.global.cloudsetting=r.cloudsetting,i.default=r.cloudsetting}],u={},r.m=o,r.c=u,r.d=function(t,i,e){r.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,i){if(1&i&&(t=r(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var n in t)r.d(e,n,function(i){return t[i]}.bind(null,n));return e},r.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(i,"a",i),i},r.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},r.p="",r(r.s=7);function r(t){var i;return(u[t]||(i=u[t]={i:t,l:!1,exports:{}},o[t].call(i.exports,i,i.exports,r),i.l=!0,i)).exports}var o,u}(e(6994),e(3788),e(6361),e(955),e(5178))},757:function(t,i,e){"undefined"!=typeof self&&self,t.exports=function(t,i,e,n){return r=[function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.LinkedList=i.ListNode=i.ENUM_NETWORK_STATE=i.SOCKET_DISCONNECT=i.errorList=i.Queue=i.getSeq=i.E_CLIENT_TYPE=i.ENUM_LOG_LEVEL=i.ZEGO_BROWSER_TYPE=i.ZEGO_ENV=i.PROTO_VERSION=void 0,i.PROTO_VERSION="1.0.6",(s=i.ZEGO_ENV||(i.ZEGO_ENV={}))[s.BROWSER=0]="BROWSER",s[s.WEIXINMINI=1]="WEIXINMINI",(s=i.ZEGO_BROWSER_TYPE||(i.ZEGO_BROWSER_TYPE={}))[s.IE=0]="IE",s[s.FIREFOX=1]="FIREFOX",s[s.CHROME=2]="CHROME",s[s.SAFARI=3]="SAFARI",s[s.OPERA=4]="OPERA",s[s.WEIXIN=5]="WEIXIN",s[s.WEIXINMINI=6]="WEIXINMINI",s[s.UNKOWN=7]="UNKOWN",i.ENUM_LOG_LEVEL={DEBUG:0,INFO:1,WARN:2,ERROR:3,REPORT:99,DISABLE:100,debug:0,info:1,warn:2,error:3,report:99,disable:100},(s=i.E_CLIENT_TYPE||(i.E_CLIENT_TYPE={}))[s.ClientType_None=0]="ClientType_None",s[s.ClientType_H5=1]="ClientType_H5",s[s.ClientType_SmallPragram=2]="ClientType_SmallPragram",s[s.ClientType_Webrtc=3]="ClientType_Webrtc",i.getSeq=(n=1,function(){return n++}),r.prototype.isEmpty=function(){return 0==this.items.length},r.prototype.enqueue=function(t){this.items.push(t)},r.prototype.dequeue=function(){return this.isEmpty()?"Underflow":this.items.shift()},r.prototype.front=function(){return this.isEmpty()?"No elements in Queue":this.items[0]},r.prototype.size=function(){return this.items.length},r.prototype.clear=function(){this.items=[]},r.prototype.all=function(){return this.items};var n,s=r;function r(){this.items=[],this.items=[]}i.Queue=s,i.errorList={TIMEOUT:{code:100001,msg:"network timeout"},DATAEXIST:{code:100002,msg:"data exist"},BROKEN:{code:100003,msg:"network broken"}},i.SOCKET_DISCONNECT=-1,(s=i.ENUM_NETWORK_STATE||(i.ENUM_NETWORK_STATE={}))[s.offline=0]="offline",s[s.online=1]="online",Object.defineProperty(u.prototype,"id",{get:function(){return this.h||null},set:function(t){this.h=t},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"data",{get:function(){return this.v},set:function(t){this.v=t},enumerable:!1,configurable:!0}),u.prototype.hasNext=function(){return this.next&&this.next.id},u.prototype.hasPrev=function(){return this.prev&&this.prev.id};var o=u;function u(t,i){void 0===t&&(t=null),void 0===i&&(i=null),this.next=null,this.prev=null,this.h=t,this.v=i}function a(){this.start=new o,this.end=new o,this.g=0,this._=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}i.ListNode=o,a.prototype.insertBefore=function(t,i){return(i=new o(this.g,i)).next=t,i.prev=t.prev,t.prev&&(t.prev.next=i),t.prev=i,++this.g,++this._,i},a.prototype.addLast=function(t){return this.insertBefore(this.end,t)},a.prototype.add=function(t){return this.addLast(t)},a.prototype.getFirst=function(){return 0===this._?null:this.start.next},a.prototype.getLast=function(){return 0===this._?null:this.end.prev},a.prototype.size=function(){return this._},a.prototype.getFromFirst=function(t){var i=0,e=this.start.next;if(0<=t)for(;i<t&&null!==e;)e=e.next,++i;else e=null;if(null===e)throw"Index out of bounds.";return e},a.prototype.get=function(t){return 0===t?this.getFirst():t===this._-1?this.getLast():this.getFromFirst(t)},a.prototype.remove=function(t){return t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),--this._,t},a.prototype.removeFirst=function(){return 0<this._&&this.start.next?this.remove(this.start.next):null},a.prototype.removeLast=function(){return 0<this._&&this.end.prev?this.remove(this.end.prev):null},a.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this._=0,this.g=0},a.prototype.each=function(t){for(var i=this.start;i.hasNext();)t(i=i.next)},a.prototype.find=function(t){for(var i=this.start,e=!1,n=null;i.hasNext()&&!e;)t(i=i.next)&&(n=i,e=!0);return n},a.prototype.map=function(t){for(var i=this.start,e=[];i.hasNext();)t(i=i.next)&&e.push(i);return e},a.prototype.push=function(t){return this.addLast(t)},a.prototype.unshift=function(t){this.insertBefore(0<this._?this.start.next:this.end,t)},a.prototype.pop=function(){return this.removeLast()},a.prototype.shift=function(){return this.removeFirst()},i.LinkedList=a},function(t,i,e){"use strict";var n=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},s=this&&this.__spread||function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(n(arguments[i]));return t},r=(Object.defineProperty(i,"u",{value:!0}),i.ContextAPI=i.suppressInstrumentation=i.ROOT_CONTEXT=i.BaseContext=i.setSpan=i.getSpanContext=i.getSpan=i.createContextKey=void 0,e(16));function o(t){return Symbol.for(t)}var u=(i.createContextKey=o)("OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION"),a=o("OpenTelemetry Context Key SPAN");function c(t){return t.getValue(a)||void 0}function h(t){this.O=t,this.S=new r.StackContextManager}i.getSpan=c,i.getSpanContext=function(t){return null==(t=c(t))?void 0:t.context()},i.setSpan=function(t,i){return t.setValue(a,i)},i.BaseContext=e=function t(i){var e=this;e.M=i?new Map(i):new Map,e.getValue=function(t){return e.M.get(t)},e.setValue=function(i,n){var s=new t(e.M);return s.M.set(i,n),s},e.deleteValue=function(i){var n=new t(e.M);return n.M.delete(i),n}},i.ROOT_CONTEXT=new e,i.suppressInstrumentation=function(t){return t.setValue(u,!0)},h.getInstance=function(t){return void 0===t&&(t="context"),this.j||(this.j=new h(t)),this.j},h.prototype.active=function(){return this.S.active()},h.prototype.with=function(t,i,e){for(var n,r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];return(n=this.T()).with.apply(n,s([t,i,e],r))},h.prototype.T=function(){return this.S},i.ContextAPI=h},function(t,i,e){"use strict";var n,s;Object.defineProperty(i,"u",{value:!0}),i.INVALID_SPAN_CONTEXT=i.INVALID_TRACEID=i.INVALID_SPANID=i.TraceFlags=i.SpanKind=i.SpanStatusCode=void 0,(n=i.SpanStatusCode||(i.SpanStatusCode={}))[n.UNSET=0]="UNSET",n[n.OK=1]="OK",n[n.ERROR=2]="ERROR",(n=i.SpanKind||(i.SpanKind={}))[n.INTERNAL=0]="INTERNAL",n[n.SERVER=1]="SERVER",n[n.CLIENT=2]="CLIENT",n[n.PRODUCER=3]="PRODUCER",n[n.CONSUMER=4]="CONSUMER",(s=n=i.TraceFlags||(i.TraceFlags={}))[s.NONE=0]="NONE",s[s.SAMPLED=1]="SAMPLED",i.INVALID_SPANID="0000000000000000",i.INVALID_TRACEID="00000000000000000000000000000000",i.INVALID_SPAN_CONTEXT={traceId:i.INVALID_TRACEID,spanId:i.INVALID_SPANID,traceFlags:n.NONE}},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.log=i.ZegoLog=void 0,s.prototype.log=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join("");console.log(e)},s.prototype.debug=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join("");console.debug(e)},s.prototype.info=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join("");console.info(e)},s.prototype.warn=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join("");console.warn(e)},s.prototype.error=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var e=t.join("");console.error(e)};var n=s;function s(){}n=new(i.ZegoLog=n),i.log=n},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.FAIL_TIME=i.FAIL_MAX_COUNT=i.FAIL_COUNT=i.STORE_SIZE=i.CACHE_SIZE=i.BUCKET_CONFIG=i.DEFAULT_CONFIG=void 0,i.DEFAULT_CONFIG={importantLevel:0,reportSize:3e3,reportNum:10,bps:16e3,netTimeout:10},i.BUCKET_CONFIG={bucketSize:1e4,tokensPerInterval:1600},i.CACHE_SIZE={totalAvailCache:102400,cacheMaxSize:2e4,cacheDelPer:.2},i.STORE_SIZE={totalDBSize:2048e3,storeDelPer:.2},i.FAIL_COUNT=5,i.FAIL_MAX_COUNT=10,i.FAIL_TIME=30},function(t,i,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.u?t:{default:t}},s=(Object.defineProperty(i,"u",{value:!0}),i.uuid=i.calculateMemSize=i.analyzeKey=i.getCurrentTime=i.getCurrentEnv=i.getBrowser=void 0,e(0)),r=n(e(30)),o=(i.getBrowser=function(){var t=window.navigator.userAgent,i=null!=window.ActiveXObject&&-1!=t.indexOf("MSIE"),e=-1!=t.indexOf("Firefox"),n=null!=window.opr,r=t.indexOf("Chrome")&&window.chrome,o=-1!=t.indexOf("Safari")&&-1!=t.indexOf("Version");return t=t.toLowerCase().match(/MicroMessenger/i)&&"micromessenger"===t.toLowerCase().match(/MicroMessenger/i)[0],i?s.ZEGO_BROWSER_TYPE.IE:e?s.ZEGO_BROWSER_TYPE.FIREFOX:n?s.ZEGO_BROWSER_TYPE.OPERA:r?s.ZEGO_BROWSER_TYPE.CHROME:o?s.ZEGO_BROWSER_TYPE.SAFARI:t?s.ZEGO_BROWSER_TYPE.WEIXIN:s.ZEGO_BROWSER_TYPE.UNKOWN},i.getCurrentEnv=function(){var t=window.navigator.userAgent;return new Promise((function(i){-1==t.indexOf("MicroMessage")?i(s.ZEGO_ENV.BROWSER):wx.miniProgram.getEnv((function(t){}))}))},["00","01","02","03","04","05","06","07","08","09"]);i.getCurrentTime=function(){var t=new Date;return[t.getFullYear()+"/",(o[t.getMonth()+1]||t.getMonth()+1)+"/",(o[t.getDate()]||t.getDate())+" ",(o[t.getHours()]||t.getHours())+":",(o[t.getMinutes()]||t.getMinutes())+":",o[t.getSeconds()]||t.getSeconds(),"."+t.getTime()%1e3].join("")},i.analyzeKey=function(t){return t=t.split("_"),{level:Number(t[0]),timestamp:t[1],seq:t[2]}},i.calculateMemSize=function(t){return r.default(t)},i.uuid=function(t,i){var e,n,s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=[];if(i=i||s.length,t)for(e=0;e<t;e++)r[e]=s[0|Math.random()*i];else for(r[8]=r[13]=r[18]=r[23]="-",r[14]="4",e=0;e<36;e++)r[e]||(n=0|16*Math.random(),r[e]=s[19==e?3&n|8:n]);return r.join("")}},function(t,i,e){"use strict";var n=this&&this.__values||function(t){var i="function"==typeof Symbol&&Symbol.iterator,e=i&&t[i],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o};function r(t){var i,e,s;if(null!=t&&Array.isArray(t))try{for(var r=n(t),o=r.next();!o.done;o=r.next()){var u=o.value;if(null!=u)if(s){if(typeof u!==s)return!1}else s=typeof u}}catch(t){i={error:t}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(i)throw i.error}}return!0}Object.defineProperty(i,"u",{value:!0}),i.sanitizeAttributes=i.isAttributeValue=void 0,i.isAttributeValue=r,i.sanitizeAttributes=function(t){var i,e,o={};if(null!=t&&"object"==typeof t)try{for(var u=n(Object.entries(t)),a=u.next();!a.done;a=u.next()){var c=s(a.value,2),h=c[0],f=c[1];r(f)&&(o[h]=Array.isArray(f)?f.slice():f)}}catch(t){i={error:t}}finally{try{a&&!a.done&&(e=u.return)&&e.call(u)}finally{if(i)throw i.error}}return o}},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.IdGenerator=void 0;var n=Array(32);function s(t){return function(){for(var i=0;i<2*t;i++)n[i]=Math.floor(16*Math.random())+48,58<=n[i]&&(n[i]+=39);return String.fromCharCode.apply(null,n.slice(0,2*t))}}i.IdGenerator=function(){this.generateTraceId=s(16),this.generateSpanId=s(8),this.generateEventId=s(4)}},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.Resource=i.SDK_INFO=i.SemanticResourceAttributes=void 0,i.SemanticResourceAttributes={PROCESS_RUNTIME_NAME:"process.runtime.name",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version"},i.SDK_INFO=((n={})[i.SemanticResourceAttributes.TELEMETRY_SDK_NAME]="opentelemetry",n[i.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]="browser",n[i.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]="webjs",n[i.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]=i.VERSION,n),s.empty=function(){return s.EMPTY},s.createTelemetrySDKResource=function(){var t;return new s(((t={})[i.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]=i.SDK_INFO[i.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],t[i.SemanticResourceAttributes.TELEMETRY_SDK_NAME]=i.SDK_INFO[i.SemanticResourceAttributes.TELEMETRY_SDK_NAME],t[i.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]=i.SDK_INFO[i.SemanticResourceAttributes.TELEMETRY_SDK_VERSION],t))},s.prototype.merge=function(t){return t&&Object.keys(t.attributes).length?new s(Object.assign({},this.attributes,t.attributes)):this},s.EMPTY=new s({});var n=s;function s(t){this.attributes=t}i.Resource=n},function(t,i,e){"use strict";var n=this&&this.__values||function(t){var i="function"==typeof Symbol&&Symbol.iterator,e=i&&t[i],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},r=(Object.defineProperty(i,"u",{value:!0}),i.Span=void 0,e(6)),o=e(1),u=e(2),a=e(7),c=e(17);function h(t,i,e,n,s,r,o,c){void 0===c&&(c=[]),this.attributes={},this.links=[],this.events=[],this.status={code:u.SpanStatusCode.UNSET},this.endTime=0,this.N=!1,this.A=0,this.exported=!0,this.R=t.context,this.reporter=t.reporter,this.spanProcessor=t.spanProcessor,this.parentTracer=t,this.name=e,this.level=n,this.spanContext=s,this.parentSpanId=o,this.kind=r,this.links=c,this.startTime=Date.now(),this.resource=t.resource,this.instrumentationLibrary=t.instrumentationLibrary,this.I=t.getActiveTraceParams(),this.k=new a.IdGenerator}h.prototype.context=function(){return this.spanContext},h.prototype.setAttribute=function(t,i){return null==i||0===t.length||!r.isAttributeValue(i)||Object.keys(this.attributes).length>=this.I.numberOfAttributesPerSpan&&!Object.prototype.hasOwnProperty.call(this.attributes,t)||(this.attributes[t]=i),this},h.prototype.appendAttribute=function(t,i){return null==i||0===t.length||!r.isAttributeValue(i)||Object.keys(this.attributes).length>=this.I.numberOfAttributesPerSpan&&!Object.prototype.hasOwnProperty.call(this.attributes,t)||(this.attributes[t]&&Array.isArray(this.attributes[t])?this.attributes[t].push(i):this.attributes[t]=[i]),this},h.prototype.setAttributes=function(t){var i,e;try{for(var r=n(Object.entries(t)),o=r.next();!o.done;o=r.next()){var u=s(o.value,2);this.setAttribute(u[0],u[1])}}catch(t){i={error:t}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(i)throw i.error}}return this},h.prototype.addEvent=function(t,i,e){this.events.length>=this.I.numberOfEventsPerSpan&&this.events.shift();var n=this.k.generateEventId();return c.isTimeInput(i)&&(void 0===e&&(e=i),i=void 0),void 0===e&&(e=c.hrTime()),this.events.push({name:t,attributes:i,time:c.timeInputToHrTime(e),event_id:n}),this},h.prototype.setStatus=function(t){return this.status=t,this},h.prototype.updateName=function(t){return this.name=t,this},h.prototype.end=function(t){var i,e=this;this.D()||(this.N=!0,this.resource=this.parentTracer.resource,this.spanProcessor.spanBeforeEnd&&this.spanProcessor.spanBeforeEnd(this),i=c.getCurrentTime(),this.setAttribute("e_time_s",i),this.endTime=Date.now(),this.A=this.endTime-this.startTime,this.R.with(o.suppressInstrumentation(this.R.active()),(function(){var i=e.P(e);e.spanProcessor.spanEnd&&e.spanProcessor.spanEnd(i,e.level),i.droped||!1===t||(delete i.droped,e.reporter.report(JSON.stringify(i),e.level))})))},h.prototype.spanReport=function(){var t=this.P(this);this.reporter.report(JSON.stringify(t),this.level)},h.prototype.isRecording=function(){return!1===this.N},Object.defineProperty(h.prototype,"duration",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"ended",{get:function(){return this.N},enumerable:!1,configurable:!0}),h.prototype.D=function(){return this.N},h.prototype.P=function(t){var i=[],e=(t.events.forEach((function(t){var e={};Object.keys(t).forEach((function(i){"name"===i&&(e[i]=t[i]),"time"===i&&(e.timestamp=c.hrTimeToMilliseconds(t[i])),"attributes"===i&&(e.tags=t[i])})),i.push(e)})),[]);return t.links.forEach((function(t){e.push({span_id:t.context.spanId,trace_id:t.context.traceId})})),{trace_id:t.spanContext.traceId,parent_span_id:t.parentSpanId,name:t.name,span_id:t.spanContext.spanId,kind:t.kind,start_time:t.startTime,end_time:t.endTime,duration:t.duration,logs:i,tags:t.attributes,links:e}},i.Span=h},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.ZegoSpan=void 0;var n=e(3),s=e(9);function r(t,i){this.spanId=t,this.span=i}r.prototype.setAttribute=function(t,i){var e=this;return this.span?this.span.setAttribute(t,i):this.B().then((function(){e.span&&e.span.setAttribute(t,i)})),this},r.prototype.setAttributes=function(t){var i=this;return this.span?this.span.setAttributes(t):this.B().then((function(){i.span&&i.span.setAttributes(t)})),this},r.prototype.appendAttribute=function(t,i){var e=this;return this.span?this.span.appendAttribute(t,i):this.B().then((function(){e.span&&e.span.appendAttribute(t,i)})),this},r.prototype.addEvent=function(t,i,e){var n=this;return this.span?this.span.addEvent(t,i,e):this.B().then((function(){n.span&&n.span.addEvent(t,i,e)})),this},r.prototype.setStatus=function(t){var i=this;return this.span?this.span.setStatus(t):this.B().then((function(){i.span&&i.span.setStatus(t)})),this},r.prototype.updateName=function(t){var i=this;return this.span?this.span.updateName(t):this.B().then((function(){i.span&&i.span.updateName(t)})),this},r.prototype.end=function(t){var i=this;void 0===t&&(t=!0),this.span?this.span.end(t):this.B(!0).then((function(){i.span&&i.span.end(t),i.U()}))},r.prototype.setSpanActive=function(t){this.activeCallback=t},r.prototype.setSpanEnd=function(t){this.endCallback=t},r.prototype.spanReport=function(){var t;null!=(t=this.span)&&t.spanReport()},r.prototype.U=function(){this.J()||(this.L(this.spanId),this.endCallback&&this.endCallback(this.spanInfo))},r.prototype.J=function(){return"noop"===this.spanId},r.prototype.B=function(t){var i=this;return void 0===t&&(t=!1),new Promise((function(e,n){i.store.getItem(i.spanId).then((function(n){var o=new s.Span(r.tracer,r.tracer.context.active(),n.name,n.level,n.spanContext,n.kind,n.parentSpanId,n.links);o.setStatus(n.status),o.setAttributes(n.attributes),i.span=o,i.activeCallback&&i.activeCallback(i.spanId,t),e()})).catch((function(t){n(t)}))}))},r.prototype.L=function(t){var i=this;this.store.getItem(t).then((function(e){e&&i.store.removeItem(t).then((function(){n.log.log("remove suc")})).catch((function(t){n.log.warn("remove fail")}))}))},i.ZegoSpan=r},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.createZegoStore=i.ZegoWechatMiniStore=i.ZEGO_ENV=void 0;var n,s,r=e(12),o=((s=n=i.ZEGO_ENV||(i.ZEGO_ENV={}))[s.BROWSER=0]="BROWSER",s[s.WEIXINMINI=1]="WEIXINMINI",e(3)),u=(a.prototype.getItem=function(t){var i=this;return new Promise((function(e,n){try{e(wx.getStorageSync(i.keyPrefix+t))}catch(e){n(e)}}))},a.prototype.setItem=function(t,i){var e=this;return new Promise((function(n,s){try{wx.setStorageSync(e.keyPrefix+t,i),n()}catch(n){s(n)}}))},a.prototype.removeItem=function(t){var i=this;return new Promise((function(e,n){try{e(wx.removeStorageSync(i.keyPrefix+t))}catch(e){n(e)}}))},a.prototype.clear=function(){return new Promise((function(t,i){try{wx.clearStorageSync(),t()}catch(t){i(t)}}))},a.prototype.keys=function(){var t=this;return new Promise((function(i,e){try{var n=wx.getStorageInfoSync().keys,s=(o.log.warn("keys",n),[]);n.forEach((function(i){0==i.indexOf(t.keyPrefix)&&s.push(i.replace(t.keyPrefix,""))})),o.log.warn("keyArr",JSON.stringify(s)),s.sort(),i(s)}catch(i){e(i)}}))},a);function a(t){this.storeName=t,this.keyPrefix=t+"/"}i.ZegoWechatMiniStore=u,i.createZegoStore=function(t,i,e){return i===n.BROWSER?r.createInstance({name:t+":"+(e||"store")}):new u(t)}},function(i,e){i.exports=t},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.DynamicCode=i.ZegoTracer=i.ZegoSpan=void 0;var n=e(14),s=(Object.defineProperty(i,"ZegoTracer",{enumerable:!0,get:function(){return n.ZegoTracer}}),e(45)),r=(Object.defineProperty(i,"DynamicCode",{enumerable:!0,get:function(){return s.DynamicCode}}),e(10));Object.defineProperty(i,"ZegoSpan",{enumerable:!0,get:function(){return r.ZegoSpan}})},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.ZegoTracer=void 0;var n=e(15),s=e(21),r=e(10),o=e(22),u=e(3),a=e(1),c=e(8),h=e(23),f=e(38),l=e(11),d=e(43),v=e(44);function m(t){this.q=o.DEFAULT_MAX_SPAN_SIZE,this.level=0,this.log=new d.ZegoLog,this.stateCenter=new v.StateCenter(this.log),this.stateCenter.proxyCtrl=t}m.prototype.init=function(t){t.deflate?(this.stateCenter.deflate=t.deflate,this.options=t,this.name=t.product,this.reporter=new h.ZegoDataReport(this.name,this.stateCenter),this.reporter.init({appID:t.appID,env:t.env||0,importantLevel:t.importantLevel,levels:t.levels,deviceID:t.deviceID,bps:t.bps,serverUrl:t.serverUrl}),this.tracer=new n.Tracer({name:this.name,version:t.version},{resource:new c.Resource(t.resources)},this.reporter,{spanStart:t.spanStart,spanBeforeEnd:t.spanBeforeEnd,spanEnd:t.spanEnd}),this.reporter.setProcessData(this.tracer.resource.attributes),this.C(this.options),this.dyStore=l.createZegoStore(t.product+"_"+t.appID+"_dy",t.env||0)):console.error("init tracer failed. need input pako inflate function")},m.prototype.C=function(t){this.rootSpan=this.tracer.startSpan("root",0);var i=a.setSpan(this.tracer.context.active(),this.rootSpan);this.tracer.context.T().M=i,this.rootSpan.end()},m.prototype.createSpan=function(t,i,e){var n,c;return t<=this.level?(n=a.setSpan(this.tracer.context.active(),e&&e.parent?e.parent.span:this.rootSpan),c=[],e&&e.linkSpans&&(e.linkSpans.forEach((function(t){c.push({context:t.span.context()})})),delete e.linkSpans),i=this.tracer.startSpan(i,t,Object.assign({},e,{links:c}),n),t=new r.ZegoSpan(i.spanContext.spanId,i),r.ZegoSpan.tracer=this.tracer,t):(u.log.warn("createSpan level not fix"),new r.ZegoSpan(o.NOOP_SPAN_ID,new s.NoopSpan))},m.prototype.setLogger=function(t){this.stateCenter.logger=t},m.prototype.setTimeOffset=function(t){this.reporter.setTimeOffset(t)},m.prototype.setWaitNtpTimeout=function(t){this.reporter.setWaitNtpTimeout(t)},m.prototype.setLogLevel=function(t){return this.stateCenter.F.setLogLevel(t)},m.prototype.startReport=function(t){return this.reporter.startReport(t)},m.prototype.setConfig=function(t){this.reporter.setConfig(t)},m.prototype.loadJs=function(t,i,e,n,s,r){return f.loadJS(t,this.dyStore,i,e,n,s,r)},m.prototype.flush=function(t){this.reporter.flush(t)},m.prototype.setUnloadState=function(t){this.reporter.setUnloadState(t)},m.prototype.shutdown=function(){this.reporter.saveDataBeforeUnload()},m.prototype.destroy=function(){this.reporter.uninit()},m.prototype.setSampleConfig=function(t){this.level=t.level||this.level},m.prototype.setResource=function(t){this.tracer.setResource(t),this.reporter.setProcessData(this.tracer.resource.attributes)},m.prototype.setNetStateCheck=function(){this.reporter.setNetStateCheck()},i.ZegoTracer=m},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.Tracer=void 0;var n=e(6),s=e(1),r=e(2),o=e(7),u=e(8),a=e(9),c=e(18),h=e(19);function f(t,i,e,n){var r=h.mergeConfig(i);this.I=r.traceParams,this.k=new o.IdGenerator,this.resource=null!=(r=i.resource)?r:u.Resource.createTelemetrySDKResource(),this.instrumentationLibrary=t,i=Math.random().toString(36).slice(-6),this.context=new s.ContextAPI(i),this.reporter=e,this.spanProcessor=n||{}}f.prototype.startSpan=function(t,i,e,o){var u,h,f,l=function(t,i){if(!t.root)return s.getSpanContext(i)}(e=void 0===e?{}:e,o=void 0===o?this.context.active():o),d=this.k.generateSpanId(),v=(l&&c.isSpanContextValid(l)?(u=l.traceId,h=l.traceState,f=l.spanId):u=this.k.generateTraceId(),l=null!=(l=e.kind)?l:r.SpanKind.INTERNAL,null!=(v=e.links)?v:[]);return e=n.sanitizeAttributes(e.attributes),(o=new a.Span(this,o,t,i,{traceId:u,spanId:d,traceFlags:r.TraceFlags.NONE,traceState:h},l,f,v)).setAttributes(e),this.spanProcessor.spanStart&&this.spanProcessor.spanStart(o),o},f.prototype.setResource=function(t){this.resource=this.resource.merge(new u.Resource(t))},f.prototype.getActiveTraceParams=function(){return this.I},i.Tracer=f},function(t,i,e){"use strict";var n=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},s=this&&this.__spread||function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(n(arguments[i]));return t},r=(Object.defineProperty(i,"u",{value:!0}),i.StackContextManager=void 0,e(1));function o(){this.W=!1,this.M=r.ROOT_CONTEXT}o.prototype.X=function(t,i){function e(){for(var e=this,s=[],r=0;r<arguments.length;r++)s[r]=arguments[r];return n.with(i,(function(){return t.apply(e,s)}))}void 0===i&&(i=r.ROOT_CONTEXT);var n=this;return Object.defineProperty(e,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),e},o.prototype.active=function(){return this.M},o.prototype.bind=function(t,i){return void 0===(i=void 0===i?r.ROOT_CONTEXT:i)&&(i=this.active()),"function"==typeof t?this.X(t,i):t},o.prototype.disable=function(){return this.M=r.ROOT_CONTEXT,this.W=!1,this},o.prototype.enable=function(){return this.W||(this.W=!0,this.M=r.ROOT_CONTEXT),this},o.prototype.with=function(t,i,e){for(var n=[],o=3;o<arguments.length;o++)n[o-3]=arguments[o];var u=this.M;this.M=t||r.ROOT_CONTEXT;try{return i.call.apply(i,s([e],n))}finally{this.M=u}},i.StackContextManager=o},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.getCurrentTime=i.isTimeInput=i.hrTimeToMilliseconds=i.hrTimeDuration=i.timeInputToHrTime=i.isTimeInputHrTime=i.hrTime=void 0;var n=9,s=Math.pow(10,n),r=["00","01","02","03","04","05","06","07","08","09"];function o(t){t/=1e3;var i=Math.trunc(t);return[i,Number((t-i).toFixed(n))*s]}function u(){var t,i=performance.timeOrigin;return"number"!=typeof i?(t=performance).timing&&t.timing.fetchStart:i}function a(t){var i=o(u()),e=(t=o("number"==typeof t?t:performance.now()),i[0]+t[0]);return s<(i=i[1]+t[1])&&(i-=s,e+=1),[e,i]}function c(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}i.hrTime=a,i.isTimeInputHrTime=c,i.timeInputToHrTime=function(t){if(c(t))return t;if("number"==typeof t)return(t<u()?a:o)(t);if(t instanceof Date)return o(t.getTime());throw TypeError("Invalid input type")},i.hrTimeDuration=function(t,i){var e=i[0]-t[0];return(i=i[1]-t[1])<0&&(--e,i+=s),[e,i]},i.hrTimeToMilliseconds=function(t){return Math.round(1e3*t[0]+t[1]/1e6)},i.isTimeInput=function(t){return c(t)||"number"==typeof t||t instanceof Date},i.getCurrentTime=function(){var t=new Date;return[t.getFullYear()+"/",(r[t.getMonth()+1]||t.getMonth()+1)+"/",(r[t.getDate()]||t.getDate())+" ",(r[t.getHours()]||t.getHours())+":",(r[t.getMinutes()]||t.getMinutes())+":",r[t.getSeconds()]||t.getSeconds(),"."+t.getTime()%1e3].join("")}},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.isSpanContextValid=i.isValidSpanId=i.isValidTraceId=i.INVALID_SPAN_CONTEXT=i.INVALID_TRACEID=i.INVALID_SPANID=void 0,e=e(2);var n=/^([0-9a-f]{32})$/i,s=/^[0-9a-f]{16}$/i;function r(t){return n.test(t)&&t!==i.INVALID_TRACEID}function o(t){return s.test(t)&&t!==i.INVALID_SPANID}i.INVALID_SPANID="0000000000000000",i.INVALID_TRACEID="00000000000000000000000000000000",i.INVALID_SPAN_CONTEXT={traceId:i.INVALID_TRACEID,spanId:i.INVALID_SPANID,traceFlags:e.TraceFlags.NONE},i.isValidTraceId=r,i.isValidSpanId=o,i.isSpanContextValid=function(t){return r(t.traceId)&&o(t.spanId)}},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.mergeConfig=void 0;var n=e(20);i.mergeConfig=function(t){var i=Object.assign({},n.DEFAULT_CONFIG,t);return i.traceParams=Object.assign({},n.DEFAULT_CONFIG.traceParams,t.traceParams||{}),i}},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.DEFAULT_CONFIG=void 0,i.DEFAULT_CONFIG={traceParams:{numberOfAttributesPerSpan:128,numberOfLinksPerSpan:128,numberOfEventsPerSpan:128}}},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.NoopSpan=void 0;var n=e(2);function s(t){void 0===t&&(t=n.INVALID_SPAN_CONTEXT),this.K=t}s.prototype.context=function(){return this.K},s.prototype.setAttribute=function(t,i){return this},s.prototype.appendAttribute=function(t,i){return this},s.prototype.setAttributes=function(t){return this},s.prototype.addEvent=function(t,i,e){return this},s.prototype.setStatus=function(t){return this},s.prototype.updateName=function(t){return this},s.prototype.end=function(t){},s.prototype.isRecording=function(){return!1},s.prototype.spanReport=function(){},s.prototype.recordException=function(t,i){},i.NoopSpan=s},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.NOOP_SPAN_ID=i.SCHEDULED_DELAY_MILLIS=i.DEFAULT_MAX_SPAN_SIZE=i.readSpanKeys=void 0,i.readSpanKeys=["name","level","kind","spanContext","parentSpanId","startTime","endTime","status","attributes","links","events","duration","ended","resource","instrumentationLibrary"],i.DEFAULT_MAX_SPAN_SIZE=1e3,i.SCHEDULED_DELAY_MILLIS=3e3,i.NOOP_SPAN_ID="noop"},function(t,i,e){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t}).apply(this,arguments)},s=this&&this.__awaiter||function(t,i,e,n){return new(e=e||Promise)((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):((i=t.value)instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},r=this&&this.__generator||function(t,i){var e,n,s,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o={next:u(0),throw:u(1),return:u(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){var a=[o,u];if(e)throw new TypeError("Generator is already executing.");for(;r;)try{if(e=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,(a=s?[2&a[0],s.value]:a)[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,n=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(s=0<(s=r.trys).length&&s[s.length-1])&&(6===a[0]||2===a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3]))r.label=a[1];else if(6===a[0]&&r.label<s[1])r.label=s[1],s=a;else{if(!(s&&r.label<s[2])){s[2]&&r.ops.pop(),r.trys.pop();continue}r.label=s[2],r.ops.push(a)}}a=i.call(t,r)}catch(u){a=[6,u],n=0}finally{e=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}},o=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},u=this&&this.__spread||function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(o(arguments[i]));return t},a=this&&this.__values||function(t){var i="function"==typeof Symbol&&Symbol.iterator,e=i&&t[i],n=0;if(e)return e.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&n>=t.length?void 0:t)&&t[n++],done:!t}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},c=(Object.defineProperty(i,"u",{value:!0}),i.ZegoDataReport=void 0,e(0)),h=e(24),f=e(29),l=e(37),d=e(5),v=e(4);function m(t,i){this.G=i,this.QUEUE_MAX=100,this.cacheMaxSize=v.CACHE_SIZE.cacheMaxSize,this.cacheDelPer=v.CACHE_SIZE.cacheDelPer,this.state="normal",this.forceDataTotalLen=0,this.reportPackagesSize=0,this.staticConfig={totalAvailCache:v.CACHE_SIZE.totalAvailCache,totalDBSize:v.STORE_SIZE.totalDBSize,bps:1600},this.dataInDb=[],this.listenerList={progressUpdate:[],forceResult:[],postFail:[],dataDroped:[]},this.tempBuffer=[],this.traceType={MEM_I_API:0,MEM_O_DONE:0,MEM_O_DUMP:0,MEM_I_LOAD:0,DB_O_DROP:0,DB_O_DONE:0,DB_I_BACKUP:0},this.isPaused=!1,this.pro="json",this.isLoadReportData=!1,this.dropCount=0,this.timeInterval=!1,this.isWaitNtpTimeout=!1,this.waitNtpTimeout=2e3,this.postDataState="",this.product=t,this.reportMap=new Map}m.prototype.init=function(t){return s(this,void 0,void 0,(function(){var i=this;return r(this,(function(e){switch(e.label){case 0:return this.config=n(n({},v.DEFAULT_CONFIG),t),this.config.env%2!=1&&this.H(),this.zegoService=new h.ZegoService(this.config.env||c.ZEGO_ENV.BROWSER,this.config.bps||v.DEFAULT_CONFIG.bps,this.product,this.pro,this.G),this.zegoService.setLogUrlParams({product:this.product,signature:this.config.token||"",appid:this.config.appID,id_name:this.config.userID||"",deviceid:this.config.deviceID||""}),this.config.serverUrl&&this.zegoService.setLogServer(this.config.serverUrl),this.zegoService.setPostSucCallback(this.product,this.Y.bind(this)),this.zegoService.setPostFailCallback(this.product,(function(t){return s(i,void 0,void 0,(function(){return r(this,(function(i){switch(i.label){case 0:return this.G.logger.warn("zt.zd.i fail"),this.postDataState="fail",this.dropCount++,this.V(t),[4,this.Z(1)];case 1:return i.sent(),this.$("postFail"),[2]}}))}))})),this.tt(),this.storeHandler=new f.ZegoStoreHandler(this.product+"_"+this.config.appID+"_datareporter",d.uuid(6),this.config,this.traceType,this.staticConfig,this.G,this.product),this.storeHandler.setDropCallBack((function(t){i.traceType.DB_O_DROP+=d.calculateMemSize(t),i.$("dataDroped",t)})),[4,this.storeHandler.loadPendingData()];case 1:return e.sent(),this.storeHandler.init().then((function(){i.it()})).catch((function(t){console.warn(t)})),this.nt(),this.rt(),this.et(),[2]}}))}))},m.prototype.uninit=function(){this.isWaitNtpTimeout=!1,this.ntpTimer&&(clearTimeout(this.ntpTimer),this.ntpTimer=null),this.zegoService.destroy()},m.prototype.setConfig=function(t){"object"==typeof t&&"number"==typeof t.bps&&(this.config.bps=t.bps,this.zegoService.setBps(this.config.bps)),"object"==typeof t&&"number"==typeof t.totalDBSize&&(this.staticConfig.totalDBSize=t.totalDBSize),"object"==typeof t&&"string"==typeof t.serverUrl&&""!==t.serverUrl&&(this.config.serverUrl=t.serverUrl,this.zegoService.setLogServer(this.config.serverUrl))},m.prototype.pause=function(){this.isPaused=!0},m.prototype.resume=function(){this.isPaused=!1;var t=(i=this.pendingQueue.getPendingDataInfo()).pendingDataSize,i=i.size;this.st(t,i)},m.prototype.startReport=function(t){var i=t.get("userID"),e=t.get("token");return!(!i||"string"!=typeof i||!e||"string"!=typeof e||(this.startCommonField=t,this.config.userID=i,this.config.token=e,this.zegoService.setLogUrlParams({product:this.product,signature:this.config.token,appid:this.config.appID,id_name:this.config.userID||"",deviceid:this.config.deviceID||""}),this.ut()&&this.ot(),(i=t.get("serverUrl"))&&(this.config.serverUrl=i,this.zegoService.setLogServer(this.config.serverUrl)),this.isConfigOK(this.config)&&(t=(e=this.pendingQueue.getPendingDataInfo()).pendingDataSize,i=e.size,this.st(t,i)),0))},m.prototype.setTimeOffset=function(t){var i=this;this.clientTimeOffset=t,this.tempBuffer.forEach((function(t){(t=t.data).tags.time_offset||(t.tags.time_offset=i.clientTimeOffset)})),this.config.userID&&this.ot()},m.prototype.setProcessData=function(t){this.G.processData=t},m.prototype.on=function(t,i){return this.ht(t,i)},m.prototype.off=function(t,i){return this.ct(t,i)},m.prototype.report=function(t,i){var e;if(15e3<t.length)return!1;try{e=JSON.parse(t)}catch(t){return!1}return this.G.F.debug(t+" "+i),(null!=e&&e.id_name||null!=(t=null==e?void 0:e.tags)&&t.id_name||this.config.userID)&&this.ut()?(null!=e&&e.id_name||null!=(t=null==e?void 0:e.tags)&&t.id_name?this.clientTimeOffset&&(e.tags.time_offset=this.clientTimeOffset):(this.clientTimeOffset&&(e.tags.time_offset=this.clientTimeOffset),e.tags.id_name=this.config.userID),this.ft(JSON.stringify(e),i)):this.tempBuffer.push({data:e,level:i}),!0},m.prototype.setUnloadState=function(t){this.unloadLevel=t,this.state="unload"},m.prototype.ft=function(t,i){var e=this,n=d.calculateMemSize(t),s=(this.traceType.MEM_I_API+=n,c.getSeq()),r=(new Date).getTime(),o={seq:s,content:t,level:i,timestamp:r};"unload"===this.state?void 0!==this.unloadLevel&&i<=this.unloadLevel?(this.storeHandler.saveDataToStorage(o),this.pendingQueue.enqueue(o,i)):this.G.F.debug("level is low"):i<=this.config.importantLevel?(o.key=i+"_"+r+"_"+s,this.dataInDb.push(o.key),this.storeHandler.storeData(o).then((function(t){e.pendingQueue.enqueue(o,i),e.traceType.DB_I_BACKUP+=n})).catch((function(t){var n=e.dataInDb.findIndex((function(t){return t===o.key}));-1<n&&e.dataInDb.splice(n,1),e.pendingQueue.enqueue(o,i)}))):this.pendingQueue.enqueue(o,i),"force"===this.state&&(r=d.calculateMemSize(t),this.forceDataTotalLen+=r)},m.prototype.ut=function(){return this.isWaitNtpTimeout||void 0!==this.clientTimeOffset},m.prototype.ot=function(){var t,i=this.tempBuffer.shift();i&&(t=i.data,i=i.level,t.tags.id_name=this.config.userID,this.ft(JSON.stringify(t),i),this.ot())},m.prototype.isConfigOK=function(t){return""!==t.userID&&""!==t.token&&""!==t.server},m.prototype.testSize=function(t){},m.prototype.flush=function(t){var i;"force"!==this.state&&(this.state="force",i=16e6,"object"==typeof t&&"number"==typeof t.bps&&(i=t.bps),this.zegoService.setBps(i),this.forceDataTotalLen=this.storeHandler.storeSize+this.pendingQueue.pendingDataSize+this.reportPackagesSize,i=(t=this.pendingQueue.getPendingDataInfo()).pendingDataSize,t=t.size,0<i?this.st(i,t):this.it())},m.prototype.setWaitNtpTimeout=function(t){this.waitNtpTimeout=t},m.prototype.rt=function(){var t=this;this.ntpTimer=setTimeout((function(){t.isWaitNtpTimeout=!0,t.config.userID&&t.ot()}),this.waitNtpTimeout)},m.prototype.nt=function(){var t=this;this.G.F.debug("startReportTimer "+new Date),this.timeInterval=!0;var i=(e=this.pendingQueue.getPendingDataInfo()).pendingDataSize,e=e.size;this.st(i,e),this.reportTimer=window.setTimeout((function(){t.nt()}),3e4)},m.prototype.et=function(){return s(this,void 0,void 0,(function(){var t,i,e=this;return r(this,(function(n){switch(n.label){case 0:return i=this.pendingQueue.getPendingDataInfo(),t=i.pendingDataSize,i=i.size,t>this.config.reportSize||i>this.config.reportNum?[4,this.st(t,i)]:[3,2];case 1:return n.sent(),[3,3];case 2:this.it(),n.label=3;case 3:return this.checkDataTimer=window.setTimeout((function(){e.et()}),15e3),[2]}}))}))},m.prototype.H=function(){var t=this,i=navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i);navigator.userAgent.indexOf("Firefox"),window.addEventListener(i?"pagehide":"beforeunload",(function(){window.event&&(window.event.cancelBubble=!0),t.saveDataBeforeUnload()}))},m.prototype.saveDataBeforeUnload=function(){var t=(t=this.pendingQueue.readStoreData(1)).storeArr,i=(this.storeHandler.resetCommonStore(),[]);i.push.apply(i,u(t)),t=this.zegoService.readReportQueueData(),i.push.apply(i,u(t)),0<i.length&&this.storeHandler.storePendingData(i)},m.prototype.setNetStateCheck=function(){"fail"===this.postDataState&&this.zegoService.handleNetConnect()},m.prototype.Y=function(t,i,e){return s(this,void 0,void 0,(function(){var e,n,s,o,u,a=this;return r(this,(function(r){switch(r.label){case 0:for(this.G.F.debug("post suc"),this.postDataState="suc",t.forEach((function(t){a.traceType.MEM_O_DONE+=d.calculateMemSize(t.content)})),e=function(i){var e=t[i];n.storeHandler.removeDataItem(e).then((function(t){e.key&&a.reportMap.delete(e.key)})).catch((function(t){}))},n=this,s=0;s<t.length;s++)e(s);return this.reportPackagesSize-=i,u=this.pendingQueue.getPendingDataInfo(),o=u.pendingDataSize,u=u.size,o>this.config.reportSize||u>this.config.reportNum?[4,this.st(o,u)]:[3,2];case 1:return r.sent(),[3,3];case 2:this.it(),r.label=3;case 3:return"force"===this.state&&0==this.reportPackagesSize&&(o=this.reportPackagesSize+this.pendingQueue.pendingDataSize+this.storeHandler.storeSize,u=1-Number((o/this.forceDataTotalLen).toFixed(2)),this.listenerList.progressUpdate&&this.$("progressUpdate",u),0<this.storeHandler.storeSize)&&this.it((function(t){0===t&&(a.state="normal",a.zegoService.setBps(a.config.bps||v.DEFAULT_CONFIG.bps),a.listenerList.forceSuccessCallback)&&a.$("forceResult","SUCCESS")})),[2]}}))}))},m.prototype.st=function(t,i){return s(this,void 0,void 0,(function(){var e,n,s,o,u;return r(this,(function(r){switch(r.label){case 0:return t>this.config.reportSize||i>this.config.reportNum||["force","unload"].includes(this.state)||this.timeInterval?(this.timeInterval=!1,!this.isPaused&&this.config.userID&&this.config.token&&this.config.serverUrl?[3,3]:(this.G.F.debug("isPaused "+this.isPaused+" "+this.userID+" "+this.config.token+" "+this.config.serverUrl),t>=this.cacheMaxSize||this.staticConfig.totalAvailCache<=0?[4,this.Z(this.cacheDelPer)]:[3,2])):[3,7];case 1:r.sent(),r.label=2;case 2:return[2];case 3:return this.zegoService.reportAllowed()?[3,6]:(this.zegoService.resumeReport(),t>=this.cacheMaxSize||this.staticConfig.totalAvailCache<=0?[4,this.Z(this.cacheDelPer)]:[3,5]);case 4:r.sent(),r.label=5;case 5:return[2];case 6:if(s=this.pendingQueue.readReportData(this.config.reportSize),e=s.totalLen,s=s.reportDataArr,e<=0)return[2];for(s=this.lt(s),this.zegoService.report(n=s.packageArr,s=s.packageLen,this.product,"unload"===this.state),o=0;o<n.length;o++)this.reportMap.set((u=n[o]).key,u);this.reportPackagesSize+=s,this.pendingQueue.refresh(e),r.label=7;case 7:return[2]}}))}))},m.prototype.tt=function(){var t=this;this.pendingQueue=new l.PendingQueue(this.config.levels,this.product,this.staticConfig,this.G),this.pendingQueue.setListener({enCallback:function(i,e,n){return s(t,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.st(n,e)];case 1:return t.sent(),[2]}}))}))}})},m.prototype.vt=function(){var t=this;this.storeHandler.readStoreDataItem().then((function(i){var e=d.calculateMemSize(i.content);t.traceType.MEM_I_LOAD+=e,t.pendingQueue.enqueue(i,i.level)})).catch((function(t){}))},m.prototype.Z=function(t){return s(this,void 0,void 0,(function(){var i,e,n,s,o,u,c,h,f;return r(this,(function(l){switch(l.label){case 0:e=this.pendingQueue.readStoreData(t),i=e.totalLen,e=e.storeArr,n=function(t){var e,n;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,s.dt(t,i)];case 1:return r.sent(),e=t.level+"_"+t.timestamp+"_"+t.seq,-1<(n=s.dataInDb.findIndex((function(t){return t===e})))&&s.dataInDb.splice(n,1),[3,3];case 2:return r.sent(),[3,3];case 3:return[2]}}))},s=this,l.label=1;case 1:l.trys.push([1,6,7,8]),o=a(e),u=o.next(),l.label=2;case 2:return u.done?[3,5]:[5,n(c=u.value)];case 3:l.sent(),l.label=4;case 4:return u=o.next(),[3,2];case 5:return[3,8];case 6:return c=l.sent(),h={error:c},[3,8];case 7:try{u&&!u.done&&(f=o.return)&&f.call(o)}finally{if(h)throw h.error}return[7];case 8:return[2]}}))}))},m.prototype.V=function(t){var i=this;t.length&&t.forEach((function(t){i.storeHandler.storeData(t).then((function(e){var n=d.calculateMemSize(t.content);i.traceType.MEM_O_DUMP+=n})).catch((function(t){}))}))},m.prototype.dt=function(t,i){var e=this;return new Promise((function(i,n){return s(e,void 0,void 0,(function(){var e;return r(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.storeHandler.storeData(t)];case 1:return s.sent(),e=d.calculateMemSize(t.content),this.traceType.MEM_O_DUMP+=e,i(),[3,3];case 2:return e=s.sent(),n(e),[3,3];case 3:return[2]}}))}))}))},m.prototype.it=function(t){var i=this;this.storeHandler.storeSize<=0||this.isLoadReportData||(this.isLoadReportData=!0,this.storeHandler.loadDBData(this.config.reportSize,5,Math.floor(this.cacheMaxSize/3),(function(t){return-1<i.dataInDb.indexOf(t)})).then((function(e){i.isLoadReportData=!1,e.datas.forEach((function(t){var e;i.reportMap.has(t.key)||i.pendingQueue.findInQueue(t)||(e=d.calculateMemSize(t.content),i.traceType.MEM_I_LOAD+=e,i.pendingQueue.enqueue(t,t.level),i.dataInDb.push(t.key))})),t&&t(e.len)})).catch((function(t){i.isLoadReportData=!1})))},m.prototype.lt=function(t){var i=this,e=0;return t.forEach((function(t){var n,s,r=JSON.parse(t.content);if(i.startCommonField)try{for(var u=a(i.startCommonField),c=u.next();!c.done;c=u.next()){var h=o(c.value,2),f=h[0];"userID"!==f&&"token"!==f&&"serverUrl"!==f&&(r[f]=h[1])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(n)throw n.error}}e+=d.calculateMemSize(r),t.content=JSON.stringify(r)})),{packageArr:t,packageLen:e}},m.prototype.ht=function(t,i){return!!this.listenerList[t]&&"function"==typeof i&&(-1==this.listenerList[t].indexOf(i)&&this.listenerList[t].push(i),!0)},m.prototype.ct=function(t,i){var e;return!!this.listenerList[t]&&(e=this.listenerList[t],i?e.splice(e.indexOf(i),1):this.listenerList[t]=[],!0)},m.prototype.$=function(t){for(var i=[],e=1;e<arguments.length;e++)i[e-1]=arguments[e];this.listenerList[t]&&this.listenerList[t].forEach((function(t){try{t.apply(void 0,u(i))}catch(t){}}))},i.ZegoDataReport=m},function(t,i,e){"use strict";var n=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},s=this&&this.__spread||function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(n(arguments[i]));return t},r=(Object.defineProperty(i,"u",{value:!0}),i.ZegoService=void 0,e(0)),o=e(25),u=e(28),a=e(4);function c(t,i,e,n,s){var u,a,c,h=this;this.yt=t,this.wt=e,this.bt=n,this.G=s,this.isDestroy=!1,this.packageLen=0,this.packagesDataSize=0,this.PACKAGE_MAX_LEN=5,this.msgID=0,this.logUploadTimer=null,this.logUploadInterval=1e4,this.logCacheSend=[],this.logCacheMax=100,this.gt=1e3,this.postSucCallbackList={},this.postFailCallbackList={},this.failCount=0,this.failStartTime=0,this.netWorkFail=!1,this.networkState=r.ENUM_NETWORK_STATE.online,this.state=0,this._t=(a=u=0,c=function(){a=u=0},{onOpen:function(){u=performance.now()},onClose:function(){0<u&&(performance.now()-u<100?(a++,h.G.logger.info("zt.rzs.wfsc frequently shutdown.")):c())},isOutOfMaxTimes:function(){return 10<=a}}),this.Ot={offline:function(){h.networkState=r.ENUM_NETWORK_STATE.offline},online:function(t){h.handleNetConnect()}},this.bindWindowListener(),this.networkState=r.ENUM_NETWORK_STATE.online,this.service=new o.LogService(t,e,n,s),this.service.onHbTimeout=function(){h.G.logger.warn("zt.rzs.ohbto hb timeout."),h.socketReconnect(!0,!0)},this.setBps(i),this.reportQueue=new r.Queue}c.prototype.destroy=function(){this.St(),this.logUploadTimer&&clearTimeout(this.logUploadTimer),this.reportQueue.clear(),window.removeEventListener("offline",this.Ot.offline),window.removeEventListener("online",this.Ot.online),this.isDestroy=!0},c.prototype.bindWindowListener=function(){window.addEventListener("offline",this.Ot.offline),window.addEventListener("online",this.Ot.online)},c.prototype.handleNetConnect=function(){var t;this.networkState=r.ENUM_NETWORK_STATE.online,1===this.logType?this.socketReconnect():(t=this.url,this.url="",this.setLogServer(t)),this.netWorkFail=!1},c.prototype.setLogServer=function(t){try{return t.startsWith("wss:")||t.startsWith("ws:")?(this.logType=1,this.Mt(t)):t.startsWith("https:")||t.startsWith("http:")?(this.logType=2,this.Et(t)):this.logType=0,!0}catch(t){return!1}},c.prototype.setLogUrlParams=function(t){this.logParams=t},c.prototype.Mt=function(t){var i=this;this.url!=t&&(this.url=t)&&(this.St(),this.logParams.id_name)&&(this._t.isOutOfMaxTimes()?(this.G.logger.warn("zt.rzs.owsls frequently shutdown too many times. cannot create socket anymore."),this.state=0):(this.state=1,t+="?product="+this.logParams.product+"&appid="+this.logParams.appid+"&token="+encodeURIComponent(this.logParams.signature)+"&deviceid="+this.logParams.deviceid+"&id_name="+this.logParams.id_name,this.service.createSocket(t),this.service.openHandler((function(){i.service.onPush(),i.service.startCheck(),i.G.logger.info("zt.rzs.owsls socket open"),i.openHandler(),i._t.onOpen()})),this.service.closeHandler((function(t){i.G.logger.warn("zt.rzs.owsls socket close "+JSON.stringify(t.code||t)),i.state=0,i.service.closeSocket(),i._t.onClose(),i.service.url&&i.socketReconnect(!1)})),this.service.errorHandler((function(t){i.G.logger.warn("zt.rzs.owsls socket error "+JSON.stringify(t.code||t)),i.state=0,i.service.closeSocket(),i.service.url&&i.socketReconnect(!1)}))))},c.prototype.St=function(){this.service.closeSocket(!0),this.jt&&(clearTimeout(this.jt),this.jt=void 0)},c.prototype.Et=function(t){(this.url=t)&&this.Tt()},c.prototype.Tt=function(){this.logUploadTimer&&(clearInterval(this.logUploadTimer),this.logUploadTimer=null)},c.prototype.Nt=function(t,i,e,n){this.yt===r.ZEGO_ENV.BROWSER?this.At(t,i,e,n):this.SendHttpsLogWeChatMini(t,i,e,n)},c.prototype.At=function(t,i,e,n){var s=this,r=(t=JSON.stringify({body:{data:t}}),new XMLHttpRequest);r.onreadystatechange=function(){if(4==r.readyState)if(200==r.status){if(0!=r.responseText.length)try{var t=JSON.parse(r.responseText).interval;"number"==typeof t&&s.logUploadInterval!==t&&s.Et(s.url),e&&e()}catch(t){n&&n()}}else n&&n()},r.open("POST",this.url,!0),r.send(t)},c.prototype.SendHttpsLogWeChatMini=function(t,i,e,n){var s=this;t={appid:this.logParams.appid+"",timestamp:(new Date).getTime()+"",token:this.logParams.signature,id_name:this.logParams.id_name,product:this.logParams.product,message_id:++this.msgID,req_sdk:1,s:JSON.stringify({speed_detail:t})},wx.request({url:this.url,data:JSON.stringify(t),method:"POST",success:function(t){0!=t.data.length&&("number"==typeof(t=t&&t.data&&t.data.interval)&&s.logUploadInterval!==t&&s.Et(s.url),e)&&e()},fail:function(t){n&&n()}})},c.prototype.openHandler=function(){this.state=2,this.startReport()},c.prototype.setPostSucCallback=function(t,i){this.postSucCallbackList[t]=i},c.prototype.setPostFailCallback=function(t,i){this.postFailCallbackList[t]=i},c.prototype.reportAllowed=function(){return this.packageLen<this.PACKAGE_MAX_LEN},c.prototype.report=function(t,i,e,n){this.packageLen++,this.packagesDataSize+=i,this.reportQueue.enqueue({reportDatas:t,dataLen:i,product:e}),this.netWorkFail=!1,this.failCount=0,this.failStartTime=0,this.startReport(n)},c.prototype.setBps=function(t){this.tokenBucket=new u.TokenBucket(a.BUCKET_CONFIG.bucketSize,t/8,"sec")},c.prototype.startReport=function(t){var i,e,n,s,r=this;this.isDestroy||1===this.logType&&this.socketReconnect()||0<this.reportQueue.size()&&(i=this.reportQueue.dequeue(),e=i.reportDatas,n=i.dataLen,s=i.product,new Date,t?this.sendReport(e,n,s):this.tokenBucket.removeTokens(n,(function(){r.sendReport(e,n,s)})))},c.prototype.Rt=function(){if(this.failCount<=0)return!1;1==this.failCount&&(this.failStartTime=Date.now());var t=(Date.now()-this.failStartTime)/1e3;return this.failCount>=a.FAIL_COUNT&&t>a.FAIL_TIME||this.failCount>=a.FAIL_MAX_COUNT},c.prototype.sendReport=function(t,i,e){var n=this;this.reportData(t,i,e,(function(){n.failCount=0,n.failStartTime=0,n.packageLen--,n.packagesDataSize-=i,n.postSucCallbackList[e]&&n.postSucCallbackList[e](t,i,e)}),(function(s){var r;n.reportQueue.enqueue({reportDatas:t,dataLen:i,product:e}),n.failCount++,n.Rt()?(n.netWorkFail=!0,r=n.decodeReportQueue(),Object.keys(n.postFailCallbackList).forEach((function(t){n.postFailCallbackList[e](r[t])}))):n.startReport()}))},c.prototype.resumeReport=function(){!0===this.netWorkFail&&this.networkState===r.ENUM_NETWORK_STATE.online&&(this.netWorkFail=!1,this.startReport())},c.prototype.reportData=function(t,i,e,n,s){var o=this,u=[];t.forEach((function(t){u.push(JSON.parse(t.content))})),1==this.logType?this.networkState===r.ENUM_NETWORK_STATE.offline?s&&s(r.errorList.BROKEN):this.service.sendMessage("report",u,n,(function(t){var i;0===o.state&&t===r.SOCKET_DISCONNECT&&(i=o.url,o.url="",o.setLogServer(i)),s&&s(t)})):2==this.logType&&this.Nt(u,i,n,(function(){s&&s()}))},c.prototype.unsigned2signed=function(t){var i=parseInt(t,10);if(256<i)return i%256;for(var e=[];0<i;)e.push(i%2!=0?1:0),i=Number(i/2);for(e.reverse();e.length<8;)e.unshift(0);var n="";if(1==(e=e.join("")).substr(0,1)){for(var s=1;s<e.length;s++)1==e.substr(s,1)?n+=0:n+=1;return"-"+(parseInt(n,2)+1)}for(s=0;s<e.length;s++)n+=e.substr(s,1);return parseInt(n,2)},c.prototype.decodeReportQueue=function(){for(var t={},i=this.reportQueue.size(),e=0;e<i;e++){var n=this.reportQueue.dequeue(),r=n.reportDatas,o=n.dataLen;t[n=n.product]||(t[n]=[]),t[n]=s(t[n],r),this.reportQueue.enqueue({reportDatas:r,dataLen:o,product:n})}return t},c.prototype.readReportQueueData=function(){for(var t=[],i=this.reportQueue.size(),e=0;e<i;e++){var n=this.reportQueue.dequeue();t.push.apply(t,s(n.reportDatas))}return t},c.prototype.socketReconnect=function(t,i){var e=this,n=(void 0===t&&(t=!0),(i=void 0!==i&&i)||0===this.state);return this.jt&&!t||n&&(t&&this.jt&&(clearTimeout(this.jt),this.jt=void 0),this.jt||(this.jt=setTimeout((function(){var t;!e.isDestroy&&(e.jt&&(clearTimeout(e.jt),e.jt=void 0),i||0===e.state)&&(t=e.url,e.url="",e.setLogServer(t))}),t?0:5e3))),n},i.ZegoService=c},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.LogService=void 0;var n=e(26),s=e(4),r=e(0);function o(t,i,e,s){this.yt=t,this.wt=i,this.bt=e,this.G=s,this.It=new n.ZegoSocketService(this.yt,this.wt,this.bt,this.G),this.kt=0,this.Dt={},this.xt=void 0,this.checkHbTimer=void 0}Object.defineProperty(o.prototype,"url",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),o.prototype.Bt=function(t){var i,e,n=this,s=this.It.sendCommandMap[t.messageId||(null==(s=null==t?void 0:t.data)?void 0:s.message_id)];null!=s&&(e=s.v,delete this.It.sendCommandMap[t.messageId||(null==(i=null==t?void 0:t.data)?void 0:i.message_id)],this.It.sendCommandList.remove(s),0===t.code?setTimeout((function(){e&&null!=e.success&&e.success(t,n.kt)}),0):setTimeout((function(){e&&null!=e.error&&e.error(t,n.kt)}),0))},o.prototype.onPush=function(){var t=this;this.It.onMessage=function(i){t.xt=performance.now(),t.startHbTimer(),t.Bt(i)}},o.prototype.closeHandler=function(t){this.It.closeHandler((function(i){t(i)}))},o.prototype.openHandler=function(t){var i=this;this.It.openHandler((function(){i.xt=performance.now(),i.startHbTimer(),t&&t()}))},o.prototype.errorHandler=function(t){this.It.errorHandler((function(i){t(i)}))},o.prototype.Ut=function(t){return{Protocol:"req",cmd:t,appid:123,seq:++this.kt,session_id:""}},o.prototype.startCheck=function(){this.It.startCheck()},o.prototype.stopCheck=function(){this.It.stopCheck()},o.prototype.isDisConnect=function(){return!this.It||this.It.isDisConnect()},o.prototype.createSocket=function(t){this.It.createSocket(t),this.Dt={},this.Pt=t},o.prototype.closeSocket=function(t){void 0===t&&(t=!1),this.xt=void 0,this.clearHbTimer(),this.It.closeSocket(),t&&(this.Pt=void 0)},o.prototype.sendMessage=function(t,i,e,n,o){return this.It.isDisConnect()?(n&&n(r.SOCKET_DISCONNECT),0):(o=o||this.Ut(t),this.It.sendMessage(o,i,e,n,{timeOut:1e3*s.DEFAULT_CONFIG.netTimeout}))},o.prototype.on=function(t,i){this.Dt[t]=i},o.prototype.clearHbTimer=function(){this.checkHbTimer&&(clearTimeout(this.checkHbTimer),this.checkHbTimer=void 0)},o.prototype.startHbTimer=function(){var t=this;this.clearHbTimer(),this.It.isDisConnect()||(void 0!==this.xt&&15e3<performance.now()-this.xt?this.Pt&&this.onHbTimeout():this.checkHbTimer=setTimeout((function(){t.It.isDisConnect()||(t.sendMessage("report",[]),t.startHbTimer())}),5e3))},o.prototype.onHbTimeout=function(){},i.LogService=o},function(t,i,e){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t}).apply(this,arguments)},s=(Object.defineProperty(i,"u",{value:!0}),i.ZegoSocketService=void 0,e(27)),r=e(0);function o(t,i,e,n){this.wt=i,this.bt=e,this.G=n,this.zt=null,this.sendCommandList=new r.LinkedList,this.sendCommandMap={},this.Jt=100,this.Lt=3e4,this.qt=2e3,this.Ot={},this.ENV=t}o.prototype.createSocket=function(t){var i=this;this.zt=s.createZegoWebSocket(t,this.ENV,this.G.proxyCtrl),this.zt.onclose=function(t){i.Ot.close&&i.Ot.close(t)},this.zt.onerror=function(t){i.Ot.error&&i.Ot.error(t)},this.zt.binaryType="arraybuffer"},o.prototype.closeSocket=function(){this.zt&&(this.zt.onclose=null,this.zt.onerror=null,this.zt.close(),this.zt=null)},o.prototype.isDisConnect=function(){return!this.zt||1!==this.zt.readyState},o.prototype.sendMessage=function(t,i,e,s,r){void 0===r&&(r={timeOut:6e3});var o=n(n({},this.G.processData),{time_upload:Date.now()});return o={data:i={message_id:t.seq,product:this.wt,s:JSON.stringify({speed_detail:i,process:o})},seq:t.seq,deleted:!1,sendTime:Date.parse(new Date+""),timeOut:r.timeOut,success:e,error:s},r=this.sendCommandList.push(o),this.sendCommandMap[o.seq]=r,this.zt&&"pb"!==this.bt&&(this.G.F.debug("zt.zss.sm upload data",JSON.stringify(i)),e=this.G.deflate(JSON.stringify(i)),this.zt.send(e)),t.seq},o.prototype.Ct=function(t){for(var i=t.getFirst();null!=i;)t.remove(i),i.v&&i.v.error&&setTimeout((function(){i&&i.v&&i.v.error&&i.v.error(r.errorList.TIMEOUT,i.v.data.message_id,i.v.data.s)}),0),i=t.getFirst()},o.prototype.Ft=function(t,i){for(var e=t.getFirst(),n=Date.parse(new Date+""),s=0;!(null==e||e.v&&e.v.sendTime+e.v.timeOut>n||(e.v&&delete i[e.v.data.message_id],t.remove(e),!(e.v&&null==e.v.error||e.v&&e.v.sendTime+this.Lt<n)&&e&&e.v&&e.v.error&&e.v.error(r.errorList.TIMEOUT,e.v.data.message_id,e.v.data.s),++s>=this.Jt));)e=t.getFirst()},o.prototype.startCheck=function(){var t=this;this.Ft(this.sendCommandList,this.sendCommandMap),this.Wt=setTimeout((function(){t.startCheck()}),this.qt)},o.prototype.stopCheck=function(){this.Ct(this.sendCommandList),clearTimeout(this.Wt)},o.prototype.openHandler=function(t){var i=this;this.zt&&(this.zt.onopen=function(e){i.responseHandler(),t(e)})},o.prototype.responseHandler=function(){var t=this;this.zt&&(this.zt.onmessage=function(i){i="string"==typeof i.data?JSON.parse(i.data):JSON.parse(String.fromCharCode.apply(null,new Uint8Array(i.data))),t.onMessage(i)})},o.prototype.closeHandler=function(t){this.Ot.close=t},o.prototype.errorHandler=function(t){this.Ot.error=t},o.prototype.onMessage=function(t){},i.ZegoSocketService=o},function(t,i,e){"use strict";Object.defineProperty(i,"u",{value:!0}),i.createZegoWebSocket=i.ZegoWeiXinMiniWebSocket=void 0;var n=e(0),s=(r.prototype.init=function(){var t=this;this.Xt&&(this.readyState=0,this.Xt.onOpen((function(i){t.readyState=t.Xt.readyState,"function"==typeof t.onopen&&(t.onopen(i),t.Xt.onClose((function(i){t.readyState=t.Xt.readyState,"function"==typeof t.onclose&&t.onclose(i)})),t.Xt.onMessage((function(i){"function"==typeof t.onmessage&&t.onmessage(i)})))})),this.Xt.onError((function(i){t.readyState=t.Xt.readyState,"function"==typeof t.onerror&&t.onerror(i)})))},r.prototype.onopen=function(t){},r.prototype.onerror=function(t){},r.prototype.onclose=function(t){},r.prototype.onmessage=function(t){},r.prototype.send=function(t){this.Xt&&this.Xt.send({data:t})},r.prototype.close=function(){this.Xt&&this.Xt.close()},r);function r(t,i){this.url=t,this.readyState=3,this.Xt=wx.connectSocket({url:t}),this.init()}i.ZegoWeiXinMiniWebSocket=s,i.createZegoWebSocket=function(t,i,e){return i%2===n.ZEGO_ENV.BROWSER?(i=t,e?e.createSocket(i,1):new WebSocket(i)):new s(t)}},function(t,i,e){"use strict";function n(t,i,e,n){if(this.bucketSize=1,this.tokensPerInterval=1,this.interval=1e3,this.parentBucket=null,this.content=0,this.lastDrip=0,this.bucketSize=t,this.tokensPerInterval=i,"string"==typeof e)switch(e){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+e)}else this.interval=e;this.parentBucket=n,this.content=0,this.lastDrip=+new Date}Object.defineProperty(i,"u",{value:!0}),i.TokenBucket=void 0,n.prototype.removeTokens=function(t,i){var e=this;return this.bucketSize?t>this.bucketSize?(setTimeout(i.bind(null,"Requested tokens "+t+" exceeds bucket size "+this.bucketSize,null),0),!1):(this.drip(),t>this.content?n():this.parentBucket?this.parentBucket.removeTokens(t,(function(s,r){return s?i(s,null):t>e.content?n():(e.content-=t,void i(null,Math.min(r,e.content)))})):(this.content-=t,setTimeout(i.bind(null,null,this.content),0),!0)):(setTimeout(i.bind(null,null,t,Number.POSITIVE_INFINITY),0),!0);function n(){var n=Math.ceil(e.interval/e.tokensPerInterval*(t-e.content));return setTimeout((function(){e.removeTokens(t,i)}),n),!1}},n.prototype.tryRemoveTokens=function(t){if(this.bucketSize){if(t>this.bucketSize)return!1;if(this.drip(),t>this.content)return!1;if(this.parentBucket&&!this.parentBucket.tryRemoveTokens(t))return!1;this.content-=t}return!0},n.prototype.drip=function(){var t,i;this.tokensPerInterval?(i=+new Date,t=Math.max(i-this.lastDrip,0),this.lastDrip=i,i=t*(this.tokensPerInterval/this.interval),this.content=Math.min(this.content+i,this.bucketSize)):this.content=this.bucketSize},i.TokenBucket=n},function(t,i,e){"use strict";var n=this&&this.__awaiter||function(t,i,e,n){return new(e=e||Promise)((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):((i=t.value)instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},s=this&&this.__generator||function(t,i){var e,n,s,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o={next:u(0),throw:u(1),return:u(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){var a=[o,u];if(e)throw new TypeError("Generator is already executing.");for(;r;)try{if(e=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,(a=s?[2&a[0],s.value]:a)[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,n=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(s=0<(s=r.trys).length&&s[s.length-1])&&(6===a[0]||2===a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3]))r.label=a[1];else if(6===a[0]&&r.label<s[1])r.label=s[1],s=a;else{if(!(s&&r.label<s[2])){s[2]&&r.ops.pop(),r.trys.pop();continue}r.label=s[2],r.ops.push(a)}}a=i.call(t,r)}catch(u){a=[6,u],n=0}finally{e=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}},r=this&&this.__importDefault||function(t){return t&&t.u?t:{default:t}},o=(Object.defineProperty(i,"u",{value:!0}),i.ZegoStoreHandler=void 0,e(11)),u=e(5),a=e(4),c=r(e(12));function h(t,i,e,n,s,r,u){this.O=t,this.Kt=i,this.Gt=e,this.Ht=n,this.Yt=s,this.G=r,this.wt=u,this.storeSize=0,this.storeTime=0,this.storeDelPer=a.STORE_SIZE.storeDelPer,this.updateTimeFreq=6e4,this.storeSleepInterval=6e5,this.droping=!1,this.bufferData=[],this.updateTimer=null,this.interSymbol="#",this.drops=[],this.storesKeys="",this.transStores=[],this.store=o.createZegoStore(t,e.env,i),this.commonStore=o.createZegoStore("data_common",e.env,"reporter")}Object.defineProperty(h.prototype,"Vt",{get:function(){return"z_t_"+this.wt+"_"+this.Gt.appID},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"Zt",{get:function(){return"z_store_keys"},enumerable:!1,configurable:!0}),h.prototype.init=function(){return n(this,void 0,void 0,(function(){var t,i;return s(this,(function(e){switch(e.label){case 0:return e.trys.push([0,6,,7]),this.setCommonStoreState(),[4,this.transferStoreData()];case 1:return e.sent(),[4,this.commonStore.getItem(this.O+this.interSymbol+this.Kt)];case 2:return(t=e.sent())?[3,4]:[4,this.commonStore.setItem(this.O+this.interSymbol+this.Kt,i={storeSize:this.storeSize,lock:0,pros:1})];case 3:return e.sent(),[3,5];case 4:i="string"==typeof t?JSON.parse(t):t,this.storeSize=i.storeSize,e.label=5;case 5:return[3,7];case 6:return e.sent(),[3,7];case 7:return[2]}}))}))},h.prototype.uninit=function(){this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)},h.prototype.setCommonStoreState=function(){var t=this,i=(this.getStorage(this.Zt)||"").split(";");this.transStores=i.filter((function(i){return i.includes(t.Gt.appID+"")&&i.includes(t.wt)})),i=i.filter((function(i){return!i.includes(t.Gt.appID+"")||!i.includes(t.wt)})),this.storesKeys=i.join(";")},h.prototype.resetCommonStore=function(){return n(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return this.saveStorage(this.Zt,this.storesKeys+(0<this.storesKeys.length?";":"")+this.O+this.interSymbol+this.Kt),[4,this.commonStore.setItem(this.O+this.interSymbol+this.Kt,{storeSize:this.storeSize,lock:0,pros:0})];case 1:return t.sent(),[2]}}))}))},h.prototype.transferStoreData=function(){return n(this,void 0,void 0,(function(){var t,i,e,r,a=this;return s(this,(function(c){switch(c.label){case 0:return[4,this.commonStore.keys()];case 1:t=c.sent(),i=function(i){var r,c,h,f,l,d,v,m;return s(this,(function(p){switch(p.label){case 0:return(r=t[i])===e.O+e.interSymbol+e.Kt?[3,9]:[4,e.commonStore.getItem(r)];case 1:return(c="string"==typeof(c=p.sent())?JSON.parse(c):c).lock||c.pros&&!e.transStores.includes(r)?[3,9]:(f=r.split(e.interSymbol),[4,(l=o.createZegoStore(h=f[0],e.Gt.env,f=f[1])).keys()]);case 2:return 0!=(d=p.sent()).length?[3,3]:[3,8];case 3:return c.lock=1,[4,e.commonStore.setItem(r,c)];case 4:p.sent(),v=function(t){var i,r,o;return s(this,(function(c){switch(c.label){case 0:return[4,l.getItem(i=d[t])];case 1:return r=c.sent(),-1!==i.indexOf("pending")?r&&JSON.parse(r).forEach((function(t){return n(a,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,this.storeData(t)];case 1:return i.sent(),[2]}}))}))})):(o=u.analyzeKey(i),e.storeData({level:o.level,timestamp:o.timestamp,seq:o=o.seq,content:r})),setTimeout((function(){return n(a,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,l.removeItem(i)];case 1:return t.sent(),[2]}}))}))}),300),[2]}}))},m=0,p.label=5;case 5:return m<d.length?[5,v(m)]:[3,8];case 6:p.sent(),p.label=7;case 7:return m++,[3,5];case 8:e.drops.push({name:h,storeName:f}),p.label=9;case 9:return[2]}}))},e=this,r=0,c.label=2;case 2:return r<t.length?[5,i(r)]:[3,5];case 3:c.sent(),c.label=4;case 4:return r++,[3,2];case 5:return this.transportStorageData(),setTimeout((function(){return n(a,void 0,void 0,(function(){var t,i,e;return s(this,(function(n){switch(n.label){case 0:t=0,n.label=1;case 1:if(!(t<this.drops.length))return[3,7];i=(e=this.drops[t]).name,e=e.storeName,n.label=2;case 2:return n.trys.push([2,5,,6]),[4,this.dropInstance(i,e)];case 3:return n.sent(),[4,this.commonStore.removeItem(i+this.interSymbol+e)];case 4:case 5:return n.sent(),[3,6];case 6:return t++,[3,1];case 7:return[2]}}))}))}),1e3),[2]}}))}))},h.prototype.dropInstance=function(t,i){return new Promise((function(e,n){c.default.dropInstance({name:t+":"+i}).then((function(){e()})).catch((function(t){n(t)}))}))},h.prototype.setDropCallBack=function(t){this.dropCallBack=t},h.prototype.storeData=function(t){var i=this;return new Promise((function(e,r){return n(i,void 0,void 0,(function(){var i,n,r,o,a=this;return s(this,(function(s){switch(s.label){case 0:n=t.content,r=(i=t.level)+"_"+(r=t.timestamp)+"_"+t.seq,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.store.getItem(r)];case 2:return s.sent()?(e(),[2]):[3,4];case 3:return s.sent(),[3,4];case 4:if(this.droping)return this.bufferData.push(t),[2];if(o=u.calculateMemSize(r)+u.calculateMemSize(n),this.Yt.totalDBSize-o<=0)return this.dropDBData(i,r,n).then((function(){a.droping=!1,a.bufferDump()})).catch((function(t){})),e(),[2];s.label=5;case 5:return s.trys.push([5,8,,9]),[4,this.store.setItem(r,n)];case 6:return s.sent(),this.storeSize+=o,this.Yt.totalDBSize-=o,[4,this.Qt()];case 7:return s.sent(),e(),[3,9];case 8:return"QuotaExceededError"===s.sent().name&&this.dropDBData(i,r,n).then((function(){a.droping=!1,a.bufferDump()})).catch((function(t){})),[3,9];case 9:return[2]}}))}))}))},h.prototype.loadPendingData=function(){return n(this,void 0,void 0,(function(){var t=this;return s(this,(function(i){switch(i.label){case 0:return[4,this.store.keys()];case 1:return i.sent().forEach((function(i){return n(t,void 0,void 0,(function(){var t,e=this;return s(this,(function(r){switch(r.label){case 0:return-1===i.indexOf("pending")?[3,3]:[4,this.store.getItem(i)];case 1:return(t=r.sent())?(JSON.parse(t).forEach((function(t){return n(e,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,this.storeData(t)];case 1:return i.sent(),[2]}}))}))})),[4,this.store.removeItem(i)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))})),[2]}}))}))},h.prototype.storePendingData=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return[4,this.store.setItem("pending"+(new Date).getTime(),JSON.stringify(t))];case 1:return i.sent(),[2]}}))}))},h.prototype.bufferDump=function(){return n(this,void 0,void 0,(function(){var t;return s(this,(function(i){switch(i.label){case 0:return(t=this.bufferData.pop())?[4,this.storeData(t)]:[3,2];case 1:i.sent(),this.bufferDump(),i.label=2;case 2:return[2]}}))}))},h.prototype.dropDBData=function(t,i,e){return n(this,void 0,void 0,(function(){var t=this;return s(this,(function(r){return this.droping=!0,[2,new Promise((function(r,o){return n(t,void 0,void 0,(function(){var t,n,a,c,h;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,10,,11]),[4,this.store.keys()];case 1:(t=s.sent()).reverse(),n=Math.ceil(t.length*this.storeDelPer),a=0,s.label=2;case 2:return a<n?[4,this.store.getItem(t[a])]:[3,7];case 3:return null==(c=s.sent())?[3,6]:[4,this.store.removeItem(t[a])];case 4:return s.sent(),h=u.calculateMemSize(t[a])+u.calculateMemSize(c),this.Yt.totalDBSize+=h,this.storeSize-=h,[4,this.Qt()];case 5:s.sent(),this.dropCallBack(c),s.label=6;case 6:return a++,[3,2];case 7:return[4,this.store.setItem(i,e)];case 8:return s.sent(),this.storeSize+=u.calculateMemSize(i)+u.calculateMemSize(e),[4,this.Qt()];case 9:return s.sent(),r(),[3,11];case 10:return h=s.sent(),o(h),[3,11];case 11:return[2]}}))}))}))]}))}))},h.prototype.removeDataItem=function(t){var i=this;return new Promise((function(e,r){return n(i,void 0,void 0,(function(){var i,n,o,a,c;return s(this,(function(s){switch(s.label){case 0:i=(i=t.level)+"_"+(o=t.timestamp)+"_"+(a=t.seq),s.label=1;case 1:return s.trys.push([1,6,,7]),[4,this.store.getItem(i)];case 2:return(n=s.sent())?[4,this.store.removeItem(i)]:[3,5];case 3:return s.sent(),o=u.calculateMemSize(1==this.Gt.env?JSON.parse(n):n),a=u.calculateMemSize(i)+o,this.storeSize-=a,this.Yt.totalDBSize+=a,this.Ht.DB_O_DONE+=a,[4,this.Qt()];case 4:s.sent(),e(),s.label=5;case 5:return[3,7];case 6:return c=s.sent(),r(c),[3,7];case 7:return[2]}}))}))}))},h.prototype.Qt=function(){return n(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),[4,this.commonStore.getItem(this.O+this.interSymbol+this.Kt)];case 1:return t.sent()?[4,this.commonStore.setItem(this.O+this.interSymbol+this.Kt,{storeSize:this.storeSize,lock:0,pros:1})]:[3,3];case 2:t.sent(),t.label=3;case 3:return[3,5];case 4:return t.sent(),[3,5];case 5:return[2]}}))}))},h.prototype.readStoreDataItem=function(){var t=this;return new Promise((function(i,e){return n(t,void 0,void 0,(function(){var t,n,r,o;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.store.keys()];case 1:return t=s.sent(),[4,this.store.getItem(t[0])];case 2:return n=s.sent(),r=u.analyzeKey(t[0]),i({level:o=r.level,timestamp:r.timestamp,seq:r=r.seq,content:n}),[3,4];case 3:return o=s.sent(),e(o),[3,4];case 4:return[2]}}))}))}))},h.prototype.loadDBData=function(t,i,e,r){var o=this;return new Promise((function(a,c){return n(o,void 0,void 0,(function(){var n,o,h,f,l,d,v,m,p,g;return s(this,(function(s){switch(s.label){case 0:return s.trys.push([0,6,,7]),[4,this.store.keys()];case 1:n=s.sent(),o=[],d=l=f=h=0,s.label=2;case 2:return d<n.length?r(n[d])?[3,4]:[4,this.store.getItem(n[d])]:[3,5];case 3:if(null==(v=s.sent()))return[3,4];if(m=u.analyzeKey(n[d]),o.push({level:p=m.level,timestamp:g=m.timestamp,seq:m=m.seq,content:v,key:n[d]}),p=u.calculateMemSize(v),f+=p,t<=(h+=p)&&(h=0,l++),i<=l&&e<=f)return[3,5];s.label=4;case 4:return d++,[3,2];case 5:return a({datas:o,len:f}),[3,7];case 6:return g=s.sent(),c(g),[3,7];case 7:return[2]}}))}))}))},h.prototype.sortKeys=function(t,i){void 0===i&&(i=!1),t.sort((function(t,i){return t=t.split("_"),+(i=i.split("_"))[0]-+t[0]||+i[1]-+t[1]||+i[2]-+t[2]})),i&&t.reverse()},h.prototype.saveStorage=function(t,i){try{localStorage.setItem(t,i)}catch(t){this.G.F.debug("storage set err")}},h.prototype.getStorage=function(t){try{return localStorage.getItem(t)}catch(t){this.G.F.debug("storage get err")}},h.prototype.saveDataToStorage=function(t){try{this.saveStorage(this.Vt+"_"+t.level+"_"+t.timestamp+"_"+t.seq,t.content)}catch(t){this.G.F.debug("saveDataToStorage "+JSON.stringify(t))}},h.prototype.transportStorageData=function(){for(var t=[],i=0;i<localStorage.length;i++){var e,n,s,r,o=localStorage.key(i);this.G.F.debug("transportStorageData "+o),null!=o&&o.startsWith(this.Vt)&&(s=o.replace(this.Vt+"_",""),e=(s=u.analyzeKey(s)).level,n=s.timestamp,s=s.seq,"string"==typeof(r=this.getStorage(o))&&this.storeData({level:e,timestamp:n,seq:s,content:r}),t.push(o))}setTimeout((function(){for(var i=0;i<t.length;i++)localStorage.removeItem(t[i])}),100)},i.ZegoStoreHandler=h},function(t,i,e){"use strict";var n=e(31),s=e(32).Buffer;function r(t){return function(i){if(s.isBuffer(i))return i.length;switch(typeof i){case"string":return i.length*n.STRING;case"boolean":return n.BOOLEAN;case"number":return n.NUMBER;case"symbol":return Symbol.keyFor&&Symbol.keyFor(i)?Symbol.keyFor(i).length*n.STRING:(i.toString().length-8)*n.STRING;case"object":if(Array.isArray(i))return i.map(r(t)).reduce((function(t,i){return t+i}),0);var e=t,o=i;if(null==o)return 0;for(var u=0,a=function(t){var i,e=[];for(i in t)e.push(i);return Object.getOwnPropertySymbols&&(t=Object.getOwnPropertySymbols(t),Array.prototype.push.apply(e,t)),e}(o),c=0;c<a.length;c++){var h=a[c];if("object"==typeof o[h]&&null!==o[h]){if(e.has(o[h]))continue;e.add(o[h])}u+=r(e)(h);try{u+=r(e)(o[h])}catch(e){e instanceof RangeError&&(u=0)}}return u;default:return 0}}}t.exports=function(t){return r(new WeakSet)(t)}},function(t,i){t.exports={STRING:2,BOOLEAN:4,NUMBER:8}},function(t,i,e){"use strict";(function(t){var n=e(34),s=e(35),r=e(36);function o(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,i){if(o()<i)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(i)).__proto__=a.prototype:(t=null===t?new a(i):t).length=i,t}function a(t,i,e){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,i,e);if("number"!=typeof t)return c(this,t,i,e);if("string"==typeof i)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}function c(t,i,e,n){if("number"==typeof i)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer){var s=t,o=i,c=e;if(c<0||o.byteLength<c)throw new RangeError("'offset' is out of bounds");if(o.byteLength<c+(n||0))throw new RangeError("'length' is out of bounds");return o=void 0===c&&void 0===n?new Uint8Array(o):void 0===n?new Uint8Array(o,c):new Uint8Array(o,c,n),a.TYPED_ARRAY_SUPPORT?(s=o).__proto__=a.prototype:s=l(s,o),s}if("string"!=typeof i){if(c=t,a.isBuffer(n=i))return 0!==(c=u(c,o=0|d(n.length))).length&&n.copy(c,0,0,o),c;if(n){if("undefined"!=typeof ArrayBuffer&&n.buffer instanceof ArrayBuffer||"length"in n)return"number"!=typeof n.length||(o=n.length)!=o?u(c,0):l(c,n);if("Buffer"===n.type&&r(n.data))return l(c,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}if(s=t,n=i,a.isEncoding(t="string"==typeof(t=e)&&""!==t?t:"utf8"))return(n=(s=u(s,i=0|v(n,t))).write(n,t))!==i?s.slice(0,n):s;throw new TypeError('"encoding" must be a valid string encoding')}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,i){if(h(i),t=u(t,i<0?0:0|d(i)),!a.TYPED_ARRAY_SUPPORT)for(var e=0;e<i;++e)t[e]=0;return t}function l(t,i){var e=i.length<0?0:0|d(i.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&i[n];return t}function d(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function v(t,i){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var e=(t="string"!=typeof t?""+t:t).length;if(0===e)return 0;for(var n=!1;;)switch(i){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return C(t).length;default:if(n)return N(t).length;i=(""+i).toLowerCase(),n=!0}}function m(t,i,e){var n=t[i];t[i]=t[e],t[e]=n}function p(t,i,e,n,s){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):2147483647<e?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,(e=(e=isNaN(e)?s?0:t.length-1:e)<0?t.length+e:e)>=t.length){if(s)return-1;e=t.length-1}else if(e<0){if(!s)return-1;e=0}if("string"==typeof i&&(i=a.from(i,n)),a.isBuffer(i))return 0===i.length?-1:g(t,i,e,n,s);if("number"==typeof i)return i&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(s?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,i,e):g(t,[i],e,n,s);throw new TypeError("val must be string, number or Buffer")}function g(t,i,e,n,s){var r=1,o=t.length,u=i.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||i.length<2)return-1;o/=r=2,u/=2,e/=2}function a(t,i){return 1===r?t[i]:t.readUInt16BE(i*r)}if(s)for(var c=-1,h=e;h<o;h++)if(a(t,h)===a(i,-1===c?0:h-c)){if(h-(c=-1===c?h:c)+1===u)return c*r}else-1!==c&&(h-=h-c),c=-1;else for(h=e=o<e+u?o-u:e;0<=h;h--){for(var f=!0,l=0;l<u;l++)if(a(t,h+l)!==a(i,l)){f=!1;break}if(f)return h}return-1}function b(t,i,e,n){return z(function(t){for(var i=[],e=0;e<t.length;++e)i.push(255&t.charCodeAt(e));return i}(i),t,e,n)}function _(t,i,e){e=Math.min(t.length,e);for(var n=[],s=i;s<e;){var r,o,u,a,c=t[s],h=null,f=239<c?4:223<c?3:191<c?2:1;if(s+f<=e)switch(f){case 1:c<128&&(h=c);break;case 2:128==(192&(r=t[s+1]))&&127<(a=(31&c)<<6|63&r)&&(h=a);break;case 3:o=t[s+2],128==(192&(r=t[s+1]))&&128==(192&o)&&2047<(a=(15&c)<<12|(63&r)<<6|63&o)&&(a<55296||57343<a)&&(h=a);break;case 4:o=t[s+2],u=t[s+3],128==(192&(r=t[s+1]))&&128==(192&o)&&128==(192&u)&&65535<(a=(15&c)<<18|(63&r)<<12|(63&o)<<6|63&u)&&a<1114112&&(h=a)}null===h?(h=65533,f=1):65535<h&&(n.push((h-=65536)>>>10&1023|55296),h=56320|1023&h),n.push(h),s+=f}var l=n,d=l.length;if(d<=y)return String.fromCharCode.apply(String,l);for(var v="",m=0;m<d;)v+=String.fromCharCode.apply(String,l.slice(m,m+=y));return v}i.Buffer=a,i.SlowBuffer=function(t){return a.alloc(+(t=+t!=t?0:t))},i.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),i.kMaxLength=o(),a.poolSize=8192,a.$t=function(t){return t.__proto__=a.prototype,t},a.from=function(t,i,e){return c(null,t,i,e)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol)&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0}),a.alloc=function(t,i,e){return h(t),t<=0||void 0===i?u(null,t):"string"==typeof e?u(null,t).fill(i,e):u(null,t).fill(i)},a.allocUnsafe=function(t){return f(null,t)},a.allocUnsafeSlow=function(t){return f(null,t)},a.isBuffer=function(t){return!(null==t||!t.ti)},a.compare=function(t,i){if(!a.isBuffer(t)||!a.isBuffer(i))throw new TypeError("Arguments must be Buffers");if(t===i)return 0;for(var e=t.length,n=i.length,s=0,r=Math.min(e,n);s<r;++s)if(t[s]!==i[s]){e=t[s],n=i[s];break}return e<n?-1:n<e?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,i){if(!r(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);if(void 0===i)for(s=i=0;s<t.length;++s)i+=t[s].length;for(var e=a.allocUnsafe(i),n=0,s=0;s<t.length;++s){var o=t[s];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(e,n),n+=o.length}return e},a.byteLength=v,a.prototype.ti=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<t;i+=2)m(this,i,i+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<t;i+=4)m(this,i,i+3),m(this,i+1,i+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<t;i+=8)m(this,i,i+7),m(this,i+1,i+6),m(this,i+2,i+5),m(this,i+3,i+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0==t?"":0===arguments.length?_(this,0,t):function(t,i,e){var s,r,o=!1;if((i=void 0===i||i<0?0:i)>this.length)return"";if((e=void 0===e||e>this.length?this.length:e)<=0)return"";if((e>>>=0)<=(i>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var u=e,a=this.length;(!u||u<0||a<u)&&(u=a);for(var c="",h=v=!(v=i)||v<0?0:v;h<u;++h)c+=(r=this[h])<16?"0"+r.toString(16):r.toString(16);return c;case"utf8":case"utf-8":return _(this,i,e);case"ascii":a=i;for(var f=e,l="",d=(f=Math.min(this.length,f),a);d<f;++d)l+=String.fromCharCode(127&this[d]);return l;case"latin1":case"binary":for(var v=i,m=e,p="",g=(m=Math.min(this.length,m),v);g<m;++g)p+=String.fromCharCode(this[g]);return p;case"base64":return b=this,s=e,0===(y=i)&&s===b.length?n.fromByteArray(b):n.fromByteArray(b.slice(y,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var b=i,y=e,w=this.slice(b,y),S="",E=0;E<w.length;E+=2)S+=String.fromCharCode(w[E]+256*w[E+1]);return S;default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}.apply(this,arguments)},a.prototype.equals=function(t){if(a.isBuffer(t))return this===t||0===a.compare(this,t);throw new TypeError("Argument must be a Buffer")},a.prototype.inspect=function(){var t="",e=i.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e)&&(t+=" ... "),"<Buffer "+t+">"},a.prototype.compare=function(t,i,e,n,s){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),(i=void 0===i?0:i)<0||e>t.length||n<0||s>this.length)throw new RangeError("out of range index");if(s<=n&&e<=i)return 0;if(s<=n)return-1;if(e<=i)return 1;if(this===t)return 0;for(var r=(s>>>=0)-(n>>>=0),o=(e>>>=0)-(i>>>=0),u=Math.min(r,o),c=this.slice(n,s),h=t.slice(i,e),f=0;f<u;++f)if(c[f]!==h[f]){r=c[f],o=h[f];break}return r<o?-1:o<r?1:0},a.prototype.includes=function(t,i,e){return-1!==this.indexOf(t,i,e)},a.prototype.indexOf=function(t,i,e){return p(this,t,i,e,!0)},a.prototype.lastIndexOf=function(t,i,e){return p(this,t,i,e,!1)},a.prototype.write=function(t,i,e,n){if(void 0===i)n="utf8",e=this.length,i=0;else if(void 0===e&&"string"==typeof i)n=i,e=this.length,i=0;else{if(!isFinite(i))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");i|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var s=this.length-i;if((void 0===e||s<e)&&(e=s),0<t.length&&(e<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var r,o,u,a,c,h=!1;;)switch(n){case"hex":var f,l=t,d=e,v=(f=Number(i)||0,this.length-f);if((!d||v<(d=Number(d)))&&(d=v),(v=l.length)%2!=0)throw new TypeError("Invalid hex string");v/2<d&&(d=v/2);for(var m=0;m<d;++m){var p=parseInt(l.substr(2*m,2),16);if(isNaN(p))return m;this[f+m]=p}return m;case"utf8":case"utf-8":return o=e,z(N(t,(r=this).length-(v=i)),r,v,o);case"ascii":case"latin1":case"binary":return b(this,t,i,e);case"base64":return r=this,o=i,a=e,z(C(t),r,o,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=e,z(function(t,i){for(var e,n,s=[],r=0;r<t.length&&!((i-=2)<0);++r)n=(e=t.charCodeAt(r))>>8,s.push(e%256),s.push(n);return s}(t,(u=this).length-(a=i)),u,a,c);default:if(h)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var y=4096;function w(t,i,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(e<t+i)throw new RangeError("Trying to access beyond buffer length")}function S(t,i,e,n,s,r){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(s<i||i<r)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function E(t,i,e,n){i<0&&(i=65535+i+1);for(var s=0,r=Math.min(t.length-e,2);s<r;++s)t[e+s]=(i&255<<8*(n?s:1-s))>>>8*(n?s:1-s)}function O(t,i,e,n){i<0&&(i=4294967295+i+1);for(var s=0,r=Math.min(t.length-e,4);s<r;++s)t[e+s]=i>>>8*(n?s:3-s)&255}function T(t,i,e,n){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function k(t,i,e,n,r){return r||T(t,0,e,4),s.write(t,i,e,n,23,4),e+4}function R(t,i,e,n,r){return r||T(t,0,e,8),s.write(t,i,e,n,52,8),e+8}a.prototype.slice=function(t,i){var e=this.length;if((t=~~t)<0?(t+=e)<0&&(t=0):e<t&&(t=e),(i=void 0===i?e:~~i)<0?(i+=e)<0&&(i=0):e<i&&(i=e),i<t&&(i=t),a.TYPED_ARRAY_SUPPORT)(s=this.subarray(t,i)).__proto__=a.prototype;else for(var n=i-t,s=new a(n,void 0),r=0;r<n;++r)s[r]=this[r+t];return s},a.prototype.readUIntLE=function(t,i,e){t|=0,i|=0,e||w(t,i,this.length);for(var n=this[t],s=1,r=0;++r<i&&(s*=256);)n+=this[t+r]*s;return n},a.prototype.readUIntBE=function(t,i,e){t|=0,i|=0,e||w(t,i,this.length);for(var n=this[t+--i],s=1;0<i&&(s*=256);)n+=this[t+--i]*s;return n},a.prototype.readUInt8=function(t,i){return i||w(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,i){return i||w(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,i){return i||w(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,i){return i||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,i){return i||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,i,e){t|=0,i|=0,e||w(t,i,this.length);for(var n=this[t],s=1,r=0;++r<i&&(s*=256);)n+=this[t+r]*s;return(s*=128)<=n&&(n-=Math.pow(2,8*i)),n},a.prototype.readIntBE=function(t,i,e){t|=0,i|=0,e||w(t,i,this.length);for(var n=i,s=1,r=this[t+--n];0<n&&(s*=256);)r+=this[t+--n]*s;return(s*=128)<=r&&(r-=Math.pow(2,8*i)),r},a.prototype.readInt8=function(t,i){return i||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,i){return i||w(t,2,this.length),32768&(i=this[t]|this[t+1]<<8)?4294901760|i:i},a.prototype.readInt16BE=function(t,i){return i||w(t,2,this.length),32768&(i=this[t+1]|this[t]<<8)?4294901760|i:i},a.prototype.readInt32LE=function(t,i){return i||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,i){return i||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,i){return i||w(t,4,this.length),s.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,i){return i||w(t,4,this.length),s.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,i){return i||w(t,8,this.length),s.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,i){return i||w(t,8,this.length),s.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,i,e,n){t=+t,i|=0,e|=0,n||S(this,t,i,e,Math.pow(2,8*e)-1,0);var s=1,r=0;for(this[i]=255&t;++r<e&&(s*=256);)this[i+r]=t/s&255;return i+e},a.prototype.writeUIntBE=function(t,i,e,n){t=+t,i|=0,e|=0,n||S(this,t,i,e,Math.pow(2,8*e)-1,0);var s=e-1,r=1;for(this[i+s]=255&t;0<=--s&&(r*=256);)this[i+s]=t/r&255;return i+e},a.prototype.writeUInt8=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[i]=255&t,i+1},a.prototype.writeUInt16LE=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8):E(this,t,i,!0),i+2},a.prototype.writeUInt16BE=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[i]=t>>>8,this[i+1]=255&t):E(this,t,i,!1),i+2},a.prototype.writeUInt32LE=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[i+3]=t>>>24,this[i+2]=t>>>16,this[i+1]=t>>>8,this[i]=255&t):O(this,t,i,!0),i+4},a.prototype.writeUInt32BE=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=255&t):O(this,t,i,!1),i+4},a.prototype.writeIntLE=function(t,i,e,n){t=+t,i|=0,n||S(this,t,i,e,(n=Math.pow(2,8*e-1))-1,-n);var s=0,r=1,o=0;for(this[i]=255&t;++s<e&&(r*=256);)t<0&&0===o&&0!==this[i+s-1]&&(o=1),this[i+s]=(t/r|0)-o&255;return i+e},a.prototype.writeIntBE=function(t,i,e,n){t=+t,i|=0,n||S(this,t,i,e,(n=Math.pow(2,8*e-1))-1,-n);var s=e-1,r=1,o=0;for(this[i+s]=255&t;0<=--s&&(r*=256);)t<0&&0===o&&0!==this[i+s+1]&&(o=1),this[i+s]=(t/r|0)-o&255;return i+e},a.prototype.writeInt8=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[i]=255&(t=t<0?255+t+1:t),i+1},a.prototype.writeInt16LE=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8):E(this,t,i,!0),i+2},a.prototype.writeInt16BE=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[i]=t>>>8,this[i+1]=255&t):E(this,t,i,!1),i+2},a.prototype.writeInt32LE=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[i]=255&t,this[i+1]=t>>>8,this[i+2]=t>>>16,this[i+3]=t>>>24):O(this,t,i,!0),i+4},a.prototype.writeInt32BE=function(t,i,e){return t=+t,i|=0,e||S(this,t,i,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=255&t):O(this,t,i,!1),i+4},a.prototype.writeFloatLE=function(t,i,e){return k(this,t,i,!0,e)},a.prototype.writeFloatBE=function(t,i,e){return k(this,t,i,!1,e)},a.prototype.writeDoubleLE=function(t,i,e){return R(this,t,i,!0,e)},a.prototype.writeDoubleBE=function(t,i,e){return R(this,t,i,!1,e)},a.prototype.copy=function(t,i,e,n){if(e=e||0,n||0===n||(n=this.length),i>=t.length&&(i=t.length),(n=0<n&&n<e?e:n)===e)return 0;if(0===t.length||0===this.length)return 0;if((i=i||0)<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length);var s,r=(n=t.length-i<n-e?t.length-i+e:n)-e;if(this===t&&e<i&&i<n)for(s=r-1;0<=s;--s)t[s+i]=this[s+e];else if(r<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s<r;++s)t[s+i]=this[s+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+r),i);return r},a.prototype.fill=function(t,i,e,n){if("string"==typeof t){var s;if("string"==typeof i?(n=i,i=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length&&(s=t.charCodeAt(0))<256&&(t=s),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(i<0||this.length<i||this.length<e)throw new RangeError("Out of range index");if(!(e<=i))if(i>>>=0,e=void 0===e?this.length:e>>>0,"number"==typeof(t=t||0))for(u=i;u<e;++u)this[u]=t;else for(var r=a.isBuffer(t)?t:N(new a(t,n).toString()),o=r.length,u=0;u<e-i;++u)this[u+i]=r[u%o];return this};var I=/[^+\/0-9A-Za-z-_]/g;function N(t,i){i=i||1/0;for(var e,n=t.length,s=null,r=[],o=0;o<n;++o){if(55295<(e=t.charCodeAt(o))&&e<57344){if(!s){if(56319<e){-1<(i-=3)&&r.push(239,191,189);continue}if(o+1===n){-1<(i-=3)&&r.push(239,191,189);continue}s=e;continue}if(e<56320){-1<(i-=3)&&r.push(239,191,189),s=e;continue}e=65536+(s-55296<<10|e-56320)}else s&&-1<(i-=3)&&r.push(239,191,189);if(s=null,e<128){if(--i<0)break;r.push(e)}else if(e<2048){if((i-=2)<0)break;r.push(e>>6|192,63&e|128)}else if(e<65536){if((i-=3)<0)break;r.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((i-=4)<0)break;r.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return r}function C(t){return n.toByteArray(function(t){var i;if((t=((i=t).trim?i.trim():i.replace(/^\s+|\s+$/g,"")).replace(I,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,i,e,n){for(var s=0;s<n&&!(s+e>=i.length||s>=t.length);++s)i[s+e]=t[s];return s}}).call(this,e(33))},function(t,i){var e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t,i,e){"use strict";i.byteLength=function(t){return 3*((t=c(t))[0]+(t=t[1]))/4-t},i.toByteArray=function(t){for(var i,e=(n=c(t))[0],n=n[1],o=new r(3*(e+n)/4-n),u=0,a=0<n?e-4:e,h=0;h<a;h+=4)i=s[t.charCodeAt(h)]<<18|s[t.charCodeAt(h+1)]<<12|s[t.charCodeAt(h+2)]<<6|s[t.charCodeAt(h+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===n&&(i=s[t.charCodeAt(h)]<<2|s[t.charCodeAt(h+1)]>>4,o[u++]=255&i),1===n&&(i=s[t.charCodeAt(h)]<<10|s[t.charCodeAt(h+1)]<<4|s[t.charCodeAt(h+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o},i.fromByteArray=function(t){for(var i,e=t.length,s=e%3,r=[],o=0,u=e-s;o<u;o+=16383)r.push(function(t,i){for(var e,s=[],r=o;r<i;r+=3)s.push(n[(e=(t[r]<<16&16711680)+(t[r+1]<<8&65280)+(255&t[r+2]))>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]);return s.join("")}(t,u<o+16383?u:o+16383));return 1==s?r.push(n[(i=t[e-1])>>2]+n[i<<4&63]+"=="):2==s&&r.push(n[(i=(t[e-2]<<8)+t[e-1])>>10]+n[i>>4&63]+n[i<<2&63]+"="),r.join("")};for(var n=[],s=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,a=o.length;u<a;++u)n[u]=o[u],s[o.charCodeAt(u)]=u;function c(t){var i=t.length;if(0<i%4)throw new Error("Invalid string. Length must be a multiple of 4");return i=(t=-1===(t=t.indexOf("="))?i:t)===i?0:4-t%4,[t,i]}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},function(t,i){i.read=function(t,i,e,n,s){var r,o,u=8*s-n-1,a=(1<<u)-1,c=a>>1,h=-7,f=e?s-1:0,l=e?-1:1;for(s=t[i+f],f+=l,r=s&(1<<-h)-1,s>>=-h,h+=u;0<h;r=256*r+t[i+f],f+=l,h-=8);for(o=r&(1<<-h)-1,r>>=-h,h+=n;0<h;o=256*o+t[i+f],f+=l,h-=8);if(0===r)r=1-c;else{if(r===a)return o?NaN:1/0*(s?-1:1);o+=Math.pow(2,n),r-=c}return(s?-1:1)*o*Math.pow(2,r-n)},i.write=function(t,i,e,n,s,r){var o,u,a=8*r-s-1,c=(1<<a)-1,h=c>>1,f=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:r-1,d=n?1:-1;for(r=i<0||0===i&&1/i<0?1:0,i=Math.abs(i),isNaN(i)||i===1/0?(u=isNaN(i)?1:0,o=c):(o=Math.floor(Math.log(i)/Math.LN2),i*(n=Math.pow(2,-o))<1&&(o--,n*=2),2<=(i+=1<=o+h?f/n:f*Math.pow(2,1-h))*n&&(o++,n/=2),c<=o+h?(u=0,o=c):1<=o+h?(u=(i*n-1)*Math.pow(2,s),o+=h):(u=i*Math.pow(2,h-1)*Math.pow(2,s),o=0));8<=s;t[e+l]=255&u,l+=d,u/=256,s-=8);for(o=o<<s|u,a+=s;0<a;t[e+l]=255&o,l+=d,o/=256,a-=8);t[e+l-d]|=128*r}},function(t,i){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,i,e){"use strict";var n=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},s=this&&this.__spread||function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(n(arguments[i]));return t},r=(Object.defineProperty(i,"u",{value:!0}),i.PendingQueue=void 0,e(0)),o=e(5);function u(t,i,e,n){var s=this;this.ii=t,this.wt=i,this.Yt=e,this.G=n,this.byteLength=0,this.size=0,this.pendingDataSize=0,this.cacheMap=new Map,t.forEach((function(t){s.cacheMap.set(t,new r.Queue)}))}u.prototype.enqueue=function(t,i){(i=this.cacheMap.get(i))&&!i.all().find((function(i){return i.content==t.content}))&&(i.enqueue(t),i=o.calculateMemSize(t.content),this.pendingDataSize+=i,this.size++,this.Yt.totalAvailCache-=i,this.enCallback)&&this.enCallback(this.byteLength,this.size,this.pendingDataSize)},u.prototype.dequeue=function(t){return t=null==(t=this.cacheMap.get(t))?void 0:t.dequeue(),this.size--,this.deCallback&&this.deCallback(),t},u.prototype.findInQueue=function(t){var i=null==(i=this.cacheMap.get(t.level))?void 0:i.all();return null==i?void 0:i.find((function(i){return i.key===t.key}))},u.prototype.readReportData=function(t){var i=s(this.cacheMap.entries());return i=this.readData(i,t,!0),this.reset(),{totalLen:i.totalLen,reportDataArr:i.resArr}},u.prototype.readStoreData=function(t){t=Math.ceil(this.pendingDataSize*t);var i=s(this.cacheMap.entries()).reverse();return i=this.readData(i,t,!1),this.refresh(i.totalLen),{totalLen:i.totalLen,storeArr:i.resArr}},u.prototype.readData=function(t,i,e){var s=[],r=0;t:for(var u=0;u<t.length;u++)for(var a=n(t[u],2),c=a[0],h=a[1];h.size();){var f=this.dequeue(c);if(s.push(f),i<(r+=o.calculateMemSize(f.content)))break t}return{totalLen:r,resArr:s}},u.prototype.decodeReportData=function(t){var i=this;t.forEach((function(t){i.enqueue(t,t.level)}))},u.prototype.setListener=function(t){this.enCallback=t.enCallback,this.deCallback=t.deCallback},u.prototype.getPendingDataInfo=function(){return{pendingDataSize:this.pendingDataSize,size:this.size}},u.prototype.refresh=function(t){this.pendingDataSize-=t,this.Yt.totalAvailCache+=t},u.prototype.reset=function(){this.byteLength=0},i.PendingQueue=u},function(t,i,e){"use strict";var n=this&&this.__awaiter||function(t,i,e,n){return new(e=e||Promise)((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):((i=t.value)instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},s=this&&this.__generator||function(t,i){var e,n,s,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o={next:u(0),throw:u(1),return:u(2)};return"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){var a=[o,u];if(e)throw new TypeError("Generator is already executing.");for(;r;)try{if(e=1,n&&(s=2&a[0]?n.return:a[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;switch(n=0,(a=s?[2&a[0],s.value]:a)[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,n=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(s=0<(s=r.trys).length&&s[s.length-1])&&(6===a[0]||2===a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3]))r.label=a[1];else if(6===a[0]&&r.label<s[1])r.label=s[1],s=a;else{if(!(s&&r.label<s[2])){s[2]&&r.ops.pop(),r.trys.pop();continue}r.label=s[2],r.ops.push(a)}}a=i.call(t,r)}catch(u){a=[6,u],n=0}finally{e=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}},r=(Object.defineProperty(i,"u",{value:!0}),i.loadJS=void 0,e(39));function o(t,i,e){return(t=r.decrypt(t,i))&&r.hashMd5(t)===e?t:""}i.loadJS=function(t,i,e,r,u,a,c){var h=this;return new Promise((function(f,l){return n(h,void 0,void 0,(function(){var h,d,v,m,p;return s(this,(function(g){switch(g.label){case 0:if(h="dy",t)return[3,7];g.label=1;case 1:return g.trys.push([1,5,,6]),[4,i.getItem("code")];case 2:return d=g.sent(),[4,i.getItem("key")];case 3:return v=g.sent(),[4,i.getItem("hash")];case 4:m=g.sent();var b=o(d,v,m)||a,_=h,y=c,w=document.getElementsByTagName("HEAD").item(0),S=document.createElement("script");S.language="javascript",S.type="text/javascript",S.id=_,S.param=y;try{S.appendChild(document.createTextNode(b))}catch(_){S.text=b}return w.appendChild(S),f(),[3,6];case 5:return g.sent(),l(),[3,6];case 6:return[2];case 7:if(window.ActiveXObject)try{p=new ActiveXObject("Msxml2.XMLHTTP")}catch(g){p=new ActiveXObject("Microsoft.XMLHTTP")}else window.XMLHttpRequest&&(p=new XMLHttpRequest);return p.open("GET",e,!0),p.send(null),p.onreadystatechange=function(){return n(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:if(4!=p.readyState)return[3,10];if(!(200<=p.status&&p.status<300||0==p.status||304==p.status))return[3,8];t.label=1;case 1:return t.trys.push([1,6,,7]),o(p.responseText,r,u)?[4,i.setItem("code",p.responseText)]:[3,5];case 2:return t.sent(),[4,i.setItem("key",r)];case 3:return t.sent(),[4,i.setItem("hash",u)];case 4:t.sent(),t.label=5;case 5:return f(),[3,7];case 6:return t.sent(),l(),[3,7];case 7:return[2];case 8:return l(),[2];case 9:return[3,11];case 10:case 11:return[2]}}))}))},[2]}}))}))}))}},function(t,i,e){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.u?t:{default:t}},s=(Object.defineProperty(i,"u",{value:!0}),i.hashMd5=i.decrypt=void 0,n(e(40))),r=n(e(41)),o=n(e(42));i.decrypt=function(t,i){var e="";try{e=r.default.decrypt(t,i).toString(o.default)}catch(t){}return e},i.hashMd5=function(t){return s.default(t).toString()}},function(t,e){t.exports=i},function(t,i){t.exports=e},function(t,i){t.exports=n},function(t,i,e){"use strict";function n(){this.logLevel=i.ENUM_LOG_LEVEL.DISABLE}Object.defineProperty(i,"u",{value:!0}),i.ZegoLog=i.ENUM_LOG_LEVEL=void 0,i.ENUM_LOG_LEVEL={DEBUG:0,INFO:1,WARN:2,ERROR:3,REPORT:99,DISABLE:100,debug:0,info:1,warn:2,error:3,report:99,disable:100},n.prototype.setLogLevel=function(t){return void 0!==(t=i.ENUM_LOG_LEVEL[t])&&(this.logLevel=t,!0)},n.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.join(" ");this.logLevel!==i.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=i.ENUM_LOG_LEVEL.DEBUG&&console.debug(n)},n.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.join(" ");this.logLevel!==i.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=i.ENUM_LOG_LEVEL.INFO&&console.log(n)},n.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.join(" ");this.logLevel!==i.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=i.ENUM_LOG_LEVEL.INFO&&console.info(n)},n.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.join(" ");this.logLevel!==i.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=i.ENUM_LOG_LEVEL.WARN&&console.warn(n)},n.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.join(" ");this.logLevel!==i.ENUM_LOG_LEVEL.DISABLE&&this.logLevel<=i.ENUM_LOG_LEVEL.ERROR&&console.error(n)},i.ZegoLog=n},function(t,i,e){"use strict";function n(t){this.logger=t,this.F=t}Object.defineProperty(i,"u",{value:!0}),i.StateCenter=void 0,n.prototype.isLogin=function(){return!0},i.StateCenter=n},function(t,i,e){"use strict";var n=this&&this.__read||function(t,i){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var n,s,r=e.call(t),o=[];try{for(;(void 0===i||0<i--)&&!(n=r.next()).done;)o.push(n.value)}catch(t){s={error:t}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(s)throw s.error}}return o},s=this&&this.__spread||function(){for(var t=[],i=0;i<arguments.length;i++)t=t.concat(n(arguments[i]));return t},r=(Object.defineProperty(i,"u",{value:!0}),i.DynamicCode=void 0,e(3));function o(){this.init()}o.prototype.init=function(){window.dyObj={}},o.prototype.runExecution=function(t,i,e){t=new(Function.bind.apply(Function,s([void 0],t,[e])));try{t.apply(void 0,s(i))}catch(t){r.log.error(t)}},i.DynamicCode=o}],o={},s.m=r,s.c=o,s.d=function(t,i,e){s.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:e})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"u",{value:!0})},s.t=function(t,i){if(1&i&&(t=s(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.u)return t;var e=Object.create(null);if(s.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var n in t)s.d(e,n,function(i){return t[i]}.bind(null,n));return e},s.n=function(t){var i=t&&t.u?function(){return t.default}:function(){return t};return s.d(i,"a",i),i},s.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},s.p="",s(s.s=13);function s(t){var i;return(o[t]||(i=o[t]={i:t,l:!1,exports:{}},r[t].call(i.exports,i,i.exports,s),i.l=!0,i)).exports}var r,o}(e(6361),e(4636),e(955),e(5178))},8754:function(){var t=function(){"use strict";function i(t,i){postMessage({action:Ut,cbn:i,result:t})}function e(t){var i=[];return i[t-1]=void 0,i}function n(t,i){return o(t[0]+i[0],t[1]+i[1])}function s(t,i){return function(t,i){var e,n;return e=t*Jt,n=i,0>i&&(n+=Jt),[n,e]}(Math.max(Math.min(t[1]/Jt,2147483647),-2147483648)&Math.max(Math.min(i[1]/Jt,2147483647),-2147483648),c(t)&c(i))}function r(t,i){var e,n;return t[0]==i[0]&&t[1]==i[1]?0:(n=0>i[1],(e=0>t[1])&&!n?-1:!e&&n?1:d(t,i)[1]<0?-1:1)}function o(t,i){var e,n;for(t%=0x10000000000000000,i=(i%=0x10000000000000000)-(e=i%Jt)+(n=Math.floor(t/Jt)*Jt),t=t-n+e;0>t;)t+=Jt,i-=Jt;for(;t>4294967295;)t-=Jt,i+=Jt;for(i%=0x10000000000000000;i>0x7fffffff00000000;)i-=0x10000000000000000;for(;-0x8000000000000000>i;)i+=0x10000000000000000;return[t,i]}function u(t,i){return t[0]==i[0]&&t[1]==i[1]}function a(t){return t>=0?[t,0]:[t+Jt,-Jt]}function c(t){return t[0]>=2147483648?~~Math.max(Math.min(t[0]-Jt,2147483647),-2147483648):~~Math.max(Math.min(t[0],2147483647),-2147483648)}function h(t){return 30>=t?1<<t:h(30)*h(t-30)}function f(t,i){var e,n,s,r;if(i&=63,u(t,Ht))return i?Gt:t;if(0>t[1])throw Error("Neg");return r=h(i),n=t[1]*r%0x10000000000000000,(n+=e=(s=t[0]*r)-s%Jt)>=0x8000000000000000&&(n-=0x10000000000000000),[s-=e,n]}function l(t,i){var e;return e=h(i&=63),o(Math.floor(t[0]/e),t[1]/e)}function d(t,i){return o(t[0]-i[0],t[1]-i[1])}function v(t,i){return t.Mc=i,t.Lc=0,t.Yb=i.length,t}function m(t){return t.Lc>=t.Yb?-1:255&t.Mc[t.Lc++]}function p(t,i,e,n){return t.Lc>=t.Yb?-1:(n=Math.min(n,t.Yb-t.Lc),w(t.Mc,t.Lc,i,e,n),t.Lc+=n,n)}function g(t){return t.Mc=e(32),t.Yb=0,t}function b(t){var i=t.Mc;return i.length=t.Yb,i}function _(t,i){t.Mc[t.Yb++]=i<<24>>24}function y(t,i,e,n){w(i,e,t.Mc,t.Yb,n),t.Yb+=n}function w(t,i,e,n,s){for(var r=0;s>r;++r)e[n+r]=t[i+r]}function S(i,e,n,s,o){var u,a;if(r(s,Vt)<0)throw Error("invalid length "+s);for(i.Tb=s,function(t,i){(function(t,i){t.ab=i;for(var e=0;i>1<<e;++e);t.$b=2*e})(i,1<<t.s),i.n=t.f,function(t,i){var e=t.X;t.X=i,t.b&&e!=t.X&&(t.wb=-1,t.b=null)}(i,t.m),i.eb=0,i.fb=3,i.Y=2,i.y=3}(o,u=Q({})),u.Gc=void 0===t.disableEndMark,function(t,i){t.fc[0]=9*(5*t.Y+t.eb)+t.fb<<24>>24;for(var e=0;4>e;++e)t.fc[1+e]=t.ab>>8*e<<24>>24;y(i,t.fc,0,5)}(u,n),a=0;64>a;a+=8)_(n,255&c(l(s,a)));i.yb=(u.W=0,u.oc=e,u.pc=0,function(t){var i,e;t.b||(i={},e=4,t.X||(e=2),function(t,i){t.qb=i>2,t.qb?(t.w=0,t.xb=4,t.R=66560):(t.w=2,t.xb=3,t.R=0)}(i,e),t.b=i),lt(t.A,t.eb,t.fb),(t.ab!=t.wb||t.Hb!=t.n)&&(z(t.b,t.ab,4096,t.n,274),t.wb=t.ab,t.Hb=t.n)}(u),u.d.Ab=n,function(t){(function(t){t.l=0,t.J=0;for(var i=0;4>i;++i)t.v[i]=0})(t),function(t){t.mc=Gt,t.xc=Gt,t.E=-1,t.Jb=1,t.Oc=0}(t.d),Nt(t.C),Nt(t._),Nt(t.bb),Nt(t.hb),Nt(t.Ub),Nt(t.vc),Nt(t.Sb),function(t){var i,e=1<<t.u+t.I;for(i=0;e>i;++i)Nt(t.V[i].tb)}(t.A);for(var i=0;4>i;++i)Nt(t.K[i].G);ot(t.$,1<<t.Y),ot(t.i,1<<t.Y),Nt(t.S.G),t.N=0,t.jb=0,t.q=0,t.s=0}(u),W(u),X(u),u.$.rb=u.n+1-2,ft(u.$,1<<u.Y),u.i.rb=u.n+1-2,ft(u.i,1<<u.Y),u.g=Gt,function(t,i){return t.cb=i,t.Z=null,t.zc=1,t}({},u))}function E(t,i,e){return t.Nb=g({}),S(t,v({},i),t.Nb,a(i.length),e),t}function O(t,i,e){var n,s,r,o,u="",c=[];for(s=0;5>s;++s){if(-1==(r=m(i)))throw Error("truncated input");c[s]=r<<24>>24}if(!function(t,i){var e,n,s,r,o,u,a;if(5>i.length)return 0;for(s=(a=255&i[0])%9,r=(u=~~(a/9))%5,o=~~(u/5),e=0,n=0;4>n;++n)e+=(255&i[1+n])<<8*n;return e>99999999||!function(t,i,e,n){if(i>8||e>4||n>4)return 0;F(t.gb,e,i);var s=1<<n;return J(t.Rb,s),J(t.sb,s),t.Dc=s-1,1}(t,s,r,o)?0:function(t,i){return 0>i?0:(t.Ob!=i&&(t.Ob=i,t.nb=Math.max(t.Ob,1),A(t.B,Math.max(t.nb,4096))),1)}(t,e)}(n=B({}),c))throw Error("corrupted input");for(s=0;64>s;s+=8){if(-1==(r=m(i)))throw Error("truncated input");1==(r=r.toString(16)).length&&(r="0"+r),u=r+""+u}/^0+$|^f+$/i.test(u)?t.Tb=Vt:(o=parseInt(u,16),t.Tb=o>4294967295?Vt:a(o)),t.yb=function(t,i,e,n){return t.e.Ab=i,j(t.B),t.B.cc=e,function(t){t.B.h=0,t.B.o=0,Nt(t.Gb),Nt(t.pb),Nt(t.Zb),Nt(t.Cb),Nt(t.Db),Nt(t.Eb),Nt(t.kc),function(t){var i,e;for(e=1<<t.u+t.I,i=0;e>i;++i)Nt(t.V[i].Ib)}(t.gb);for(var i=0;4>i;++i)Nt(t.kb[i].G);G(t.Rb),G(t.sb),Nt(t.Fb.G),function(t){t.Bb=0,t.E=-1;for(var i=0;5>i;++i)t.Bb=t.Bb<<8|m(t.Ab)}(t.e)}(t),t.U=0,t.ib=0,t.Jc=0,t.Ic=0,t.Qc=0,t.Nc=n,t.g=Gt,t.jc=0,function(t,i){return t.Z=i,t.cb=null,t.zc=1,t}({},t)}(n,i,e,t.Tb)}function T(t,i){return t.Nb=g({}),O(t,v({},i),t.Nb),t}function k(t,i){return t.c[t.f+t.o+i]}function R(t,i,e,n){var s,r;for(t.T&&t.o+i+n>t.h&&(n=t.h-(t.o+i)),++e,r=t.f+t.o+i,s=0;n>s&&t.c[r+s]==t.c[r+s-e];++s);return s}function I(t){return t.h-t.o}function N(t){var i,e;if(!t.T)for(;;){if(!(e=-t.f+t.Kb-t.h))return;if(-1==(i=p(t.cc,t.c,t.f+t.h,e)))return t.zb=t.h,t.f+t.zb>t.H&&(t.zb=t.H-t.f),void(t.T=1);t.h+=i,t.h>=t.o+t._b&&(t.zb=t.h-t._b)}}function C(t,i){t.f+=i,t.zb-=i,t.o-=i,t.h-=i}function z(t,i,n,s,r){var o,u;1073741567>i&&(t.Fc=16+(s>>1),function(t,i,n,s){var r;t.Bc=i,t._b=n,r=i+n+s,(null==t.c||t.Kb!=r)&&(t.c=null,t.Kb=r,t.c=e(t.Kb)),t.H=t.Kb-n}(t,i+n,s+r,256+~~((i+n+s+r)/2)),t.ob=s,t.p!=(o=i+1)&&(t.L=e(2*(t.p=o))),u=65536,t.qb&&(u=i-1,u|=u>>1,u|=u>>2,u|=u>>4,u|=u>>8,u>>=1,(u|=65535)>16777216&&(u>>=1),t.Ec=u,++u,u+=t.R),u!=t.rc&&(t.ub=e(t.rc=u)))}function D(t){var i;++t.k>=t.p&&(t.k=0),function(t){++t.o,t.o>t.zb&&(t.f+t.o>t.H&&function(t){var i,e,n;for((n=t.f+t.o-t.Bc)>0&&--n,e=t.f+t.h-n,i=0;e>i;++i)t.c[i]=t.c[n+i];t.f-=n}(t),N(t))}(t),1073741823==t.o&&(P(t.L,2*t.p,i=t.o-t.p),P(t.ub,t.rc,i),C(t,i))}function P(t,i,e){var n,s;for(n=0;i>n;++n)e>=(s=t[n]||0)?s=0:s-=e,t[n]=s}function A(t,i){(null==t.Lb||t.M!=i)&&(t.Lb=e(i)),t.M=i,t.o=0,t.h=0}function M(t){var i=t.o-t.h;i&&(y(t.cc,t.Lb,t.h,i),t.o>=t.M&&(t.o=0),t.h=t.o)}function x(t,i){var e=t.o-i-1;return 0>e&&(e+=t.M),t.Lb[e]}function j(t){M(t),t.cc=null}function L(t){return 4>(t-=2)?t:3}function q(t){return 4>t?0:10>t?t-3:t-6}function U(t){if(!t.zc)throw Error("bad state");return t.cb?function(t){(function(t,i,e,s){var o,h,f,l,v,m,p,g,b,_,y,w,S,E,O;if(i[0]=Gt,e[0]=Gt,s[0]=1,t.oc&&(t.b.cc=t.oc,function(t){t.f=0,t.o=0,t.h=0,t.T=0,N(t),t.k=0,C(t,-1)}(t.b),t.W=1,t.oc=null),!t.pc){if(t.pc=1,E=t.g,u(t.g,Gt)){if(!I(t.b))return void K(t,c(t.g));nt(t),S=c(t.g)&t.y,Ct(t.d,t.C,(t.l<<4)+S,0),t.l=q(t.l),f=k(t.b,-t.s),vt(dt(t.A,c(t.g),t.J),t.d,f),t.J=f,--t.s,t.g=n(t.g,Ft)}if(!I(t.b))return void K(t,c(t.g));for(;;){if(p=$(t,c(t.g)),_=t.mb,S=c(t.g)&t.y,h=(t.l<<4)+S,1==p&&-1==_)Ct(t.d,t.C,h,0),f=k(t.b,-t.s),O=dt(t.A,c(t.g),t.J),7>t.l?vt(O,t.d,f):(b=k(t.b,-t.v[0]-1-t.s),mt(O,t.d,b,f)),t.J=f,t.l=q(t.l);else{if(Ct(t.d,t.C,h,1),4>_){if(Ct(t.d,t.bb,t.l,1),_?(Ct(t.d,t.hb,t.l,1),1==_?Ct(t.d,t.Ub,t.l,0):(Ct(t.d,t.Ub,t.l,1),Ct(t.d,t.vc,t.l,_-2))):(Ct(t.d,t.hb,t.l,0),Ct(t.d,t._,h,1==p?0:1)),1==p?t.l=7>t.l?9:11:(at(t.i,t.d,p-2,S),t.l=7>t.l?8:11),l=t.v[_],0!=_){for(m=_;m>=1;--m)t.v[m]=t.v[m-1];t.v[0]=l}}else{for(Ct(t.d,t.bb,t.l,0),t.l=7>t.l?7:10,at(t.$,t.d,p-2,S),w=rt(_-=4),g=L(p),St(t.K[g],t.d,w),w>=4&&(y=_-(o=(2|1&w)<<(v=(w>>1)-1)),14>w?kt(t.Sb,o-w-1,t.d,v,y):(zt(t.d,y>>4,v-4),Ot(t.S,t.d,15&y),++t.Qb)),l=_,m=3;m>=1;--m)t.v[m]=t.v[m-1];t.v[0]=l,++t.Mb}t.J=k(t.b,p-1-t.s)}if(t.s-=p,t.g=n(t.g,a(p)),!t.s){if(t.Mb>=128&&W(t),t.Qb>=16&&X(t),i[0]=t.g,e[0]=Dt(t.d),!I(t.b))return void K(t,c(t.g));if(r(d(t.g,E),[4096,0])>=0)return t.pc=0,void(s[0]=0)}}}})(t.cb,t.cb.Xb,t.cb.uc,t.cb.Kc),t.Pb=t.cb.Xb[0],t.cb.Kc[0]&&(function(t){st(t),t.d.Ab=null}(t.cb),t.zc=0)}(t):function(t){var i=function(t){var i,e,s,o,u,h;if(h=c(t.g)&t.Dc,It(t.e,t.Gb,(t.U<<4)+h)){if(It(t.e,t.Zb,t.U))s=0,It(t.e,t.Cb,t.U)?(It(t.e,t.Db,t.U)?(It(t.e,t.Eb,t.U)?(e=t.Qc,t.Qc=t.Ic):e=t.Ic,t.Ic=t.Jc):e=t.Jc,t.Jc=t.ib,t.ib=e):It(t.e,t.pb,(t.U<<4)+h)||(t.U=7>t.U?9:11,s=1),s||(s=V(t.sb,t.e,h)+2,t.U=7>t.U?8:11);else if(t.Qc=t.Ic,t.Ic=t.Jc,t.Jc=t.ib,s=2+V(t.Rb,t.e,h),t.U=7>t.U?7:10,(u=yt(t.kb[L(s)],t.e))>=4){if(t.ib=(2|1&u)<<(o=(u>>1)-1),14>u)t.ib+=function(t,i,e,n){var s,r,o=1,u=0;for(r=0;n>r;++r)s=It(e,t,i+o),o<<=1,o+=s,u|=s<<r;return u}(t.kc,t.ib-u-1,t.e,o);else if(t.ib+=function(t,i){var e,n,s=0;for(e=i;0!=e;--e)t.E>>>=1,t.Bb-=t.E&(n=t.Bb-t.E>>>31)-1,s=s<<1|1-n,-16777216&t.E||(t.Bb=t.Bb<<8|m(t.Ab),t.E<<=8);return s}(t.e,o-4)<<4,t.ib+=function(t,i){var e,n,s=1,r=0;for(n=0;t.F>n;++n)e=It(i,t.G,s),s<<=1,s+=e,r|=e<<n;return r}(t.Fb,t.e),0>t.ib)return-1==t.ib?1:-1}else t.ib=u;if(r(a(t.ib),t.g)>=0||t.ib>=t.nb)return-1;(function(t,i,e){var n=t.o-i-1;for(0>n&&(n+=t.M);0!=e;--e)n>=t.M&&(n=0),t.Lb[t.o++]=t.Lb[n++],t.o>=t.M&&M(t)})(t.B,t.ib,s),t.g=n(t.g,a(s)),t.jc=x(t.B,0)}else i=function(t,i,e){return t.V[((i&t.qc)<<t.u)+((255&e)>>>8-t.u)]}(t.gb,c(t.g),t.jc),t.jc=7>t.U?function(t,i){var e=1;do{e=e<<1|It(i,t.Ib,e)}while(256>e);return e<<24>>24}(i,t.e):function(t,i,e){var n,s,r=1;do{if(s=e>>7&1,e<<=1,n=It(i,t.Ib,(1+s<<8)+r),r=r<<1|n,s!=n){for(;256>r;)r=r<<1|It(i,t.Ib,r);break}}while(256>r);return r<<24>>24}(i,t.e,x(t.B,t.ib)),function(t,i){t.Lb[t.o++]=i,t.o>=t.M&&M(t)}(t.B,t.jc),t.U=q(t.U),t.g=n(t.g,Ft);return 0}(t.Z);if(-1==i)throw Error("corrupted input");t.Pb=Vt,t.Pc=t.Z.g,(i||r(t.Z.Nc,Gt)>=0&&r(t.Z.g,t.Z.Nc)>=0)&&(M(t.Z.B),j(t.Z.B),t.Z.e.Ab=null,t.zc=0)}(t),t.zc}function B(t){t.B={},t.e={},t.Gb=e(192),t.Zb=e(12),t.Cb=e(12),t.Db=e(12),t.Eb=e(12),t.pb=e(192),t.kb=e(4),t.kc=e(114),t.Fb=_t({},4),t.Rb=H({}),t.sb=H({}),t.gb={};for(var i=0;4>i;++i)t.kb[i]=_t({},6);return t}function J(t,i){for(;i>t.O;++t.O)t.ec[t.O]=_t({},3),t.hc[t.O]=_t({},3)}function V(t,i,e){return It(i,t.wc,0)?8+(It(i,t.wc,1)?8+yt(t.tc,i):yt(t.hc[e],i)):yt(t.ec[e],i)}function H(t){return t.wc=e(2),t.ec=e(16),t.hc=e(16),t.tc=_t({},8),t.O=0,t}function G(t){Nt(t.wc);for(var i=0;t.O>i;++i)Nt(t.ec[i].G),Nt(t.hc[i].G);Nt(t.tc.G)}function F(t,i,n){var s,r;if(null==t.V||t.u!=n||t.I!=i)for(t.I=i,t.qc=(1<<i)-1,t.u=n,t.V=e(r=1<<t.u+t.I),s=0;r>s;++s)t.V[s]=Y({})}function Y(t){return t.Ib=e(768),t}function Z(t,i){var e,n,s,r;t.jb=i,s=t.a[i].r,n=t.a[i].j;do{t.a[i].t&&(bt(t.a[s]),t.a[s].r=s-1,t.a[i].Ac&&(t.a[s-1].t=0,t.a[s-1].r=t.a[i].r2,t.a[s-1].j=t.a[i].j2)),e=n,n=t.a[r=s].j,s=t.a[r].r,t.a[r].j=e,t.a[r].r=i,i=r}while(i>0);return t.mb=t.a[0].j,t.q=t.a[0].r}function Q(t){var i;for(t.v=e(4),t.a=[],t.d={},t.C=e(192),t.bb=e(12),t.hb=e(12),t.Ub=e(12),t.vc=e(12),t._=e(192),t.K=[],t.Sb=e(114),t.S=wt({},4),t.$=ct({}),t.i=ct({}),t.A={},t.m=[],t.P=[],t.lb=[],t.nc=e(16),t.x=e(4),t.Q=e(4),t.Xb=[Gt],t.uc=[Gt],t.Kc=[0],t.fc=e(5),t.yc=e(128),t.vb=0,t.X=1,t.D=0,t.Hb=-1,t.mb=0,i=0;4096>i;++i)t.a[i]={};for(i=0;4>i;++i)t.K[i]=wt({},6);return t}function X(t){for(var i=0;16>i;++i)t.nc[i]=Tt(t.S,i);t.Qb=0}function W(t){var i,e,n,s,r,o,u,a;for(s=4;128>s;++s)o=rt(s),t.yc[s]=Rt(t.Sb,(i=(2|1&o)<<(n=(o>>1)-1))-o-1,n,s-i);for(r=0;4>r;++r){for(e=t.K[r],u=r<<6,o=0;t.$b>o;++o)t.P[u+o]=Et(e,o);for(o=14;t.$b>o;++o)t.P[u+o]+=(o>>1)-1-4<<6;for(a=128*r,s=0;4>s;++s)t.lb[a+s]=t.P[u+s];for(;128>s;++s)t.lb[a+s]=t.P[u+rt(s)]+t.yc[s]}t.Mb=0}function K(t,i){st(t),function(t,i){if(t.Gc){Ct(t.d,t.C,(t.l<<4)+i,1),Ct(t.d,t.bb,t.l,0),t.l=7>t.l?7:10,at(t.$,t.d,0,i);var e=L(2);St(t.K[e],t.d,63),zt(t.d,67108863,26),Ot(t.S,t.d,15)}}(t,i&t.y);for(var e=0;5>e;++e)Pt(t.d)}function $(t,i){var e,n,s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S,E,O,T,N,C,z,D,P,A,M,x,j,L,U,B,J,V,H,G,F,Y,Q,X;if(t.jb!=t.q)return v=t.a[t.q].r-t.q,t.mb=t.a[t.q].j,t.q=t.a[t.q].r,v;if(t.q=t.jb=0,t.N?(d=t.vb,t.N=0):d=nt(t),C=t.D,2>(T=I(t.b)+1))return t.mb=-1,1;for(T>273&&(T=273),H=0,h=0;4>h;++h)t.x[h]=t.v[h],t.Q[h]=R(t.b,-1,t.x[h],273),t.Q[h]>t.Q[H]&&(H=h);if(t.Q[H]>=t.n)return t.mb=H,et(t,(v=t.Q[H])-1),v;if(d>=t.n)return t.mb=t.m[C-1]+4,et(t,d-1),d;if(a=k(t.b,-1),b=k(t.b,-t.v[0]-1-1),2>d&&a!=b&&2>t.Q[H])return t.mb=-1,1;if(t.a[0].Hc=t.l,t.a[1].z=Qt[t.C[(t.l<<4)+(j=i&t.y)]>>>2]+gt(dt(t.A,i,t.J),t.l>=7,b,a),bt(t.a[1]),V=(_=Qt[2048-t.C[(t.l<<4)+j]>>>2])+Qt[2048-t.bb[t.l]>>>2],b==a&&(G=V+function(t,i,e){return Qt[t.hb[i]>>>2]+Qt[t._[(i<<4)+e]>>>2]}(t,t.l,j),t.a[1].z>G&&(t.a[1].z=G,function(t){t.j=0,t.t=0}(t.a[1]))),2>(l=d>=t.Q[H]?d:t.Q[H]))return t.mb=t.a[1].j,1;t.a[1].r=0,t.a[0].bc=t.x[0],t.a[0].ac=t.x[1],t.a[0].dc=t.x[2],t.a[0].lc=t.x[3],f=l;do{t.a[f--].z=268435455}while(f>=2);for(h=0;4>h;++h)if(!(2>(J=t.Q[h]))){U=V+it(t,h,t.l,j);do{r=U+ht(t.i,J-2,j),(A=t.a[J]).z>r&&(A.z=r,A.r=0,A.j=h,A.t=0)}while(--J>=2)}if(O=_+Qt[t.bb[t.l]>>>2],d>=(f=t.Q[0]>=2?t.Q[0]+1:2)){for(z=0;f>t.m[z];)z+=2;for(;r=O+tt(t,c=t.m[z+1],f,j),(A=t.a[f]).z>r&&(A.z=r,A.r=0,A.j=c+4,A.t=0),f!=t.m[z]||(z+=2)!=C;++f);}for(e=0;;){if(++e==l)return Z(t,e);if(y=nt(t),C=t.D,y>=t.n)return t.vb=y,t.N=1,Z(t,e);if(++i,x=t.a[e].r,t.a[e].t?(--x,t.a[e].Ac?(Y=t.a[t.a[e].r2].Hc,Y=4>t.a[e].j2?7>Y?8:11:7>Y?7:10):Y=t.a[x].Hc,Y=q(Y)):Y=t.a[x].Hc,x==e-1?Y=t.a[e].j?q(Y):7>Y?9:11:(t.a[e].t&&t.a[e].Ac?(x=t.a[e].r2,M=t.a[e].j2,Y=7>Y?8:11):Y=4>(M=t.a[e].j)?7>Y?8:11:7>Y?7:10,P=t.a[x],4>M?M?1==M?(t.x[0]=P.ac,t.x[1]=P.bc,t.x[2]=P.dc,t.x[3]=P.lc):2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m=g,B||(F=m+1),N>m&&(X=Math.min(N-1-m,t.n),(p=R(t.b,m,t.x[B],X))>=2)){for(Q=7>Y?8:11,L=i+m&t.y,s=V+(ht(t.i,m-2,j)+it(t,B,Y,j))+Qt[t.C[(Q<<4)+L]>>>2]+gt(dt(t.A,i+m,k(t.b,m-1-1)),1,k(t.b,m-1-(t.x[B]+1)),k(t.b,m-1)),Q=q(Q),E=s+Qt[2048-t.C[(Q<<4)+(L=i+m+1&t.y)]>>>2]+Qt[2048-t.bb[Q]>>>2],D=m+1+p;e+D>l;)t.a[++l].z=268435455;r=E+(ht(t.i,p-2,L)+it(t,0,Q,L)),(A=t.a[e+D]).z>r&&(A.z=r,A.r=e+m+1,A.j=0,A.t=1,A.Ac=1,A.r2=e,A.j2=B)}}if(y>T){for(y=T,C=0;y>t.m[C];C+=2);t.m[C]=y,C+=2}if(y>=F){for(O=_+Qt[t.bb[Y]>>>2];e+y>l;)t.a[++l].z=268435455;for(z=0;F>t.m[z];)z+=2;for(m=F;;++m)if(r=O+tt(t,o=t.m[z+1],m,j),(A=t.a[e+m]).z>r&&(A.z=r,A.r=e,A.j=o+4,A.t=0),m==t.m[z]){if(N>m&&(X=Math.min(N-1-m,t.n),(p=R(t.b,m,o,X))>=2)){for(s=r+Qt[t.C[((Q=7>Y?7:10)<<4)+(L=i+m&t.y)]>>>2]+gt(dt(t.A,i+m,k(t.b,m-1-1)),1,k(t.b,m-(o+1)-1),k(t.b,m-1)),Q=q(Q),E=s+Qt[2048-t.C[(Q<<4)+(L=i+m+1&t.y)]>>>2]+Qt[2048-t.bb[Q]>>>2],D=m+1+p;e+D>l;)t.a[++l].z=268435455;r=E+(ht(t.i,p-2,L)+it(t,0,Q,L)),(A=t.a[e+D]).z>r&&(A.z=r,A.r=e+m+1,A.j=0,A.t=1,A.Ac=1,A.r2=e,A.j2=o+4)}if((z+=2)==C)break}}}}}function tt(t,i,e,n){var s=L(e);return(128>i?t.lb[128*s+i]:t.P[(s<<6)+function(t){return 131072>t?Zt[t>>6]+12:134217728>t?Zt[t>>16]+32:Zt[t>>26]+52}(i)]+t.nc[15&i])+ht(t.$,e-2,n)}function it(t,i,e,n){var s;return i?(s=Qt[2048-t.hb[e]>>>2],1==i?s+=Qt[t.Ub[e]>>>2]:(s+=Qt[2048-t.Ub[e]>>>2],s+=At(t.vc[e],i-2))):(s=Qt[t.hb[e]>>>2],s+=Qt[2048-t._[(e<<4)+n]>>>2]),s}function et(t,i){i>0&&(function(t,i){var e,n,s,r,o,u,a,c,h,f,l,d,v,m,p;do{if(t.h>=t.o+t.ob)f=t.ob;else if(t.xb>(f=t.h-t.o)){D(t);continue}for(l=t.o>t.p?t.o-t.p:0,n=t.f+t.o,t.qb?(t.ub[1023&(p=Yt[255&t.c[n]]^255&t.c[n+1])]=t.o,t.ub[1024+(65535&(p^=(255&t.c[n+2])<<8))]=t.o,u=(p^Yt[255&t.c[n+3]]<<5)&t.Ec):u=255&t.c[n]^(255&t.c[n+1])<<8,s=t.ub[t.R+u],t.ub[t.R+u]=t.o,v=1+(t.k<<1),m=t.k<<1,c=h=t.w,e=t.Fc;;){if(l>=s||0==e--){t.L[v]=t.L[m]=0;break}if(r=(t.k>=(o=t.o-s)?t.k-o:t.k-o+t.p)<<1,t.c[(d=t.f+s)+(a=h>c?c:h)]==t.c[n+a]){for(;++a!=f&&t.c[d+a]==t.c[n+a];);if(a==f){t.L[m]=t.L[r],t.L[v]=t.L[r+1];break}}(255&t.c[n+a])>(255&t.c[d+a])?(t.L[m]=s,s=t.L[m=r+1],h=a):(t.L[v]=s,s=t.L[v=r],c=a)}D(t)}while(0!=--i)}(t.b,i),t.s+=i)}function nt(t){var i=0;return t.D=function(t,i){var e,n,s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S;if(t.h>=t.o+t.ob)m=t.ob;else if(t.xb>(m=t.h-t.o))return D(t),0;for(b=0,p=t.o>t.p?t.o-t.p:0,n=t.f+t.o,g=1,c=0,h=0,t.qb?(c=1023&(S=Yt[255&t.c[n]]^255&t.c[n+1]),h=65535&(S^=(255&t.c[n+2])<<8),f=(S^Yt[255&t.c[n+3]]<<5)&t.Ec):f=255&t.c[n]^(255&t.c[n+1])<<8,s=t.ub[t.R+f]||0,t.qb&&(r=t.ub[c]||0,o=t.ub[1024+h]||0,t.ub[c]=t.o,t.ub[1024+h]=t.o,r>p&&t.c[t.f+r]==t.c[n]&&(i[b++]=g=2,i[b++]=t.o-r-1),o>p&&t.c[t.f+o]==t.c[n]&&(o==r&&(b-=2),i[b++]=g=3,i[b++]=t.o-o-1,r=o),0!=b&&r==s&&(b-=2,g=1)),t.ub[t.R+f]=t.o,y=1+(t.k<<1),w=t.k<<1,d=v=t.w,0!=t.w&&s>p&&t.c[t.f+s+t.w]!=t.c[n+t.w]&&(i[b++]=g=t.w,i[b++]=t.o-s-1),e=t.Fc;;){if(p>=s||0==e--){t.L[y]=t.L[w]=0;break}if(u=(t.k>=(a=t.o-s)?t.k-a:t.k-a+t.p)<<1,t.c[(_=t.f+s)+(l=v>d?d:v)]==t.c[n+l]){for(;++l!=m&&t.c[_+l]==t.c[n+l];);if(l>g&&(i[b++]=g=l,i[b++]=a-1,l==m)){t.L[w]=t.L[u],t.L[y]=t.L[u+1];break}}(255&t.c[n+l])>(255&t.c[_+l])?(t.L[w]=s,s=t.L[w=u+1],v=l):(t.L[y]=s,s=t.L[y=u],d=l)}return D(t),b}(t.b,t.m),t.D>0&&((i=t.m[t.D-2])==t.n&&(i+=R(t.b,i-1,t.m[t.D-1],273-i))),++t.s,i}function st(t){t.b&&t.W&&(t.b.cc=null,t.W=0)}function rt(t){return 2048>t?Zt[t]:2097152>t?Zt[t>>10]+20:Zt[t>>20]+40}function ot(t,i){Nt(t.db);for(var e=0;i>e;++e)Nt(t.Vb[e].G),Nt(t.Wb[e].G);Nt(t.ic.G)}function ut(t,i,e,n,s){var r,o,u,a,c;for(r=Qt[t.db[0]>>>2],u=(o=Qt[2048-t.db[0]>>>2])+Qt[t.db[1]>>>2],a=o+Qt[2048-t.db[1]>>>2],c=0,c=0;8>c;++c){if(c>=e)return;n[s+c]=r+Et(t.Vb[i],c)}for(;16>c;++c){if(c>=e)return;n[s+c]=u+Et(t.Wb[i],c-8)}for(;e>c;++c)n[s+c]=a+Et(t.ic,c-8-8)}function at(t,i,e,n){(function(t,i,e,n){8>e?(Ct(i,t.db,0,0),St(t.Vb[n],i,e)):(e-=8,Ct(i,t.db,0,1),8>e?(Ct(i,t.db,1,0),St(t.Wb[n],i,e)):(Ct(i,t.db,1,1),St(t.ic,i,e-8)))})(t,i,e,n),0==--t.sc[n]&&(ut(t,n,t.rb,t.Cc,272*n),t.sc[n]=t.rb)}function ct(t){return function(t){t.db=e(2),t.Vb=e(16),t.Wb=e(16),t.ic=wt({},8);for(var i=0;16>i;++i)t.Vb[i]=wt({},3),t.Wb[i]=wt({},3)}(t),t.Cc=[],t.sc=[],t}function ht(t,i,e){return t.Cc[272*e+i]}function ft(t,i){for(var e=0;i>e;++e)ut(t,e,t.rb,t.Cc,272*e),t.sc[e]=t.rb}function lt(t,i,n){var s,r;if(null==t.V||t.u!=n||t.I!=i)for(t.I=i,t.qc=(1<<i)-1,t.u=n,t.V=e(r=1<<t.u+t.I),s=0;r>s;++s)t.V[s]=pt({})}function dt(t,i,e){return t.V[((i&t.qc)<<t.u)+((255&e)>>>8-t.u)]}function vt(t,i,e){var n,s,r=1;for(s=7;s>=0;--s)Ct(i,t.tb,r,n=e>>s&1),r=r<<1|n}function mt(t,i,e,n){var s,r,o,u,a=1,c=1;for(r=7;r>=0;--r)s=n>>r&1,u=c,a&&(u+=1+(o=e>>r&1)<<8,a=o==s),Ct(i,t.tb,u,s),c=c<<1|s}function pt(t){return t.tb=e(768),t}function gt(t,i,e,n){var s,r,o=1,u=7,a=0;if(i)for(;u>=0;--u)if(a+=At(t.tb[(1+(r=e>>u&1)<<8)+o],s=n>>u&1),o=o<<1|s,r!=s){--u;break}for(;u>=0;--u)a+=At(t.tb[o],s=n>>u&1),o=o<<1|s;return a}function bt(t){t.j=-1,t.t=0}function _t(t,i){return t.F=i,t.G=e(1<<i),t}function yt(t,i){var e,n=1;for(e=t.F;0!=e;--e)n=(n<<1)+It(i,t.G,n);return n-(1<<t.F)}function wt(t,i){return t.F=i,t.G=e(1<<i),t}function St(t,i,e){var n,s,r=1;for(s=t.F;0!=s;)--s,Ct(i,t.G,r,n=e>>>s&1),r=r<<1|n}function Et(t,i){var e,n,s=1,r=0;for(n=t.F;0!=n;)--n,r+=At(t.G[s],e=i>>>n&1),s=(s<<1)+e;return r}function Ot(t,i,e){var n,s,r=1;for(s=0;t.F>s;++s)Ct(i,t.G,r,n=1&e),r=r<<1|n,e>>=1}function Tt(t,i){var e,n,s=1,r=0;for(n=t.F;0!=n;--n)e=1&i,i>>>=1,r+=At(t.G[s],e),s=s<<1|e;return r}function kt(t,i,e,n,s){var r,o,u=1;for(o=0;n>o;++o)Ct(e,t,i+u,r=1&s),u=u<<1|r,s>>=1}function Rt(t,i,e,n){var s,r,o=1,u=0;for(r=e;0!=r;--r)s=1&n,n>>>=1,u+=Qt[(2047&(t[i+o]-s^-s))>>>2],o=o<<1|s;return u}function It(t,i,e){var n,s=i[e];return(-2147483648^(n=(t.E>>>11)*s))>(-2147483648^t.Bb)?(t.E=n,i[e]=s+(2048-s>>>5)<<16>>16,-16777216&t.E||(t.Bb=t.Bb<<8|m(t.Ab),t.E<<=8),0):(t.E-=n,t.Bb-=n,i[e]=s-(s>>>5)<<16>>16,-16777216&t.E||(t.Bb=t.Bb<<8|m(t.Ab),t.E<<=8),1)}function Nt(t){for(var i=t.length-1;i>=0;--i)t[i]=1024}function Ct(t,i,e,r){var o,u=i[e];o=(t.E>>>11)*u,r?(t.xc=n(t.xc,s(a(o),[4294967295,0])),t.E-=o,i[e]=u-(u>>>5)<<16>>16):(t.E=o,i[e]=u+(2048-u>>>5)<<16>>16),-16777216&t.E||(t.E<<=8,Pt(t))}function zt(t,i,e){for(var s=e-1;s>=0;--s)t.E>>>=1,1==(i>>>s&1)&&(t.xc=n(t.xc,a(t.E))),-16777216&t.E||(t.E<<=8,Pt(t))}function Dt(t){return n(n(a(t.Jb),t.mc),[4,0])}function Pt(t){var i,e=c(function(t,i){var e;return e=l(t,i&=63),0>t[1]&&(e=n(e,f([2,0],63-i))),e}(t.xc,32));if(0!=e||r(t.xc,[4278190080,0])<0){t.mc=n(t.mc,a(t.Jb)),i=t.Oc;do{_(t.Ab,i+e),i=255}while(0!=--t.Jb);t.Oc=c(t.xc)>>>24}++t.Jb,t.xc=f(s(t.xc,[16777215,0]),8)}function At(t,i){return Qt[(2047&(t-i^-i))>>>2]}function Mt(t){for(var i,e,n,s=0,r=0,o=t.length,u=[],a=[];o>s;++s,++r){if(128&(i=255&t[s]))if(192==(224&i)){if(s+1>=o)return t;if(128!=(192&(e=255&t[++s])))return t;a[r]=(31&i)<<6|63&e}else{if(224!=(240&i))return t;if(s+2>=o)return t;if(128!=(192&(e=255&t[++s])))return t;if(128!=(192&(n=255&t[++s])))return t;a[r]=(15&i)<<12|(63&e)<<6|63&n}else{if(!i)return t;a[r]=i}16383==r&&(u.push(String.fromCharCode.apply(String,a)),r=-1)}return r>0&&(a.length=r,u.push(String.fromCharCode.apply(String,a))),u.join("")}function xt(t){var i,e,n,s=[],r=0,o=t.length;if("object"==typeof t)return t;for(function(t,i,e,n,s){var r;for(r=i;e>r;++r)n[s++]=t.charCodeAt(r)}(t,0,o,s,0),n=0;o>n;++n)(i=s[n])>=1&&127>=i?++r:r+=!i||i>=128&&2047>=i?2:3;for(e=[],r=0,n=0;o>n;++n)(i=s[n])>=1&&127>=i?e[r++]=i<<24>>24:!i||i>=128&&2047>=i?(e[r++]=(192|i>>6&31)<<24>>24,e[r++]=(128|63&i)<<24>>24):(e[r++]=(224|i>>12&15)<<24>>24,e[r++]=(128|i>>6&63)<<24>>24,e[r++]=(128|63&i)<<24>>24);return e}function jt(t){return t[1]+t[0]}var Lt=1,qt=2,Ut=3,Bt="function"==typeof setImmediate?setImmediate:setTimeout,Jt=4294967296,Vt=[4294967295,-Jt],Ht=[0,-0x8000000000000000],Gt=[0,0],Ft=[1,0],Yt=function(){var t,i,e,n=[];for(t=0;256>t;++t){for(e=t,i=0;8>i;++i)1&e?e=e>>>1^-306674912:e>>>=1;n[t]=e}return n}(),Zt=function(){var t,i,e,n=2,s=[0,1];for(e=2;22>e;++e)for(i=1<<(e>>1)-1,t=0;i>t;++t,++n)s[n]=e<<24>>24;return s}(),Qt=function(){var t,i,e,n=[];for(i=8;i>=0;--i)for(t=1<<9-i,e=1<<9-i-1;t>e;++e)n[e]=(i<<6)+(t-e<<6>>>9-i-1);return n}(),Xt=function(){var t=[{s:16,f:64,m:0},{s:20,f:64,m:0},{s:19,f:64,m:1},{s:20,f:64,m:1},{s:21,f:128,m:1},{s:22,f:128,m:1},{s:23,f:128,m:1},{s:24,f:255,m:1},{s:25,f:255,m:1}];return function(i){return t[i-1]||t[6]}}();return"undefined"==typeof onmessage||"undefined"!=typeof window&&void 0!==window.document||(onmessage=function(i){i&&i.gc&&(i.gc.action==qt?t.decompress(i.gc.gc,i.gc.cbn):i.gc.action==Lt&&t.compress(i.gc.gc,i.gc.Rc,i.gc.cbn))}),{compress:function(t,e,n,s){var r,o,u={},a=void 0===n&&void 0===s;if("function"!=typeof n&&(o=n,n=s=0),s=s||function(t){return void 0!==o?i(t,o):void 0},n=n||function(t,i){return void 0!==o?postMessage({action:Lt,cbn:o,result:t,error:i}):void 0},a){for(u.c=E({},xt(t),Xt(e));U(u.c.yb););return b(u.c.Nb)}try{u.c=E({},xt(t),Xt(e)),s(0)}catch(t){return n(null,t)}Bt((function t(){try{for(var i,e=(new Date).getTime();U(u.c.yb);)if(r=jt(u.c.yb.Pb)/jt(u.c.Tb),(new Date).getTime()-e>200)return s(r),Bt(t,0),0;s(1),i=b(u.c.Nb),Bt(n.bind(null,i),0)}catch(t){n(null,t)}}),0)},decompress:function(t,e,n){var s,r,o,u,a={},c=void 0===e&&void 0===n;if("function"!=typeof e&&(r=e,e=n=0),n=n||function(t){return void 0!==r?i(o?t:-1,r):void 0},e=e||function(t,i){return void 0!==r?postMessage({action:qt,cbn:r,result:t,error:i}):void 0},c){for(a.d=T({},t);U(a.d.yb););return Mt(b(a.d.Nb))}try{a.d=T({},t),u=jt(a.d.Tb),o=u>-1,n(0)}catch(t){return e(null,t)}Bt((function t(){try{for(var i,r=0,c=(new Date).getTime();U(a.d.yb);)if(++r%1e3==0&&(new Date).getTime()-c>200)return o&&(s=jt(a.d.yb.Z.g)/u,n(s)),Bt(t,0),0;n(1),i=Mt(b(a.d.Nb)),Bt(e.bind(null,i),0)}catch(t){e(null,t)}}),0)}}}();this.G=t},6794:function(t){t.exports=function(){function t(i,e,n){function s(o,u){if(!e[o]){if(!i[o]){if(r)return r(o,!0);var a=new Error("Cannot find module '"+o+"'");throw a.code="MODULE_NOT_FOUND",a}var c=e[o]={exports:{}};i[o][0].call(c.exports,(function(t){return s(i[o][1][t]||t)}),c,c.exports,t,i,e,n)}return e[o].exports}for(var r=void 0,o=0;o<n.length;o++)s(n[o]);return s}return t}()({1:[function(t,i,e){"use strict";var n=(0,t("./adapter_factory.js").adapterFactory)({window:window});i.exports=n},{"./adapter_factory.js":2}],2:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adapterFactory=h;var n=c(t("./utils")),s=c(t("./chrome/chrome_shim")),r=c(t("./edge/edge_shim")),o=c(t("./firefox/firefox_shim")),u=c(t("./safari/safari_shim")),a=c(t("./common_shim"));function c(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}function h(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).window,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimEdge:!0,shimSafari:!0},e=n.log,c=n.detectBrowser(t),h={browserDetails:c,commonShim:a,extractVersion:n.extractVersion,disableLog:n.disableLog,disableWarnings:n.disableWarnings};switch(c.browser){case"chrome":if(!s||!s.shimPeerConnection||!i.shimChrome)return e("Chrome shim is not included in this adapter release."),h;e("adapter.js shimming chrome."),h.browserShim=s,s.shimGetUserMedia(t),s.shimMediaStream(t),s.shimPeerConnection(t),s.shimOnTrack(t),s.shimAddTrackRemoveTrack(t),s.shimGetSendersWithDtmf(t),s.shimGetStats(t),s.shimSenderReceiverGetStats(t),s.fixNegotiationNeeded(t),a.shimRTCIceCandidate(t),a.shimConnectionState(t),a.shimMaxMessageSize(t),a.shimSendThrowTypeError(t),a.removeAllowExtmapMixed(t);break;case"firefox":if(!o||!o.shimPeerConnection||!i.shimFirefox)return e("Firefox shim is not included in this adapter release."),h;e("adapter.js shimming firefox."),h.browserShim=o,o.shimGetUserMedia(t),o.shimPeerConnection(t),o.shimOnTrack(t),o.shimRemoveStream(t),o.shimSenderGetStats(t),o.shimReceiverGetStats(t),o.shimRTCDataChannel(t),a.shimRTCIceCandidate(t),a.shimConnectionState(t),a.shimMaxMessageSize(t),a.shimSendThrowTypeError(t);break;case"edge":if(!r||!r.shimPeerConnection||!i.shimEdge)return e("MS edge shim is not included in this adapter release."),h;e("adapter.js shimming edge."),h.browserShim=r,r.shimGetUserMedia(t),r.shimGetDisplayMedia(t),r.shimPeerConnection(t),r.shimReplaceTrack(t),a.shimMaxMessageSize(t),a.shimSendThrowTypeError(t);break;case"safari":if(!u||!i.shimSafari)return e("Safari shim is not included in this adapter release."),h;e("adapter.js shimming safari."),h.browserShim=u,u.shimRTCIceServerUrls(t),u.shimCreateOfferLegacy(t),u.shimCallbacksAPI(t),u.shimLocalStreamsAPI(t),u.shimRemoteStreamsAPI(t),u.shimTrackEventTransceiver(t),u.shimGetUserMedia(t),a.shimRTCIceCandidate(t),a.shimMaxMessageSize(t),a.shimSendThrowTypeError(t),a.removeAllowExtmapMixed(t);break;default:e("Unsupported browser!")}return h}},{"./chrome/chrome_shim":3,"./common_shim":6,"./edge/edge_shim":7,"./firefox/firefox_shim":11,"./safari/safari_shim":14,"./utils":15}],3:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shimGetDisplayMedia=e.shimGetUserMedia=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=t("./getusermedia");Object.defineProperty(e,"shimGetUserMedia",{enumerable:!0,get:function(){return s.shimGetUserMedia}});var r=t("./getdisplaymedia");Object.defineProperty(e,"shimGetDisplayMedia",{enumerable:!0,get:function(){return r.shimGetDisplayMedia}}),e.shimMediaStream=a,e.shimOnTrack=c,e.shimGetSendersWithDtmf=h,e.shimGetStats=f,e.shimSenderReceiverGetStats=l,e.shimAddTrackRemoveTrackWithNative=d,e.shimAddTrackRemoveTrack=v,e.shimPeerConnection=m,e.fixNegotiationNeeded=p;var o=u(t("../utils.js"));function u(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}function a(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function c(t){if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});var i=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._ontrackpoly||(this._ontrackpoly=function(i){i.stream.addEventListener("addtrack",(function(n){var s=void 0;s=t.RTCPeerConnection.prototype.getReceivers?e.getReceivers().find((function(t){return t.track&&t.track.id===n.track.id})):{track:n.track};var r=new Event("track");r.track=n.track,r.receiver=s,r.transceiver={receiver:s},r.streams=[i.stream],e.dispatchEvent(r)})),i.stream.getTracks().forEach((function(n){var s=void 0;s=t.RTCPeerConnection.prototype.getReceivers?e.getReceivers().find((function(t){return t.track&&t.track.id===n.id})):{track:n};var r=new Event("track");r.track=n,r.receiver=s,r.transceiver={receiver:s},r.streams=[i.stream],e.dispatchEvent(r)}))},this.addEventListener("addstream",this._ontrackpoly)),i.apply(this,arguments)}}else o.wrapPeerConnectionEvent(t,"track",(function(t){return t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t}))}function h(t){if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){var i=function(t,i){return{track:i,get dtmf(){return void 0===this._dtmf&&(this._dtmf="audio"===i.kind?t.createDTMFSender(i):null),this._dtmf},_pc:t}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,n){var s=e.apply(this,arguments);return s||(s=i(this,t),this._senders.push(s)),s};var s=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){s.apply(this,arguments);var i=this._senders.indexOf(t);-1!==i&&this._senders.splice(i,1)}}var r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){var e=this;this._senders=this._senders||[],r.apply(this,[t]),t.getTracks().forEach((function(t){e._senders.push(i(e,t))}))};var o=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){var i=this;this._senders=this._senders||[],o.apply(this,[t]),t.getTracks().forEach((function(t){var e=i._senders.find((function(i){return i.track===t}));e&&i._senders.splice(i._senders.indexOf(e),1)}))}}else if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){var u=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){var t=this,i=u.apply(this,[]);return i.forEach((function(i){return i._pc=t})),i},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&(this._dtmf="audio"===this.track.kind?this._pc.createDTMFSender(this.track):null),this._dtmf}})}}function f(t){if(t.RTCPeerConnection){var i=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(t,e,n){var s=this,r=arguments;if(arguments.length>0&&"function"==typeof t)return i.apply(this,arguments);if(0===i.length&&(0===arguments.length||"function"!=typeof arguments[0]))return i.apply(this,[]);var o=function(t){var i={};return t.result().forEach((function(t){var e={id:t.id,timestamp:t.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[t.type]||t.type};t.names().forEach((function(i){e[i]=t.stat(i)})),i[e.id]=e})),i},u=function(t){return new Map(Object.keys(t).map((function(i){return[i,t[i]]})))};return arguments.length>=2?i.apply(this,[function(t){r[1](u(o(t)))},arguments[0]]):new Promise((function(t,e){i.apply(s,[function(i){t(u(o(i)))},e])})).then(e,n)}}}function l(t){if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver){if(!("getStats"in t.RTCRtpSender.prototype)){var i=t.RTCPeerConnection.prototype.getSenders;i&&(t.RTCPeerConnection.prototype.getSenders=function(){var t=this,e=i.apply(this,[]);return e.forEach((function(i){return i._pc=t})),e});var e=t.RTCPeerConnection.prototype.addTrack;e&&(t.RTCPeerConnection.prototype.addTrack=function(){var t=e.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){var t=this;return this._pc.getStats().then((function(i){return o.filterStats(i,t.track,!0)}))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){var s=t.RTCPeerConnection.prototype.getReceivers;s&&(t.RTCPeerConnection.prototype.getReceivers=function(){var t=this,i=s.apply(this,[]);return i.forEach((function(i){return i._pc=t})),i}),o.wrapPeerConnectionEvent(t,"track",(function(t){return t.receiver._pc=t.srcElement,t})),t.RTCRtpReceiver.prototype.getStats=function(){var t=this;return this._pc.getStats().then((function(i){return o.filterStats(i,t.track,!1)}))}}if("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype){var r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){var i=arguments[0],e=void 0,n=void 0,s=void 0;return this.getSenders().forEach((function(t){t.track===i&&(e?s=!0:e=t)})),this.getReceivers().forEach((function(t){return t.track===i&&(n?s=!0:n=t),t.track===i})),s||e&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return r.apply(this,arguments)}}}}function d(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(i){return t._shimmedLocalStreams[i][0]}))};var i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,e){if(!e)return i.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var n=i.apply(this,arguments);return this._shimmedLocalStreams[e.id]?-1===this._shimmedLocalStreams[e.id].indexOf(n)&&this._shimmedLocalStreams[e.id].push(n):this._shimmedLocalStreams[e.id]=[e,n],n};var e=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){var i=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},t.getTracks().forEach((function(t){if(i.getSenders().find((function(i){return i.track===t})))throw new DOMException("Track already exists.","InvalidAccessError")}));var n=this.getSenders();e.apply(this,arguments);var s=this.getSenders().filter((function(t){return-1===n.indexOf(t)}));this._shimmedLocalStreams[t.id]=[t].concat(s)};var n=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[t.id],n.apply(this,arguments)};var s=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){var i=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},t&&Object.keys(this._shimmedLocalStreams).forEach((function(e){var n=i._shimmedLocalStreams[e].indexOf(t);-1!==n&&i._shimmedLocalStreams[e].splice(n,1),1===i._shimmedLocalStreams[e].length&&delete i._shimmedLocalStreams[e]})),s.apply(this,arguments)}}function v(t){if(t.RTCPeerConnection){var i=o.detectBrowser(t);if(t.RTCPeerConnection.prototype.addTrack&&i.version>=65)return d(t);var e=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){var t=this,i=e.apply(this);return this._reverseStreams=this._reverseStreams||{},i.map((function(i){return t._reverseStreams[i.id]}))};var n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(i){var e=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.getTracks().forEach((function(t){if(e.getSenders().find((function(i){return i.track===t})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[i.id]){var s=new t.MediaStream(i.getTracks());this._streams[i.id]=s,this._reverseStreams[s.id]=i,i=s}n.apply(this,[i])};var s=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},s.apply(this,[this._streams[t.id]||t]),delete this._reverseStreams[this._streams[t.id]?this._streams[t.id].id:t.id],delete this._streams[t.id]},t.RTCPeerConnection.prototype.addTrack=function(i,e){var n=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var s=[].slice.call(arguments,1);if(1!==s.length||!s[0].getTracks().find((function(t){return t===i})))throw new DOMException("The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((function(t){return t.track===i})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var r=this._streams[e.id];if(r)r.addTrack(i),Promise.resolve().then((function(){n.dispatchEvent(new Event("negotiationneeded"))}));else{var o=new t.MediaStream([i]);this._streams[e.id]=o,this._reverseStreams[o.id]=e,this.addStream(o)}return this.getSenders().find((function(t){return t.track===i}))},["createOffer","createAnswer"].forEach((function(i){var e=t.RTCPeerConnection.prototype[i];t.RTCPeerConnection.prototype[i]=function(){var t=this,i=arguments;return arguments.length&&"function"==typeof arguments[0]?e.apply(this,[function(e){var n=a(t,e);i[0].apply(null,[n])},function(t){i[1]&&i[1].apply(null,t)},arguments[2]]):e.apply(this,arguments).then((function(i){return a(t,i)}))}}));var r=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=c(this,arguments[0]),r.apply(this,arguments)):r.apply(this,arguments)};var u=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get:function(){var t=u.get.apply(this);return""===t.type?t:a(this,t)}}),t.RTCPeerConnection.prototype.removeTrack=function(t){var i=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!t._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(t._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var e=void 0;Object.keys(this._streams).forEach((function(n){i._streams[n].getTracks().find((function(i){return t.track===i}))&&(e=i._streams[n])})),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(t.track),this.dispatchEvent(new Event("negotiationneeded")))}}function a(t,i){var e=i.sdp;return Object.keys(t._reverseStreams||[]).forEach((function(i){var n=t._reverseStreams[i];e=e.replace(new RegExp(t._streams[n.id].id,"g"),n.id)})),new RTCSessionDescription({type:i.type,sdp:e})}function c(t,i){var e=i.sdp;return Object.keys(t._reverseStreams||[]).forEach((function(i){var n=t._reverseStreams[i],s=t._streams[n.id];e=e.replace(new RegExp(n.id,"g"),s.id)})),new RTCSessionDescription({type:i.type,sdp:e})}}function m(t){if(!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection){["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(i){var e=t.RTCPeerConnection.prototype[i];t.RTCPeerConnection.prototype[i]=function(){return arguments[0]=new("addIceCandidate"===i?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),e.apply(this,arguments)}}));var i=t.RTCPeerConnection.prototype.addIceCandidate;t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?i.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())}}}function p(t){o.wrapPeerConnectionEvent(t,"negotiationneeded",(function(t){if("stable"===t.target.signalingState)return t}))}},{"../utils.js":15,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(t,i,e){"use strict";function n(t,i){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&("function"==typeof i?t.navigator.mediaDevices.getDisplayMedia=function(e){return i(e).then((function(i){var n=e.video&&e.video.width,s=e.video&&e.video.height;return e.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:e.video&&e.video.frameRate||3}},n&&(e.video.mandatory.maxWidth=n),s&&(e.video.mandatory.maxHeight=s),t.navigator.mediaDevices.getUserMedia(e)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}Object.defineProperty(e,"__esModule",{value:!0}),e.shimGetDisplayMedia=n},{}],5:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.shimGetUserMedia=u;var s=r(t("../utils.js"));function r(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}var o=s.log;function u(t){var i=t&&t.navigator;if(i.mediaDevices){var e=s.detectBrowser(t),r=function(t){if("object"!==(void 0===t?"undefined":n(t))||t.mandatory||t.optional)return t;var i={};return Object.keys(t).forEach((function(e){if("require"!==e&&"advanced"!==e&&"mediaSource"!==e){var s="object"===n(t[e])?t[e]:{ideal:t[e]};void 0!==s.exact&&"number"==typeof s.exact&&(s.min=s.max=s.exact);var r=function(t,i){return t?t+i.charAt(0).toUpperCase()+i.slice(1):"deviceId"===i?"sourceId":i};if(void 0!==s.ideal){i.optional=i.optional||[];var o={};"number"==typeof s.ideal?(o[r("min",e)]=s.ideal,i.optional.push(o),(o={})[r("max",e)]=s.ideal,i.optional.push(o)):(o[r("",e)]=s.ideal,i.optional.push(o))}void 0!==s.exact&&"number"!=typeof s.exact?(i.mandatory=i.mandatory||{},i.mandatory[r("",e)]=s.exact):["min","max"].forEach((function(t){void 0!==s[t]&&(i.mandatory=i.mandatory||{},i.mandatory[r(t,e)]=s[t])}))}})),t.advanced&&(i.optional=(i.optional||[]).concat(t.advanced)),i},u=function(t,s){if(e.version>=61)return s(t);if((t=JSON.parse(JSON.stringify(t)))&&"object"===n(t.audio)){var u=function(t,i,e){i in t&&!(e in t)&&(t[e]=t[i],delete t[i])};u((t=JSON.parse(JSON.stringify(t))).audio,"autoGainControl","googAutoGainControl"),u(t.audio,"noiseSuppression","googNoiseSuppression"),t.audio=r(t.audio)}if(t&&"object"===n(t.video)){var a=t.video.facingMode;a=a&&("object"===(void 0===a?"undefined":n(a))?a:{ideal:a});var c=e.version<66;if(a&&("user"===a.exact||"environment"===a.exact||"user"===a.ideal||"environment"===a.ideal)&&(!i.mediaDevices.getSupportedConstraints||!i.mediaDevices.getSupportedConstraints().facingMode||c)){delete t.video.facingMode;var h=void 0;if("environment"===a.exact||"environment"===a.ideal?h=["back","rear"]:"user"!==a.exact&&"user"!==a.ideal||(h=["front"]),h)return i.mediaDevices.enumerateDevices().then((function(i){var e=(i=i.filter((function(t){return"videoinput"===t.kind}))).find((function(t){return h.some((function(i){return t.label.toLowerCase().includes(i)}))}));return!e&&i.length&&h.includes("back")&&(e=i[i.length-1]),e&&(t.video.deviceId=a.exact?{exact:e.deviceId}:{ideal:e.deviceId}),t.video=r(t.video),o("chrome: "+JSON.stringify(t)),s(t)}))}t.video=r(t.video)}return o("chrome: "+JSON.stringify(t)),s(t)},a=function(t){return e.version>=64?t:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraint||t.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},c=function(t,e,n){u(t,(function(t){i.webkitGetUserMedia(t,e,(function(t){n&&n(a(t))}))}))};if(i.getUserMedia=c.bind(i),i.mediaDevices.getUserMedia){var h=i.mediaDevices.getUserMedia.bind(i.mediaDevices);i.mediaDevices.getUserMedia=function(t){return u(t,(function(t){return h(t).then((function(i){if(t.audio&&!i.getAudioTracks().length||t.video&&!i.getVideoTracks().length)throw i.getTracks().forEach((function(t){t.stop()})),new DOMException("","NotFoundError");return i}),(function(t){return Promise.reject(a(t))}))}))}}}}},{"../utils.js":15}],6:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.shimRTCIceCandidate=a,e.shimMaxMessageSize=c,e.shimSendThrowTypeError=h,e.shimConnectionState=f,e.removeAllowExtmapMixed=l;var s=u(t("sdp")),r=o(t("./utils"));function o(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}function u(t){return t&&t.__esModule?t:{default:t}}function a(t){if(!(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)){var i=t.RTCIceCandidate;t.RTCIceCandidate=function(t){if("object"===(void 0===t?"undefined":n(t))&&t.candidate&&0===t.candidate.indexOf("a=")&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substr(2)),t.candidate&&t.candidate.length){var e=new i(t),r=s.default.parseCandidate(t.candidate),o=Object.assign(e,r);return o.toJSON=function(){return{candidate:o.candidate,sdpMid:o.sdpMid,sdpMLineIndex:o.sdpMLineIndex,usernameFragment:o.usernameFragment}},o}return new i(t)},t.RTCIceCandidate.prototype=i.prototype,r.wrapPeerConnectionEvent(t,"icecandidate",(function(i){return i.candidate&&Object.defineProperty(i,"candidate",{value:new t.RTCIceCandidate(i.candidate),writable:"false"}),i}))}}function c(t){if(!t.RTCSctpTransport&&t.RTCPeerConnection){var i=r.detectBrowser(t);"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var e=function(t){if(!t||!t.sdp)return!1;var i=s.default.splitSections(t.sdp);return i.shift(),i.some((function(t){var i=s.default.parseMLine(t);return i&&"application"===i.kind&&-1!==i.protocol.indexOf("SCTP")}))},n=function(t){var i=t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===i||i.length<2)return-1;var e=parseInt(i[1],10);return e!=e?-1:e},o=function(t){var e=65536;return"firefox"===i.browser&&(e=i.version<57?-1===t?16384:2147483637:i.version<60?57===i.version?65535:65536:2147483637),e},u=function(t,e){var n=65536;"firefox"===i.browser&&57===i.version&&(n=65535);var r=s.default.matchPrefix(t.sdp,"a=max-message-size:");return r.length>0?n=parseInt(r[0].substr(19),10):"firefox"===i.browser&&-1!==e&&(n=2147483637),n},a=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e(arguments[0])){var t=n(arguments[0]),i=o(t),s=u(arguments[0],t),r=void 0;r=0===i&&0===s?Number.POSITIVE_INFINITY:0===i||0===s?Math.max(i,s):Math.min(i,s);var c={};Object.defineProperty(c,"maxMessageSize",{get:function(){return r}}),this._sctp=c}return a.apply(this,arguments)}}}function h(t){if(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype){var i=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){var t=i.apply(this,arguments);return e(t,this),t},r.wrapPeerConnectionEvent(t,"datachannel",(function(t){return e(t.channel,t.target),t}))}function e(t,i){var e=t.send;t.send=function(){var n=arguments[0];if("open"===t.readyState&&i.sctp&&(n.length||n.size||n.byteLength)>i.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+i.sctp.maxMessageSize+" bytes)");return e.apply(t,arguments)}}}function f(t){if(t.RTCPeerConnection&&!("connectionState"in t.RTCPeerConnection.prototype)){var i=t.RTCPeerConnection.prototype;Object.defineProperty(i,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(i,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(t){var e=i[t];i[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(t){var i=t.target;if(i._lastConnectionState!==i.connectionState){i._lastConnectionState=i.connectionState;var e=new Event("connectionstatechange",t);i.dispatchEvent(e)}return t},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),e.apply(this,arguments)}}))}}function l(t){if(t.RTCPeerConnection){var i=r.detectBrowser(t);if(!("chrome"===i.browser&&i.version>=71)){var e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(t){return t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")&&(t.sdp=t.sdp.split("\n").filter((function(t){return"a=extmap-allow-mixed"!==t.trim()})).join("\n")),e.apply(this,arguments)}}}}},{"./utils":15,sdp:17}],7:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shimGetDisplayMedia=e.shimGetUserMedia=void 0;var n=t("./getusermedia");Object.defineProperty(e,"shimGetUserMedia",{enumerable:!0,get:function(){return n.shimGetUserMedia}});var s=t("./getdisplaymedia");Object.defineProperty(e,"shimGetDisplayMedia",{enumerable:!0,get:function(){return s.shimGetDisplayMedia}}),e.shimPeerConnection=h,e.shimReplaceTrack=f;var r=c(t("../utils")),o=t("./filtericeservers"),u=a(t("rtcpeerconnection-shim"));function a(t){return t&&t.__esModule?t:{default:t}}function c(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}function h(t){var i=r.detectBrowser(t);if(t.RTCIceGatherer&&(t.RTCIceCandidate||(t.RTCIceCandidate=function(t){return t}),t.RTCSessionDescription||(t.RTCSessionDescription=function(t){return t}),i.version<15025)){var e=Object.getOwnPropertyDescriptor(t.MediaStreamTrack.prototype,"enabled");Object.defineProperty(t.MediaStreamTrack.prototype,"enabled",{set:function(t){e.set.call(this,t);var i=new Event("enabled");i.enabled=t,this.dispatchEvent(i)}})}t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)&&Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=new t.RTCDtmfSender(this):"video"===this.track.kind&&(this._dtmf=null)),this._dtmf}}),t.RTCDtmfSender&&!t.RTCDTMFSender&&(t.RTCDTMFSender=t.RTCDtmfSender);var n=(0,u.default)(t,i.version);t.RTCPeerConnection=function(t){return t&&t.iceServers&&(t.iceServers=(0,o.filterIceServers)(t.iceServers,i.version),r.log("ICE servers after filtering:",t.iceServers)),new n(t)},t.RTCPeerConnection.prototype=n.prototype}function f(t){t.RTCRtpSender&&!("replaceTrack"in t.RTCRtpSender.prototype)&&(t.RTCRtpSender.prototype.replaceTrack=t.RTCRtpSender.prototype.setTrack)}},{"../utils":15,"./filtericeservers":8,"./getdisplaymedia":9,"./getusermedia":10,"rtcpeerconnection-shim":16}],8:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.filterIceServers=r;var n=s(t("../utils"));function s(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}function r(t,i){var e=!1;return(t=JSON.parse(JSON.stringify(t))).filter((function(t){if(t&&(t.urls||t.url)){var i=t.urls||t.url;t.url&&!t.urls&&n.deprecated("RTCIceServer.url","RTCIceServer.urls");var s="string"==typeof i;return s&&(i=[i]),i=i.filter((function(t){if(0===t.indexOf("stun:"))return!1;var i=t.startsWith("turn")&&!t.startsWith("turn:[")&&t.includes("transport=udp");return i&&!e?(e=!0,!0):i&&!e})),delete t.url,t.urls=s?i[0]:i,!!i.length}}))}},{"../utils":15}],9:[function(t,i,e){"use strict";function n(t){"getDisplayMedia"in t.navigator&&t.navigator.mediaDevices&&(t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||(t.navigator.mediaDevices.getDisplayMedia=t.navigator.getDisplayMedia.bind(t.navigator)))}Object.defineProperty(e,"__esModule",{value:!0}),e.shimGetDisplayMedia=n},{}],10:[function(t,i,e){"use strict";function n(t){var i=t&&t.navigator,e=function(t){return{name:{PermissionDeniedError:"NotAllowedError"}[t.name]||t.name,message:t.message,constraint:t.constraint,toString:function(){return this.name}}},n=i.mediaDevices.getUserMedia.bind(i.mediaDevices);i.mediaDevices.getUserMedia=function(t){return n(t).catch((function(t){return Promise.reject(e(t))}))}}Object.defineProperty(e,"__esModule",{value:!0}),e.shimGetUserMedia=n},{}],11:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shimGetDisplayMedia=e.shimGetUserMedia=void 0;var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=t("./getusermedia");Object.defineProperty(e,"shimGetUserMedia",{enumerable:!0,get:function(){return s.shimGetUserMedia}});var r=t("./getdisplaymedia");Object.defineProperty(e,"shimGetDisplayMedia",{enumerable:!0,get:function(){return r.shimGetDisplayMedia}}),e.shimOnTrack=a,e.shimPeerConnection=c,e.shimSenderGetStats=h,e.shimReceiverGetStats=f,e.shimRemoveStream=l,e.shimRTCDataChannel=d;var o=u(t("../utils"));function u(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}function a(t){"object"===(void 0===t?"undefined":n(t))&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function c(t){var i=o.detectBrowser(t);if("object"===(void 0===t?"undefined":n(t))&&(t.RTCPeerConnection||t.mozRTCPeerConnection)){!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(i){var e=t.RTCPeerConnection.prototype[i];t.RTCPeerConnection.prototype[i]=function(){return arguments[0]=new("addIceCandidate"===i?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),e.apply(this,arguments)}}));var e=t.RTCPeerConnection.prototype.addIceCandidate;t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?e.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())};var s={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(t,e,n){return r.apply(this,[t||null]).then((function(t){if(i.version<53&&!e)try{t.forEach((function(t){t.type=s[t.type]||t.type}))}catch(i){if("TypeError"!==i.name)throw i;t.forEach((function(i,e){t.set(e,Object.assign({},i,{type:s[i.type]||i.type}))}))}return t})).then(e,n)}}}function h(t){if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection&&t.RTCRtpSender&&(!t.RTCRtpSender||!("getStats"in t.RTCRtpSender.prototype))){var i=t.RTCPeerConnection.prototype.getSenders;i&&(t.RTCPeerConnection.prototype.getSenders=function(){var t=this,e=i.apply(this,[]);return e.forEach((function(i){return i._pc=t})),e});var e=t.RTCPeerConnection.prototype.addTrack;e&&(t.RTCPeerConnection.prototype.addTrack=function(){var t=e.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}}function f(t){if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection&&t.RTCRtpSender&&(!t.RTCRtpSender||!("getStats"in t.RTCRtpReceiver.prototype))){var i=t.RTCPeerConnection.prototype.getReceivers;i&&(t.RTCPeerConnection.prototype.getReceivers=function(){var t=this,e=i.apply(this,[]);return e.forEach((function(i){return i._pc=t})),e}),o.wrapPeerConnectionEvent(t,"track",(function(t){return t.receiver._pc=t.srcElement,t})),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function l(t){t.RTCPeerConnection&&!("removeStream"in t.RTCPeerConnection.prototype)&&(t.RTCPeerConnection.prototype.removeStream=function(t){var i=this;o.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(e){e.track&&t.getTracks().includes(e.track)&&i.removeTrack(e)}))})}function d(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}},{"../utils":15,"./getdisplaymedia":12,"./getusermedia":13}],12:[function(t,i,e){"use strict";function n(t,i){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(e){if(!e||!e.video){var n=new DOMException("getDisplayMedia without video constraints is undefined");return n.name="NotFoundError",n.code=8,Promise.reject(n)}return!0===e.video?e.video={mediaSource:i}:e.video.mediaSource=i,t.navigator.mediaDevices.getUserMedia(e)})}Object.defineProperty(e,"__esModule",{value:!0}),e.shimGetDisplayMedia=n},{}],13:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.shimGetUserMedia=o;var s=r(t("../utils"));function r(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}function o(t){var i=s.detectBrowser(t),e=t&&t.navigator,r=t&&t.MediaStreamTrack;if(e.getUserMedia=function(t,i,n){s.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),e.mediaDevices.getUserMedia(t).then(i,n)},!(i.version>55&&"autoGainControl"in e.mediaDevices.getSupportedConstraints())){var o=function(t,i,e){i in t&&!(e in t)&&(t[e]=t[i],delete t[i])},u=e.mediaDevices.getUserMedia.bind(e.mediaDevices);if(e.mediaDevices.getUserMedia=function(t){return"object"===(void 0===t?"undefined":n(t))&&"object"===n(t.audio)&&(t=JSON.parse(JSON.stringify(t)),o(t.audio,"autoGainControl","mozAutoGainControl"),o(t.audio,"noiseSuppression","mozNoiseSuppression")),u(t)},r&&r.prototype.getSettings){var a=r.prototype.getSettings;r.prototype.getSettings=function(){var t=a.apply(this,arguments);return o(t,"mozAutoGainControl","autoGainControl"),o(t,"mozNoiseSuppression","noiseSuppression"),t}}if(r&&r.prototype.applyConstraints){var c=r.prototype.applyConstraints;r.prototype.applyConstraints=function(t){return"audio"===this.kind&&"object"===(void 0===t?"undefined":n(t))&&(t=JSON.parse(JSON.stringify(t)),o(t,"autoGainControl","mozAutoGainControl"),o(t,"noiseSuppression","mozNoiseSuppression")),c.apply(this,[t])}}}}},{"../utils":15}],14:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.shimLocalStreamsAPI=o,e.shimRemoteStreamsAPI=u,e.shimCallbacksAPI=a,e.shimGetUserMedia=c,e.shimConstraints=h,e.shimRTCIceServerUrls=f,e.shimTrackEventTransceiver=l,e.shimCreateOfferLegacy=d;var s=r(t("../utils"));function r(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i}function o(t){if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var i=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(t){var e=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getTracks().forEach((function(n){return i.call(e,n,t)}))},t.RTCPeerConnection.prototype.addTrack=function(t,e){return e&&(this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]),i.call(this,t,e)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){var i=this;this._localStreams||(this._localStreams=[]);var e=this._localStreams.indexOf(t);if(-1!==e){this._localStreams.splice(e,1);var n=t.getTracks();this.getSenders().forEach((function(t){n.includes(t.track)&&i.removeTrack(t)}))}})}}function u(t){if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(t){var i=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(i._remoteStreams||(i._remoteStreams=[]),!i._remoteStreams.includes(t)){i._remoteStreams.push(t);var e=new Event("addstream");e.stream=t,i.dispatchEvent(e)}}))})}});var i=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach((function(i){if(t._remoteStreams||(t._remoteStreams=[]),!(t._remoteStreams.indexOf(i)>=0)){t._remoteStreams.push(i);var e=new Event("addstream");e.stream=i,t.dispatchEvent(e)}}))}),i.apply(t,arguments)}}}function a(t){if("object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection){var i=t.RTCPeerConnection.prototype,e=i.createOffer,s=i.createAnswer,r=i.setLocalDescription,o=i.setRemoteDescription,u=i.addIceCandidate;i.createOffer=function(t,i){var n=e.apply(this,[arguments.length>=2?arguments[2]:arguments[0]]);return i?(n.then(t,i),Promise.resolve()):n},i.createAnswer=function(t,i){var e=s.apply(this,[arguments.length>=2?arguments[2]:arguments[0]]);return i?(e.then(t,i),Promise.resolve()):e};var a=function(t,i,e){var n=r.apply(this,[t]);return e?(n.then(i,e),Promise.resolve()):n};i.setLocalDescription=a,i.setRemoteDescription=a=function(t,i,e){var n=o.apply(this,[t]);return e?(n.then(i,e),Promise.resolve()):n},i.addIceCandidate=a=function(t,i,e){var n=u.apply(this,[t]);return e?(n.then(i,e),Promise.resolve()):n}}}function c(t){var i=t&&t.navigator;if(i.mediaDevices&&i.mediaDevices.getUserMedia){var e=i.mediaDevices,n=e.getUserMedia.bind(e);i.mediaDevices.getUserMedia=function(t){return n(h(t))}}!i.getUserMedia&&i.mediaDevices&&i.mediaDevices.getUserMedia&&(i.getUserMedia=function(t,e,n){i.mediaDevices.getUserMedia(t).then(e,n)}.bind(i))}function h(t){return t&&void 0!==t.video?Object.assign({},t,{video:s.compactObject(t.video)}):t}function f(t){var i=t.RTCPeerConnection;t.RTCPeerConnection=function(t,e){if(t&&t.iceServers){for(var n=[],r=0;r<t.iceServers.length;r++){var o=t.iceServers[r];!o.hasOwnProperty("urls")&&o.hasOwnProperty("url")?(s.deprecated("RTCIceServer.url","RTCIceServer.urls"),(o=JSON.parse(JSON.stringify(o))).urls=o.url,delete o.url,n.push(o)):n.push(t.iceServers[r])}t.iceServers=n}return new i(t,e)},t.RTCPeerConnection.prototype=i.prototype,"generateCertificate"in t.RTCPeerConnection&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:function(){return i.generateCertificate}})}function l(t){"object"===(void 0===t?"undefined":n(t))&&t.RTCPeerConnection&&"receiver"in t.RTCTrackEvent.prototype&&!t.RTCTransceiver&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function d(t){var i=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(t){if(t){void 0!==t.offerToReceiveAudio&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);var e=this.getTransceivers().find((function(t){return"audio"===t.receiver.track.kind}));!1===t.offerToReceiveAudio&&e?"sendrecv"===e.direction?e.setDirection?e.setDirection("sendonly"):e.direction="sendonly":"recvonly"===e.direction&&(e.setDirection?e.setDirection("inactive"):e.direction="inactive"):!0!==t.offerToReceiveAudio||e||this.addTransceiver("audio"),void 0!==t.offerToReceiveVideo&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);var n=this.getTransceivers().find((function(t){return"video"===t.receiver.track.kind}));!1===t.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==t.offerToReceiveVideo||n||this.addTransceiver("video")}return i.apply(this,arguments)}}},{"../utils":15}],15:[function(t,i,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function s(t,i,e){return i in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}e.extractVersion=u,e.wrapPeerConnectionEvent=a,e.disableLog=c,e.disableWarnings=h,e.log=f,e.deprecated=l,e.detectBrowser=d,e.compactObject=v,e.walkStats=m,e.filterStats=p;var r=!0,o=!0;function u(t,i,e){var n=t.match(i);return n&&n.length>=e&&parseInt(n[e],10)}function a(t,i,e){if(t.RTCPeerConnection){var n=t.RTCPeerConnection.prototype,s=n.addEventListener;n.addEventListener=function(t,n){if(t!==i)return s.apply(this,arguments);var r=function(t){var i=e(t);i&&n(i)};return this._eventMap=this._eventMap||{},this._eventMap[n]=r,s.apply(this,[t,r])};var r=n.removeEventListener;n.removeEventListener=function(t,e){if(t!==i||!this._eventMap||!this._eventMap[e])return r.apply(this,arguments);var n=this._eventMap[e];return delete this._eventMap[e],r.apply(this,[t,n])},Object.defineProperty(n,"on"+i,{get:function(){return this["_on"+i]},set:function(t){this["_on"+i]&&(this.removeEventListener(i,this["_on"+i]),delete this["_on"+i]),t&&this.addEventListener(i,this["_on"+i]=t)},enumerable:!0,configurable:!0})}}function c(t){return"boolean"!=typeof t?new Error("Argument type: "+(void 0===t?"undefined":n(t))+". Please use a boolean."):(r=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function h(t){return"boolean"!=typeof t?new Error("Argument type: "+(void 0===t?"undefined":n(t))+". Please use a boolean."):(o=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function f(){if("object"===("undefined"==typeof window?"undefined":n(window))){if(r)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function l(t,i){o&&console.warn(t+" is deprecated, please use "+i+" instead.")}function d(t){var i=t.navigator,e={browser:null,version:null};if(void 0===t||!t.navigator)return e.browser="Not a browser.",e;if(i.mozGetUserMedia)e.browser="firefox",e.version=u(i.userAgent,/Firefox\/(\d+)\./,1);else if(i.webkitGetUserMedia||!1===t.isSecureContext&&t.webkitRTCPeerConnection&&!t.RTCIceGatherer)e.browser="chrome",e.version=u(i.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(i.mediaDevices&&i.userAgent.match(/Edge\/(\d+).(\d+)$/))e.browser="edge",e.version=u(i.userAgent,/Edge\/(\d+).(\d+)$/,2);else{if(!t.RTCPeerConnection||!i.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=u(i.userAgent,/AppleWebKit\/(\d+)\./,1)}return e}function v(t){return"object"!==(void 0===t?"undefined":n(t))?t:Object.keys(t).reduce((function(i,e){var r="object"===n(t[e]),o=r?v(t[e]):t[e],u=r&&!Object.keys(o).length;return void 0===o||u?i:Object.assign(i,s({},e,o))}),{})}function m(t,i,e){i&&!e.has(i.id)&&(e.set(i.id,i),Object.keys(i).forEach((function(n){n.endsWith("Id")?m(t,t.get(i[n]),e):n.endsWith("Ids")&&i[n].forEach((function(i){m(t,t.get(i),e)}))})))}function p(t,i,e){var n=e?"outbound-rtp":"inbound-rtp",s=new Map;if(null===i)return s;var r=[];return t.forEach((function(t){"track"===t.type&&t.trackIdentifier===i.id&&r.push(t)})),r.forEach((function(i){t.forEach((function(e){e.type===n&&e.trackId===i.id&&m(t,e,s)}))})),s}},{}],16:[function(t,i,e){"use strict";var n=t("sdp");function s(t){return{inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[t.type]||t.type}function r(t,i,e,s,r){var o=n.writeRtpDescription(t.kind,i);if(o+=n.writeIceParameters(t.iceGatherer.getLocalParameters()),o+=n.writeDtlsParameters(t.dtlsTransport.getLocalParameters(),"offer"===e?"actpass":r||"active"),o+="a=mid:"+t.mid+"\r\n",o+=t.rtpSender&&t.rtpReceiver?"a=sendrecv\r\n":t.rtpSender?"a=sendonly\r\n":t.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",t.rtpSender){var u=t.rtpSender._initialTrackId||t.rtpSender.track.id;t.rtpSender._initialTrackId=u;var a="msid:"+(s?s.id:"-")+" "+u+"\r\n";o+="a="+a,o+="a=ssrc:"+t.sendEncodingParameters[0].ssrc+" "+a,t.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+t.sendEncodingParameters[0].rtx.ssrc+" "+a,o+="a=ssrc-group:FID "+t.sendEncodingParameters[0].ssrc+" "+t.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return o+="a=ssrc:"+t.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",t.rtpSender&&t.sendEncodingParameters[0].rtx&&(o+="a=ssrc:"+t.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),o}function o(t,i){var e=!1;return(t=JSON.parse(JSON.stringify(t))).filter((function(t){if(t&&(t.urls||t.url)){var n=t.urls||t.url;t.url&&!t.urls&&console.warn("RTCIceServer.url is deprecated! Use urls instead.");var s="string"==typeof n;return s&&(n=[n]),n=n.filter((function(t){return 0!==t.indexOf("turn:")||-1===t.indexOf("transport=udp")||-1!==t.indexOf("turn:[")||e?0===t.indexOf("stun:")&&i>=14393&&-1===t.indexOf("?transport=udp"):(e=!0,!0)})),delete t.url,t.urls=s?n[0]:n,!!n.length}}))}function u(t,i){var e={codecs:[],headerExtensions:[],fecMechanisms:[]},n=function(t,i){t=parseInt(t,10);for(var e=0;e<i.length;e++)if(i[e].payloadType===t||i[e].preferredPayloadType===t)return i[e]},s=function(t,i,e,s){var r=n(t.parameters.apt,e),o=n(i.parameters.apt,s);return r&&o&&r.name.toLowerCase()===o.name.toLowerCase()};return t.codecs.forEach((function(n){for(var r=0;r<i.codecs.length;r++){var o=i.codecs[r];if(n.name.toLowerCase()===o.name.toLowerCase()&&n.clockRate===o.clockRate){if("rtx"===n.name.toLowerCase()&&n.parameters&&o.parameters.apt&&!s(n,o,t.codecs,i.codecs))continue;(o=JSON.parse(JSON.stringify(o))).numChannels=Math.min(n.numChannels,o.numChannels),e.codecs.push(o),o.rtcpFeedback=o.rtcpFeedback.filter((function(t){for(var i=0;i<n.rtcpFeedback.length;i++)if(n.rtcpFeedback[i].type===t.type&&n.rtcpFeedback[i].parameter===t.parameter)return!0;return!1}));break}}})),t.headerExtensions.forEach((function(t){for(var n=0;n<i.headerExtensions.length;n++){var s=i.headerExtensions[n];if(t.uri===s.uri){e.headerExtensions.push(s);break}}})),e}function a(t,i,e){return-1!=={offer:{setLocalDescription:["stable","have-local-offer"],setRemoteDescription:["stable","have-remote-offer"]},answer:{setLocalDescription:["have-remote-offer","have-local-pranswer"],setRemoteDescription:["have-local-offer","have-remote-pranswer"]}}[i][t].indexOf(e)}function c(t,i){var e=t.getRemoteCandidates().find((function(t){return i.foundation===t.foundation&&i.ip===t.ip&&i.port===t.port&&i.priority===t.priority&&i.protocol===t.protocol&&i.type===t.type}));return e||t.addRemoteCandidate(i),!e}function h(t,i){var e=new Error(i);return e.name=t,e.code={NotSupportedError:9,InvalidStateError:11,InvalidAccessError:15,TypeError:void 0,OperationError:void 0}[t],e}i.exports=function(t,i){function e(i,e){e.addTrack(i),e.dispatchEvent(new t.MediaStreamTrackEvent("addtrack",{track:i}))}function f(i,e){e.removeTrack(i),e.dispatchEvent(new t.MediaStreamTrackEvent("removetrack",{track:i}))}function l(i,e,n,s){var r=new Event("track");r.track=e,r.receiver=n,r.transceiver={receiver:n},r.streams=s,t.setTimeout((function(){i._dispatchEvent("track",r)}))}var d=function(e){var s=this,r=document.createDocumentFragment();if(["addEventListener","removeEventListener","dispatchEvent"].forEach((function(t){s[t]=r[t].bind(r)})),this.canTrickleIceCandidates=null,this.needNegotiation=!1,this.localStreams=[],this.remoteStreams=[],this._localDescription=null,this._remoteDescription=null,this.signalingState="stable",this.iceConnectionState="new",this.connectionState="new",this.iceGatheringState="new",e=JSON.parse(JSON.stringify(e||{})),this.usingBundle="max-bundle"===e.bundlePolicy,"negotiate"===e.rtcpMuxPolicy)throw h("NotSupportedError","rtcpMuxPolicy 'negotiate' is not supported");switch(e.rtcpMuxPolicy||(e.rtcpMuxPolicy="require"),e.iceTransportPolicy){case"all":case"relay":break;default:e.iceTransportPolicy="all"}switch(e.bundlePolicy){case"balanced":case"max-compat":case"max-bundle":break;default:e.bundlePolicy="balanced"}if(e.iceServers=o(e.iceServers||[],i),this._iceGatherers=[],e.iceCandidatePoolSize)for(var u=e.iceCandidatePoolSize;u>0;u--)this._iceGatherers.push(new t.RTCIceGatherer({iceServers:e.iceServers,gatherPolicy:e.iceTransportPolicy}));else e.iceCandidatePoolSize=0;this._config=e,this.transceivers=[],this._sdpSessionId=n.generateSessionId(),this._sdpSessionVersion=0,this._dtlsRole=void 0,this._isClosed=!1};Object.defineProperty(d.prototype,"localDescription",{configurable:!0,get:function(){return this._localDescription}}),Object.defineProperty(d.prototype,"remoteDescription",{configurable:!0,get:function(){return this._remoteDescription}}),d.prototype.onicecandidate=null,d.prototype.onaddstream=null,d.prototype.ontrack=null,d.prototype.onremovestream=null,d.prototype.onsignalingstatechange=null,d.prototype.oniceconnectionstatechange=null,d.prototype.onconnectionstatechange=null,d.prototype.onicegatheringstatechange=null,d.prototype.onnegotiationneeded=null,d.prototype.ondatachannel=null,d.prototype._dispatchEvent=function(t,i){this._isClosed||(this.dispatchEvent(i),"function"==typeof this["on"+t]&&this["on"+t](i))},d.prototype._emitGatheringStateChange=function(){var t=new Event("icegatheringstatechange");this._dispatchEvent("icegatheringstatechange",t)},d.prototype.getConfiguration=function(){return this._config},d.prototype.getLocalStreams=function(){return this.localStreams},d.prototype.getRemoteStreams=function(){return this.remoteStreams},d.prototype._createTransceiver=function(t,i){var e={track:null,iceGatherer:null,iceTransport:null,dtlsTransport:null,localCapabilities:null,remoteCapabilities:null,rtpSender:null,rtpReceiver:null,kind:t,mid:null,sendEncodingParameters:null,recvEncodingParameters:null,stream:null,associatedRemoteMediaStreams:[],wantReceive:!0};if(this.usingBundle&&this.transceivers.length>0)e.iceTransport=this.transceivers[0].iceTransport,e.dtlsTransport=this.transceivers[0].dtlsTransport;else{var n=this._createIceAndDtlsTransports();e.iceTransport=n.iceTransport,e.dtlsTransport=n.dtlsTransport}return i||this.transceivers.push(e),e},d.prototype.addTrack=function(i,e){if(this._isClosed)throw h("InvalidStateError","Attempted to call addTrack on a closed peerconnection.");var n;if(this.transceivers.find((function(t){return t.track===i})))throw h("InvalidAccessError","Track already exists.");for(var s=0;s<this.transceivers.length;s++)this.transceivers[s].track||this.transceivers[s].kind!==i.kind||(n=this.transceivers[s]);return n||(n=this._createTransceiver(i.kind)),this._maybeFireNegotiationNeeded(),-1===this.localStreams.indexOf(e)&&this.localStreams.push(e),n.track=i,n.stream=e,n.rtpSender=new t.RTCRtpSender(i,n.dtlsTransport),n.rtpSender},d.prototype.addStream=function(t){var e=this;if(i>=15025)t.getTracks().forEach((function(i){e.addTrack(i,t)}));else{var n=t.clone();t.getTracks().forEach((function(t,i){var e=n.getTracks()[i];t.addEventListener("enabled",(function(t){e.enabled=t.enabled}))})),n.getTracks().forEach((function(t){e.addTrack(t,n)}))}},d.prototype.removeTrack=function(i){if(this._isClosed)throw h("InvalidStateError","Attempted to call removeTrack on a closed peerconnection.");if(!(i instanceof t.RTCRtpSender))throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.");var e=this.transceivers.find((function(t){return t.rtpSender===i}));if(!e)throw h("InvalidAccessError","Sender was not created by this connection.");var n=e.stream;e.rtpSender.stop(),e.rtpSender=null,e.track=null,e.stream=null,-1===this.transceivers.map((function(t){return t.stream})).indexOf(n)&&this.localStreams.indexOf(n)>-1&&this.localStreams.splice(this.localStreams.indexOf(n),1),this._maybeFireNegotiationNeeded()},d.prototype.removeStream=function(t){var i=this;t.getTracks().forEach((function(t){var e=i.getSenders().find((function(i){return i.track===t}));e&&i.removeTrack(e)}))},d.prototype.getSenders=function(){return this.transceivers.filter((function(t){return!!t.rtpSender})).map((function(t){return t.rtpSender}))},d.prototype.getReceivers=function(){return this.transceivers.filter((function(t){return!!t.rtpReceiver})).map((function(t){return t.rtpReceiver}))},d.prototype._createIceGatherer=function(i,e){var n=this;if(e&&i>0)return this.transceivers[0].iceGatherer;if(this._iceGatherers.length)return this._iceGatherers.shift();var s=new t.RTCIceGatherer({iceServers:this._config.iceServers,gatherPolicy:this._config.iceTransportPolicy});return Object.defineProperty(s,"state",{value:"new",writable:!0}),this.transceivers[i].bufferedCandidateEvents=[],this.transceivers[i].bufferCandidates=function(t){var e=!t.candidate||0===Object.keys(t.candidate).length;s.state=e?"completed":"gathering",null!==n.transceivers[i].bufferedCandidateEvents&&n.transceivers[i].bufferedCandidateEvents.push(t)},s.addEventListener("localcandidate",this.transceivers[i].bufferCandidates),s},d.prototype._gather=function(i,e){var s=this,r=this.transceivers[e].iceGatherer;if(!r.onlocalcandidate){var o=this.transceivers[e].bufferedCandidateEvents;this.transceivers[e].bufferedCandidateEvents=null,r.removeEventListener("localcandidate",this.transceivers[e].bufferCandidates),r.onlocalcandidate=function(t){if(!(s.usingBundle&&e>0)){var o=new Event("icecandidate");o.candidate={sdpMid:i,sdpMLineIndex:e};var u=t.candidate,a=!u||0===Object.keys(u).length;if(a)"new"!==r.state&&"gathering"!==r.state||(r.state="completed");else{"new"===r.state&&(r.state="gathering"),u.component=1,u.ufrag=r.getLocalParameters().usernameFragment;var c=n.writeCandidate(u);o.candidate=Object.assign(o.candidate,n.parseCandidate(c)),o.candidate.candidate=c,o.candidate.toJSON=function(){return{candidate:o.candidate.candidate,sdpMid:o.candidate.sdpMid,sdpMLineIndex:o.candidate.sdpMLineIndex,usernameFragment:o.candidate.usernameFragment}}}var h=n.getMediaSections(s._localDescription.sdp);h[o.candidate.sdpMLineIndex]+=a?"a=end-of-candidates\r\n":"a="+o.candidate.candidate+"\r\n",s._localDescription.sdp=n.getDescription(s._localDescription.sdp)+h.join("");var f=s.transceivers.every((function(t){return t.iceGatherer&&"completed"===t.iceGatherer.state}));"gathering"!==s.iceGatheringState&&(s.iceGatheringState="gathering",s._emitGatheringStateChange()),a||s._dispatchEvent("icecandidate",o),f&&(s._dispatchEvent("icecandidate",new Event("icecandidate")),s.iceGatheringState="complete",s._emitGatheringStateChange())}},t.setTimeout((function(){o.forEach((function(t){r.onlocalcandidate(t)}))}),0)}},d.prototype._createIceAndDtlsTransports=function(){var i=this,e=new t.RTCIceTransport(null);e.onicestatechange=function(){i._updateIceConnectionState(),i._updateConnectionState()};var n=new t.RTCDtlsTransport(e);return n.ondtlsstatechange=function(){i._updateConnectionState()},n.onerror=function(){Object.defineProperty(n,"state",{value:"failed",writable:!0}),i._updateConnectionState()},{iceTransport:e,dtlsTransport:n}},d.prototype._disposeIceAndDtlsTransports=function(t){var i=this.transceivers[t].iceGatherer;i&&(delete i.onlocalcandidate,delete this.transceivers[t].iceGatherer);var e=this.transceivers[t].iceTransport;e&&(delete e.onicestatechange,delete this.transceivers[t].iceTransport);var n=this.transceivers[t].dtlsTransport;n&&(delete n.ondtlsstatechange,delete n.onerror,delete this.transceivers[t].dtlsTransport)},d.prototype._transceive=function(t,e,s){var r=u(t.localCapabilities,t.remoteCapabilities);e&&t.rtpSender&&(r.encodings=t.sendEncodingParameters,r.rtcp={cname:n.localCName,compound:t.rtcpParameters.compound},t.recvEncodingParameters.length&&(r.rtcp.ssrc=t.recvEncodingParameters[0].ssrc),t.rtpSender.send(r)),s&&t.rtpReceiver&&r.codecs.length>0&&("video"===t.kind&&t.recvEncodingParameters&&i<15019&&t.recvEncodingParameters.forEach((function(t){delete t.rtx})),r.encodings=t.recvEncodingParameters.length?t.recvEncodingParameters:[{}],r.rtcp={compound:t.rtcpParameters.compound},t.rtcpParameters.cname&&(r.rtcp.cname=t.rtcpParameters.cname),t.sendEncodingParameters.length&&(r.rtcp.ssrc=t.sendEncodingParameters[0].ssrc),t.rtpReceiver.receive(r))},d.prototype.setLocalDescription=function(t){var i,e,s=this;if(-1===["offer","answer"].indexOf(t.type))return Promise.reject(h("TypeError",'Unsupported type "'+t.type+'"'));if(!a("setLocalDescription",t.type,s.signalingState)||s._isClosed)return Promise.reject(h("InvalidStateError","Can not set local "+t.type+" in state "+s.signalingState));if("offer"===t.type)i=n.splitSections(t.sdp),e=i.shift(),i.forEach((function(t,i){var e=n.parseRtpParameters(t);s.transceivers[i].localCapabilities=e})),s.transceivers.forEach((function(t,i){s._gather(t.mid,i)}));else if("answer"===t.type){i=n.splitSections(s._remoteDescription.sdp),e=i.shift();var r=n.matchPrefix(e,"a=ice-lite").length>0;i.forEach((function(t,i){var o=s.transceivers[i],a=o.iceGatherer,c=o.iceTransport,h=o.dtlsTransport,f=o.localCapabilities,l=o.remoteCapabilities;if(!(n.isRejected(t)&&0===n.matchPrefix(t,"a=bundle-only").length||o.rejected)){var d=n.getIceParameters(t,e),v=n.getDtlsParameters(t,e);r&&(v.role="server"),s.usingBundle&&0!==i||(s._gather(o.mid,i),"new"===c.state&&c.start(a,d,r?"controlling":"controlled"),"new"===h.state&&h.start(v));var m=u(f,l);s._transceive(o,m.codecs.length>0,!1)}}))}return s._localDescription={type:t.type,sdp:t.sdp},s._updateSignalingState("offer"===t.type?"have-local-offer":"stable"),Promise.resolve()},d.prototype.setRemoteDescription=function(s){var r=this;if(-1===["offer","answer"].indexOf(s.type))return Promise.reject(h("TypeError",'Unsupported type "'+s.type+'"'));if(!a("setRemoteDescription",s.type,r.signalingState)||r._isClosed)return Promise.reject(h("InvalidStateError","Can not set remote "+s.type+" in state "+r.signalingState));var o={};r.remoteStreams.forEach((function(t){o[t.id]=t}));var d=[],v=n.splitSections(s.sdp),m=v.shift(),p=n.matchPrefix(m,"a=ice-lite").length>0,g=n.matchPrefix(m,"a=group:BUNDLE ").length>0;r.usingBundle=g;var b=n.matchPrefix(m,"a=ice-options:")[0];return r.canTrickleIceCandidates=!!b&&b.substr(14).split(" ").indexOf("trickle")>=0,v.forEach((function(a,h){var l=n.splitLines(a),v=n.getKind(a),b=n.isRejected(a)&&0===n.matchPrefix(a,"a=bundle-only").length,_=l[0].substr(2).split(" ")[2],y=n.getDirection(a,m),w=n.parseMsid(a),S=n.getMid(a)||n.generateIdentifier();if(b||"application"===v&&("DTLS/SCTP"===_||"UDP/DTLS/SCTP"===_))r.transceivers[h]={mid:S,kind:v,protocol:_,rejected:!0};else{var E,O,T,k,R,I,N,C,z;!b&&r.transceivers[h]&&r.transceivers[h].rejected&&(r.transceivers[h]=r._createTransceiver(v,!0));var D,P,A=n.parseRtpParameters(a);b||(D=n.getIceParameters(a,m),(P=n.getDtlsParameters(a,m)).role="client"),N=n.parseRtpEncodingParameters(a);var M=n.parseRtcpParameters(a),x=n.matchPrefix(a,"a=end-of-candidates",m).length>0,j=n.matchPrefix(a,"a=candidate:").map((function(t){return n.parseCandidate(t)})).filter((function(t){return 1===t.component}));if(("offer"===s.type||"answer"===s.type)&&!b&&g&&h>0&&r.transceivers[h]&&(r._disposeIceAndDtlsTransports(h),r.transceivers[h].iceGatherer=r.transceivers[0].iceGatherer,r.transceivers[h].iceTransport=r.transceivers[0].iceTransport,r.transceivers[h].dtlsTransport=r.transceivers[0].dtlsTransport,r.transceivers[h].rtpSender&&r.transceivers[h].rtpSender.setTransport(r.transceivers[0].dtlsTransport),r.transceivers[h].rtpReceiver&&r.transceivers[h].rtpReceiver.setTransport(r.transceivers[0].dtlsTransport)),"offer"!==s.type||b)"answer"!==s.type||b||(O=(E=r.transceivers[h]).iceGatherer,T=E.iceTransport,k=E.dtlsTransport,R=E.rtpReceiver,I=E.sendEncodingParameters,C=E.localCapabilities,r.transceivers[h].recvEncodingParameters=N,r.transceivers[h].remoteCapabilities=A,r.transceivers[h].rtcpParameters=M,j.length&&"new"===T.state&&(!p&&!x||g&&0!==h?j.forEach((function(t){c(E.iceTransport,t)})):T.setRemoteCandidates(j)),g&&0!==h||("new"===T.state&&T.start(O,D,"controlling"),"new"===k.state&&k.start(P)),!u(E.localCapabilities,E.remoteCapabilities).codecs.filter((function(t){return"rtx"===t.name.toLowerCase()})).length&&E.sendEncodingParameters[0].rtx&&delete E.sendEncodingParameters[0].rtx,r._transceive(E,"sendrecv"===y||"recvonly"===y,"sendrecv"===y||"sendonly"===y),!R||"sendrecv"!==y&&"sendonly"!==y?delete E.rtpReceiver:(z=R.track,w?(o[w.stream]||(o[w.stream]=new t.MediaStream),e(z,o[w.stream]),d.push([z,R,o[w.stream]])):(o.default||(o.default=new t.MediaStream),e(z,o.default),d.push([z,R,o.default]))));else{(E=r.transceivers[h]||r._createTransceiver(v)).mid=S,E.iceGatherer||(E.iceGatherer=r._createIceGatherer(h,g)),j.length&&"new"===E.iceTransport.state&&(!x||g&&0!==h?j.forEach((function(t){c(E.iceTransport,t)})):E.iceTransport.setRemoteCandidates(j)),C=t.RTCRtpReceiver.getCapabilities(v),i<15019&&(C.codecs=C.codecs.filter((function(t){return"rtx"!==t.name}))),I=E.sendEncodingParameters||[{ssrc:1001*(2*h+2)}];var L,q=!1;"sendrecv"===y||"sendonly"===y?(q=!E.rtpReceiver,R=E.rtpReceiver||new t.RTCRtpReceiver(E.dtlsTransport,v),q&&(z=R.track,w&&"-"===w.stream||(w?(o[w.stream]||(o[w.stream]=new t.MediaStream,Object.defineProperty(o[w.stream],"id",{get:function(){return w.stream}})),Object.defineProperty(z,"id",{get:function(){return w.track}}),L=o[w.stream]):(o.default||(o.default=new t.MediaStream),L=o.default)),L&&(e(z,L),E.associatedRemoteMediaStreams.push(L)),d.push([z,R,L]))):E.rtpReceiver&&E.rtpReceiver.track&&(E.associatedRemoteMediaStreams.forEach((function(t){var i=t.getTracks().find((function(t){return t.id===E.rtpReceiver.track.id}));i&&f(i,t)})),E.associatedRemoteMediaStreams=[]),E.localCapabilities=C,E.remoteCapabilities=A,E.rtpReceiver=R,E.rtcpParameters=M,E.sendEncodingParameters=I,E.recvEncodingParameters=N,r._transceive(r.transceivers[h],!1,q)}}})),void 0===r._dtlsRole&&(r._dtlsRole="offer"===s.type?"active":"passive"),r._remoteDescription={type:s.type,sdp:s.sdp},r._updateSignalingState("offer"===s.type?"have-remote-offer":"stable"),Object.keys(o).forEach((function(i){var e=o[i];if(e.getTracks().length){if(-1===r.remoteStreams.indexOf(e)){r.remoteStreams.push(e);var n=new Event("addstream");n.stream=e,t.setTimeout((function(){r._dispatchEvent("addstream",n)}))}d.forEach((function(t){e.id===t[2].id&&l(r,t[0],t[1],[e])}))}})),d.forEach((function(t){t[2]||l(r,t[0],t[1],[])})),t.setTimeout((function(){r&&r.transceivers&&r.transceivers.forEach((function(t){t.iceTransport&&"new"===t.iceTransport.state&&t.iceTransport.getRemoteCandidates().length>0&&(console.warn("Timeout for addRemoteCandidate. Consider sending an end-of-candidates notification"),t.iceTransport.addRemoteCandidate({}))}))}),4e3),Promise.resolve()},d.prototype.close=function(){this.transceivers.forEach((function(t){t.iceTransport&&t.iceTransport.stop(),t.dtlsTransport&&t.dtlsTransport.stop(),t.rtpSender&&t.rtpSender.stop(),t.rtpReceiver&&t.rtpReceiver.stop()})),this._isClosed=!0,this._updateSignalingState("closed")},d.prototype._updateSignalingState=function(t){this.signalingState=t;var i=new Event("signalingstatechange");this._dispatchEvent("signalingstatechange",i)},d.prototype._maybeFireNegotiationNeeded=function(){var i=this;"stable"===this.signalingState&&!0!==this.needNegotiation&&(this.needNegotiation=!0,t.setTimeout((function(){if(i.needNegotiation){i.needNegotiation=!1;var t=new Event("negotiationneeded");i._dispatchEvent("negotiationneeded",t)}}),0))},d.prototype._updateIceConnectionState=function(){var t,i={new:0,closed:0,checking:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(t){t.iceTransport&&!t.rejected&&i[t.iceTransport.state]++})),t="new",i.failed>0?t="failed":i.checking>0?t="checking":i.disconnected>0?t="disconnected":i.new>0?t="new":i.connected>0?t="connected":i.completed>0&&(t="completed"),t!==this.iceConnectionState){this.iceConnectionState=t;var e=new Event("iceconnectionstatechange");this._dispatchEvent("iceconnectionstatechange",e)}},d.prototype._updateConnectionState=function(){var t,i={new:0,closed:0,connecting:0,connected:0,completed:0,disconnected:0,failed:0};if(this.transceivers.forEach((function(t){t.iceTransport&&t.dtlsTransport&&!t.rejected&&(i[t.iceTransport.state]++,i[t.dtlsTransport.state]++)})),i.connected+=i.completed,t="new",i.failed>0?t="failed":i.connecting>0?t="connecting":i.disconnected>0?t="disconnected":i.new>0?t="new":i.connected>0&&(t="connected"),t!==this.connectionState){this.connectionState=t;var e=new Event("connectionstatechange");this._dispatchEvent("connectionstatechange",e)}},d.prototype.createOffer=function(){var e=this;if(e._isClosed)return Promise.reject(h("InvalidStateError","Can not call createOffer after close"));var s=e.transceivers.filter((function(t){return"audio"===t.kind})).length,o=e.transceivers.filter((function(t){return"video"===t.kind})).length,u=arguments[0];if(u){if(u.mandatory||u.optional)throw new TypeError("Legacy mandatory/optional constraints not supported.");void 0!==u.offerToReceiveAudio&&(s=!0===u.offerToReceiveAudio?1:!1===u.offerToReceiveAudio?0:u.offerToReceiveAudio),void 0!==u.offerToReceiveVideo&&(o=!0===u.offerToReceiveVideo?1:!1===u.offerToReceiveVideo?0:u.offerToReceiveVideo)}for(e.transceivers.forEach((function(t){"audio"===t.kind?--s<0&&(t.wantReceive=!1):"video"===t.kind&&--o<0&&(t.wantReceive=!1)}));s>0||o>0;)s>0&&(e._createTransceiver("audio"),s--),o>0&&(e._createTransceiver("video"),o--);var a=n.writeSessionBoilerplate(e._sdpSessionId,e._sdpSessionVersion++);e.transceivers.forEach((function(s,r){var o=s.track,u=s.kind,a=s.mid||n.generateIdentifier();s.mid=a,s.iceGatherer||(s.iceGatherer=e._createIceGatherer(r,e.usingBundle));var c=t.RTCRtpSender.getCapabilities(u);i<15019&&(c.codecs=c.codecs.filter((function(t){return"rtx"!==t.name}))),c.codecs.forEach((function(t){"H264"===t.name&&void 0===t.parameters["level-asymmetry-allowed"]&&(t.parameters["level-asymmetry-allowed"]="1"),s.remoteCapabilities&&s.remoteCapabilities.codecs&&s.remoteCapabilities.codecs.forEach((function(i){t.name.toLowerCase()===i.name.toLowerCase()&&t.clockRate===i.clockRate&&(t.preferredPayloadType=i.payloadType)}))})),c.headerExtensions.forEach((function(t){(s.remoteCapabilities&&s.remoteCapabilities.headerExtensions||[]).forEach((function(i){t.uri===i.uri&&(t.id=i.id)}))}));var h=s.sendEncodingParameters||[{ssrc:1001*(2*r+1)}];o&&i>=15019&&"video"===u&&!h[0].rtx&&(h[0].rtx={ssrc:h[0].ssrc+1}),s.wantReceive&&(s.rtpReceiver=new t.RTCRtpReceiver(s.dtlsTransport,u)),s.localCapabilities=c,s.sendEncodingParameters=h})),"max-compat"!==e._config.bundlePolicy&&(a+="a=group:BUNDLE "+e.transceivers.map((function(t){return t.mid})).join(" ")+"\r\n"),a+="a=ice-options:trickle\r\n",e.transceivers.forEach((function(t,i){a+=r(t,t.localCapabilities,"offer",t.stream,e._dtlsRole),a+="a=rtcp-rsize\r\n",!t.iceGatherer||"new"===e.iceGatheringState||0!==i&&e.usingBundle||(t.iceGatherer.getLocalCandidates().forEach((function(t){t.component=1,a+="a="+n.writeCandidate(t)+"\r\n"})),"completed"===t.iceGatherer.state&&(a+="a=end-of-candidates\r\n"))}));var c=new t.RTCSessionDescription({type:"offer",sdp:a});return Promise.resolve(c)},d.prototype.createAnswer=function(){var e=this;if(e._isClosed)return Promise.reject(h("InvalidStateError","Can not call createAnswer after close"));if("have-remote-offer"!==e.signalingState&&"have-local-pranswer"!==e.signalingState)return Promise.reject(h("InvalidStateError","Can not call createAnswer in signalingState "+e.signalingState));var s=n.writeSessionBoilerplate(e._sdpSessionId,e._sdpSessionVersion++);e.usingBundle&&(s+="a=group:BUNDLE "+e.transceivers.map((function(t){return t.mid})).join(" ")+"\r\n"),s+="a=ice-options:trickle\r\n";var o=n.getMediaSections(e._remoteDescription.sdp).length;e.transceivers.forEach((function(t,n){if(!(n+1>o)){if(t.rejected)return"application"===t.kind?s+="DTLS/SCTP"===t.protocol?"m=application 0 DTLS/SCTP 5000\r\n":"m=application 0 "+t.protocol+" webrtc-datachannel\r\n":"audio"===t.kind?s+="m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n":"video"===t.kind&&(s+="m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"),void(s+="c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:"+t.mid+"\r\n");var a;t.stream&&("audio"===t.kind?a=t.stream.getAudioTracks()[0]:"video"===t.kind&&(a=t.stream.getVideoTracks()[0]),a&&i>=15019&&"video"===t.kind&&!t.sendEncodingParameters[0].rtx&&(t.sendEncodingParameters[0].rtx={ssrc:t.sendEncodingParameters[0].ssrc+1}));var c=u(t.localCapabilities,t.remoteCapabilities);!c.codecs.filter((function(t){return"rtx"===t.name.toLowerCase()})).length&&t.sendEncodingParameters[0].rtx&&delete t.sendEncodingParameters[0].rtx,s+=r(t,c,"answer",t.stream,e._dtlsRole),t.rtcpParameters&&t.rtcpParameters.reducedSize&&(s+="a=rtcp-rsize\r\n")}}));var a=new t.RTCSessionDescription({type:"answer",sdp:s});return Promise.resolve(a)},d.prototype.addIceCandidate=function(t){var i,e=this;return t&&void 0===t.sdpMLineIndex&&!t.sdpMid?Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")):new Promise((function(s,r){if(!e._remoteDescription)return r(h("InvalidStateError","Can not add ICE candidate without a remote description"));if(t&&""!==t.candidate){var o=t.sdpMLineIndex;if(t.sdpMid)for(var u=0;u<e.transceivers.length;u++)if(e.transceivers[u].mid===t.sdpMid){o=u;break}var a=e.transceivers[o];if(!a)return r(h("OperationError","Can not add ICE candidate"));if(a.rejected)return s();var f=Object.keys(t.candidate).length>0?n.parseCandidate(t.candidate):{};if("tcp"===f.protocol&&(0===f.port||9===f.port))return s();if(f.component&&1!==f.component)return s();if((0===o||o>0&&a.iceTransport!==e.transceivers[0].iceTransport)&&!c(a.iceTransport,f))return r(h("OperationError","Can not add ICE candidate"));var l=t.candidate.trim();0===l.indexOf("a=")&&(l=l.substr(2)),(i=n.getMediaSections(e._remoteDescription.sdp))[o]+="a="+(f.type?l:"end-of-candidates")+"\r\n",e._remoteDescription.sdp=n.getDescription(e._remoteDescription.sdp)+i.join("")}else for(var d=0;d<e.transceivers.length&&(e.transceivers[d].rejected||(e.transceivers[d].iceTransport.addRemoteCandidate({}),(i=n.getMediaSections(e._remoteDescription.sdp))[d]+="a=end-of-candidates\r\n",e._remoteDescription.sdp=n.getDescription(e._remoteDescription.sdp)+i.join(""),!e.usingBundle));d++);s()}))},d.prototype.getStats=function(i){if(i&&i instanceof t.MediaStreamTrack){var e=null;if(this.transceivers.forEach((function(t){t.rtpSender&&t.rtpSender.track===i?e=t.rtpSender:t.rtpReceiver&&t.rtpReceiver.track===i&&(e=t.rtpReceiver)})),!e)throw h("InvalidAccessError","Invalid selector.");return e.getStats()}var n=[];return this.transceivers.forEach((function(t){["rtpSender","rtpReceiver","iceGatherer","iceTransport","dtlsTransport"].forEach((function(i){t[i]&&n.push(t[i].getStats())}))})),Promise.all(n).then((function(t){var i=new Map;return t.forEach((function(t){t.forEach((function(t){i.set(t.id,t)}))})),i}))},["RTCRtpSender","RTCRtpReceiver","RTCIceGatherer","RTCIceTransport","RTCDtlsTransport"].forEach((function(i){var e=t[i];if(e&&e.prototype&&e.prototype.getStats){var n=e.prototype.getStats;e.prototype.getStats=function(){return n.apply(this).then((function(t){var i=new Map;return Object.keys(t).forEach((function(e){t[e].type=s(t[e]),i.set(e,t[e])})),i}))}}}));var v=["createOffer","createAnswer"];return v.forEach((function(t){var i=d.prototype[t];d.prototype[t]=function(){var t=arguments;return"function"==typeof t[0]||"function"==typeof t[1]?i.apply(this,[arguments[2]]).then((function(i){"function"==typeof t[0]&&t[0].apply(null,[i])}),(function(i){"function"==typeof t[1]&&t[1].apply(null,[i])})):i.apply(this,arguments)}})),(v=["setLocalDescription","setRemoteDescription","addIceCandidate"]).forEach((function(t){var i=d.prototype[t];d.prototype[t]=function(){var t=arguments;return"function"==typeof t[1]||"function"==typeof t[2]?i.apply(this,arguments).then((function(){"function"==typeof t[1]&&t[1].apply(null)}),(function(i){"function"==typeof t[2]&&t[2].apply(null,[i])})):i.apply(this,arguments)}})),["getStats"].forEach((function(t){var i=d.prototype[t];d.prototype[t]=function(){var t=arguments;return"function"==typeof t[1]?i.apply(this,arguments).then((function(){"function"==typeof t[1]&&t[1].apply(null)})):i.apply(this,arguments)}})),d}},{sdp:17}],17:[function(t,i,e){"use strict";var n={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};n.localCName=n.generateIdentifier(),n.splitLines=function(t){return t.trim().split("\n").map((function(t){return t.trim()}))},n.splitSections=function(t){return t.split("\nm=").map((function(t,i){return(i>0?"m="+t:t).trim()+"\r\n"}))},n.getDescription=function(t){var i=n.splitSections(t);return i&&i[0]},n.getMediaSections=function(t){var i=n.splitSections(t);return i.shift(),i},n.matchPrefix=function(t,i){return n.splitLines(t).filter((function(t){return 0===t.indexOf(i)}))},n.parseCandidate=function(t){for(var i,e={foundation:(i=0===t.indexOf("a=candidate:")?t.substring(12).split(" "):t.substring(10).split(" "))[0],component:parseInt(i[1],10),protocol:i[2].toLowerCase(),priority:parseInt(i[3],10),ip:i[4],address:i[4],port:parseInt(i[5],10),type:i[7]},n=8;n<i.length;n+=2)switch(i[n]){case"raddr":e.relatedAddress=i[n+1];break;case"rport":e.relatedPort=parseInt(i[n+1],10);break;case"tcptype":e.tcpType=i[n+1];break;case"ufrag":e.ufrag=i[n+1],e.usernameFragment=i[n+1];break;default:e[i[n]]=i[n+1]}return e},n.writeCandidate=function(t){var i=[];i.push(t.foundation),i.push(t.component),i.push(t.protocol.toUpperCase()),i.push(t.priority),i.push(t.address||t.ip),i.push(t.port);var e=t.type;return i.push("typ"),i.push(e),"host"!==e&&t.relatedAddress&&t.relatedPort&&(i.push("raddr"),i.push(t.relatedAddress),i.push("rport"),i.push(t.relatedPort)),t.tcpType&&"tcp"===t.protocol.toLowerCase()&&(i.push("tcptype"),i.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(i.push("ufrag"),i.push(t.usernameFragment||t.ufrag)),"candidate:"+i.join(" ")},n.parseIceOptions=function(t){return t.substr(14).split(" ")},n.parseRtpMap=function(t){var i=t.substr(9).split(" "),e={payloadType:parseInt(i.shift(),10)};return i=i[0].split("/"),e.name=i[0],e.clockRate=parseInt(i[1],10),e.channels=3===i.length?parseInt(i[2],10):1,e.numChannels=e.channels,e},n.writeRtpMap=function(t){var i=t.payloadType;void 0!==t.preferredPayloadType&&(i=t.preferredPayloadType);var e=t.channels||t.numChannels||1;return"a=rtpmap:"+i+" "+t.name+"/"+t.clockRate+(1!==e?"/"+e:"")+"\r\n"},n.parseExtmap=function(t){var i=t.substr(9).split(" ");return{id:parseInt(i[0],10),direction:i[0].indexOf("/")>0?i[0].split("/")[1]:"sendrecv",uri:i[1]}},n.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&"sendrecv"!==t.direction?"/"+t.direction:"")+" "+t.uri+"\r\n"},n.parseFmtp=function(t){for(var i,e={},n=t.substr(t.indexOf(" ")+1).split(";"),s=0;s<n.length;s++)e[(i=n[s].trim().split("="))[0].trim()]=i[1];return e},n.writeFmtp=function(t){var i="",e=t.payloadType;if(void 0!==t.preferredPayloadType&&(e=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){var n=[];Object.keys(t.parameters).forEach((function(i){n.push(t.parameters[i]?i+"="+t.parameters[i]:i)})),i+="a=fmtp:"+e+" "+n.join(";")+"\r\n"}return i},n.parseRtcpFb=function(t){var i=t.substr(t.indexOf(" ")+1).split(" ");return{type:i.shift(),parameter:i.join(" ")}},n.writeRtcpFb=function(t){var i="",e=t.payloadType;return void 0!==t.preferredPayloadType&&(e=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach((function(t){i+="a=rtcp-fb:"+e+" "+t.type+(t.parameter&&t.parameter.length?" "+t.parameter:"")+"\r\n"})),i},n.parseSsrcMedia=function(t){var i=t.indexOf(" "),e={ssrc:parseInt(t.substr(7,i-7),10)},n=t.indexOf(":",i);return n>-1?(e.attribute=t.substr(i+1,n-i-1),e.value=t.substr(n+1)):e.attribute=t.substr(i+1),e},n.parseSsrcGroup=function(t){var i=t.substr(13).split(" ");return{semantics:i.shift(),ssrcs:i.map((function(t){return parseInt(t,10)}))}},n.getMid=function(t){var i=n.matchPrefix(t,"a=mid:")[0];if(i)return i.substr(6)},n.parseFingerprint=function(t){var i=t.substr(14).split(" ");return{algorithm:i[0].toLowerCase(),value:i[1]}},n.getDtlsParameters=function(t,i){return{role:"auto",fingerprints:n.matchPrefix(t+i,"a=fingerprint:").map(n.parseFingerprint)}},n.writeDtlsParameters=function(t,i){var e="a=setup:"+i+"\r\n";return t.fingerprints.forEach((function(t){e+="a=fingerprint:"+t.algorithm+" "+t.value+"\r\n"})),e},n.getIceParameters=function(t,i){var e=n.splitLines(t);return{usernameFragment:(e=e.concat(n.splitLines(i))).filter((function(t){return 0===t.indexOf("a=ice-ufrag:")}))[0].substr(12),password:e.filter((function(t){return 0===t.indexOf("a=ice-pwd:")}))[0].substr(10)}},n.writeIceParameters=function(t){return"a=ice-ufrag:"+t.usernameFragment+"\r\na=ice-pwd:"+t.password+"\r\n"},n.parseRtpParameters=function(t){for(var i={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},e=n.splitLines(t)[0].split(" "),s=3;s<e.length;s++){var r=e[s],o=n.matchPrefix(t,"a=rtpmap:"+r+" ")[0];if(o){var u=n.parseRtpMap(o),a=n.matchPrefix(t,"a=fmtp:"+r+" ");switch(u.parameters=a.length?n.parseFmtp(a[0]):{},u.rtcpFeedback=n.matchPrefix(t,"a=rtcp-fb:"+r+" ").map(n.parseRtcpFb),i.codecs.push(u),u.name.toUpperCase()){case"RED":case"ULPFEC":i.fecMechanisms.push(u.name.toUpperCase())}}}return n.matchPrefix(t,"a=extmap:").forEach((function(t){i.headerExtensions.push(n.parseExtmap(t))})),i},n.writeRtpDescription=function(t,i){var e="";e+="m="+t+" ",e+=i.codecs.length>0?"9":"0",e+=" UDP/TLS/RTP/SAVPF ",e+=i.codecs.map((function(t){return void 0!==t.preferredPayloadType?t.preferredPayloadType:t.payloadType})).join(" ")+"\r\n",e+="c=IN IP4 0.0.0.0\r\n",e+="a=rtcp:9 IN IP4 0.0.0.0\r\n",i.codecs.forEach((function(t){e+=n.writeRtpMap(t),e+=n.writeFmtp(t),e+=n.writeRtcpFb(t)}));var s=0;return i.codecs.forEach((function(t){t.maxptime>s&&(s=t.maxptime)})),s>0&&(e+="a=maxptime:"+s+"\r\n"),e+="a=rtcp-mux\r\n",i.headerExtensions&&i.headerExtensions.forEach((function(t){e+=n.writeExtmap(t)})),e},n.parseRtpEncodingParameters=function(t){var i,e=[],s=n.parseRtpParameters(t),r=-1!==s.fecMechanisms.indexOf("RED"),o=-1!==s.fecMechanisms.indexOf("ULPFEC"),u=n.matchPrefix(t,"a=ssrc:").map((function(t){return n.parseSsrcMedia(t)})).filter((function(t){return"cname"===t.attribute})),a=u.length>0&&u[0].ssrc,c=n.matchPrefix(t,"a=ssrc-group:FID").map((function(t){return t.substr(17).split(" ").map((function(t){return parseInt(t,10)}))}));c.length>0&&c[0].length>1&&c[0][0]===a&&(i=c[0][1]),s.codecs.forEach((function(t){if("RTX"===t.name.toUpperCase()&&t.parameters.apt){var n={ssrc:a,codecPayloadType:parseInt(t.parameters.apt,10)};a&&i&&(n.rtx={ssrc:i}),e.push(n),r&&((n=JSON.parse(JSON.stringify(n))).fec={ssrc:a,mechanism:o?"red+ulpfec":"red"},e.push(n))}})),0===e.length&&a&&e.push({ssrc:a});var h=n.matchPrefix(t,"b=");return h.length&&(h=0===h[0].indexOf("b=TIAS:")?parseInt(h[0].substr(7),10):0===h[0].indexOf("b=AS:")?1e3*parseInt(h[0].substr(5),10)*.95-16e3:void 0,e.forEach((function(t){t.maxBitrate=h}))),e},n.parseRtcpParameters=function(t){var i={},e=n.matchPrefix(t,"a=ssrc:").map((function(t){return n.parseSsrcMedia(t)})).filter((function(t){return"cname"===t.attribute}))[0];e&&(i.cname=e.value,i.ssrc=e.ssrc);var s=n.matchPrefix(t,"a=rtcp-rsize");i.reducedSize=s.length>0,i.compound=0===s.length;var r=n.matchPrefix(t,"a=rtcp-mux");return i.mux=r.length>0,i},n.parseMsid=function(t){var i,e=n.matchPrefix(t,"a=msid:");if(1===e.length)return{stream:(i=e[0].substr(7).split(" "))[0],track:i[1]};var s=n.matchPrefix(t,"a=ssrc:").map((function(t){return n.parseSsrcMedia(t)})).filter((function(t){return"msid"===t.attribute}));return s.length>0?{stream:(i=s[0].value.split(" "))[0],track:i[1]}:void 0},n.generateSessionId=function(){return Math.random().toString().substr(2,21)},n.writeSessionBoilerplate=function(t,i,e){var s=void 0!==i?i:2;return"v=0\r\no="+(e||"thisisadapterortc")+" "+(t||n.generateSessionId())+" "+s+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},n.writeMediaSection=function(t,i,e,s){var r=n.writeRtpDescription(t.kind,i);if(r+=n.writeIceParameters(t.iceGatherer.getLocalParameters()),r+=n.writeDtlsParameters(t.dtlsTransport.getLocalParameters(),"offer"===e?"actpass":"active"),r+="a=mid:"+t.mid+"\r\n",r+=t.direction?"a="+t.direction+"\r\n":t.rtpSender&&t.rtpReceiver?"a=sendrecv\r\n":t.rtpSender?"a=sendonly\r\n":t.rtpReceiver?"a=recvonly\r\n":"a=inactive\r\n",t.rtpSender){var o="msid:"+s.id+" "+t.rtpSender.track.id+"\r\n";r+="a="+o,r+="a=ssrc:"+t.sendEncodingParameters[0].ssrc+" "+o,t.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+t.sendEncodingParameters[0].rtx.ssrc+" "+o,r+="a=ssrc-group:FID "+t.sendEncodingParameters[0].ssrc+" "+t.sendEncodingParameters[0].rtx.ssrc+"\r\n")}return r+="a=ssrc:"+t.sendEncodingParameters[0].ssrc+" cname:"+n.localCName+"\r\n",t.rtpSender&&t.sendEncodingParameters[0].rtx&&(r+="a=ssrc:"+t.sendEncodingParameters[0].rtx.ssrc+" cname:"+n.localCName+"\r\n"),r},n.getDirection=function(t,i){for(var e=n.splitLines(t),s=0;s<e.length;s++)switch(e[s]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return e[s].substr(2)}return i?n.getDirection(i):"sendrecv"},n.getKind=function(t){return n.splitLines(t)[0].split(" ")[0].substr(2)},n.isRejected=function(t){return"0"===t.split(" ",2)[1]},n.parseMLine=function(t){var i=n.splitLines(t)[0].substr(2).split(" ");return{kind:i[0],port:parseInt(i[1],10),protocol:i[2],fmt:i.slice(3).join(" ")}},n.parseOLine=function(t){var i=n.matchPrefix(t,"o=")[0].substr(2).split(" ");return{username:i[0],sessionId:i[1],sessionVersion:parseInt(i[2],10),netType:i[3],addressType:i[4],address:i[5]}},n.isValidSDP=function(t){if("string"!=typeof t||0===t.length)return!1;for(var i=n.splitLines(t),e=0;e<i.length;e++)if(i[e].length<2||"="!==i[e].charAt(1))return!1;return!0},"object"==typeof i&&(i.exports=n)},{}]},{},[1])(1)},6361:function(t){"use strict";t.exports=n},6994:function(i){"use strict";i.exports=t},3788:function(t){"use strict";t.exports=i},5733:function(t){"use strict";t.exports=e},477:function(){}},r={};function o(t){var i=r[t];if(void 0!==i)return i.exports;var e=r[t]={exports:{}};return s[t].call(e.exports,e,e.exports,o),e.exports}o.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(i,{a:i}),i},o.d=function(t,i){for(var e in i)o.o(i,e)&&!o.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var u={};return function(){"use strict";o.r(u),o.d(u,{ZegoExpressEngine:function(){return Sw}});var t,i;!function(t){t[t.SWITCH_ONE=1]="SWITCH_ONE",t[t.SWITCH_TWO=2]="SWITCH_TWO"}(t||(t={})),function(t){t[t.ZegoGeoFenceTypeNone=0]="ZegoGeoFenceTypeNone",t[t.ZegoGeoFenceTypeInclude=1]="ZegoGeoFenceTypeInclude",t[t.ZegoGeoFenceTypeExclude=2]="ZegoGeoFenceTypeExclude"}(i||(i={}));var e,n,s=1000000152;!function(t){t[t.TT_NONE=0]="TT_NONE",t[t.TT_PC=1]="TT_PC",t[t.TT_IOS=2]="TT_IOS",t[t.TT_ANDROID=3]="TT_ANDROID",t[t.TT_MAC=4]="TT_MAC",t[t.TT_LINUX=5]="TT_LINUX",t[t.TT_WEB=6]="TT_WEB",t[t.TT_MINIPROGRAM=7]="TT_MINIPROGRAM",t[t.TT_UNKNOWN=32]="TT_UNKNOWN"}(e||(e={})),function(t){t[t.disconnected=0]="disconnected",t[t.connecting=1]="connecting",t[t.connected=2]="connected"}(n||(n={}));var r,a,c,h;!function(t){t[t.logout=0]="logout",t[t.trylogin=1]="trylogin",t[t.login=2]="login"}(r||(r={})),function(t){t[t.I=0]="I",t[t.H=10]="H",t[t.M=100]="M",t[t.L=1e3]="L"}(a||(a={})),function(t){t[t.offline=0]="offline",t[t.online=1]="online"}(c||(c={})),function(t){t[t.NT_NONE=0]="NT_NONE",t[t.NT_LINE=1]="NT_LINE",t[t.NT_WIFI=2]="NT_WIFI",t[t.NT_2G=3]="NT_2G",t[t.NT_3G=4]="NT_3G",t[t.NT_4G=5]="NT_4G",t[t.NT_UNKNOWN=32]="NT_UNKNOWN"}(h||(h={}));var f,l=3e3,d="未引入消息模块",v="3.10.0";!function(t){t[t.debug=0]="debug",t[t.info=1]="info",t[t.warn=2]="warn",t[t.error=3]="error",t[t.report=99]="report",t[t.disable=100]="disable"}(f||(f={}));var m,p,g;!function(t){t[t.disable=0]="disable",t[t.websocket=1]="websocket",t[t.https=2]="https"}(m||(m={})),function(t){t[t.SDKProject_ZegoWebRTC=6]="SDKProject_ZegoWebRTC",t[t.SDKProject_ZegoMiniProgram=7]="SDKProject_ZegoMiniProgram"}(p||(p={})),function(t){t[t.UDP=0]="UDP",t[t.RTMP=1]="RTMP",t[t.FLV=2]="FLV",t[t.HLS=3]="HLS",t[t.WEBRTC=4]="WEBRTC"}(g||(g={}));var b,_=0,y=1,w=2,S=1e3,E=3600,O=52e6,T={waiting_url:1,tryPublish:2,update_info:3,publishing:4,stop:5,retryPublish:6},k=2001,R=2002,I=2003,N=function(){var t=1;return function(){return t++}}(),C=function(){var t=1;return function(){return t++}}();!function(t){t[t.ClientType_None=0]="ClientType_None",t[t.ClientType_H5=1]="ClientType_H5",t[t.ClientType_SmallPragram=2]="ClientType_SmallPragram",t[t.ClientType_Webrtc=3]="ClientType_Webrtc"}(b||(b={}));var z,D,P,A,M,x,j,L,q,U,B,J,V,H=12001,G=12002,F=12003,Y=0,Z=1,Q=2,X=0,W=1,K=2;!function(t){t[t.Default=0]="Default",t[t.Extranet=1]="Extranet",t[t.Intranet=2]="Intranet"}(z||(z={})),function(t){t[t.logout=0]="logout",t[t.trylogin=1]="trylogin",t[t.login=2]="login"}(D||(D={})),function(t){t[t.logout=0]="logout",t[t.trylogin=1]="trylogin",t[t.login=2]="login",t[t.reconnect=3]="reconnect"}(P||(P={})),function(t){t[t.stop=0]="stop",t[t.start=1]="start"}(A||(A={})),function(t){t[t.CDN=0]="CDN",t[t.RTC=1]="RTC",t[t.L3=2]="L3",t[t.DG=3]="DG"}(M||(M={})),function(t){t[t.useAnalyzer=0]="useAnalyzer",t[t.useWorklet=1]="useWorklet"}(x||(x={})),function(t){t[t.Default=3]="Default",t[t.StandardVideoCall=4]="StandardVideoCall",t[t.HighVideoCall=5]="HighVideoCall",t[t.StandardChatroom=6]="StandardChatroom",t[t.HighQualityChatroom=7]="HighQualityChatroom",t[t.Broadcast=8]="Broadcast",t[t.Karaoke=9]="Karaoke",t[t.UNKNOWN=100]="UNKNOWN"}(j||(j={})),function(t){t.WIN32="WIN32",t.MAC="Mac",t.ANDROID="Android",t.LINUX="Linux",t.IOS="iOS",t.Harmony="Harmony",t.UNKNOWN="WTF"}(L||(L={})),function(t){t.CDN="cdn",t.L3="l3",t.RTC="rtc"}(q||(q={})),function(t){t[t.RTC=0]="RTC",t[t.CDN=1]="CDN",t[t.L3=2]="L3",t[t.DG=3]="DG",t[t.CUSTOM=5]="CUSTOM"}(U||(U={})),function(t){t[t.offline=0]="offline",t[t.online=1]="online"}(B||(B={})),function(t){t[t.MinQuality=0]="MinQuality",t[t.DieQuality=0]="DieQuality",t[t.PoorMinQuality=1]="PoorMinQuality",t[t.MiddleMinQuality=30]="MiddleMinQuality",t[t.GoodMinQuality=60]="GoodMinQuality",t[t.ExcellentMinQuality=85]="ExcellentMinQuality",t[t.MaxQuality=100]="MaxQuality"}(J||(J={})),function(t){t[t.Unknown=-1]="Unknown",t[t.Excellent=0]="Excellent",t[t.Good=1]="Good",t[t.Middle=2]="Middle",t[t.Poor=3]="Poor",t[t.Die=4]="Die"}(V||(V={}));var $,tt,it,et,nt=function(){function t(t,i){void 0===t&&(t=null),void 0===i&&(i=null),this.next=null,this.prev=null,this._id=t,this._data=i}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id?this._id:null},set:function(t){this._id=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t},enumerable:!1,configurable:!0}),t.prototype.hasNext=function(){return this.next&&this.next.id},t.prototype.hasPrev=function(){return this.prev&&this.prev.id},t}(),st=function(){function t(){this.start=new nt,this.end=new nt,this._idCounter=0,this._numNodes=0,this.start.next=this.end,this.start.prev=null,this.end.prev=this.start,this.end.next=null}return t.prototype.insertBefore=function(t,i){var e=new nt(this._idCounter,i);return e.next=t,e.prev=t.prev,t.prev&&(t.prev.next=e),t.prev=e,++this._idCounter,++this._numNodes,e},t.prototype.addLast=function(t){return this.insertBefore(this.end,t)},t.prototype.add=function(t){return this.addLast(t)},t.prototype.getFirst=function(){return 0===this._numNodes?null:this.start.next},t.prototype.getLast=function(){return 0===this._numNodes?null:this.end.prev},t.prototype.size=function(){return this._numNodes},t.prototype.getFromFirst=function(t){var i=0,e=this.start.next;if(t>=0)for(;i<t&&null!==e;)e=e.next,++i;else e=null;if(null===e)throw"Index out of bounds.";return e},t.prototype.get=function(t){return 0===t?this.getFirst():t===this._numNodes-1?this.getLast():this.getFromFirst(t)},t.prototype.remove=function(t){return t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),--this._numNodes,t},t.prototype.removeFirst=function(){var t=null;return this._numNodes>0&&this.start.next&&(t=this.remove(this.start.next)),t},t.prototype.removeLast=function(){var t=null;return this._numNodes>0&&this.end.prev&&(t=this.remove(this.end.prev)),t},t.prototype.removeAll=function(){this.start.next=this.end,this.end.prev=this.start,this._numNodes=0,this._idCounter=0},t.prototype.each=function(t){for(var i=this.start;i.hasNext();)t(i=i.next)},t.prototype.find=function(t){for(var i=this.start,e=!1,n=null;i.hasNext()&&!e;)t(i=i.next)&&(n=i,e=!0);return n},t.prototype.map=function(t){for(var i=this.start,e=[];i.hasNext();)t(i=i.next)&&e.push(i);return e},t.prototype.push=function(t){return this.addLast(t)},t.prototype.unshift=function(t){this.insertBefore(this._numNodes>0?this.start.next:this.end,t)},t.prototype.pop=function(){return this.removeLast()},t.prototype.shift=function(){return this.removeFirst()},t}();!function(t){t.ONLY_BASELINE="only_baseline",t.HARD_SOFT_ENCODEC_FIRST="hard_or_soft_encodec_first",t.HIGH_PROFILE_FIRST="high_profile_first"}($||($={})),function(t){t[t.None=0]="None",t[t.Vocalist=1]="Vocalist",t[t.BackingSinging=2]="BackingSinging"}(tt||(tt={})),function(t){t[t.CN=2]="CN",t[t.NA=3]="NA",t[t.EU=4]="EU",t[t.AS=5]="AS",t[t.IN=6]="IN",t[t.NCN=7]="NCN"}(it||(it={})),function(t){t[t.ZegoDefined=0]="ZegoDefined",t[t.UserUnregister=1]="UserUnregister"}(et||(et={}));var rt,ot,ut;!function(t){t[t.disconnected=0]="disconnected",t[t.connecting=1]="connecting",t[t.connected=2]="connected"}(rt||(rt={})),function(t){t[t.tryProbe=0]="tryProbe",t[t.probed=2]="probed"}(ot||(ot={})),function(t){t[t.replaceNew=0]="replaceNew",t[t.changeResolution=1]="changeResolution"}(ut||(ut={}));var at,ct={0:{code:1,description:"user_stop_publishing_stream_normal"},1:{code:2,description:"user_heart_beat_timeout"},2:{code:3,description:"user_repeat_login"},3:{code:4,description:"user_kicked_out"},4:{code:5,description:"user_offline"},100:{code:6,description:"remove_by_server"}};!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.CDN=1]="CDN",t[t.RTC=2]="RTC",t[t.L3=3]="L3"}(at||(at={}));var ht,ft;!function(t){t[t.publish_quality=0]="publish_quality",t[t.play_quality=1]="play_quality",t[t.charge=2]="charge"}(ht||(ht={})),function(t){t[t.low=1]="low",t[t.stantard=2]="stantard",t[t.hight=3]="hight",t[t.custome=4]="custome"}(ft||(ft={}));var lt,dt,vt={stop:0,start:1,waiterAnswer:2,waitingCandidate:3,sendCandidate:4,iceConnected:5,iceDisconnected:6,iceClosed:7,iceFailed:8};!function(t){t[t.Delete=0]="Delete",t[t.Add=1]="Add"}(lt||(lt={})),function(t){t[t.captureFpsToLow=1001]="captureFpsToLow",t[t.captureVolumeToLow=1002]="captureVolumeToLow",t[t.sendVideoBitrateToLow=1003]="sendVideoBitrateToLow",t[t.sendFpsToLow=1004]="sendFpsToLow",t[t.sendAudioBitrateToLow=1005]="sendAudioBitrateToLow",t[t.receiveVolumeToLow=1006]="receiveVolumeToLow",t[t.receiveAudioDecodedFail=1007]="receiveAudioDecodedFail",t[t.receiveVideoDecodedFail=1008]="receiveVideoDecodedFail",t[t.receiveVideoFpsDecodedToLow=1009]="receiveVideoFpsDecodedToLow",t[t.renderVideoFpsToLow=1010]="renderVideoFpsToLow",t[t.captureFpsNormal=2001]="captureFpsNormal",t[t.captureVolumeNormal=2002]="captureVolumeNormal",t[t.sendVideoBitrateNormal=2003]="sendVideoBitrateNormal",t[t.sendFpsNormal=2004]="sendFpsNormal",t[t.sendAudioBitrateNormal=2005]="sendAudioBitrateNormal",t[t.receiveVolumeNormal=2006]="receiveVolumeNormal",t[t.receiveAudioDecodedNormal=2007]="receiveAudioDecodedNormal",t[t.receiveVideoDecodedNormal=2008]="receiveVideoDecodedNormal",t[t.receiveVideoFpsDecodedNormal=2009]="receiveVideoFpsDecodedNormal",t[t.renderVideoFpsNormal=2010]="renderVideoFpsNormal"}(dt||(dt={}));var mt,pt,gt,bt;!function(t){t[t.PortraitSegmentation=0]="PortraitSegmentation"}(mt||(mt={})),function(t){t[t.BASE_LINE=1]="BASE_LINE",t[t.MAIN=2]="MAIN",t[t.HIGH=3]="HIGH"}(pt||(pt={})),function(t){t[t.METHOD_UNSET=0]="METHOD_UNSET",t[t.METHOD_GET=1]="METHOD_GET",t[t.METHOD_POST=2]="METHOD_POST",t[t.METHOD_PUT=3]="METHOD_PUT",t[t.METHOD_PATCH=4]="METHOD_PATCH",t[t.METHOD_DELETE=5]="METHOD_DELETE",t[t.METHOD_HEAD=6]="METHOD_HEAD",t[t.METHOD_OPTIONS=7]="METHOD_OPTIONS"}(gt||(gt={})),function(t){t[t.SERVICE_UNSET=0]="SERVICE_UNSET",t[t.SERVICE_MEDIAGW=1]="SERVICE_MEDIAGW",t[t.SERVICE_LIVEROOM=2]="SERVICE_LIVEROOM",t[t.SERVICE_MIX=3]="SERVICE_MIX",t[t.SERVICE_ZEUS=4]="SERVICE_ZEUS",t[t.SERVICE_ZPUSH=5]="SERVICE_ZPUSH",t[t.SERVICE_L3=6]="SERVICE_L3",t[t.SERVICE_TALKLINE=7]="SERVICE_TALKLINE",t[t.SERVICE_EDUSUITE=8]="SERVICE_EDUSUITE",t[t.SERVICE_ZIM=9]="SERVICE_ZIM",t[t.SERVICE_ClOUD_SETTING=10]="SERVICE_ClOUD_SETTING",t[t.SERVICE_ZEUSHB=11]="SERVICE_ZEUSHB",t[t.SERVICE_USER_LOGIC=12]="SERVICE_USER_LOGIC",t[t.SERVICE_UNIFYDISPATCH=13]="SERVICE_UNIFYDISPATCH",t[t.SERVICE_QUALITY=14]="SERVICE_QUALITY",t[t.SERVICE_SECURITY=15]="SERVICE_SECURITY",t[t.SERVICE_KTVCPR=16]="SERVICE_KTVCPR",t[t.SERVICE_SWITCH4LIVEROOM=17]="SERVICE_SWITCH4LIVEROOM",t[t.SERVICE_WEBRTC_SIGNAL=18]="SERVICE_WEBRTC_SIGNAL",t[t.SERVICE_L3_WEBRTC_SIGNAL=19]="SERVICE_L3_WEBRTC_SIGNAL",t[t.SERVICE_VIDEOCPR=20]="SERVICE_VIDEOCPR",t[t.SERVICE_CDN=21]="SERVICE_CDN",t[t.SERVICE_CLOUDRECORD=22]="SERVICE_CLOUDRECORD",t[t.SERVICE_INNER_ECHO=23]="SERVICE_INNER_ECHO",t[t.SERVICE_OUTER_ECHO=24]="SERVICE_OUTER_ECHO",t[t.SERVICE_LOCALHOST_ECHO=25]="SERVICE_LOCALHOST_ECHO",t[t.SERVICE_ECHO=26]="SERVICE_ECHO",t[t.SERVICE_DOCSERVICE=27]="SERVICE_DOCSERVICE",t[t.SERVICE_AUTHSVR=28]="SERVICE_AUTHSVR"}(bt||(bt={}));var _t,yt={width:320,height:240,frameRate:15,bitRate:300},wt={width:640,height:480,frameRate:15,bitRate:800},St={width:1280,height:720,frameRate:20,bitRate:1500},Et={frameRate:20,bitRate:800},Ot={frameRate:15,bitRate:1500},Tt={frameRate:5,bitRate:2e3};!function(t){t[t.IPv4Only=0]="IPv4Only",t[t.IPv4Prefer=1]="IPv4Prefer",t[t.IPv6Prefer=2]="IPv6Prefer"}(_t||(_t={}));var kt,Rt,It,Nt,Ct,zt,Dt,Pt,At={0:"IPv4Only",1:"IPv4Prefer",2:"IPv6Prefer"};!function(t){t[t.IPv4=0]="IPv4",t[t.IPv6=1]="IPv6"}(kt||(kt={})),function(t){t[t.kV4Only=0]="kV4Only",t[t.kV4AndV6=1]="kV4AndV6",t[t.kV6AndV4=2]="kV6AndV4"}(Rt||(Rt={})),function(t){t[t.ZV4Only=0]="ZV4Only",t[t.ZV4Priority=1]="ZV4Priority",t[t.ZV6Priority=2]="ZV6Priority",t[t.ZV6AndV4Priority=3]="ZV6AndV4Priority"}(It||(It={})),function(t){t[t.unreachable=0]="unreachable",t[t.unknown=1]="unknown",t[t.reachable=2]="reachable"}(Nt||(Nt={})),function(t){t[t.probed=0]="probed",t[t.noProbe=1]="noProbe",t[t.probing=2]="probing"}(Ct||(Ct={})),function(t){t[t.LOGOUT=0]="LOGOUT",t[t.TRY_LOGIN=1]="TRY_LOGIN",t[t.LOGIN=2]="LOGIN"}(zt||(zt={})),function(t){t[t.RSP=0]="RSP",t[t.PUSH=1]="PUSH"}(Dt||(Dt={})),function(t){t.Logining="LOGINING",t.Logined="LOGINED",t.LoginFailed="LOGIN_FAILED",t.Reconnecting="RECONNECTING",t.Reconnected="RECONNECTED",t.ReconnectFailed="RECONNECT_FAILED",t.Kickout="KICKOUT",t.Logout="LOGOUT",t.LogoutFailed="LOGOUT_FAILED"}(Pt||(Pt={}));var Mt={SERVER:{code:0,msg:"liverooom cmd error"},SUCCESS:{code:0,msg:"success."},INIT:{code:2000000001,msg:"init sdk wrong"},NOT_LOGIN:{code:1000002,msg:"not login"},APPID_INVALID:{code:1001004,msg:"appid invalid"},SDK_NOT_SPECIAL:{code:1001005,msg:"sdk require special"},NETWORK_BROKEN:{code:1000017,msg:"network is broken"},GEO_SET_ERROR:{code:1000018,msg:"geo set error"},INPUT_PARAM:{code:1100001,msg:"input parm error."},TIMEOUT:{code:1100002,msg:"network timeout."},SOCKET_CLOSE:{code:1100003,msg:"socket close"},NET_SOCKET_TIMEOUT:{code:1100004,msg:"net agent timeout"},NET_HB_TIMEOUT:{code:1100005,msg:"net hb timeout"},INIT_SDK_WRONG:{code:1101e3,msg:"init sdk wrong"},ROOM_COUNT_EXCEED:{code:1002001,msg:"login rooms exceeds the upper limit"},MULTI_ROOM_COUNT_EXCEED:{code:1002037,msg:"login rooms exceeds the upper limit"},ROOM_ROOMID_INCORRECT:{code:1002002,msg:"have not logged in with this room ID"},USER_ID_NULL:{code:1002005,msg:"user ID is empty"},USER_ID_INVALID_CHARACTER:{code:1002006,msg:"user ID contains illegal characters"},USER_ID_TOO_LONG:{code:1002007,msg:"user ID is too long"},USER_NAME_NULL:{code:1002008,msg:"username is empty"},USER_NAME_TOO_LONG:{code:1002010,msg:"username is too long"},ROOM_ID_NULL:{code:1002011,msg:"room ID is empty"},ROOM_ID_INVALID_CHARACTER:{code:1002012,msg:"room ID contains illegal characters"},ROOM_ID_TOO_LONG:{code:1002013,msg:"room ID is too long"},ROOM_NOT_EXIST:{code:1002014,msg:"room not exist"},ROOM_EXTRA_INFO_KEY_LIMIT:{code:1002017,msg:"room extra info key exceed the limit"},DIFFERENT_USER_ID:{code:1002018,msg:"In multi-room mode, only the same user id can be used."},NO_PUBLISH_AUTH:{code:1002082,msg:"Token does not have the permission to publish current stream."},LOGIN_TIMEOUT:{code:1002031,msg:"login timeout"},ROOM_MAX_USER_COUNT:{code:1002034,msg:"users logging into the room exceeds the maximum number"},MULTI_ROOM_UNABLE:{code:1002036,msg:"multi room unable"},MULTIPLE_LOGIN_KICKOUT:{code:1002050,msg:"kickout may be the same user ID login other"},NETWORK_RECOVERY:{code:1002051,msg:"network recovery"},ROOM_RETRY_TIMEOUT:{code:1002053,msg:"network is broken and login fail."},MANUAL_KICKOUT:{code:1002055,msg:"server has sent a signal to kick out"},REPEATEDLY_LOGIN:{code:1002056,msg:"user repeatedly login"},REPEATEDLY_ENTER_ROOM:{code:1002057,msg:"user repeatedly enter room"},ALREADY_LOGIN:{code:1002058,msg:"user already logged in"},LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID:{code:1002064,msg:"the roomID is used by the login room interface"},FORBID_BLACK_USER:{code:1002066,msg:"forbid black user"},WHITE_BOARD_VERSION_ERROR:{code:1002098,msg:"Mismatch with RTC SDK version, please upgrade ZegoSuperBoard or ZegoWhiteboardView SDK to the latest version"},ROOM_INNER_ERROR:{code:1002099,msg:"room inner error"},HEARTBEAT_TIMEOUT:{code:1102001,msg:"heartbeat timeout."},PARSE_JSON_ERROR:{code:1102011,msg:"parse json error."},LOGIN_PROCESSING:{code:1102012,msg:"login is processing."},LIVEROMM_REQUEST_ERROR:{code:1102013,msg:"liveroom request error."},ZPUSH_REQUEST_FAIL:{code:1102014,msg:"zpush request fail."},LOGIN_STATE_WRONG:{code:1102015,msg:"user login state is wrong."},TOKEN_ERROR:{code:1102016,msg:"token error"},DIAPATCH_ERROR:{code:1102017,msg:"dispatch error"},TOKEN_EXPIRED:{code:1102018,msg:"token expired"},SUBCMD_ERROR:{code:1102019,msg:"subcmd error."},ZEGO_AUTH_ERROR:{code:1102020,msg:"zego auth error."},BIZ_CHANNEL_ERROR:{code:1102021,msg:"biz channel error."},UPLOAD_LOG_ERROR:{code:1102025,msg:"upload zip logs failed"}},xt=o(6994),jt=xt.default||xt;function Lt(t){return"number"==typeof t}function qt(t){return"string"==typeof t}function Ut(t){return"boolean"==typeof t}function Bt(t){return void 0===t}function Jt(t){return null!==t&&t instanceof Object}function Vt(t){return null===t}function Ht(t){return"function"==typeof t}function Gt(t){return t instanceof Array}function Ft(t){return t instanceof Uint8Array}function Yt(t){return t instanceof MediaStream}function Zt(t){return t instanceof HTMLElement}function Qt(t){return t instanceof HTMLMediaElement}var Xt=Promise,Wt=document;function Kt(t,i,e){void 0===e&&(e=!0);var n=Wt.createElement("video");return t&&(n.style.width=t+"px;"),i&&(n.style.height=i+"px;"),n.setAttribute("muted",""),n.muted=!0,e&&(n.setAttribute("autoplay",""),n.autoplay=!0),n.setAttribute("playsinline",""),n.setAttribute("webkit-playsinline",""),n}function $t(t,i){var e=Wt.createElement("canvas");return e.width=t,e.height=i,e}function ti(t,i,e){void 0===e&&(e=""),t.info("".concat(i," call ").concat(e))}function ii(t,i,e){void 0===e&&(e=""),t.info("".concat(i," end ").concat(e))}function ei(t,i,e){void 0===e&&(e=""),t.info("".concat(i," success ").concat(e))}function ni(t,i){var e=function(t){var i=t.reduce((function(i,e,n){var s="".concat(e," module");return 0==n?s:n==t.length-1?"".concat(i," and ").concat(s):"".concat(i,", ").concat(s)}),"");return"should install ".concat(i)}(t);return console.error(e),{errorCode:i||zi.code,extendedData:e}}function si(t,i){return new Xt((function(e,n){n(ni(t,i))}))}function ri(t,i){for(var e in void 0===i&&(i=""),t){if(jt.isLong(t[e])||Ht(t[e]||Ft(t[e])))return;Array.isArray(t[e])?t[e].forEach((function(t,i){ri(t,i+"")})):Jt(t[e])?ri(t[e],e):t.hasOwnProperty(e)||(Lt(t[e])&&(t[e]=0),qt(t[e])&&(t[e]=""))}}function oi(t){return/^([0-9a-zA-Z#!$%&()`'+-;<=.>@^_~,\\*])+$/.test(t)&&/^[^:/]*$/g.test(t)}function ui(t){return/^([0-9a-zA-Z-_])+$/.test(t)}function ai(t,i){return 0==i?Lt(t)&&t%1==0&&t>=0:Lt(t)&&t%1==0&&t>0}var ci="room not exist",hi="device is not found",fi="stream is not from zego",li="input param error",di="no preview",vi="network is broken";function mi(t,i,e,n,s,r,o){return void 0===o&&(o=!1),t.createSpan(i,{key:s,bak_key:r,par:e},{key:n,par:e},n,o)}function pi(t,i,e){i&&t.setAttributes(i),t.end(e)}var gi=function(){return new Promise((function(t,i){t(Math.random())}))};function bi(t,i){return null!=i||(i="_zegom{codecid}"),0===t?"_zego264":i.replace("{codecid}",t+"")}function _i(t,i){var e;return void 0===i&&(i=100),function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];var r=this;clearTimeout(e),e=window.setTimeout((function(){t.apply(r,n)}),i)}}var yi="the user cancels the stream request.",wi={code:1000002,message:"not login room"},Si={code:1000014,message:"stream ID is too long"},Ei={code:1000015,message:"streamID is empty"},Oi={code:1000016,message:"stream ID contains illegal characters"},Ti={code:1000017,message:vi},ki={code:1000018,message:"local stream wrong"},Ri={code:1001021,message:"set geoFence fail"},Ii={code:1100001,message:li},Ni={code:1100002,message:"network timeout."},Ci={code:1101002,message:"get app config fail"},zi={code:1101003,message:"Module not imported"},Di=1002099,Pi=1102016,Ai={code:1102017,message:"dispatch error"},Mi={code:1102018,message:"token expired"},xi={code:1102022,message:"dispatch request timeout"},ji={code:1102023,message:"connect signal fail"},Li={code:1102026,msg:ci},qi={code:1003028,message:"There are duplicate stream ids in the room"},Ui={code:1003050,message:"the extra info of the stream is null"},Bi={code:1003080,message:"browser does not support the codec"},Ji={code:1003099,message:"publish inner error"},Vi=1003081,Hi={code:1103001,message:li},Gi={code:1103002,message:"browser do not support"},Fi={code:1103011,message:"enumerate devices fail"},Yi={code:1103012,message:"use camera device fail"},Zi={code:1103021,message:"session request fail"},Qi={code:1103022,message:"create offer error"},Xi={code:1103044,message:fi},Wi={code:1103055,message:"publish stream no found"},Ki={code:1103058,message:"client ip changed"},$i={code:1103061,message:"get media fail"},te={code:1103068,message:"update sdp fail"},ie={code:1103103,message:"remote sdp no candidate "},ee={code:1103089,message:yi},ne=1103093,se={code:1004099,message:"internal exeception"},re={code:1104001,message:"input parm error"},oe={code:1104020,message:"dispatch request fail"},ue={code:1104021,message:"session request fail"},ae={code:1104022,message:"create offer error"},ce={code:1104033,message:"client ip changed"},he={code:1104038,message:"resource mode is not supported"},fe={code:1104027,message:"server session closed"},le={code:1004002,message:"play stream not found"},de={code:1004020,message:"play stream interrupted"},ve={code:1004025,message:"stream is forbided by media server"},me={code:1104042,message:yi},pe={code:1104043,message:"mini sdp error"},ge={code:1104044,message:"stream is not playing"},be={code:1104047,message:"remote sdp no candidate "},_e=1006006,ye=1106007,we="the microphone may be loose, and audio data collection is abnormal.",Se=1106008,Ee="the camera may be loose, and video data collection is abnormal.",Oe=1106009,Te=1106010,ke={code:1000067,message:"Logged in room, setting scenario is not supported"},Re={code:1103083,message:"sdp wrong format"},Ie={code:1103084,message:"mini sdp buffer size exceeded"},Ne={code:1103085,message:"url size exceeded"},Ce=1103086,ze="this publish stream id is not created by CreateZegoStream",De=1103087,Pe="the zego stream does not capture audio",Ae=1103088,Me="the zego stream does not capture video",xe={code:1103074,message:"video track is not readable"},je=1103047,Le="track is not found",qe={code:1103048,message:hi},Ue=1103029,Be={code:1103045,message:"video is false"},Je={code:1103046,message:"audio is false"},Ve=1103101,He="only stream which have one track and kind no exist can add track",Ge=1103069,Fe="publisher state wrong",Ye=1103070,Ze="not support handle track",Qe=1103071,Xe=1103071,We=1103079,Ke="replace track fail",$e={code:1103076,message:"audio track is not readable"},tn={code:1017130,message:"get mini sdp error"},en={code:1017131,message:"parse mini sdp error"},nn={code:1017132,message:"worker is invalid"},sn={code:1017133,message:"mini trans timeout"},rn=function(t){return t},on=function(t){return t},un=function(t){return t},an=function(t){return t},cn=function(t){return t},hn="/sdk/init",fn=hn,ln="/sdk/login",dn="listener",vn={event:"/sdk/on_listener",listener:on,error:{te:Ii}},mn={event:"/sdk/off_listener",listener:on,error:{te:Ii}},pn=hn,gn={event:"/sdk/create_stream",error:{ie:Gi,te:Hi,ee:{code:1103042,message:"screen canceled"},ne:{code:1103010,message:"screen fail"},se:{code:1103043,message:"screen not support"},re:{code:1103053,message:"https is required"},oe:$i,ue:{code:1103064,message:"get device not allowed"},ae:{code:1103065,message:"device is not readable"},ce:{code:1103066,message:"device does not meet constraints"}},stream_type:on,screen:rn,camera:rn,custom:rn,preview_conf:rn,media_stream_id:on},bn={event:"/sdk/start_publish",error:{he:Hi,fe:Ni,le:xi,de:Ai,ve:Ti,me:Xi,pe:{code:1103099,message:"stream is not capturing"},ge:{code:1103073,message:"video effect is starting, please operate after video effect is started"},be:wi,_e:{code:1103051,message:"publisher retry timeout"},ye:{code:1003025,message:"stream is forbided by media server"},we:Mi,Se:{code:1103027,message:"server session closed"},Ee:{code:1103030,message:"negotiation timeout"},Oe:Qi,Te:{code:1103023,message:"setLocalDescription error"},ke:{code:1103060,message:"session request timeout"},Re:Zi,Ie:{code:1103025,message:"other side offer error"},Ne:{code:1103028,message:"ice connection error"},Ce:{code:1103050,message:"websocket disconnected"},ze:{code:1103024,message:"mediaDesc error"},De:{code:1103026,message:"candidate error"},Pe:{code:1103056,message:"publish is publishing"},Ae:Ki,Me:{code:1103059,message:"ttl over time"},xe:{code:1103067,message:"update sdp time out"},je:te,Le:{code:1103078,message:"publish stream poor and net probe poor"},qe:{code:1103100,message:"background process is start, but not subscribe yet"},Ue:ee,Be:pe,Je:{code:1103019,message:"publish streams auth fail"},Ve:Bi},urls:un,server_url:on,publish_option:rn,message:on,stream_id:on,stream_sid:an,room_id:on,video_en_codec_id:an,cap_w:an,cap_h:an,w:an,h:an,video_en_fps:an,video_en_bps:an,audio_c_channel_count:an,audio_en_bps:an,aec_level:an,ans_level:an,agc:cn,traffic_control_min_video_bitrate:{bitrate:an,mode:an},cap_volume:an,enable_camera:cn,enable_mic:cn,video_activate:cn,audio_activate:cn,gw_version:an,use_na:an,is_dual_stream:an,is_mini:cn,is_peer:cn},_n={event:"/publish/start",is_peer:cn,reason:on,url:on,ip:on,peer_id:an,source_type:on,net_protocol:on,wait_consume:an,dispatch_consume:an,signal_consume:an,is_dual_stream:an,is_mini:cn,mini_error:an},yn={event:"/publish/restart",stream_id:on,server_url:on,reason_code:an,is_dual_stream:an,is_mini:cn,mini_error:an},wn={event:"/sdk/publish",room_id:on,room_sid_string:on,retry_btime:an,max_retry_interval:an,fail_cnt:an,continuous_fail_cnt:an,probe_ip_cnt:an,valid_probe_ip_cnt:an,poor_quality_retry_cnt:an,use_resource_type:un,probe_not_trigger_retry_info:rn,stop_reason:on,child_error:an,try_time:an,try_cnt:an,server_url:on,publish_begin_time:an,publish_state_time:an,bitrate:an,h:an,w:an,cap_w:an,cap_h:an,fps:an,use_na:an,env:an,webrtc_sid:an,stream_id:on,itemtype:on,total_d:an,valid_d:an,tempbroken_cnt:an},Sn="/sdk/api/publish_video_c_size",En=an,On=an,Tn=an,kn="/sdk/play_video_size_changed",Rn=an,In=an,Nn=an,Cn={event:"/rtc/publish",tryidx:an,url:on,ip:on,net_protocol:on,lsttime:an,denied_info:on,dispatch_external_ip:on,total_stat:rn,room_id:on,room_sid_string:on,resource_type:on,protocol:on,stop_reason:on,try_time:an},zn={event:"/sdk/stop_publish",error:{te:Hi},stream_id:on,stream_sid:an,room_id:on},Dn="/rtc/publish_stream_state_error",Pn={event:"/sdk/start_play",error:{He:Ei,Ge:re,Fe:Si,Ye:Oi,Ze:wi,Qe:{code:1103049,message:"repeated pull same stream"},Xe:Ni,We:xi,Ke:Ai,en:Ti,nn:he,rn:{code:1104039,message:"play stream not found"},un:{code:1104031,message:"player retry timeout"},an:de,cn:{code:1104035,message:"reset session push"},hn:{code:1104030,message:"negotiation timeout"},Oe:ae,Te:{code:1104023,message:"setLocalDescription error"},Re:ue,ke:{code:1104036,message:"session request timeout"},Ie:{code:1104025,message:"other side offer error"},Ne:{code:1104028,message:"ice connection error"},Ce:{code:1104029,message:"websocket disconnected"},De:{code:1104026,message:"candidate error"},ze:{code:1104024,message:"mediaDesc error"},fn:{code:1104032,message:"player is playing"},Ae:ce,Me:{code:1104034,message:"ttl is over time"},ln:{code:1104037,message:"probe time out"},dn:{code:1104041,message:"stream quality poor and net probe poor"},vn:me,Be:pe,mn:{code:1104045,message:"play streams is out limit"},pn:{code:1104046,message:"play streams auth fail"},gn:se},room_id:on,urls:un,server_url:on,video_layer:an,play_option:rn,message:on,stream_id:on,stream_sid:an,resource_mode:an,src:on,video_codec_id:on,room_sid_string:on,is_multi:cn,audio_activate:cn,video_activate:cn,gw_version:an,use_na:an,biz_product:an,is_peer:cn,is_mini:cn},An={event:"/play/start",tryidx:an,is_peer:cn,reason:on,url:on,ip:on,peer_id:an,source_type:on,net_protocol:on,wait_consume:an,dispatch_consume:an,signal_consume:an,biz_product:an,is_mini:cn},Mn="/play/restart",xn={event:"/sdk/play",audio_cumulative_break_time:an,audio_cumulative_decode_time:an,video_cumulative_break_time:an,video_cumulative_decode_time:an,l3_a_break_time:an,l3_a_decode_time:an,l3_v_break_time:an,l3_v_decode_time:an,rtc_a_break_time:an,rtc_a_decode_time:an,rtc_v_break_time:an,rtc_v_decode_time:an,fft_audio:an,fft_video:an,room_id:on,room_sid_string:on,retry_btime:an,max_retry_interval:an,use_na:an,fail_cnt:an,continuous_fail_cnt:an,probe_ip_cnt:an,valid_probe_ip_cnt:an,poor_quality_retry_cnt:an,probe_not_trigger_retry_info:rn,use_resource_type:un,stop_reason:on,child_error:an,try_time:an,try_cnt:an,webrtc_sid:an,itemtype:on,server_url:on,play_begin_time:an,play_state_time:an,play_state_cnt:an,first_frame_time:an,protocol:on,dispatch_external_ip:on,total_stat:rn,w:an,h:an,abrc:an,vbrc:an,vinfo:rn,total_d:an,valid_d:an,tempbroken_cnt:an},jn={event:"/rtc/play",tryidx:an,url:on,ip:on,stream_id:on,room_id:on,room_sid_string:on,net_protocol:on,lsttime:an,denied_info:on,stop_reason:on,dispatch_external_ip:on,env:an,resource_type:on,protocol:on,total_stat:rn,vinfo:rn,try_time:an},Ln={event:"/sdk/stop_play",error:{te:Hi},room_id:on,stream_id:on,webrtc_sid:an,stream_sid:an,biz_product:an},qn="/rtc/play_stream_state_error",Un="/device/list",Bn={ie:Gi,bn:Fi},Jn=rn,Vn=on,Hn={event:"/device/audio_device_changed",error:{ie:Gi,bn:Fi},interrupt:an,device:on,device_name:on},Gn={event:"/device/video_device_changed",error:{ie:Gi,bn:Fi},interrupt:an,device:on,device_name:on},Fn="/sdk/check_system",Yn=rn,Zn="/sdk/remote_camera_update",Qn=on,Xn=on,Wn=an,Kn="/sdk/remote_mic_update",$n=on,ts=on,is=an,es={event:"/sdk/destroy_stream",error:{_n:ki},stop_reason:on},ns="/device/api/audio_output",ss=on,rs=on,os={event:"/liveroom/recv_stream_update_info",stream_update_type:on,stream_seq:an,stream_list:rn,error:{yn:Li}},us="/liveroom/send_stream_update_info",as=on,cs=on,hs=on,fs={event:"/liveroom/get_current_stream_list",room_id:on,room_sid_string:on,stream_seq:an,stream_size:an,stream_list:rn,use_ua:an,error:{te:Hi,NOT_LOGIN:wi}},ls={event:"/sdk/net_first_video_frame",webrtc_sid:an,fft_consumed:rn,resource_type:on,reliability:an,push_consumed:an,prepare_recv_consumed:an,connected_consumed:an,protocol:on,biz_product:an,dev_changed:cn},ds={event:"/sdk/net_first_audio_frame",webrtc_sid:an,fft_consumed:rn,resource_type:on,reliability:an,push_consumed:an,prepare_recv_consumed:an,connected_consumed:an,protocol:on,biz_product:an,dev_changed:cn},vs="/app/lifecycle",ms=on,ps={event:"/sdk/publish_volume_changed",old_cap_volume:an,cap_volume:an,change_duration:an,error:{te:Ii}},gs="/sdk/listener",bs="/sdk/net_probe",_s=an,ys=un,ws={event:"/sdk/net_probe_result",is_switch:cn,is_publish:cn,stream_id:on,result:an,node:on,net_quality:an,probe_net_quality:an},Ss="/cloud_setting/cache",Es=rn,Os="/cdn/play",Ts=on,ks=on,Rs="/l3/play",Is=an,Ns=an,Cs="/sdk/play_src_changed",zs=on,Ds=on,Ps="/publish/create_offer",As=on,Ms=cn,xs=an,js="/publish/set_local_sdp",Ls=on,qs=cn,Us={event:"/publish/create_session",sdp:on,is_mini:cn,gw_nodes:un,gw_nodes_ttl:an,gw_version:an,webrtc_sid:an},Bs="/publish/set_remote_sdp",Js=on,Vs=cn,Hs=an,Gs="/publish/ice_connected",Fs="/publish/rtc_publish_event",Ys=an,Zs="/rtc/play_event_message",Qs=an,Xs="/rtc/recv_close_session",Ws=rn,Ks="/rtc/recv_reset_session",$s="/rtc/ice_connection_state_changed",tr=on,ir="/publish/send_media_desc",er=an,nr="/publish/send_ice_candidate",sr=rn,rr="/play/create_offer",or=on,ur=cn,ar="/play/set_local_sdp",cr=on,hr=cn,fr={event:"/play/create_session",sdp:on,is_mini:cn,gw_nodes:un,gw_nodes_ttl:an,gw_version:an,webrtc_sid:an},lr="/play/set_remote_sdp",dr=on,vr=cn,mr=an,pr="/play/ice_connected",gr="/play/send_media_desc",br=an,_r="/play/send_ice_candidate",yr=rn,wr="/zegoconn/connect",Sr="/sdk/net_ip_stack",Er=on,Or={event:"/zegoconn/proxy_connect",service_no:an,proxy_link_sources:an,recv_time:an,connect_stream:an},Tr={event:"/zegoconn/proxy_broken",service_no:an},kr={event:"/zegoconn/proxy_disconnect",service_no:an},Rr="/rtc/exception_update",Ir=an,Nr=on,Cr={event:"/sdk/set_video_config",error:{te:Ii,_n:ki},video_params:rn,video_conf:rn},zr={event:"/sdk/set_audio_config",error:{te:Ii,_n:ki},audio_params:rn,audio_conf:rn},Dr="/sdk/api/publish_video_en_size",Pr=an,Ar=an,Mr="/sdk/api/publish_video_en_bps",xr=an,jr="/sdk/api/publish_video_en_fps",Lr=an,qr={event:"/sdk/replace_track",error:{te:Ii},track_kind:on},Ur={event:"/device/api/video_c",error:{te:Ii,wn:qe,_n:ki,Sn:Yi},device:on,device_name:on,facing_mode:on},Br={event:"/device/api/audio_c",error:{te:Ii,wn:qe,_n:ki},device:on,device_name:on},Jr={event:"/sdk/play_content_changed",webrtc_sid:an,video_activate:cn,audio_activate:cn,video_layer:an},Vr="/sdk/mute_publish_video",Hr=an,Gr=cn,Fr="/sdk/mute_publish_audio",Yr=an,Zr="/device/enable_mic",Qr=cn,Xr=rn,Wr="/device/enable_camera",Kr=cn,$r=rn,to="/sdk/mute_play_video",io=an,eo="/sdk/mute_play_audio",no=an,so={event:"/liveroom/send_stream_extra_info",error:{te:Ii,En:Ui,Tn:wi,kn:Wi,Rn:{code:1103062,message:"update stream info fail"},_zpg_kExtraInfoNull:Ui,_zpg_kExtraInfoTooLong:{code:1003051,message:"the extra info of the stream is too long"}},stream_id:on,send_seq:an,stream_extra_info:rn,room_id:on,room_sid_string:on,use_na:an},ro="/active/sei",oo=an,uo=an,ao=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];var co=o(955),ho=o.n(co),fo=o(5178),lo=o.n(fo),vo="TOKEN_ERROR",mo="MULTIPLE_LOGIN_KICKOUT",po="TOKEN_EXPIRED",go="ROOM_INNER_ERROR";function bo(t,i,e){i.success&&(e[t+"SuccessCallback"]=i.success),i.error&&(e[t+"ErrorCallback"]=i.error)}function _o(t,i){return i[t+"SuccessCallback"]}function yo(t,i,e,n){bo(t,{success:function(t,n){for(var s=[],r=2;r<arguments.length;r++)s[r-2]=arguments[r];!function(t,i,e,n,s){switch(e){case"eventStart":t.eventStart(i,n);break;case"eventEndWithMsgInfo":t.eventEndWithMsgInfo(i,n,s[0]);break;case"addEventMsg":t.addEventMsg(i,n,s[0],s[1]);break;case"addEvent":t.addEvent(i,n);break;case"eventEnd":t.eventEnd(i,n);break;case"addMsgInfo":t.addMsgInfo(i,s[0])}}(i,e,t,n,s)}},n)}function wo(t,i){return{code:t,msg:i||"liveroom error"}}function So(t,i){delete i[t+"SuccessCallback"],delete i[t+"ErrorCallback"]}function Eo(t,i){var e={code:t,message:"server error"};return e.code=t>1e9?t-1e9+52e6:t+2002e6,i&&(e.message=i),e}function Oo(t){var i={1016:"MULTI_ROOM_UNABLE",1105:"ROOM_MAX_USER_COUNT",1012:"PUBLISHER_ERROR_REPETITIVE_PUBLISH_STREAM",2002:vo,2003:"ROOM_ERROR_LOGIN_TIMEOUT",2010:vo,5022:"MULTI_ROOM_COUNT_EXCEED",5030:"FORBID_BLACK_USER"};return t>2e5&&t<3e5?i[t-2e5]||go:t<2e5?{50013:mo,50116:vo,50117:po,50118:vo,50119:vo,50120:vo,50121:vo,50122:vo,50123:po,50124:vo,50125:vo,50126:vo,50127:vo,50128:vo}[t]||i[t]||go:i[t]||go}function To(t,i,e,n){var s,r=[],o=[],u=[],a=[];e||(e=[]);for(var c=0;c<e.length;c++)if(e[c].anchor_id_name!=t&&e[c].id_name!=t&&e[c].user_id!=t){s=!1;for(var h=0;h<i.length;h++)if(e[c].stream_id===i[h].stream_id){e[c].extra_info!==i[h].extra_info&&u.push(e[c]),JSON.stringify(e[c].stream_attr_opts)!==JSON.stringify(i[h].stream_attr_opts)&&a.push(e[c]),s=!0;break}s||r.push(e[c])}for(var f=0;f<i.length;f++)if(i[f].anchor_id_name!=t&&i[f].id_name!=t&&i[f].user_id!=t){s=!1;for(var l=0;l<e.length;l++)if(i[f].stream_id===e[l].stream_id){s=!0;break}s||o.push(i[f])}i.splice(0);for(c=0;c<e.length;c++)i.push(e[c]);n(r,o,u,a)}function ko(t,i,e){return i=null!=i?i:1,e=null!=e?e:1e4,Lt(t)&&t%1==0&&t>=i&&t<=e}function Ro(t,i){var e,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];if(i=i||n.length,t)for(e=0;e<t;e++)s[e]=n[0|Math.random()*i];else{var r=void 0;for(s[8]=s[13]=s[18]=s[23]="-",s[14]="4",e=0;e<36;e++)s[e]||(r=0|16*Math.random(),s[e]=n[19==e?3&r|8:r])}return s.join("")}function Io(t,i,e){return t.push(i),t.length>e&&t.shift(),t.reduce((function(t,i){return t+i}))/t.length}function No(t){return t<600?97-Math.pow(.09*t,1.1):18*Math.exp(.002*(600-t))}function Co(t,i){if(i){return t<=55?99-Math.pow(.8*t,1.18):J.PoorMinQuality}var e=100*t;return e<=40?96-Math.pow(e,1.22):J.PoorMinQuality}function zo(t,i,e){if(Bt(e))return Math.min(No(t),Co(i,!0));var n=function(t){return t<=50?98-Math.pow(t,1.15):J.PoorMinQuality}(e);return.15*n+.85*Math.min(No(t),Co(i,!1))}function Do(t){return t>=J.ExcellentMinQuality?V.Excellent:t>=J.GoodMinQuality?V.Good:t>=J.MiddleMinQuality?V.Middle:t>=J.PoorMinQuality?V.Poor:V.Die}function Po(){var t=!!window.RTCRtpScriptTransform;if(!t){var i=!!RTCRtpSender.prototype.createEncodedStreams,e=!1;try{new ReadableStream;e=!0}catch(t){console.error("Transferable streams are not supported.")}t=i&&e}return t}function Ao(){return"function"==typeof RTCPeerConnection.prototype.setConfiguration}function Mo(t){for(var i,e=0,n=t.length,s="";e<n;)i=t.subarray(e,Math.min(e+32768,n)),s+=String.fromCharCode.apply(null,Array.from(i)),e+=32768;return btoa(s)}function xo(t){var i=[];return t.getTracks().forEach((function(t){i.push("audio"===t.kind?"mic(".concat(t.id,",").concat(t.label,",").concat(t.muted,",").concat(t.enabled,",").concat(t.readyState,")"):"camera(".concat(t.id,",").concat(t.label,",").concat(t.muted,",").concat(t.enabled,",").concat(t.readyState,")"))})),i.join("|")}function jo(t,i,e,n){var s=(null==n?void 0:n.streamID)?" ".concat(n.streamID," "):"";i.info("audio"===t.kind?e+" mic(".concat(t.id,",").concat(t.label,",").concat(t.muted,",").concat(t.enabled,",").concat(t.readyState,")"):e+" camera(".concat(t.id,",").concat(t.label,",").concat(t.muted,",").concat(t.enabled,",").concat(t.readyState,")"),{streamid:s})}var Lo=function(t){var i=0;if(0==t.length)return i;for(var e=0;e<t.length;e++){i=(i<<5)-i+t.charCodeAt(e),i|=0}return i>>>0};function qo(t,i,e){var n=(new Date).getTime(),s=C(),r="".concat(t,"_").concat(i,"_").concat(e,"_").concat(n,"_").concat(s);return Lo(r)}function Uo(t,i){return(t&1<<i)>>i}function Bo(){var t=window.navigator.userAgent,i=null!=window.ActiveXObject&&-1!=t.indexOf("MSIE"),e=-1!=t.indexOf("Firefox"),n=null!=window.opr,s=t.indexOf("Chrome")&&window.chrome,r=-1!=t.indexOf("Safari")&&-1!=t.indexOf("Version");return i?"IE":e?"Firefox":n?"Opera":s?"Chrome":r?"Safari":"Unkown"}function Jo(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return((null==t?void 0:t.effectiveType)||(null==t?void 0:t.type)||"unknown").toUpperCase()}function Vo(t,i){return ho().encrypt(t,i).toString()}function Ho(t,i){try{return ho().decrypt(t,i).toString(lo())}catch(t){return""}}function Go(t,i){try{localStorage.setItem(t,i)}catch(t){}}function Fo(t){try{return localStorage.getItem(t)}catch(t){}}function Yo(t,i,e,n){return{interResolve:function(n){t.uploadReport(i),e(n)},interReject:function(e,s){var r;void 0===s&&(s=""),(r=e.code<2e9&&e.code>1e9?Eo(e.code,e.msg):{code:e.code,message:e.msg})&&t.addMsgInfo(i,{error:r.code,message:r.message+s}),t.uploadReport(i),n({errorCode:e.code||e.errorCode})}}}function Zo(t){return!(!t.startsWith("wss")||-1===t.indexOf("test")||!t.endsWith("ws"))}function Qo(t){try{var i=Uint8Array.from(function(t){var i,e,n,s,r,o,u;for(o=t.length,r=0,u="";r<o;){do{i=ao[255&t.charCodeAt(r++)]}while(r<o&&-1==i);if(-1==i)break;do{e=ao[255&t.charCodeAt(r++)]}while(r<o&&-1==e);if(-1==e)break;u+=String.fromCharCode(i<<2|(48&e)>>4);do{if(61==(n=255&t.charCodeAt(r++)))return u;n=ao[n]}while(r<o&&-1==n);if(-1==n)break;u+=String.fromCharCode((15&e)<<4|(60&n)>>2);do{if(61==(s=255&t.charCodeAt(r++)))return u;s=ao[s]}while(r<o&&-1==s);if(-1==s)break;u+=String.fromCharCode((3&n)<<6|s)}return u}(t),(function(t){return t.charCodeAt(0)})),e=new DataView(i.buffer),n=void 0;return n=Ht(e.getBigInt64)?e.getBigUint64(0):function(t,i,e){var n=e.getUint32(t,i),s=e.getUint32(t+4,i),r=i?n+Math.pow(2,32)*s:Math.pow(2,32)*n+s;return Number.isSafeInteger(r)||console.warn(r,"exceeds MAX_SAFE_INTEGER. Precision may be lost"),r}(0,!1,e),Number(n>0?n:e.getBigUint64(0,!0))}catch(t){console.error("token error")}return-1}function Xo(t){var i=(new Date).getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=(i+16*Math.random())%16|0;return i=Math.floor(i/16),("x"==t?e:3&e|8).toString(36)}));if(0===t){var n=function(t){var i=document.createElement("canvas"),e=i.getContext("2d"),n=t;e.textBaseline="top",e.font="14px 'Arial'",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText(n,4,17);var s=i.toDataURL().replace("data:image/png;base64,",""),r=function(t){var i,e,n,s="";for(i=0,e=(t+="").length;i<e;i++)s+=(n=t.charCodeAt(i).toString(16)).length<2?"0"+n:n;return s}(atob(s).slice(-16,-12));return r}("hello, zego");e=n+e.slice(8)}return e}function Wo(){var t=h.NT_UNKNOWN,i="",e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(i=((null==e?void 0:e.effectiveType)||(null==e?void 0:e.type)||"unknown").toUpperCase()).indexOf("4G")>-1?t=h.NT_4G:i.indexOf("2G")>-1?t=h.NT_2G:i.indexOf("3G")>-1?t=h.NT_3G:i.indexOf("WIFI")>-1?t=h.NT_WIFI:i.indexOf("LINE")>-1?t=h.NT_LINE:i.indexOf("NONE")>-1&&(t=h.NT_NONE),t}var Ko,$o,tu=o(2799),iu=1,eu={product:"rtc_web",importLevel:a.H,levels:[0,10,100,1e3],bps:32e3},nu="0c9e6e0f8c0a8f4e",su="z_net_access_servers",ru="z_net_http3_access_servers",ou="z_net_v6_access_servers",uu="z_net_http3_v6_access_servers",au="z_appconfig",cu="z_appconfig_etag",hu="z_geos",fu="z_rtc_domains",lu={domains:["accesshub-wss.zego.im","accesshub-wss.coolzcloud.com","accesshub-wss.zegocloud.com"],logreportDomain:"weblogger-wss.coolfcloud.com",prefixDomain:"accesshub-wss",rtcLogPath:"zglog/ws",wssV6preFixDomain:"accesshub-wss-v6",normalPriDomains:["coolbcloud.com","coolgcloud.com"],specialDomain:"cooldcloud.com",mode:"online",modeNo:tu.Mode.MODE_ONLINE,sdkType:3,connectVer:4,pcEstablishTimeout:15,scheme:"wss",location:"accesshub",wssMessageType:1},du="weblogger-wss",vu="detaillog-global",mu=[{id:2,relative_geofencings:[],accesshub:"accesshub-wss-geo-2",wssV6Accesshub:"accesshub-wss-geo-2-v6",logreport:"weblogger-wss-geo-2",detaillog:"detaillog-geo-2"},{id:3,relative_geofencings:[7],accesshub:"accesshub-wss-geo-3",wssV6Accesshub:"accesshub-wss-geo-3-v6",logreport:"weblogger-wss-geo-3",detaillog:"detaillog-geo-3"},{id:4,relative_geofencings:[7],accesshub:"accesshub-wss-geo-4",wssV6Accesshub:"accesshub-wss-geo-4-v6",logreport:"weblogger-wss-geo-4",detaillog:"detaillog-geo-4"},{id:5,relative_geofencings:[7],accesshub:"accesshub-wss-geo-5",wssV6Accesshub:"accesshub-wss-geo-5-v6",logreport:"weblogger-wss-geo-5",detaillog:"detaillog-geo-5"},{id:6,relative_geofencings:[7],accesshub:"accesshub-wss-geo-6",wssV6Accesshub:"accesshub-wss-geo-6-v6",logreport:"weblogger-wss-geo-6",detaillog:"detaillog-geo-6"},{id:7,relative_geofencings:[3,4,5,6,1],accesshub:"accesshub-wss-geo-7",wssV6Accesshub:"accesshub-wss-geo-7-v6",logreport:"weblogger-wss-geo-7",detaillog:"detaillog-geo-7"}],pu=[2,3,4,5,6],gu="zm.0",bu="zm.wl",_u="zm.slf",yu="zm.lg",wu="zm.lo",Su="zm.sr",Eu="zm.fac",Ou="zm.fac.tk",Tu="zm.hlu",ku="zm.cna",Ru="zm.gsac",Iu="zm.zpl.url",Nu="zm.glgf",Cu="zm.scsu",zu="zm.on",Du="zm.off",Pu="zm.rntk",Au="zm.emr",Mu="zm.rm.lg",xu="zm.rm.tl",ju="zm.rm.lgr",Lu="zm.rm.lo",qu="zm.rm.rr",Uu="zm.rm.kco",Bu="zm.hhl",Ju="zm.hb.st",Vu="zm.hb.rsp",Hu="zm.rrh.hlf",Gu="zm.us.ftu",Fu="zm.us.urp",Yu="zm.us.uph",Zu="zm.us.mg",Qu="zm.st.at",Xu="ON_LISTENER",Wu="zm.st.ofls",Ku="zm.lrh.sm",$u="zm.lrh.hp",ta="zm.lrh.hsp",ia="zm.lrh.gs",ea="zm.lrh.lgi",na="zm.lrh.ful",sa="zm.lrh.lgo",ra="zm.lrh.sru",oa="zm.lrh.scc",ua="zm.lrh.hd",aa="zm.lrh.hb",ca="zm.tc.ii",ha="zm.nt.od",fa=function(t){return t},la=function(t){return t},da=function(t){return t},va=function(t){return t},ma=function(t){return t},pa={event:"/sdk/init",error:{kInvalidParamError:Mt.INPUT_PARAM},system_info:da,servers:function(t){return t},is_from_cache:ma,project:da,liveroom_version:da,biz_type:va,lua_md5:da,sev_env:da,use_na:va},ga="listener",ba="/sdk/set_debug",_a=da,ya={event:"/sdk/set_log_config",error:{kInvalidParamError:Mt.INPUT_PARAM},log_level:function(t){return t},remote_log_level:da,log_url:da},wa={event:"/sdk/on_listener",listener:da,error:{INPUT_PARAM:Mt.INPUT_PARAM}},Sa="/sdk/off_listener",Ea=da,Oa={event:"/sdk/login",room_id:da,room_sid_string:da,user_state_update:va,max_member_cnt:va,message:da,token:da,svr_env:da,server:da,try_cnt:va,room_mode:va,role:va,audience_create_room:va,liveroom_sid_string:da,error:{ROOM_ID_NULL:Mt.ROOM_ID_NULL,INPUT_PARAM:Mt.INPUT_PARAM,ROOM_ID_TOO_LONG:Mt.ROOM_ID_TOO_LONG,ROOM_ID_INVALID_CHARACTER:Mt.ROOM_ID_INVALID_CHARACTER,USER_ID_NULL:Mt.USER_ID_NULL,USER_ID_TOO_LONG:Mt.USER_ID_TOO_LONG,USER_ID_INVALID_CHARACTER:Mt.USER_ID_INVALID_CHARACTER,USER_NAME_NULL:Mt.USER_NAME_NULL,USER_NAME_TOO_LONG:Mt.USER_NAME_TOO_LONG,REPEATEDLY_LOGIN:Mt.REPEATEDLY_LOGIN,LOGIN_TIMEOUT:Mt.LOGIN_TIMEOUT,INNER_ERROR:Mt.ROOM_INNER_ERROR,NETWORK_BROKEN:Mt.NETWORK_BROKEN,ROOM_COUNT_EXCEED:Mt.ROOM_COUNT_EXCEED,DIFFERENT_USER_ID:Mt.DIFFERENT_USER_ID,LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID:Mt.LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID}},Ta="/sdk/sublogin",ka={event:"/zpush/login",sdk_zpush_sessionid_string:da},Ra={event:"/liveroom/enter"},Ia={event:"/sdk/renew_token",error:{INPUT_PARAM:Mt.INPUT_PARAM,NOT_LOGIN:Mt.NOT_LOGIN},token:da},Na="/zpush/hb_timeout",Ca={event:"/sdk/logout",error:{INPUT_PARAM:Mt.INPUT_PARAM,ROOM_ROOMID_INCORRECT:Mt.ROOM_ROOMID_INCORRECT},room_id:da,room_sid_string:da,is_multi:ma,is_send_cmd_net:ma,liveroom_sid_string:da},za="/switch/logout_user",Da="/liveroom/quit",Pa=da,Aa=da,Ma="/zpush/multi_logout_user",xa="/sdk/relogin",ja={event:"/liveroom/tempbroken"},La={event:"/sdk/reconnect",room_broken_time:va},qa={event:"/sdk/disconnect",valid_d:va,total_d:va,tempbroken_cnt:va},Ua="/sdk/kickout",Ba=va,Ja=va,Va={event:"/liveroom/hb",room_id:da,room_sid_string:da,interval:va,stream_seq:va,server_user_seq:va,error:{NOT_LOGIN:Mt.NOT_LOGIN,HB_TIMEOUT:Mt.TIMEOUT}},Ha="/liveroom/recv_user_update_info",Ga="/sdk/listener",Fa={event:"/sdk/enable_multi_room",is_multi:ma,error:{kInvalidParamError:Mt.INPUT_PARAM,kAlreadyLoginError:Mt.ALREADY_LOGIN}},Ya="/cloud_setting/cache",Za=la,Qa="/cloud_setting/refresh",Xa=la,Wa=la,Ka="/cloud_setting/request",$a=la,tc=la,ic={event:"/liveroom/get_current_user_list",user_index:va,is_time_ascend:ma,use_na:va},ec="/zegoconn/connect",nc=da,sc=va,rc=la,oc="/zegoconn/connected",uc="/zegoconn/connect_failed",ac="/zegoconn/connect_back_to_ws",cc="/zegoconn/disconnect",hc=da,fc=da,lc=va,dc="/zegoconn/auto_dispatch",vc=fa,mc=fa,pc=fa,gc=fa,bc="/zegoconn/request",_c=la,yc="/sdk_config/init",wc=la,Sc=va,Ec={event:"/zegoconn/proxy_connect",service_no:va,proxy_link_sources:va,recv_time:va,connect_stream:va},Oc={event:"/zegoconn/proxy_broken",service_no:va},Tc={event:"/zegoconn/proxy_disconnect",service_no:va},kc=[50116,50118,50119,50120,50121,50122,50124,50125,50126,50127,50128],Rc=function(){function t(){this.RETRY_MAX_TIME=300,this.RETRY_START_TIME_INTERVAL=4,this.RETRY_CONTINUE_COUNT=2,this.RETRY_MAX_TIME_INTERVAL=32,this.retryStartTime=0,this.retryActiveCount=1,this.isOverTime=!1}return t.prototype.init=function(t,i,e,n){this.invalid(),this.stopMaxTime(),this.isOverTime=!1,Lt(t)&&t<3600&&(this.RETRY_MAX_TIME=t),Lt(i)&&(this.RETRY_START_TIME_INTERVAL=i),Lt(e)&&(this.RETRY_CONTINUE_COUNT=e),Lt(n)&&(this.RETRY_MAX_TIME_INTERVAL=n)},t.prototype.invalid=function(){this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this.startRetryTimer&&clearTimeout(this.startRetryTimer),this.startRetryTimer=null,this.retryStartTime=0,this.retryActiveCount=1},t.prototype.isRetrying=function(){return null!==this.retryTimer||null!==this.startRetryTimer||null!==this.maxTimer},t}(),Ic=(Ko=function(t,i){return Ko=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},Ko(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function e(){this.constructor=t}Ko(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}),Nc=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},Cc=function(t){function i(i,e,n){var s=t.call(this)||this;return s.In=i,s.Nn=e,s.Cn=n,s.zn=0,s.Dn=0,s.Pn=3,s.An="",s.loginCompleted=!1,s.loginRoomCallback={},s}return Ic(i,t),Object.defineProperty(i.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),i.prototype.renewLocalToken=function(t,i){this.token=t,this.Cn.token=this.token;var e=(new Date).getTime(),n=parseInt(t.substring(0,2)),s=void 0;if(i&&Lt(i))s=1e3*i;else if(qt(t)&&n>=3){var r=1e3*Qo(t.substring(2));this.In.info("zm.rm.rlt time "+r+" "+e+" "+this.Nn.local_time_deviation),s=r-(e-this.Nn.local_time_deviation)}s&&this.roomHandler.resetTokenTimer(s),this.In.setTokenInfo(t),this.Nn.actionListener("_tokenRenewed",t,this.Cn.roomID)},i.prototype.initRoom=function(t,i,e,n,s){this.roomHandler=t,this.roomID=i,this.renewLocalToken(e),this.user=n,this.config=s},i.prototype.active=function(t,i){var e,n,s,o=this;void 0===t&&(t=!1),this.In.info(Mu+" retry call "+(null===(e=this.Cn)||void 0===e?void 0:e.roomID)+" "+t);var u=(null===(n=this.loginRoomCallback)||void 0===n?void 0:n.success)?Ta:xa;if(this.xn||(this.xn=this.Mn.createSpan(a.H,{key:Oa.event,par:this.roomID},{key:u,par:this.roomID},u,!0),this.An=u),this.roomHandler.setRunState(r.trylogin),this.Cn.isMulti&&(null===(s=this.Nn.roomModulesList.find((function(t){return!t.isMulti})))||void 0===s?void 0:s.runState)!==r.login)this.In.info(Mu+" service is disconnected, multi room stop retry");else if(this.retryTimer)this.In.info(Mu+" has actived, ignore");else{var h=this.Nn.networkState==c.offline;if(h){if(this.In.info(Mu+" check if really offline. "+this.Dn),this.Dn>=this.Pn)return void this.In.warn(Mu+" network is broken, stop retry")}else this.Dn=0;if(this.isOverTime)this.In.info(Mu+" retry over time, stop retry");else{var f=function(){o.In.info(Mu+" interval "+o.retryActiveInterval),o.retryTimer=setTimeout((function(){o.roomHandler.login(o.roomID,o.token,o.user,o.config,(function(t){o.Nn.networkState=c.online,o.handleLoginFinish(t)}),(function(t,i){o.handleLoginFinish(!1,t,i)}),i),o.retryTimer&&clearTimeout(o.retryTimer),o.retryTimer=null,h?o.Dn++:o.retryActiveCount++}),t?0:1e3*o.retryActiveInterval)};if(1==this.retryActiveCount)gi().then((function(t){o.retryActiveInterval=Math.floor(t*(1-o.RETRY_START_TIME_INTERVAL)+o.RETRY_START_TIME_INTERVAL),f()})).catch((function(t){o.retryActiveInterval=.5*o.RETRY_START_TIME_INTERVAL,f()}));else{var l=Math.pow(2,Math.round(this.retryActiveCount/this.RETRY_CONTINUE_COUNT+1));this.retryActiveInterval=l>this.RETRY_MAX_TIME_INTERVAL?this.RETRY_MAX_TIME_INTERVAL:l,f()}}}},i.prototype.startMaxTime=function(){var t=this;this.maxTimer||(this.In.info(Mu+" start max timer"),0===this.zn&&(this.zn=(new Date).getTime()),this.maxTimer=setTimeout((function(){var i;t.In.info(Mu+" over max time ".concat(t.RETRY_MAX_TIME,"s, stop retry")),t.isOverTime=!0,t.roomHandler.resetRoom(),0!==t.zn&&(i=(i=(new Date).getTime()-t.zn)>0?i:void 0),t.jn(!1,Mt.LOGIN_TIMEOUT),t.xn&&(t.Mn.spanEnd({key:t.An,par:t.roomID},{error:Mt.LOGIN_TIMEOUT.code,message:Mt.LOGIN_TIMEOUT.msg,try_time:i}),t.xn=null),t.loginRoomCallback.fail&&(t.loginRoomCallback.fail(Mt.LOGIN_TIMEOUT),t.roomHandler.disconnectedHandle(Mt.LOGIN_TIMEOUT),t.resetCallBack())}),1e3*this.RETRY_MAX_TIME))},i.prototype.stopMaxTime=function(){this.In.info(Mu+" stop max timer"),0!==this.zn&&(this.zn=0),this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},i.prototype.onactive=function(t,i){},i.prototype.retryLoginRoom=function(t,i,e){void 0===t&&(t=!1),void 0===i&&(i=!1),!this.maxTimer&&this.startMaxTime(),i&&this.Cn.resetSessionInfo(),this.active(t,e)},i.prototype.handleError=function(t,i){if(this.RETRY_MAX_TIME<3)return!1;var e=t.code;if(i){var n=[200207,200208];if(e>=40001&&e<=40100||e>=50200&&e<=50299||[201002,30019].includes(e))return this.Cn.resetSessionInfo(),!0;var s=Nc(Nc([202002,205030,205035],kc,!0),[50013],!1);return 10015===e?(this.Cn.retryConnect(),!0):!(null==s?void 0:s.includes(e))&&(!!n.includes(e)||this.Cn.lastRunState==r.login&&(this.In.warn("zm.rrh.he reset"),this.Cn.resetUserSession(),this.invalid(),!0))}return!0},i.prototype.setLoginRoomCallback=function(t,i){this.loginRoomCallback.success=t,this.loginRoomCallback.fail=i},i.prototype.loginFail=function(t){this.roomHandler.resetRoom(),this.jn(!1,t),this.loginRoomCallback.fail&&(this.loginRoomCallback.fail(t),this.roomHandler.disconnectedHandle(t),this.resetCallBack())},i.prototype.handleLoginFinish=function(t,i,e){var n;if(this.In.info(Hu+" "+t+" "+JSON.stringify(i)),i){if(this.xn){var s=void 0;0!==this.zn&&(s=(s=(new Date).getTime()-this.zn)>0?s:void 0),this.Mn.spanEnd({key:this.An,par:this.roomID},{error:i.code,message:i.msg,try_time:s}),this.xn=null}if(this.handleError(i,e))this.In.info(Hu+" retry"),[40001].includes(i.code)&&this.Cn.userHandler.updateUserDelete(this.roomID),this.retryLoginRoom();else{this.In.info(Hu+" reset"),this.roomHandler.resetRoom(),this.jn(t,i);var r=this.Ln(i.code);if(this.loginRoomCallback.fail){this.loginRoomCallback.fail(i);var o="";e&&i.code===Di&&(o=JSON.stringify({server_code:r})),this.roomHandler.disconnectedHandle(i,{extendedData:o}),this.resetCallBack()}}}else{s=void 0;0!==this.zn&&(s=(s=(new Date).getTime()-this.zn)>0?s:void 0),this.jn(t,{code:0,msg:""}),this.xn&&(this.Mn.spanEnd({key:this.An,par:this.roomID},{room_id:this.roomID,room_sid_string:null===(n=this.Cn)||void 0===n?void 0:n.roomSidString,try_time:s}),this.xn=null),this.loginRoomCallback.success&&(this.loginRoomCallback.success(t),this.resetCallBack())}},i.prototype.invalid=function(){this.In.info("zm.rh.ivd end retry"),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this.retryActiveCount=1,this.Dn=0},i.prototype.jn=function(t,i){this.stopMaxTime(),this.invalid(),this.onactive(t,i)},i.prototype.Ln=function(t){return O+t},i.prototype.resetCallBack=function(){this.loginRoomCallback.success=void 0,this.loginRoomCallback.fail=void 0,this.loginCompleted=!0},i}(Rc);!function(t){t.NOT_EMPTY="NOT_EMPTY",t.ILLEGAL_CHARACTERS="ILLEGAL_CHARACTERS",t.TYPE_STRING="TYPE_STRING",t.TYPE_INTEGER="TYPE_INTEGER",t.TYPE_OBJECT="TYPE_OBJECT",t.MAX_LENGTH_10="MAX_LENGTH_10",t.MAX_LENGTH_64="MAX_LENGTH_64",t.MAX_LENGTH_100="MAX_LENGTH_100",t.MAX_LENGTH_128="MAX_LENGTH_128",t.MAX_LENGTH_256="MAX_LENGTH_256",t.MAX_LENGTH_1024="MAX_LENGTH_1024"}($o||($o={}));var zc={error:{code:0,msg:"suc"}},Dc={NOT_EMPTY:function(t,i,e,n,s){return void 0===i||""===i||null===i?(n.error("".concat(e," ").concat(t," is empty")),s):zc},ILLEGAL_CHARACTERS:function(t,i,e,n,s){return oi(i)?zc:(n.error("".concat(e," ").concat(t," contains illegal characters")),s)},TYPE_STRING:function(t,i,e,n,s){return qt(i)?zc:(n.error("".concat(e," ").concat(t," must be string")),s)},TYPE_INTEGER:function(t,i,e,n,s){return ai(i,!1)?zc:(n.error("".concat(e," ").concat(t,"  must be integer number")),s)},TYPE_OBJECT:function(t,i,e,n,s){return i&&Jt(i)?zc:(n.error("".concat(e," ").concat(t,"  must be object")),s)},MAX_LENGTH_10:function(t,i,e,n,s){return i.length>10?(n.error("".concat(e," ").concat(t," is too long")),s):zc},MAX_LENGTH_64:function(t,i,e,n,s){return i.length>64?(n.error("".concat(e," ").concat(t," is too long")),s):zc},MAX_LENGTH_100:function(t,i,e,n,s){return i.length>100?(n.error("".concat(e," ").concat(t," is too long")),s):zc},MAX_LENGTH_128:function(t,i,e,n,s){return i.length>128?(n.error("".concat(e," ").concat(t," is too long")),s):zc},MAX_LENGTH_256:function(t,i,e,n,s){return i.length>256?(n.error("".concat(e," ").concat(t," is too long")),s):zc},MAX_LENGTH_1024:function(t,i,e,n,s){return i.length>1024?(n.error("".concat(e," ").concat(t," is too long")),s):zc}};function Pc(t,i){var e=[],n={};for(var s in t){n[t[s].order]=t[s],t[s].key=s}for(var r in n)e.push(n[r]);for(var o=0;o<e.length;o++)for(var u=e[o].rules,a=0;a<u.length;a++){var c={key:e[o].key,value:e[o].value,action:i.action,logger:i.logger},h=c.value,f=u[a].name?""+u[a].name:"";if((void 0===h&&f===$o.NOT_EMPTY||void 0!==h)&&Dc[f]){var l=Dc[f](c.key,h,c.action,c.logger,u[a]);if(l!=zc)return l}}return zc}var Ac=o(5733),Mc=function(){function t(t,i){this.In=t,this._dataReport=i,this.id="",this._debug=!1,this.appConfigEtag=-1,this.appConfigFetched=!1,this.customSetLogURL=!1,this.requestList={},this.mode=tu.Mode.MODE_ONLINE,this.connectState="connected",this.testNetPackageSize=!1,this.netGeoFencing={},this.agentIpStackDetection={IPv4:Nt.unknown,IPv6:Nt.unknown},this.isFlutter=!1,this.agentConnectIPStackType=kt.IPv4,this.advanceConfig={},this.svrDomains={},this.userListenerList=["roomUserUpdate","roomOnlineUserCountUpdate","IMRecvCustomCommand","IMRecvBroadcastMessage","roomExtraInfoUpdate","IMRecvBarrageMessage","roomStateUpdate","tokenWillExpire","roomStateChanged"],this._testEnvironment=!1,this._env=0,this.type="PUBLIC",this.debugCustom=!1,this.configOK=!1,this.role=2,this.relateService=[],this.maxMemberCount=0,this.roomCreateFlag=1,this.local_time_deviation=0,this.callbackList={},this.listenerList={roomUserUpdate:[],roomOnlineUserCountUpdate:[],getAnchorInfo:[],_getAnchorInfo:[],IMRecvCustomCommand:[],IMRecvBroadcastMessage:[],recvReliableMessage:[],roomExtraInfoUpdate:[],IMRecvBarrageMessage:[],recvJoinLiveRequest:[],recvInviteJoinLiveRequest:[],recvEndJoinLiveCommand:[],roomLoginResponse:[],_roomLogin:[],_appConfigRsp:[],_netAppConfigRsp:[],_connectChanged:[],HBResponse:[],roomStateUpdate:[],_roomStateUpdate:[],_getTotalUserList:[],_userStateUpdate:[],_recvBigRoomMessage:[],_recvRoomMsg:[],_kickout:[],tokenWillExpire:[],_stopStream:[],roomStateChanged:[],_userTransUpdate:[],_uaHeartBeatTimeout:[],hallStateUpdate:[],_hallStateUpdate:[],roomTokenWillExpire:[],_tokenRenewed:[],_protobufResponse:[],_cloudSettingNotify:[],_settingCanFetch:[],_beforeSwitchRoom:[],_afterSwitchRoom:[],_experimentalAPICallback:[]},this.reportList={},this.reportSeqList={login:0,relogin:0},this.networkState=c.online,this.roomRetryTime=300,this.roomModulesList=[],this.isMultiRoom=!1,this.setMultiRoom=!1,this.protoFormat="json",this.settingFetched=!1,this.configRoomAuth=!1,this.configCheckToken=!1,this._sdkVersion="unknown",this.mode=lu.modeNo}return Object.defineProperty(t.prototype,"selectIPStackMode",{get:function(){var t;return this.settingConfig.getSettingWithUserParams("ip_stack_mode",null===(t=Qf.engineOptions)||void 0===t?void 0:t.ipStackMode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debug",{get:function(){return this._debug},set:function(t){this._debug=t,Ac.LoggerStateCenter.getInstance().debug=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"testEnvironment",{get:function(){return this._testEnvironment},set:function(t){this._testEnvironment=t,Ac.LoggerStateCenter.getInstance().testEnvironment=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ENV",{get:function(){return this._env},set:function(t){this._env=t,Ac.LoggerStateCenter.getInstance().ENV=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomid",{get:function(){return this.roomModulesList[0]?this.roomModulesList[0].roomID:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"serverTimeOffset",{get:function(){return this.roomModulesList[0]?this.roomModulesList[0].messageHandler.qn:0},enumerable:!1,configurable:!0}),t.prototype.getRequestId=function(){return this.idName+"-"+N()},t.prototype.actionListener=function(t){for(var i=this,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!["getAnchorInfo","HBResponse","roomOnlineUserCountUpdate","roomLoginResponse"].includes(t)&&!t.startsWith("_")&&this.listenerList[t]){var s=this.reporter.createSpan(a.H,{key:ga},{key:""},Ga);s.setAttributes({listener:t,listener_params:JSON.stringify(e)}),s.end()}["roomStateChanged","tokenWillExpire"].includes(t)&&this.In.info("zm.al ".concat(t," ").concat(JSON.stringify(e),". pageID: ").concat(Qf.pageID," , instID: ").concat(this.id)),this.listenerList[t]&&this.listenerList[t].forEach((function(n){if(i.userListenerList.includes(t))setTimeout((function(){try{n.apply(void 0,e)}catch(e){throw i.In.error(Qu+" "+t+" "+JSON.stringify(e)),e}}),0);else try{n.apply(void 0,e)}catch(e){i.In.error(Qu+" "+t+" "+JSON.stringify(e))}}))},t.prototype.onListener=function(t,i){return this.listenerList[t]?Ht(i)?(-1==this.listenerList[t].indexOf(i)&&this.listenerList[t].push(i),!0):(this.In.error(Xu+" listener callBack must be funciton"),!1):(this.In.error(Xu+" event "+t+" no found"),!1)},t.prototype.offListener=function(t,i){return this.listenerList[t]?Ht(i)?(-1!==this.listenerList[t].indexOf(i)&&(this.listenerList[t]=this.listenerList[t].filter((function(t){return t!==i}))),!0):(this.In.error(Wu+" listener callBack must be funciton"),!1):(this.In.error(Wu+" event "+t+" no found"),!1)},Object.defineProperty(t.prototype,"sdKVersion",{get:function(){return this._sdkVersion},set:function(t){this._sdkVersion=t},enumerable:!1,configurable:!0}),t.prototype.proxyRes=function(t,i,e){return{interResolve:function(e){i(e),t.end()},interReject:function(i,n){var s;void 0===n&&(n=""),!i.code&&i.errorCode&&(i.code=i.errorCode),(s=i.code<2e9&&i.code>1e9?Eo(i.code,i.msg):{code:i.code,message:i.msg})&&t.setAttributes({error:s.code,message:s.message+n}),t.end(),e({errorCode:i.code})}}},t}(),xc=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},jc=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Lc=function(){function t(t,i,e,n,s){this.In=t,this.Nn=i,this._dataReport=e,this.Un=n,this.Cn=s,this.Bn=null,this.Jn=1e5,this.Vn=null,this.Hn=0,this.Gn=!1}return Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),t.prototype.Fn=function(){var t=this;this.Yn(),this.Vn=setTimeout((function(){t.In.warn("zm.hb.to call. "+t.Jn),t.hbLogout(Mt.HEARTBEAT_TIMEOUT),t.Mn.createSpan(a.H,{key:Oa.event,par:t.Cn.roomID},{key:""},Na).end()}),this.Jn)},t.prototype.Yn=function(){this.Vn&&clearTimeout(this.Vn)},t.prototype.init=function(t){var i=this;this.Gn=!1;var e=t.body.hearbeat_interval<l?l:t.body.hearbeat_interval,n=Math.floor(Math.random()*e);this.Yn(),this.Bn&&clearTimeout(this.Bn),this.Bn=setTimeout((function(){i.start(e)}),n),this.Hn++},t.prototype.start=function(t){return xc(this,void 0,void 0,(function(){var i,e,n,s,r=this;return jc(this,(function(o){switch(o.label){case 0:return this.In.info(Ju+" call"),i=this.Mn.createSpan(a.H,{key:Oa.event,par:this.Cn.roomID},{key:""},Va.event),this.Cn.isLogin()?(e=function(t,e){var n,s,o,u;if(t.header&&t.body){if(0!==(t.body&&t.body.err_code)){var a=Eo(t.body.err_code||t.body.code,t.body.err_message||t.body.message);i.setAttributes({error:a.code,message:a.message+t.body.err_code})}}else i.setAttributes({error:t.code>0?t.code:Mt.ROOM_INNER_ERROR.code,message:t.msg?t.msg:Mt.ROOM_INNER_ERROR});r.Zn(t,e),0===(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.err_code)&&i.setAttributes({interval:Va.interval(null===(s=null==t?void 0:t.body)||void 0===s?void 0:s.hearbeat_interval),stream_seq:Va.stream_seq(null===(o=null==t?void 0:t.body)||void 0===o?void 0:o.stream_seq),server_user_seq:Va.server_user_seq(null===(u=null==t?void 0:t.body)||void 0===u?void 0:u.server_user_seq)}),i.end()},this.Un.heartBeat(e,e,this.Cn,this.Jn),this.Qn=t,n=this.Qn,this.Hn>=2?[4,gi()]:[3,2]):(this.In.error(Ju+" state error"),this.Mn.setError(i,Va.error.NOT_LOGIN),[2]);case 1:return s=o.sent(),n=Math.round(s*(this.Qn+1)),this.Hn=1,[3,3];case 2:n=this.Qn,o.label=3;case 3:return this.Vn||this.Fn(),this.Bn=setTimeout((function(){r.start(r.Qn)}),n),this.In.info(Ju+" call success"),[2]}}))}))},t.prototype.Zn=function(t,i){if(t.body&&t.body.err_code&&0!==t.body.err_code){if(this.In.error(Vu+" disconnect, server error="+t.body.err_code),40001==t.body.err_code)return;return t.body.err_code==s?void this.hbLogout(Mt.HEARTBEAT_TIMEOUT):void this.hbLogout(wo(t.body.err_code))}if(!t.header||!t.body)return this.In.error(Vu+" disconnect, error="+JSON.stringify(t)+", seq = "+i),void this.hbLogout(t);void 0!==t.body.hearbeat_interval&&0!==t.body.hearbeat_interval&&(this.Qn=t.body.hearbeat_interval,this.Qn<l&&(this.Qn=l)),0!==t.body.hearbeat_timeout&&(this.Jn=t.body.hearbeat_timeout),this.Gn?this.In.info(Vu+" has reset"):this.Fn(),this.heartbeatRspNotiFy(t,this.Cn.roomID),this.In.info(Vu+" call success "+i)},t.prototype.heartbeatRspNotiFy=function(t,i){},t.prototype.hbLogout=function(t){},t.prototype.resetHeartbeat=function(){clearTimeout(this.Bn),this.Bn=null,this.Gn=!0,this.Yn(),this.Hn=0,this.In.info("zm.hb.rst call success")},t}(),qc={code:1102026,msg:"cancel login"};var Uc=function(t){return function(t){var i=unescape||window.unescape;return Uint8Array.from(Array.from(i(encodeURIComponent(t))).map((function(t){return t.charCodeAt(0)})))}(t=null!=t?t:"")},Bc=function(t){return function(t){var i=escape||window.escape;return decodeURIComponent(i(String.fromCharCode.apply(String,Array.from(t))))}(t)};function Jc(t){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t).length;for(var i=0,e=0;e<t.length;e++){var n=t.charCodeAt(e);i+=n<=127?1:n<=2047?2:n<=65535?3:4}return i}var Vc="DISCONNECTED",Hc="CONNECTED",Gc="CONNECTING",Fc=function(){function t(t,i,e,n,s){this.In=t,this.Nn=i,this._dataReport=e,this.Cn=n,this.Un=s,this.Xn=null,this.Wn=1e4,this.Kn=null,this.$n=0,this.es=0,this.validTime=0,this.totalTime=0,this.brokenCounts=0,this.ns=0,this.ss=0,this.rs=!1,this.loginCallback={}}return Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"us",{get:function(){return this.Cn.roomID},enumerable:!1,configurable:!0}),t.prototype.resetTokenTimer=function(t){var i=this;this.In.info("zm.rm.rst  call: "+(t=(t=(t-=3e4)<0?0:t)>2147483647?2147483647:t)),this.Kn&&clearTimeout(this.Kn),this.Kn=setTimeout((function(){i.Nn.actionListener("tokenWillExpire",i.us),i.Nn.actionListener("roomTokenWillExpire",i.us)}),t)},t.prototype.cs=function(){this.Kn&&clearTimeout(this.Kn),this.Kn=null},t.prototype.setRunState=function(t){this.Cn.runState!==t&&(this.Cn.lastRunState=this.Cn.runState,this.Cn.runState=t)},t.prototype.hs=function(){this.Xn&&clearTimeout(this.Xn),this.Xn=null},t.prototype.fs=function(t){var i,e,n,s,r,o,u,c,h=this.Mn.createSpan(a.H,{key:Ca.event,par:this.us},{key:""},this.Nn.isMultiRoom?Da:za);t&&"0"===this.Un.zPushSid&&(this.Un.zPushSid=null===(e=null===(i=this.Un)||void 0===i?void 0:i.switchSessionID)||void 0===e?void 0:e.toString()),this.updateTimes();var f=t?null===(n=this.Un)||void 0===n?void 0:n.zPushSid:null===(r=null===(s=this.Un)||void 0===s?void 0:s.switchSessionID)||void 0===r?void 0:r.toString();h.setAttributes({room_id:Ca.room_id(null===(o=this.Cn)||void 0===o?void 0:o.roomID),room_sid_string:Ca.room_sid_string(null===(u=this.Cn)||void 0===u?void 0:u.roomSidString),liveroom_sid_string:Pa(null===(c=this.Cn)||void 0===c?void 0:c.userSidString),sdk_zpush_sessionid_string:Aa(f),valid_d:this.validTime,total_d:this.totalTime,tempbroken_cnt:this.brokenCounts}),h.end()},t.prototype.resetRoom=function(t){var i,e=this;if(this.In.info(qu+" call"),this.Nn.roomModulesList.length>1&&!t&&(this.Cn.isMulti=!0),this.hs(),this.Cn.sessionExist&&this.Cn.runState!==r.logout&&!this.Cn.isDisConnect()){var n=function(t){e.ls(t,!e.Cn.isMulti)};this.Un.logout(this.Cn,n,n)}this.fs(t),this.setRunState(r.logout),this.Cn.resetRoomSession(),this.Cn.resetUserSession(),this.Cn.isMulti||(this.Nn.userid="",this.In.setSessionInfo(this.Nn.appid,this.us,this.Cn.userSidString,this.Nn.idName,this.Nn.nickName,this.Nn.sdKVersion),null===(i=this.Un)||void 0===i||i.reset()),this.resetRoomCallBack(),this.Nn.roomModulesList=this.Nn.roomModulesList.filter((function(t){return t!==e.Cn}));var s=this.Nn.roomModulesList[0];(s&&(s.isMulti=!1,s.runState!==r.login&&s&&s.retryRoom()),this.Nn.isMultiRoom&&0===this.Nn.roomModulesList.length)&&(this.Mn.createSpan(a.H,{key:Ca.event,par:this.us},{key:""},Ma).end(),this.Un.zPushSid="0");this.In.info(qu+" call success")},t.prototype.resetRoomCallBack=function(){},t.prototype.loginSuccessCallBack=function(t,i){},t.prototype.handlePushKickout=function(t,i,e){var n,s,o,u,c,h=this;this.In.info(Uu+"  call "+JSON.stringify(t));var f=function(t){var i={code:t,message:"kickout reason = "+t},e={code:63000005,message:"zpush token expired",name:po};switch(t){case 1:return{code:63000001,message:"zpush multiple login kickout",name:mo};case 2:return{code:63000002,message:"zpush manual kickout",name:"MANUAL_KICKOUT"};case 4:return e;default:i.code=t,i.message="kickout reason = "+t}return i}(t.body.reason||(null===(n=t.body)||void 0===n?void 0:n.kickout_reason)),l=this.Mn.createSpan(a.H,{key:Oa.event,par:this.us},{key:""},Ua);this.updateTimes(),l.setAttributes({error:null===(s=Mt[f.name||"ROOM_INNER_ERROR"])||void 0===s?void 0:s.code,message:f.message,kickout_reason:Ba((null===(o=t.body)||void 0===o?void 0:o.reason)||(null===(u=t.body)||void 0===u?void 0:u.kickout_reason)),need_relogin:Ja(null===(c=null==t?void 0:t.body)||void 0===c?void 0:c.need_relogin),valid_d:this.validTime,total_d:this.totalTime,tempbroken_cnt:this.brokenCounts}),l.end();var d=this.Cn.roomTryHandler;if(d)if(d.onactive=function(t,i){h.In.info(Uu+" onactive"),h.disconnectedHandle(i),h.Nn.actionListener("_kickout",i)},t.body.need_relogin&&1==t.body.need_relogin)this.Cn.retryRoom(!1,!0);else{this.setRunState(r.logout),this.resetRoom(i);var v={};if(t&&t.body.custom_reason)v.custom_kickout_message=t.body.custom_reason;else if(f.name&&Mt[f.name]){v.custom_kickout_message=Mt[f.name].msg+"; kickout reason: "+(t.body.reason||t.body.kickout_reason)}this.disconnectedHandle(f.name&&Mt[f.name]?Mt[f.name]:Mt.ROOM_INNER_ERROR,{extendedData:JSON.stringify(v),isKickout:!0}),this.Nn.actionListener("_kickout",{code:Mt.MANUAL_KICKOUT.code,msg:Mt.MANUAL_KICKOUT.msg+t.body.reason||t.body.kickout_reason})}else this.In.info(Uu+" try handler no found")},t.prototype.handleHbLogout=function(t){var i=this,e=this.Cn.roomTryHandler;e&&(e.onactive=function(t,e){i.In.warn(Bu+" onactive"),i.transError(e),i.disconnectedHandle(e)},[Mt.HEARTBEAT_TIMEOUT,Mt.SOCKET_CLOSE].includes(t)||[105,152,2001].includes(null==t?void 0:t.code)||t.msg.endsWith("1000002001")||t.msg.endsWith("1000000152")||t.msg.endsWith("1000000105")?[Mt.HEARTBEAT_TIMEOUT.code].includes(t.code)?this.Cn.retryRoom(!1,!1,Mt.NETWORK_RECOVERY):this.Cn.retryRoom():[Mt.TIMEOUT].includes(t)?this.In.warn(Bu+" timeout"):(this.In.warn(Bu+" unexpected error: ".concat(JSON.stringify(t))),this.logoutByError(t)))},t.prototype.logoutByError=function(t){var i=this.Cn.roomTryHandler;i&&(i.stopMaxTime(),i.invalid(),this.resetRoom(),this.disconnectedHandle(t))},t.prototype.onConnecting=function(t){this._roomStateHandle(Gc,Pt.Logining,t)},t.prototype.disconnectedHandle=function(t,i){if(t&&0!==t.code){this.cs();var e=(null==i?void 0:i.isKickout)?Pt.Kickout:Pt.ReconnectFailed;this.transError(t),this._roomStateHandle(Vc,e,t,(null==i?void 0:i.extendedData)||t.msg)}else this._roomStateHandle(Hc,Pt.Reconnected,t,null==i?void 0:i.extendedData)},t.prototype.updateTimes=function(){this.updateValidTime(),this.updateTotalTime()},t.prototype.updateValidTime=function(){this.ns&&(this.validTime=this.validTime+Date.now()-this.ns,this.ns=0)},t.prototype.updateTotalTime=function(){this.ss&&(this.totalTime=Date.now()-this.ss)},t.prototype._roomStateHandle=function(t,i,e,n,s){var r,o,u,c=this.Cn.roomID,h=Date.now();if(!i||i!=Pt.Reconnecting||(this.es++,1!=this.es)){var f;this.In.info("zm.rm.scb "+t+" "+JSON.stringify(e)),[Hc,Vc].includes(t)&&(this.es=0,this.rs&&this.brokenCounts++),t!==Hc&&this.updateTimes(),i&&[Pt.LoginFailed,Pt.ReconnectFailed].includes(i)&&(i=(null===(r=this.Cn.roomTryHandler)||void 0===r?void 0:r.loginCompleted)?Pt.ReconnectFailed:Pt.LoginFailed),i&&[Pt.Logined,Pt.Reconnected].includes(i)&&((null===(o=this.Cn.roomTryHandler)||void 0===o?void 0:o.loginCompleted)?i=Pt.Reconnected:(i=Pt.Logined,this.ss=this.ss||h),this.rs=!1,this.ns=h),i&&[Pt.Logining,Pt.Reconnecting].includes(i)&&(i=(null===(u=this.Cn.roomTryHandler)||void 0===u?void 0:u.loginCompleted)?Pt.Reconnecting:Pt.Logining,this.ss&&(this.rs=!0));var l=0;switch(i){case Pt.Reconnecting:f=ja,this.$n=(new Date).getTime();break;case Pt.ReconnectFailed:f=qa;break;case Pt.Reconnected:f=La,l=(new Date).getTime()-this.$n}if(this.Cn.lastRoomState=this.Cn.roomState,this.Cn.roomState=t,this.Cn.roomReasonState=i,this.Cn.roomState!==this.Cn.lastRoomState){this.Nn.actionListener("_roomStateUpdate",c,t,e?e.code:0,n,i,s);var d=(null==e?void 0:e.code)||0;if(d==qc.code&&(d=0),this.Nn.actionListener("roomStateUpdate",c,t,d,n),this.Nn.actionListener("roomStateChanged",c,i,d,n),f){var v=this.Mn.createSpan(a.H,{key:Oa.event,par:c},{key:""},f.event);v.setAttributes(i===Pt.Reconnected?{room_broken_time:La.room_broken_time(l)}:{error:(null==e?void 0:e.code)||0,message:n||""}),f==qa&&v.setAttributes({valid_d:this.validTime,total_d:this.totalTime,tempbroken_cnt:this.brokenCounts}),v.end()}}t===Vc&&(this.ss=0,this.totalTime=0,this.validTime=0,this.brokenCounts=0)}},t.prototype.transError=function(t){if(this.In.info("zm.rm.te "+JSON.stringify(t)),0!==t.code&&(t.code<2e9&&t.code>1e9||t.code<1e6)){var i=Oo(t.code);i&&Mt[i]&&(t.code=Mt[i].code,t.msg=Mt[i].msg)}},t.prototype.login=function(t,i,e,n,s,o,u){if(this.In.info(Mu+" call:"+t),this.In.remoteReport(Mu+" call:"+i),!this.Cn.isMulti&&this.In.setSessionInfo(this.Nn.appid,t,"",e.userID,"",this.Nn.sdKVersion),n){var c=n.userUpdate,h=n.maxMemberCount;c&&Ut(c)&&(this.Cn.userStateUpdate=c),h&&Lt(h)&&(this.Cn.maxMemberCount=h)}if(!this.Nn.configOK)return this.In.error(Mu+" init sdk wrong"),void o(Mt.INIT);this.Cn.runState!==r.trylogin&&this.setRunState(r.trylogin),this.Cn.isCancelLogin=!1,this.Cn.roomID=t,this.Cn.token=i,this.Cn.thirdToken=i,this.Nn.idName=e.userID,this.Nn.nickName=e.userName||e.userID,this.loginCallback.success=s,this.loginCallback.fail=o,this.ds=this.Cn.isMulti?Ra:ka,this.Mn.createSpan(a.H,{key:Ta,bak_key:xa,par:this.us},{key:this.ds.event,par:this.us},this.ds.event,!0),this.hs(),this.onConnecting(u||{code:0,msg:""}),this.vs(),this.In.info(Mu+" call success")},t.prototype.vs=function(){var t,i,e,n,s=this;if(this.Cn.runState===r.trylogin)if(this.Cn.isMulti&&this.Cn.isDisConnect())this.In.warn(xu+" liveroom is not connected");else{var o=function(t,i){s.ps(t,i)};(null===(t=this.Un)||void 0===t?void 0:t.isUaConnect)?(this.Mn.spanSetAttributes({key:this.ds.event,par:null===(i=this.Cn)||void 0===i?void 0:i.roomID},{sdk_zpush_sessionid_string:null===(n=null===(e=this.Un)||void 0===e?void 0:e.switchSessionID)||void 0===n?void 0:n.toString()}),this.Un.login(this.Cn,o,o)):(this.Xn=setTimeout((function(){s.In.info(xu+" over time no response, login timeout"),s.loginCallback.fail&&s.loginCallback.fail(Oa.error.LOGIN_TIMEOUT)}),this.Wn),this.In.warn(xu+" ua is not connected")),this.In.info(xu+" call success")}else this.In.error("zb.rh.tl state error")},t.prototype.ps=function(t,i){if(this.In.info(ju+" seq: "+i+" "+JSON.stringify(t)),this.Cn.runState===r.trylogin)if(t.header&&t.body){if(t.header.seq!==i&&0==this.Cn.isMulti)return void this.In.error(ju+" in wrong seq, local="+i+",recv="+t.header.seq);0!==t.body.err_code?(this.In.error(ju+" server error="+t.body.err_code),this.gs(t)):(this.In.info(ju+" call success."),this.bs(t))}else this.In.error(ju+" "+JSON.stringify(t)),this.gs(t);else this.Cn.isCancelLogin?(this.gs(qc),this.Cn.isCancelLogin=!1):this.In.error(ju+" state error")},t.prototype.gs=function(t){this.hs();var i=Oa.error.INNER_ERROR;t.header&&t.body?i=wo(t.body.err_code):t.code&&t.msg&&(i=t),this.Mn.spanEnd({key:this.ds.event,par:this.us},{error:i.code,message:i.msg}),this.loginCallback.fail&&this.loginCallback.fail(i,!0)},t.prototype.bs=function(t){var i,e,n,s,o,u,a,c=this;this.Cn.checkRoomSession(t.body.room_session_id)&&(this.Cn.loginTime=Date.now());var h=this.Cn.lastRunState;this.setRunState(r.login),this.Nn.userid=t.body.user_id,this.Cn.longRoomSid=t.body.room_session_id,this.Cn.longSid=t.body.session_id;var f=((i={})[this.us]={room_sid_string:this.Cn.roomSidString},i);this.Mn.setPublicPros(f);var l=null===(e=null==t?void 0:t.body)||void 0===e?void 0:e.token_remain_time;this.Nn.configRoomAuth=l>0;var d=parseInt(this.Cn.token.substring(0,2));if(t.body.ret_timestamp&&d>=3){var v=(new Date).getTime(),m=v-t.body.ret_timestamp;this.Nn.local_time_deviation=m<5e3?0:m;var p=l>0?1e3*l:1e3*Qo(this.Cn.token.substring(2))-(v-this.Nn.local_time_deviation);this.resetTokenTimer(p)}!this.Cn.isMulti&&this.In.setSessionInfo(this.Nn.appid,this.us,this.Cn.userSidString,this.Nn.idName,this.Nn.nickName,this.Nn.sdKVersion),this.Mn.spanEnd({key:this.ds.event,par:this.us},{room_id:null===(n=this.Cn)||void 0===n?void 0:n.roomID,room_sid_string:null===(s=this.Cn)||void 0===s?void 0:s.roomSidString,zpush_sessionid_string:null===(u=null===(o=null==t?void 0:t.header)||void 0===o?void 0:o.session_id)||void 0===u?void 0:u.toString(),liveroom_sid_string:null===(a=this.Cn)||void 0===a?void 0:a.userSidString}),this.hs(),this.loginSuccessCallBack(h,t),this._roomStateHandle(Hc,Pt.Logined,{code:0,msg:""}),this.In.makeZipLogSpaceUpload().catch((function(t){c.In.error("zm.rm.lgsuc zip log upload error: "+JSON.stringify(t))})),this.loginCallback.success&&this.loginCallback.success(!0)},t.prototype.logout=function(t,i){this.In.info(Lu+" call");var e={code:0,msg:""};this.Cn.runState!==r.logout?(this.Cn.runState===r.trylogin&&(this.Cn.isCancelLogin=!0,e=qc),this.resetRoom(t),this._roomStateHandle(Vc,Pt.Logout,e,void 0,i),this.cs(),this.In.info(Lu+" call success")):this.In.warn("zb.rh.lo at logout")},t.prototype.ls=function(t,i){var e;this.In.info(Lu+" result="+(t.body&&t.body.err_code?t.body.err_code:"-1")),i&&(null===(e=this.Un)||void 0===e||e.closeRequest())},t}(),Yc=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},Zc=function(){function t(t,i,e,n,s){this.In=t,this.Nn=i,this._dataReport=e,this.Un=n,this.Cn=s,this._s=!1,this.ys=[],this.ws=0,this.Ss=0,this.Es=[],this.Os=null,this.Ts=3e4,this.ks=5e3,this.Rs={anchor_id:"",anchor_id_name:"",anchor_nick_name:""}}return t.prototype.loginRsp=function(t,i){this.Rs=t.body.anchor_info||this.Rs,this.Ts=t.body.userlist_interval||this.Ts,this.ks=t.body.userlist_merge_timeout||this.ks,t.body.anchor_info&&(this.Nn.actionListener("getAnchorInfo",t.body.anchor_info.anchor_id_name,t.body.anchor_info.anchor_nick_name),this.Nn.actionListener("_getAnchorInfo",t.body.anchor_info.anchor_id_name,t.body.anchor_info.anchor_nick_name)),t.body.online_count&&this.Nn.actionListener("roomOnlineUserCountUpdate",this.Cn.roomID,t.body.online_count),this.In.info("zm.us.lgr  userStateUpdate "+this.Cn.userStateUpdate),this.Cn.userStateUpdate&&this.Is(i)},t.prototype.patchUserList=function(t){var i=this;t.body.server_user_seq!==this.ws&&this.Cn.userStateUpdate&&!this.Os&&(this.In.info("zm.us.pt call update user "+this.ws+" server "+t.body.server_user_seq),this.Os||(this.Os={}),this.Ns&&clearTimeout(this.Ns),this.Ns=setTimeout((function(){i.Cs()}),this.ks)),this.Ss=t.body.server_user_seq,null!=t.body.online_count&&0!=t.body.online_count&&this.Nn.actionListener("roomOnlineUserCountUpdate",this.Cn.roomID,t.body.online_count)},t.prototype.resetUserHandler=function(){this._s=!1,this.zs=0,this.ys=[],this.ws=0,this.Ss=0,this.Es=void 0,this.Os={},this.Ns=void 0,this.Ds=void 0,this.Ts=3e4,this.ks=5e3,this.Rs={anchor_id:"",anchor_id_name:"",anchor_nick_name:""}},t.prototype.Is=function(t){this._s?this.In.warn(Gu+" is already querying"):(this._s=!0,this.ys=[],this.Ps(0,t||0),this.In.info(Gu+" the first time call"))},t.prototype.Ps=function(t,i){var e,n=this,s=function(t){n.As(t,i)},r={user_index:t,sort_type:0},o=ic;this.Nn.reporter.createSpan(a.H,{key:Oa.event,par:this.Cn.roomID},{key:o.event,par:this.Cn.roomID},o.event,!0).setAttribute("user_index",o.user_index(t)),null===(e=this.Un)||void 0===e||e.fetchUserList(r,s,s,this.Cn)},t.prototype.As=function(t,i){var e,n,s=this;if(this.Nn.reporter.spanEnd({key:ic.event,par:this.Cn.roomID},{error:(null===(e=null==t?void 0:t.body)||void 0===e?void 0:e.err_code)||(null==t?void 0:t.code),message:(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.err_message)||(null==t?void 0:t.msg)}),t.body&&0!=t.body.err_code)return this._s=!1,this.zs=Date.now()+this.Ts,void this.In.info(Fu+" fetch error "+t.body.err_code);if(!t.header||!t.body)return this._s=!1,this.zs=Date.now()+this.Ts,void this.In.info(Fu+" fetch error "+t);if(this.Cn.userStateUpdate){this.ys=Yc(Yc([],this.ys,!0),t.body.user_baseinfos,!0);var o=t.body.ret_user_index;if(o!=t.body.server_user_index)return this.In.info(Fu+" fetch another page"),void this.Ps(o+1,i);this.ws=t.body.server_user_seq;for(var u=[],a=[],c=0;c<this.ys.length;c++){var h={userID:this.ys[c].id_name,userName:this.ys[c].nick_name,role:this.ys[c].role};4!==h.role&&(u.push(h),a.push({idName:this.ys[c].id_name,nickName:this.ys[c].nick_name,role:this.ys[c].role}))}this.Nn.actionListener("_getTotalUserList",this.Cn.roomID,a),i==r.login?(this.Es&&function(t,i,e,n){t.debug("msl.0 call");var s,r=[],o=[];e||(e=[]);for(var u=0;u<e.length;u++){s=!1;for(var a=0;a<i.length;a++)if(e[u].userID===i[a].userID){s=!0;break}s||r.push(e[u])}for(var c=0;c<i.length;c++){s=!1;for(var h=0;h<e.length;h++)if(i[c].userID===e[h].userID){s=!0;break}s||o.push(i[c])}for(i.splice(0),u=0;u<e.length;u++)i.push(i[u]);n(r,o),t.debug("msl.0 call success")}(this.In,this.Es,u,(function(t,i){0!==t.length&&s.onUserStateUpdate(s.Cn.roomID,"ADD",t),0!==i.length&&s.onUserStateUpdate(s.Cn.roomID,"DELETE",i)})),this.Es=u):(this.Es=u,0!==u.length&&this.onUserStateUpdate(this.Cn.roomID,"ADD",u)),this._s=!1,this.zs=Date.now()+this.Ts,this.ys=[],this.In.info(Fu+" call success user_list "+u+", count: "+u.length+", seq: "+this.ws)}else this.In.info(Fu+" not update")},t.prototype.handlePushUserStateUpdateMsg=function(t){if(this.In.info(Yu+" call"),this.Cn.userStateUpdate)if(this.ws!==t.body.user_list_seq)if(this.ws+t.body.user_actions.length===t.body.user_list_seq){this.ws=t.body.user_list_seq;for(var i=[],e=0;e<t.body.user_actions.length;e++){var n={action:t.body.user_actions[e].Action,idName:t.body.user_actions[e].IdName,nickName:t.body.user_actions[e].NickName,role:t.body.user_actions[e].Role,loginTime:t.body.user_actions[e].LoginTime};4===n.role||i.push(n)}this.Nn.actionListener("_userStateUpdate",t.body.room_id,i);var s=[],r=[];i.forEach((function(t){1==t.action?s.push({userID:t.idName,userName:t.nickName,role:t.role}):2==t.action&&r.push({userID:t.idName,userName:t.nickName,role:t.role})})),this.Es&&(this.Es=this.Es.concat(s).filter((function(t){return!r.some((function(i){return i.userID==t.userID}))}))),0!==s.length&&this.onUserStateUpdate(t.body.room_id,"ADD",s),0!==r.length&&this.onUserStateUpdate(t.body.room_id,"DELETE",r),this.In.info(Yu+" call success")}else this.Ms(t.body.user_list_seq,t.body.user_actions);else this.In.warn(Yu+" user_list_seq is the same with local seq");else this.In.info(Yu+" userStateUpdate is false")},t.prototype.onUserStateUpdate=function(t,i,e){var n=this,s=e.filter((function(t){return t.userID!==n.Nn.idName}));0!=s.length&&(s=s.map((function(t){return{userID:t.userID,userName:t.userName}})),this.Nn.actionListener("roomUserUpdate",t,i,s))},t.prototype.Ms=function(t,i){var e=this;this.Os||(this.In.warn(Zu+" new merge userlist "+this.ws+" server "+t),this.Os={},this.Ns&&clearTimeout(this.Ns),this.Ns=setTimeout((function(){e.Cs()}),this.ks)),this.Os[t]=i,this.In.warn(Zu+"  merge userlist "+this.ws+" server "+t+" userlist "+i.length)},t.prototype.xs=function(t){var i=this;this.In.info("zm.us.mg merge userlist "+this.ws+" userSeqList "+t.join(",")),this.ws=t[t.length-1],this.zs=Date.now()+this.Ts;var e={};t.forEach((function(t){i.Os&&i.Os[t].forEach((function(t){e[t.IdName]=t}))})),this.Os=null;var n=Object.values(e).map((function(t){return{action:t.Action,idName:t.IdName,nickName:t.NickName,role:t.Role,loginTime:t.LoginTime?String(t.LoginTime):""}})).filter((function(t){return 4!==t.role}));n.sort((function(t,i){return t.loginTime.localeCompare(i.loginTime)}));var s=[],r=[];n.forEach((function(t){1==t.action?s.push({userID:t.idName,userName:t.nickName,role:t.role}):2==t.action&&r.push({userID:t.idName,userName:t.nickName,role:t.role})})),this.Es=this.Es&&this.Es.concat(s).filter((function(t){return!r.some((function(i){return i.userID==t.userID}))})),0!==s.length&&this.onUserStateUpdate(this.Cn.roomID,"ADD",s),0!==r.length&&this.onUserStateUpdate(this.Cn.roomID,"DELETE",r),this.Nn.actionListener("_userStateUpdate",this.Cn.roomID,n)},t.prototype.Cs=function(){var t=this,i=Object.keys(this.Os).map((function(t){return+t})).sort((function(t,i){return t-i}));if(i[i.length-1]-i[0]+1===i.length||i[i.length-1]>=this.Ss)this.xs(i);else{this.Os=null;var e=this.zs-Date.now();this.In.info("zm.us.mto  fetch merge userlist "+this.ws+" userSeqList "+i.join(",")+" wait "+e),e>0?(this.Ds&&clearTimeout(this.Ds),this.Ds=setTimeout((function(){t.Is()}),e)):this.Is()}},t.prototype.updateUserDelete=function(t){this.Es&&this.Es.length&&(this.onUserStateUpdate(t,"DELETE",this.Es),this.Es=[])},t}(),Qc=function(){function t(t,i,e,n,s,o){this.roomID=t,this.Nn=i,this.In=e,this.dataReport=n,this.rtm=s,this.Un=o,this.runState=r.logout,this.lastRunState=r.logout,this.lastRoomState="DISCONNECTED",this.roomState="DISCONNECTED",this.roomReasonState=Pt.Logout,this.roomSessionID="0",this.sessionID="0",this.longSid=null,this.longRoomSid=null,this.isMulti=!1,this.token="",this.thirdToken="",this.loginTime=0,this.userStateUpdate=!1,this.maxMemberCount=0,this.roomName="",this.isCancelLogin=!1,this.roomHandler=new Fc(this.In,this.Nn,this.dataReport,this,o),this.heartBeatHandler=new Lc(this.In,this.Nn,this.dataReport,this.Un,this),this.userHandler=new Zc(this.In,this.Nn,this.dataReport,this.Un,this),this.initMessageHandler(),this.initLiveHandler(),this.init()}return Object.defineProperty(t.prototype,"logger",{get:function(){return this.In},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateCenter",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"liveRoomHandler",{get:function(){return this.Un},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionExist",{get:function(){return null!==this.longSid||"0"!==this.sessionID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomSidString",{get:function(){return this.longRoomSid?this.longRoomSid.toString():"0"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userSidString",{get:function(){return this.longSid?this.longSid.toString():"0"},enumerable:!1,configurable:!0}),t.prototype.initMessageHandler=function(){},t.prototype.initLiveHandler=function(){},t.prototype.init=function(){this.bindHeatBeatHandler(),this.bindRoomHandler(),this.bindMessageHandler(),this.bindLiveHandler()},t.prototype.bindHeatBeatHandler=function(){var t=this;this.heartBeatHandler.hbLogout=function(i){t.roomHandler.handleHbLogout(i)},this.heartBeatHandler.heartbeatRspNotiFy=function(i,e){t.messageHandler&&t.messageHandler.loginRsp(i),t.userHandler.patchUserList(i),t._HBResponse(i,e)}},t.prototype.bindRoomHandler=function(){var t=this;this.roomHandler.loginSuccessCallBack=function(i,e){t.In.info("zm.lrm.brh login suc "+i),t.heartBeatHandler.init(e),t.Un.startCheck(),t.userHandler.loginRsp(e,i),t.messageHandler&&t.messageHandler.loginRsp(e),t.isMulti||t.js(),t.Ls(e)},this.roomHandler.resetRoomCallBack=function(){t.heartBeatHandler.resetHeartbeat(),t.liveHandler&&t.liveHandler.resetLiveHandler(),t.messageHandler&&t.messageHandler.resetMessageInfo(),t.Un&&t.Un.stopCheck(),t.userHandler.resetUserHandler(),t.roomTryHandler&&(t.roomTryHandler.invalid(),t.roomTryHandler.stopMaxTime())}},t.prototype.bindUserHandler=function(){},t.prototype.bindMessageHandler=function(){},t.prototype.bindLiveHandler=function(){},t.prototype._HBResponse=function(t,i){this.Nn.actionListener("HBResponse",t,i)},t.prototype.Ls=function(t){this.Nn.actionListener("roomLoginResponse",t)},t.prototype.checkRoomSession=function(t){return null!==this.longRoomSid&&this.longRoomSid.eq(t)},t.prototype.js=function(){this.Nn.roomModulesList.forEach((function(t){var i=t.roomTryHandler;t.runState!==r.login&&i&&1==t.isMulti&&(i.onactive=function(i,e){if(e&&0!==e.code){var n=Oo(e.code);n&&Mt[n]&&(e=Mt[n]),t.roomHandler._roomStateHandle("DISCONNECTED",Pt.ReconnectFailed,e,e.msg)}else t.roomHandler._roomStateHandle("CONNECTED",Pt.Reconnected,e)},i.retryLoginRoom())}))},t.prototype.isLogin=function(){return this.runState===r.login},t.prototype.isLogout=function(){return this.runState===r.logout},t.prototype.isTryLogin=function(){return this.runState===r.trylogin},t.prototype.isDisConnect=function(){return this.Un.isDisConnect()},t.prototype.retryConnect=function(){this.In.info("zm.lrm.rc call"),this.resetSessionInfo(),this.Un.closeRequest()},t.prototype.retryRoom=function(t,i,e){void 0===t&&(t=!1),void 0===i&&(i=!1),this.In.info("zm.lrm.rr.0 call retryNow:"+t+" resetSession: "+i+" "+JSON.stringify(e));var n=this.roomTryHandler;n&&this.rtm.isUaConnect&&n.retryLoginRoom(t,i,e)},t.prototype.resetSessionInfo=function(){var t;this.In.info("zm.lrm.rsi call"),this.resetRoomSession(),this.resetUserSession(),null===(t=this.Un)||void 0===t||t.reset()},t.prototype.resetRoomSession=function(){this.roomSessionID="0",this.longRoomSid=null},t.prototype.resetUserSession=function(){this.sessionID="0",this.longSid=null},t}(),Xc=o(4883),Wc=function(){function t(t){void 0===t&&(t=!1),this.close=!1,this.isLoad=!1,this.callBackList=[],this.close=t,this.close||(this.qs=new Xc.ZegoSetting)}return t.prototype.setLog=function(t){var i;null===(i=this.qs)||void 0===i||i.setLog(t)},t.prototype.init=function(t){var i;null===(i=this.qs)||void 0===i||i.init(t)},t.prototype.setEnvVariable=function(t,i){var e;null===(e=this.qs)||void 0===e||e.setEnvVariable(t,i)},t.prototype.getEnvVariables=function(){var t;return null===(t=this.qs)||void 0===t?void 0:t.getEnvVariables()},t.prototype.fetchSetting=function(t,i,e){return this.qs?this.qs.fetchSetting(t,i,e):Promise.resolve()},t.prototype.fetchMultiSetting=function(t,i,e){return this.qs?this.qs.fetchMultiSetting(t,i,e):Promise.resolve()},t.prototype.setOptions=function(t){var i;return this.close||null===(i=this.qs)||void 0===i?void 0:i.setOptions(t)},t.prototype.getSettingCache=function(t){var i;return this.qs?null===(i=this.qs)||void 0===i?void 0:i.getSettingCache(t):Promise.resolve()},t.prototype.setToken=function(t){var i;null===(i=this.qs)||void 0===i||i.setToken(t)},t.prototype.setUserID=function(t){var i;null===(i=this.qs)||void 0===i||i.setUserID(t)},t.prototype.activePolling=function(){var t;null===(t=this.qs)||void 0===t||t.activePolling()},t.prototype.uninit=function(){var t;null===(t=this.qs)||void 0===t||t.uninit()},t.prototype.getEnvVariable=function(t){var i;null===(i=this.qs)||void 0===i||i.getEnvVariable(t)},t}(),Kc=function(){function t(t){this.Us=-1,this.Bs=3e4,this.Js=0,this.Bs=t}return t.prototype.trigger=function(){var t,i=performance.now();(this.Js++,-1===this.Us)?(t={toReport:!0,failCount:this.Js},this.Us=i,this.Js=0):i-this.Us>this.Bs?(t={toReport:!0,failCount:this.Js},this.Us=i,this.Js=0):t={toReport:!1};return t},t}(),$c=o(757);function th(){return navigator.userAgent||""}function ih(){return null!==navigator.platform.match(/iPhone|iPod|iPad|ios/i)}function eh(){return null!==th().match(/Android|android/i)}function nh(){return null!==th().match(/OpenHarmony|HarmonyOS/i)}function sh(){var t,i=navigator.userAgent,e=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*([\d\.]+)/i)||[];return/trident/i.test(e[1])?{name:"IE",version:(t=/\brv[ :]+([\d\.]+)/g.exec(i)||[])[1]||""}:"Chrome"===e[1]&&null!=(t=i.match(/\bOPR|Edge\/([\d\.]+)/))?{name:"Opera",version:t[1]}:(e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=i.match(/version\/([\d+\.]+)/i))&&e.splice(1,1,t[1]),{name:e[0],version:e[1]})}function rh(){return"safari"==sh().name.toLowerCase()}function oh(){return"chrome"==sh().name.toLowerCase()}function uh(){return"firefox"==sh().name.toLowerCase()}function ah(){return oh()&&!!navigator.userAgent.toLocaleLowerCase().match(/redmi\snote\s8/)}function ch(){var t=th();return!!(t.match(/Mobi/i)||t.match(/Android/i)||t.match(/iPhone/i))}function hh(){var t,i;return!!(null===(i=null===(t=th())||void 0===t?void 0:t.toLowerCase())||void 0===i?void 0:i.match(/MicroMessenger/i))}function fh(){var t=th().toLowerCase().match(/cpu iphone os (.*?) like mac os/);return t&&t[1]||""}function lh(){return ih()?L.IOS:eh()?L.ANDROID:null!==navigator.platform.match(/Mac|Mac68K|MacPPC|MacIntel/i)?L.MAC:null!==navigator.platform.match("Win32")&&null===th().match(/WOW64|Win64|x86_64|x86-64|x64;|amd64|AMD64|x64_64/i)?L.WIN32:nh()?L.Harmony:L.UNKNOWN}var dh=function(){return dh=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},dh.apply(this,arguments)},vh=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},mh=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},ph=function(){function t(t){this.In=t,this.Vs=eu.product,this.Hs={},this.Gs={},this.isUnload=!1;new $c.DynamicCode;this.Fs=new $c.ZegoTracer(Qf.proxyCtrl),this.Fs.setSampleConfig({level:a.L}),this.Ys=lh()}return Object.defineProperty(t.prototype,"tracer",{get:function(){return this.Fs},enumerable:!1,configurable:!0}),t.prototype.init=function(t,i,e){var n=this;this.Fs.init({product:this.Vs,version:"1.0.0",env:i,appID:t,deviceID:e,importantLevel:eu.importLevel,levels:eu.levels,bps:eu.bps,spanStart:function(t){try{Ht(window.scriptSpanStart)&&scriptSpanStart(n.Gs,n.Fs,t)}catch(t){n.In.warn(ca+" dy span start "+t)}},spanBeforeEnd:function(t){t.setAttribute("ntype_end",Jo())},spanEnd:function(t,i){try{Ht(window.scriptSpanEnd)&&scriptSpanEnd(n.Gs,n.Fs,t)}catch(t){n.In.warn(ca+" dy span end "+JSON.stringify(t))}},resources:{product:this.Vs,appid:t,device_id:e,console:0==i?"rtc":"ali"},deflate:this.In.deflate})},t.prototype.setConfig=function(t){this.Fs.setConfig(t)},t.prototype.loadScript=function(t,i,e,n){return vh(this,void 0,void 0,(function(){var s;return mh(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.Fs.loadJs(t,i,e,n,"\nfunction scriptSpanStart(states, tracer, span) {\n    \n}\nfunction scriptSpanEnd(states, tracer, span) {\n    if (span['tags']['msg_content']) {\n        span['tags']['msg_content_size'] = span['tags']['msg_content'].length;\n        delete span['tags']['msg_content'];\n    }\n    delete span['tags']['resp'];\n    const filterSpans = ['/rtc/login', '/rtc/hb', '/rtc/recv_remote_stream'];\n    if (filterSpans.includes(span.name)) {\n        console.log(span.name + ' do not report');\n        span.droped = true;\n    }\n}\nfunction scriptInit(states, tracer) {\n\n}\n\n",{})];case 1:return r.sent(),Ht(window.scriptInit)&&scriptInit(this.Gs,this.Fs),[3,3];case 2:return s=r.sent(),this.In.warn("zm.tc.ls load script fail "+JSON.stringify(s)),[3,3];case 3:return[2]}}))}))},t.prototype.setReporterInfo=function(t,i){var e=new Map;e.set("userID",t),e.set("token",i),this.Fs.startReport(e)},t.prototype.flush=function(t){this.Fs.flush(t)},t.prototype.destroy=function(){this.Fs.destroy()},t.prototype.setCommonStates=function(t){this.Gs=t},t.prototype.setResource=function(t){this.Fs.setResource(t)},t.prototype.setCommonAttributes=function(t){this.Hs=Object.assign({},this.Hs,t)},t.prototype.deleteCommonAttributes=function(t){var i=this;t.forEach((function(t){delete i.Hs[t]}))},t.prototype.createSpan=function(i,e,n){var s=this.Fs.createSpan(i,e,{parent:n});return t.reportCustomerContext>0&&s.setAttributes({customer_context:t.reportCustomerContext}),s.setAttributes(dh({ntype:Jo(),os_type:this.Ys,error:0,message:""},this.Hs)),s},t.prototype.spanEnd=function(t,i,e){t&&i&&t.setAttributes(dh({},i)),t&&t.end(e)},t.prototype.spanReport=function(t){t&&t.spanReport()},t.prototype.spanSetAttributes=function(t,i){t&&t.setAttributes(i)},t.prototype.spanAppendAttribute=function(t,i,e){t&&t.appendAttribute(i,e)},t.prototype.setError=function(t,i,e){void 0===e&&(e=""),t.setAttributes({error:i.code||i.errorCode,message:(i.msg||i.message||i.extendedData)+" "+e}),t.end()},t.prototype.setLogger=function(t){this.Fs.setLogger(t)},t.prototype.setTimeOffset=function(t){this.Fs.setTimeOffset(t)},t.prototype.setUnloadState=function(t){this.isUnload=!0,this.Fs.setUnloadState(t)},t.prototype.setNetStateCheck=function(){this.Fs.setNetStateCheck()},t.reportCustomerContext=0,t}(),gh=function(){return gh=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},gh.apply(this,arguments)},bh=(function(){function t(t,i){this._dataReport=t,this._seq=i}t.prototype.setAttributes=function(t){this._dataReport.addMsgInfo(this._seq,t)},t.prototype.setAttribute=function(t,i){this._dataReport.addMsgInfo(this._seq,{key:i})},t.prototype.end=function(t){this._dataReport.uploadReport(this._seq)},t.prototype.spanReport=function(){}}(),["/sdk/start_publish","/publish/start","/publish/restart"]),_h=["/sdk/start_play","/play/start","/play/restart"],yh=function(){function t(t){this.In=t,this.Zs={},this.Qs={},this.Xs={},this.Ws=new Map,this.tracerHandler=new ph(t)}return t.setReportCustomerContext=function(t){ph.reportCustomerContext=t},t.prototype.init=function(t,i,e){this.tracerHandler.init(t,i,e)},t.prototype.setConfig=function(t){this.tracerHandler.setConfig(t)},t.prototype.loadScript=function(t,i,e,n){return this.tracerHandler.loadScript(t,i,e,n)},t.prototype.setReporterInfo=function(t,i){this.tracerHandler.setReporterInfo(t,i)},t.prototype.flush=function(t){this.tracerHandler.flush(t)},t.prototype.destroy=function(){this.tracerHandler.destroy(),this.Ws.clear()},t.prototype.setCommonStates=function(t){this.tracerHandler.setCommonStates(t)},t.prototype.setResource=function(t){this.tracerHandler.setResource(t)},t.prototype.setCommonAttributes=function(t){this.tracerHandler.setCommonAttributes(t)},t.prototype.deleteCommonAttributes=function(t){this.tracerHandler.deleteCommonAttributes(t)},t.prototype.clearRoomSpans=function(t){var i=this;t.forEach((function(t){for(var e in i.Zs)null==i.Zs[e].span&&delete i.Zs[e][t]}))},t.prototype.setPublicPros=function(t){this.Qs=Object.assign({},this.Qs,t)},t.prototype.createSpan=function(t,i,e,n,s){var r,o,u,a;if(i&&i.key&&i.par){var c=i.par1?"_"+i.par1:"";!(u=null===(r=this.Zs[i.key])||void 0===r?void 0:r[i.par+c])&&i.bak_key&&(u=null===(o=this.Zs[i.bak_key])||void 0===o?void 0:o[i.par+c])}else i&&!(u=this.Zs[i.key])&&i.bak_key&&(u=this.Zs[i.bak_key]);(u||(u=this.Zs[pa.event]),a=this.tracerHandler.createSpan(t,n,u),"/sdk/login"===i.key&&(a.setAttribute("room_id",i.par),this.Qs[i.par]&&a.setAttributes(this.Qs[i.par])),(bh.includes(i.key)||_h.includes(i.key))&&a.setAttribute("stream_id",i.par),bh.includes(i.key)&&this.Qs["_publish_"+i.par]&&a.setAttributes(this.Qs["_publish_"+i.par]),_h.includes(i.key)&&this.Qs["_play_"+i.par]&&a.setAttributes(this.Qs["_play_"+i.par]),s)&&(e.par?(!this.Zs[e.key]&&(this.Zs[e.key]={}),this.Zs[e.key][e.par+(c=e.par1?"_"+e.par1:"")]=a):this.Zs[e.key]=a);return a},t.prototype.setSpanInMap=function(t,i){i.par?(!this.Zs[i.key]&&(this.Zs[i.key]={}),this.Zs[i.key][i.par+(i.par2?"_"+i.par2:"")]=t):this.Zs[i.key]=t},t.prototype.spanEnd=function(t,i,e,n){var s;t.par?(s=this.Zs[t.key]&&this.Zs[t.key][t.par+(t.par1?"_"+t.par1:"")],this.Zs[t.key]&&!e&&delete this.Zs[t.key][t.par]):(s=this.Zs[t.key],!e&&delete this.Zs[t.key]);this.tracerHandler.spanEnd(s,i,n)},t.prototype.spanReport=function(t){var i;t.par?(i=this.Zs[t.key]&&this.Zs[t.key][t.par+(t.par1?"_"+t.par1:"")],this.Zs[t.key]&&delete this.Zs[t.key][t.par]):(i=this.Zs[t.key],delete this.Zs[t.key]);this.tracerHandler.spanReport(i)},t.prototype.spanSetAttributes=function(t,i){var e;if(t.par){var n=t.par1?"_"+t.par1:"";!(e=this.Zs[t.key]&&this.Zs[t.key][t.par+n])&&t.bak_key&&(e=this.Zs[t.bak_key]&&this.Zs[t.bak_key][t.par+n])}else!(e=this.Zs[t.key])&&t.bak_key&&(e=this.Zs[t.key]);this.tracerHandler.spanSetAttributes(e,i)},t.prototype.spanAppendAttribute=function(t,i,e){var n;if(t.par){var s=t.par1?"_"+t.par1:"";!(n=this.Zs[t.key]&&this.Zs[t.key][t.par+s])&&t.bak_key&&(n=this.Zs[t.bak_key]&&this.Zs[t.bak_key][t.par+s])}else!(n=this.Zs[t.key])&&t.bak_key&&(n=this.Zs[t.key]);this.tracerHandler.spanAppendAttribute(n,i,e)},t.prototype.setError=function(t,i,e){this.tracerHandler.setError(t,i,e)},t.prototype.setLogger=function(t){this.tracerHandler.setLogger(t)},t.prototype.setTimeOffset=function(t){this.tracerHandler.setTimeOffset(t)},t.prototype.setUnloadState=function(t){this.tracerHandler.setUnloadState(t)},t.prototype.setNetStateCheck=function(){this.tracerHandler.setNetStateCheck()},t.prototype.setAPIErrorReport=function(t,i){this.Xs[t]=i},t.prototype.getAPIErrorReport=function(t){return this.Xs[t]},t.prototype.takeAPIErrorReport=function(t,i,e,n){if(e){var s=this.Ws.get(t);s||(s=new Kc(e),this.Ws.set(t,s));var r=s.trigger(),o=r.failCount;if(r.toReport){var u=this.createSpan(a.I,{key:pa.event},{key:""},t);u.setAttributes(gh({api_fail_count:o},n)),this.setError(u,i)}}},t}(),wh=o(3788);const Sh=o(6994);(wh=wh.default||wh).util.Long=Sh.default||Sh,wh.util.Long.fromBits=wh.util.Long.fromBits||function(){return 0};for(var Eh=wh.roots,Oh=wh.types?wh.types.basic:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0,string:2,bytes:2},Th=wh.types?wh.types.packed:{double:1,float:5,int32:0,uint32:0,sint32:0,fixed32:5,sfixed32:5,int64:0,uint64:0,sint64:0,fixed64:1,sfixed64:1,bool:0},kh=Object.keys(Oh),Rh={$:function(t){return Rh[t]?Rh[t].call(this):Eh[t].decode?Eh[t].decode(this,this.uint32()):Rh.$.call(this,"int32")}},Ih={$:function(t,i,e){var n=Oh[t];return void 0===n?Eh[t].encode?(this.uint32(e<<3|2).fork(),Eh[t].encode(i,this).ldelim()):Ih.$.call(this,"int32",i,e):Ih[t].call(this.uint32(e<<3|n),i)}},Nh=0;Nh<kh.length;Nh++)Rh[kh[Nh]]=wh.Reader.prototype[kh[Nh]],Ih[kh[Nh]]=wh.Writer.prototype[kh[Nh]];!function t(i,e,n,s){for(var r=0,o=Object.keys(i);r<o.length;r++){var u=o[r];if(i[u].$m&&Object.keys(i[u].$m).every((function(t){return Number(t)}))){if(n[u])throw Error(`nested type ${n}.${u} has already exist`);n[u]=function(i,n){function s(t){for(var e in i){var n=i[e];"{"===n[1].charAt(0)?this[n[0]]={}:"["!==n[1].charAt(0)&&"<"!==n[1].charAt(0)||(this[n[0]]=[])}if(t)for(var s=Object.keys(t),r=0;r<s.length;++r)null!=t[s[r]]&&(this[s[r]]=t[s[r]])}var r={};for(var o in i){var u=i[o],a=u[1];"{"===a.charAt(0)?(s.prototype[u[0]]=wh.util.emptyObject,r[a]={$m:a.substring(1).split(",").map((function(t,i){return[`$${i+1}`,t,null]})).reduce((function(t,i,e){return t[e+1]=i,t}),{})}):s.prototype[u[0]]="["===a.charAt(0)||"<"===a.charAt(0)?wh.util.emptyArray:"bytes"===a?wh.util.newBuffer([]):u[2]&&u[2].hasOwnProperty("low")&&u[2].hasOwnProperty("high")?wh.util.Long.fromBits(u[2].low,u[2].high,u[2].unsigned):u[2]}return s.create=function(t){return new s(t)},s.decode=function(t,e){t instanceof wh.Reader||(t=wh.Reader.create(t));for(var n=void 0===e?t.len:t.pos+e,r=new s;t.pos<n;){var o=t.uint32(),u=o>>>3;if(u>0&&i[u]){var a=i[u][0],c=i[u][1];if("{"===c.charAt(0)){r[a]===wh.util.emptyObject&&(r[a]={});var h=s.$namespace[c].decode(t,t.uint32());r[a][h.$1]=h.$2}else if("["===c.charAt(0)||"<"===c.charAt(0)){c=c.substring(1),r[a]&&r[a].length||(r[a]=[]);if(void 0!==Th[c=!Rh[c]&&!Eh[c].decode?"int32":c]&&2==(7&o))for(var f=t.uint32()+t.pos;t.pos<f;)r[a].push(Rh.$.call(t,c));else r[a].push(Rh.$.call(t,c))}else r[a]=Rh.$.call(t,c)}else t.skipType(7&o)}return r},s.encode=function(t,e){for(var n in e||(e=wh.Writer.create()),i){var r=i[n][0],o=i[n][1];if("{"===o.charAt(0)){if(null!=t[r]&&t.hasOwnProperty(r))for(var u=0,a=Object.keys(t[r]);u<a.length;++u)e.uint32(n<<3|2).fork(),s.$namespace[o].encode({$1:a[u],$2:t[r][a[u]]},e).ldelim()}else if("["===o.charAt(0)||"<"===o.charAt(0)){var c="<"===o.charAt(0);o=o.substring(1);var h=t[r];if(null!=h&&h.length){if(o=void 0===Oh[o]&&!Eh[o].encode?"int32":o,c&&void 0!==Th[o]){e.uint32(n<<3|2).fork();for(u=0;u<h.length;u++)Ih[o].call(e,h[u]);e.ldelim()}else for(u=0;u<h.length;u++)Ih.$.call(e,o,h[u],n)}}else null!=t[r]&&t.hasOwnProperty(r)&&Ih.$.call(e,o,t[r],n)}return e},Object.keys(r).length&&(s.$namespace=t(r,e+"."+n,s.$namespace||{},!0)),s}(i[u].$m,u)}else i[u].$s?n[u]=function(t,i){function n(t,i,e){wh.rpc.Service.call(this,t,i,e)}return(n.prototype=Object.create(wh.rpc.Service.prototype)).constructor=n,n.create=function(t,i,e){return new n(t,i,e)},Object.keys(t).forEach((function(s){var r=t[s];function o(t,i){return this.rpcCall(o,Eh[r[0]],Eh[r[1]],t,i)}Object.defineProperty(o,"name",{value:s}),Object.defineProperty(o,"path",{value:`${e}.${i}`}),n.prototype[s]=o})),n}(i[u].$s,u):i[u].$e&&Object.values(i[u].$e).every((function(t){return Number(t)===t}))&&(n[u]=function(t){for(var i=Object.keys(t),e={},n=0;n<i.length;n++)e[e[i[n]]=t[i[n]]]=i[n];return e}(i[u].$e));n[u]&&!s&&(Eh[`${e}.${u}`]=n[u]),delete i[u].$m,delete i[u].$s,delete i[u].$e,n[u]=t(i[u],Boolean(e)?`${e}.${u}`:u,n[u]||{})}return n}({rtc:{generalpclib:{CmbType:{$e:{CMD_TYPE_BUSINESS_REQUEST:100,CMD_TYPE_BUSINESS_RESPONSE:101}},Header:{$m:{1:["cmd","uint32",0]}}},liveroom_cs_v3:{AddStreamReq:{$m:{1:["stream_id","bytes",[]],2:["stream_title","bytes",[]],3:["stream_type","uint32",0],4:["stream_attr","bytes",[]],5:["extra_info","bytes",[]],6:["client_req_seq","uint32",0],7:["third_token","bytes",[]],8:["censor_mode","uint32",0],9:["need_gather","uint32",0],11:["stream_attr_opts","rtc.liveroom_cs_v3.StreamAttrOptions",null],12:["sdk_custom","bytes",[]]}},AddStreamRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["stream_seq","uint32",0],3:["stream_sid","string",""],4:["stream_ver","uint32",0],5:["stream_nid","uint32",0],6:["token_remain_time","uint32",0]}},AnchorInfo:{$m:{1:["id_name","bytes",[]],2:["user_id","uint64",{low:0,high:0,unsigned:!0}],3:["nick_name","bytes",[]]}},BigImData:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["msg_id","bytes",[]],5:["msg_category","uint32",0],6:["msg_type","uint32",0],7:["msg_content","bytes",[]],8:["msg_timestamp","int64",{low:0,high:0,unsigned:!1}]}},CapabilityParams:{$m:{1:["video_codec","uint32",0],2:["gop_mode","uint32",0],3:["nego_types","uint32",0]}},CapabilityResult:{$m:{1:["nego_type","uint32",0],2:["video_codec","uint32",0],3:["gop_mode","uint32",0]}},CommonRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},DeleteStreamReq:{$m:{1:["stream_sid","string",""],2:["stream_id","bytes",[]],3:["client_req_seq","uint32",0]}},DeleteStreamRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["stream_seq","uint32",0],3:["stream_ver","uint32",0]}},EnterRoomReq:{$m:{1:["net_type","uint32",0],2:["conn_type","uint32",0],3:["room_id","bytes",[]],4:["room_name","bytes",[]],5:["role","uint32",0],6:["third_token","bytes",[]],7:["room_create_flag","uint32",0],8:["user_state_flag","uint32",0],9:["user_count_limit","uint32",0],10:["relate_service","string",""],11:["need_gather_stream","uint32",0],12:["callback_data","bytes",[]],13:["service_flags","uint32",0],14:["license_token","bytes",[]],15:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],16:["capabilities","rtc.liveroom_cs_v3.CapabilityParams",null]}},EnterRoomRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],3:["room_session_id","uint64",{low:0,high:0,unsigned:!0}],4:["user_id","uint64",{low:0,high:0,unsigned:!0}],5:["ret_timestamp","int64",{low:0,high:0,unsigned:!1}],6:["big_im_time_window","uint32",0],7:["liveroom_hb_interval","uint32",0],8:["liveroom_hb_timeout","uint32",0],9:["online_count","uint32",0],10:["anchor_info","rtc.liveroom_cs_v3.AnchorInfo",null],11:["userlist_merge_timeout","uint32",0],12:["userlist_interval","uint32",0],13:["token_remain_time","uint32",0],14:["trans_list_seq","uint32",0],15:["trans_channel_list","<rtc.liveroom_cs_v3.TransChannel",null],16:["stream_count","uint32",0],17:["stream_list_seq","uint32",0],18:["stream_info_list","<rtc.liveroom_cs_v3.StreamInfo",null],19:["stream_fetch_flag","uint32",0],20:["stream_list_push_merge_timeout","uint32",0],21:["stream_list_hb_merge_timeout","uint32",0],22:["relate_result_list","<rtc.liveroom_cs_v3.RelateResult",null],23:["gather_list_seq","uint32",0],24:["gather_info_list","<rtc.liveroom_cs_v3.GatherInfo",null]}},EnumSignalTransmitResult:{$e:{ok:0,version_err:1}},EnumSignalTransparentMsgType:{$e:{SignalTransparentMsgTypeSDK:0,SignalTransparentMsgTypeServer:1,SignalTransparentMsgTypeBoth:2}},GatherInfo:{$m:{1:["gather_id","string",""]}},GetCapabilityReq:{$m:{}},GetCapabilityRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["capability_seq","int64",{low:0,high:0,unsigned:!1}],4:["capability_collection","<rtc.liveroom_cs_v3.CapabilityResult",null]}},GetGatherListReq:{$m:{}},GetGatherListRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["gather_list_seq","uint32",0],3:["gather_info_list","<rtc.liveroom_cs_v3.GatherInfo",null]}},GetImReq:{$m:{1:["msg_id","uint64",{low:0,high:0,unsigned:!0}],2:["sort_type","uint32",0],3:["msg_count","uint32",0]}},GetImRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["server_msg_id","uint64",{low:0,high:0,unsigned:!0}],3:["ret_msg_id","uint64",{low:0,high:0,unsigned:!0}],4:["msg_list","<rtc.liveroom_cs_v3.GetImRspImData",null]}},GetImRspImData:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["msg_id","uint64",{low:0,high:0,unsigned:!0}],5:["msg_category","uint32",0],6:["msg_type","uint32",0],7:["msg_content","bytes",[]],8:["send_time","int64",{low:0,high:0,unsigned:!1}]}},GetStreamListReq:{$m:{}},GetStreamListRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["stream_list_seq","uint32",0],3:["stream_info_list","<rtc.liveroom_cs_v3.StreamInfo",null],4:["stream_refresh","uint32",0]}},GetTransReq:{$m:{1:["trans_channel","bytes",[]],2:["trans_list","<rtc.liveroom_cs_v3.GetTransReqTransData",null]}},GetTransReqTransData:{$m:{1:["trans_type","bytes",[]],2:["trans_local_seq","uint32",0]}},GetTransRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["trans_channel","bytes",[]],3:["trans_list_seq","uint32",0],4:["trans_list","<rtc.liveroom_cs_v3.GetTransRspTransData",null]}},GetTransRspTransData:{$m:{1:["err_code","uint32",0],2:["trans_type","bytes",[]],3:["trans_data","bytes",[]],4:["trans_send_time","int64",{low:0,high:0,unsigned:!1}],5:["trans_seq","uint32",0],6:["id_name","bytes",[]],7:["nick_name","bytes",[]],8:["role","uint32",0]}},GetUserCountReq:{$m:{}},GetUserCountRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["get_interval","int64",{low:0,high:0,unsigned:!1}],3:["user_count","uint32",0],4:["admin_user_count","uint32",0]}},GetUserlistReq:{$m:{1:["sort_type","uint32",0],2:["user_index","uint32",0]}},GetUserlistRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["server_user_seq","uint64",{low:0,high:0,unsigned:!0}],3:["server_user_index","int64",{low:0,high:0,unsigned:!1}],4:["ret_user_index","int64",{low:0,high:0,unsigned:!1}],5:["user_base_info_list","<rtc.liveroom_cs_v3.UserBaseInfo",null]}},GetUserTransReq:{$m:{1:["trans_channel","bytes",[]],2:["user_trans_list","<rtc.liveroom_cs_v3.GetUserTransReqTransData",null]}},GetUserTransReqTransData:{$m:{1:["trans_type","bytes",[]],2:["trans_local_seq","uint32",0]}},GetUserTransRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["trans_channel","bytes",[]],3:["user_trans_list","<rtc.liveroom_cs_v3.GetUserTransRspTransData",null]}},GetUserTransRspTransData:{$m:{1:["err_code","uint32",0],2:["trans_type","bytes",[]],3:["trans_data","bytes",[]],4:["trans_send_time","int64",{low:0,high:0,unsigned:!1}],5:["trans_seq","uint32",0],6:["id_name","bytes",[]],7:["nick_name","bytes",[]],8:["role","uint32",0]}},HbReq:{$m:{}},HbRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["ret_timestamp","int64",{low:0,high:0,unsigned:!1}],3:["hb_interval","uint32",0],4:["hb_timeout","uint32",0],5:["stream_seq","uint32",0],6:["user_seq","int64",{low:0,high:0,unsigned:!1}],7:["online_count","uint32",0],8:["big_im_time_window","uint32",0],9:["trans_channel_list","<rtc.liveroom_cs_v3.TransChannel",null],10:["user_trans_channel_list","<rtc.liveroom_cs_v3.TransChannel",null],11:["stream_refresh","uint32",0],12:["trans_list_seq","uint32",0],13:["gather_list_seq","uint32",0],14:["capability_seq","int64",{low:0,high:0,unsigned:!1}]}},ImData:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["msg_id","uint64",{low:0,high:0,unsigned:!0}],5:["msg_category","uint32",0],6:["msg_type","uint32",0],7:["msg_content","bytes",[]],8:["send_time","int64",{low:0,high:0,unsigned:!1}]}},LiveroomSessionInfo:{$m:{1:["RoomId","bytes",[]],2:["UserSessionId","uint64",{low:0,high:0,unsigned:!0}],3:["RoomSessionId","uint64",{low:0,high:0,unsigned:!0}],4:["Role","uint32",0]}},PushBigIm:{$m:{1:["msg_list","<rtc.liveroom_cs_v3.BigImData",null]}},PushCapabilityChange:{$m:{1:["capability_seq","int64",{low:0,high:0,unsigned:!1}],3:["capability_collection","<rtc.liveroom_cs_v3.CapabilityResult",null]}},PushChannelMsg:{$m:{1:["sender_idname","bytes",[]],2:["sender_nickname","bytes",[]],3:["channel_type","uint32",0],4:["msg_type","uint32",0],5:["msg_content","bytes",[]]}},PushIm:{$m:{1:["server_msg_id","uint64",{low:0,high:0,unsigned:!0}],2:["ret_msg_id","uint64",{low:0,high:0,unsigned:!0}],4:["msg_list","<rtc.liveroom_cs_v3.ImData",null]}},PushStartGather:{$m:{1:["gather_id","string",""],2:["gather_seq","uint32",0]}},PushStopGather:{$m:{1:["gather_id","string",""],2:["gather_seq","uint32",0]}},PushStream:{$m:{1:["stream_seq","uint32",0],2:["stream_info_list","<rtc.liveroom_cs_v3.PushStreamInfo",null]}},PushStreamInfo:{$m:{1:["stream_id","bytes",[]],2:["stream_sid","string",""],3:["id_name","bytes",[]],4:["nick_name","bytes",[]],5:["stream_title","bytes",[]],6:["stream_ver","uint32",0],7:["stream_attr","bytes",[]],8:["stream_src","uint32",0],9:["stream_state","uint32",0],10:["stream_type","uint32",0],11:["stream_nid","uint32",0],12:["extra_info","bytes",[]],13:["create_time","int64",{low:0,high:0,unsigned:!1}],14:["close_type","uint32",0],15:["need_gather","uint32",0],17:["stream_attr_opts","rtc.liveroom_cs_v3.StreamAttrOptions",null],18:["sdk_custom","bytes",[]]}},PushTrans:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["trans_type","bytes",[]],5:["trans_data","bytes",[]],6:["trans_seq","uint32",0],7:["trans_send_time","int64",{low:0,high:0,unsigned:!1}],8:["trans_channel","bytes",[]],9:["trans_list_seq","uint32",0]}},PushTransparentMsg:{$m:{1:["msg_data","bytes",[]],2:["client_seq","uint64",{low:0,high:0,unsigned:!0}],3:["sender_idname","bytes",[]],4:["sender_nickname","bytes",[]]}},PushUserInfoUpdated:{$m:{1:["server_user_seq","int64",{low:0,high:0,unsigned:!1}],2:["user_action_list","<rtc.liveroom_cs_v3.UserAction",null]}},PushUserKickout:{$m:{1:["id_name","bytes",[]],2:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],3:["kickout_reason","int32",0],4:["custom_reason","bytes",[]]}},PushUserLogReport:{$m:{}},PushUserTokenExpire:{$m:{1:["token","string",""],2:["stop_stream_info","rtc.liveroom_cs_v3.StopStream",null]}},PushUserTrans:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0],4:["trans_send_time","int64",{low:0,high:0,unsigned:!1}],5:["trans_channel","bytes",[]],6:["trans_seq_list","<rtc.liveroom_cs_v3.PushUserTransInfo",null]}},PushUserTransInfo:{$m:{1:["trans_type","bytes",[]],2:["trans_data","bytes",[]],3:["trans_seq","uint32",0]}},QuitRoomReq:{$m:{}},QuitRoomRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},RelateResult:{$m:{1:["service","string",""],2:["relate_result","uint32",0]}},RenewTokenReq:{$m:{1:["token","string",""]}},RenewTokenRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["token_remain_time","uint32",0],3:["stop_stream_id_list","<bytes",null]}},RspHead:{$m:{1:["code","uint32",0],2:["message","string",""]}},SendBigImReq:{$m:{1:["msg_list","<rtc.liveroom_cs_v3.SendBigImReqMsgData",null]}},SendBigImReqMsgData:{$m:{1:["msg_category","uint32",0],2:["msg_type","uint32",0],3:["msg_content","bytes",[]],4:["msg_timestamp","int64",{low:0,high:0,unsigned:!1}],5:["msg_client_id","bytes",[]]}},SendBigImRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["big_im_time_window","uint32",0],3:["msg_list","<rtc.liveroom_cs_v3.SendBigImRspMsgData",null]}},SendBigImRspMsgData:{$m:{1:["msg_id","bytes",[]],2:["msg_client_id","bytes",[]]}},SendChannelMsgReq:{$m:{1:["channel_type","uint32",0],2:["msg_type","uint32",0],3:["msg_content","bytes",[]],4:["to_user_list","<bytes",null]}},SendChannelMsgRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},SendImReq:{$m:{1:["msg_category","uint32",0],2:["msg_type","uint32",0],3:["msg_content","bytes",[]],4:["to_user_list","<rtc.liveroom_cs_v3.ToUser",null]}},SendImRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["msg_id","uint64",{low:0,high:0,unsigned:!0}]}},SetTransReq:{$m:{1:["trans_type","bytes",[]],2:["trans_data","bytes",[]],3:["trans_local_seq","uint32",0],4:["trans_channel","bytes",[]]}},SetTransRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["trans_type","bytes",[]],3:["trans_seq","uint32",0],4:["trans_list_seq","uint32",0],5:["trans_channel","bytes",[]]}},SetUserAttrReq:{$m:{1:["use_data_channel","uint32",0],2:["is_modify_use_data_channel","bool",!1],3:["user_type","uint32",0],4:["is_modify_user_type","bool",!1]}},SetUserAttrRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},SignalLiveCustomReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<rtc.liveroom_cs_v3.ToUser",null]}},SignalLiveCustomRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},SignalLiveInviteReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<rtc.liveroom_cs_v3.ToUser",null]}},SignalLiveInviteRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},SignalLiveRequestReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<rtc.liveroom_cs_v3.ToUser",null]}},SignalLiveRequestRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},SignalLiveResultReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<rtc.liveroom_cs_v3.ToUser",null]}},SignalLiveResultRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},SignalLiveStopReq:{$m:{1:["push_message","bytes",[]],2:["to_user_list","<rtc.liveroom_cs_v3.ToUser",null]}},SignalLiveStopRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},SignalTransmitReq:{$m:{1:["to_user_list","<bytes",null],2:["transmit_data","bytes",[]]}},SignalTransmitResult:{$m:{1:["to_user","bytes",[]],2:["result","rtc.liveroom_cs_v3.EnumSignalTransmitResult",0]}},SignalTransmitRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["result","<rtc.liveroom_cs_v3.SignalTransmitResult",null]}},SignalTransparentMsgReq:{$m:{1:["msg_type","rtc.liveroom_cs_v3.EnumSignalTransparentMsgType",0],2:["msg_data","bytes",[]],3:["to_user_list","<bytes",null],4:["client_seq","uint64",{low:0,high:0,unsigned:!0}]}},SignalTransparentMsgRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null]}},StopStream:{$m:{1:["stream_id_list","<bytes",null]}},StreamAttrOptions:{$m:{1:["stream_resource","sint32",0],2:["stream_codec","sint32",0],3:["play_mode","uint32",0],4:["forbid_play_expire_time","int64",{low:0,high:0,unsigned:!1}],5:["censor_flag","int32",0]}},StreamInfo:{$m:{1:["stream_id","bytes",[]],2:["stream_sid","string",""],3:["id_name","bytes",[]],4:["nick_name","bytes",[]],5:["stream_title","bytes",[]],6:["stream_ver","uint32",0],7:["stream_attr","bytes",[]],8:["create_time","int64",{low:0,high:0,unsigned:!1}],9:["stream_src","uint32",0],10:["stream_state","uint32",0],11:["stream_type","uint32",0],12:["stream_nid","uint32",0],13:["extra_info","bytes",[]],14:["need_gather","uint32",0],16:["stream_attr_opts","rtc.liveroom_cs_v3.StreamAttrOptions",null],17:["sdk_custom","bytes",[]]}},ToUser:{$m:{1:["id_name","bytes",[]],2:["user_id","uint64",{low:0,high:0,unsigned:!0}]}},TransChannel:{$m:{1:["trans_channel","bytes",[]],2:["trans_seq_list","<rtc.liveroom_cs_v3.TransSeq",null]}},TransSeq:{$m:{1:["trans_type","bytes",[]],2:["trans_seq","uint32",0]}},UpdateStreamAttrReq:{$m:{1:["stream_id","bytes",[]],2:["client_req_seq","uint32",0],3:["update_flag","uint32",0],5:["stream_attr_opts","rtc.liveroom_cs_v3.StreamAttrOptions",null],6:["sdk_custom","bytes",[]]}},UpdateStreamAttrRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["stream_seq","uint32",0]}},UpdateStreamReq:{$m:{1:["stream_sid","string",""],2:["stream_id","bytes",[]],3:["stream_title","bytes",[]],4:["stream_attr","bytes",[]],5:["extra_info","bytes",[]],6:["client_req_seq","uint32",0],7:["nick_name","bytes",[]]}},UpdateStreamRsp:{$m:{1:["rsp_head","rtc.liveroom_cs_v3.RspHead",null],2:["stream_seq","uint32",0],3:["stream_ver","uint32",0]}},UserAction:{$m:{1:["action","uint32",0],2:["id_name","bytes",[]],3:["nick_name","bytes",[]],4:["role","uint32",0],5:["login_time","int64",{low:0,high:0,unsigned:!1}]}},UserBaseInfo:{$m:{1:["id_name","bytes",[]],2:["nick_name","bytes",[]],3:["role","uint32",0]}}},logreport:{ChargeInfo:{$m:{1:["is_publishing","uint32",0],2:["play_stream_resolution_infos","<rtc.logreport.ResolutionInfo",null],3:["play_max_audio_bitrate","uint32",0],4:["no_playing","uint32",0],5:["p2p_charge_info","rtc.logreport.P2PChargeInfo",null],6:["sample_time_offset","uint32",0],7:["play_l3_stream_resolution_infos","<rtc.logreport.ResolutionInfo",null],8:["play_l3_max_audio_bitrate","uint32",0]}},ChargeInfos:{$m:{1:["timestamp_offset_begin","uint32",0],2:["timestamp_offset_end","uint32",0],3:["timestamp_diff_flag","uint32",0],4:["timestamp_diff","uint32",0],5:["room_id","string",""],6:["play_iframe","uint32",0],100:["infos","<rtc.logreport.ChargeInfo",null]}},DynQualityEvent:{$m:{1:["seq_no","string",""],2:["num","uint32",0],3:["dyn_quality_infos","<rtc.logreport.DynQualityInfos",null],4:["device_id","string",""],5:["latitude","uint32",0],6:["longitude","uint32",0],7:["country","string",""],8:["region","string",""],9:["city","string",""],10:["isp","string",""],11:["ve_mode","uint32",0]}},DynQualityInfo:{$m:{1:["time","uint64",{low:0,high:0,unsigned:!0}],2:["plr","uint32",0],3:["rtt","uint32",0],4:["score","uint32",0],5:["sample_time","uint32",0]}},DynQualityInfos:{$m:{1:["timestamp_offset_begin","uint64",{low:0,high:0,unsigned:!0}],2:["timestamp_offset_end","uint64",{low:0,high:0,unsigned:!0}],3:["server_ip","string",""],4:["infos","<rtc.logreport.DynQualityInfo",null],5:["network_type","uint32",0],6:["stream_id","string",""]}},HardwareInfo:{$m:{1:["sys_cpu_used","uint32",0],2:["app_cpu_used","uint32",0],3:["sys_mem_used","uint32",0],4:["app_mem_used","uint32",0],5:["sample_time_offset","uint32",0]}},HardwareInfos:{$m:{1:["timestamp_offset_begin","uint32",0],2:["timestamp_offset_end","uint32",0],3:["infos","<rtc.logreport.HardwareInfo",null],4:["sys_mem_total","uint32",0]}},NoBillingEvent:{$m:{1:["platform_info","string",""],2:["room_id","string",""]}},P2PChargeInfo:{$m:{1:["media_inc","uint64",{low:0,high:0,unsigned:!0}],2:["data_inc","uint64",{low:0,high:0,unsigned:!0}]}},PlayQualityInfo:{$m:{1:["audio_bitrate","uint32",0],2:["video_bitrate","uint32",0],3:["video_network_fps","uint32",0],4:["audio_break_count","uint32",0],5:["video_break_count","uint32",0],6:["downlink_plr","uint32",0],7:["peer_to_peer_plr","uint32",0],8:["peer_to_peer_delay","uint32",0],9:["audio_network_fps","uint32",0],10:["audio_break_duration","uint32",0],11:["video_break_duration","uint32",0],12:["audio_break_rate","uint32",0],13:["video_break_rate","uint32",0],14:["audio_break_cancel","uint32",0],15:["video_break_cancel","uint32",0],16:["rtt","uint32",0],17:["rendered_sound_level","uint32",0],18:["audio_break_cancel_duration","uint32",0],19:["video_break_cancel_duration","uint32",0],20:["audio_decode_time","uint32",0],21:["video_decode_time","uint32",0],22:["real_sampling_interval","uint32",0],23:["mos","int32",0],24:["audio_decode_fps","uint32",0],25:["video_decode_fps","uint32",0],26:["video_frames_decoded","uint32",0],27:["video_frames_dropped","uint32",0],28:["quality","int32",0],29:["evaluation_quality","int32",0],30:["break_stat_duration","uint32",0],31:["sample_time_offset","uint32",0],32:["peer_to_peer_net_delay","uint32",0],33:["audio_render_fps","uint32",0],34:["video_render_fps","uint32",0],35:["video_frame_interval_standard_deviation","uint32",0],100:["sample_time_window","uint32",0]}},PlayQualityInfos:{$m:{1:["timestamp_offset_begin","uint32",0],2:["timestamp_offset_end","uint32",0],3:["stream_id","string",""],4:["session_id","uint32",0],5:["video_width","uint32",0],6:["video_height","uint32",0],7:["ipv4","uint32",0],8:["ipv6","string",""],9:["resource_type","uint32",0],10:["infos","<rtc.logreport.PlayQualityInfo",null],11:["room_id","string",""],13:["session","string",""],14:["room_session_id","uint64",{low:0,high:0,unsigned:!0}],15:["protocol_type","uint32",0],16:["product","uint32",0],17:["resource_flag","uint32",0]}},PublishQualityInfo:{$m:{1:["audio_bitrate","uint32",0],2:["video_bitrate","uint32",0],3:["video_capture_fps","uint32",0],4:["video_network_fps","uint32",0],5:["uplink_plr","uint32",0],6:["rtt","uint32",0],7:["audio_network_fps","uint32",0],8:["captured_sound_level","uint32",0],9:["quality","uint32",0],10:["sample_time_offset","uint32",0],11:["tc_setting_audio_bitrate","uint32",0],12:["tc_setting_video_bitrate","uint32",0],13:["audio_capture_fps","uint32",0],14:["video_encode_fps","uint32",0],100:["sample_time_window","uint32",0]}},PublishQualityInfos:{$m:{1:["timestamp_offset_begin","uint32",0],2:["timestamp_offset_end","uint32",0],3:["stream_id","string",""],4:["session_id","uint32",0],5:["video_width","uint32",0],6:["video_height","uint32",0],7:["ipv4","uint32",0],8:["ipv6","string",""],9:["resource_type","uint32",0],10:["infos","<rtc.logreport.PublishQualityInfo",null],11:["room_id","string",""],13:["evnvironment","uint32",0],14:["ap","string",""],15:["session","string",""],16:["room_session_id","uint64",{low:0,high:0,unsigned:!0}],17:["protocol_type","uint32",0],18:["setting_video_bitrate","uint32",0],19:["setting_audio_bitrate","uint32",0],20:["setting_video_fps","uint32",0],21:["resource_flag","uint32",0]}},QualityEvent:{$m:{1:["hardware_infos","rtc.logreport.HardwareInfos",null],2:["publish_quality_infos","<rtc.logreport.PublishQualityInfos",null],3:["play_quality_infos","<rtc.logreport.PlayQualityInfos",null],4:["network_type","uint32",0],5:["charge_infos","rtc.logreport.ChargeInfos",null],6:["server_time","int64",{low:0,high:0,unsigned:!1}],100:["client_type","uint32",0]},ResourceType:{$e:{UNKNOWN:0,CDN:1,RTC:2,L3:3,P2P:4}}},ResolutionInfo:{$m:{1:["video_width","uint32",0],2:["video_height","uint32",0],3:["count","uint32",0]}},SpeedLogHead:{$m:{1:["version","uint32",0],2:["signature","bytes",[]],3:["timestamp","uint32",0],4:["event","uint32",0],5:["app_id","uint32",0],6:["user_id","string",""],7:["biz_type","uint32",0],8:["device_id","string",""],9:["lite_sign","bytes",[]],10:["token","bytes",[]],11:["os_type","string",""],12:["sdk_version","string",""],13:["time_offset","int64",{low:0,high:0,unsigned:!1}],14:["scenario","uint32",0],15:["report_version","uint32",0],16:["customer_context","uint32",0],17:["extlib_type","uint32",0]},BizType:{$e:{UNKNOWN:0,LIVE:1,RTV:2}},Event:{$e:{QUALITY_EVENT:0,NO_BILLING_EVENT:100,DETECT_QUALITY_EVENT:300}},ProtoVersion:{$e:{PROTO_VERSION:0,PROTO_VERSION1:1,PROTO_VERSION2:2,PROTO_VERSION3:3,PROTO_VERSION4:4,PROTO_VERSION5:5,PROTO_VERSION6:6,PROTO_VERSION7:7,PROTO_VERSION8:8,PROTO_VERSION9:9,PROTO_VERSION10:10,PROTO_VERSION11:11,PROTO_VERSION12:12,PROTO_VERSION13:13,PROTO_VERSION14:14,PROTO_VERSION15:15,PROTO_VERSION16:16,PROTO_VERSION17:17,PROTO_VERSION18:18,PROTO_VERSION19:19,PROTO_VERSION20:20,PROTO_VERSION21:21,PROTO_VERSION22:22}},ZegoScenario:{$e:{ZEGO_SCENARIO_GENERAL:0,ZEGO_SCENARIO_COMMUNICATION:1,ZEGO_SCENARIO_LIVE:2,ZEGO_SCENARIO_DEFAULT:3,ZEGO_SCENARIO_STANDARD_VIDEO_CALL:4,ZEGO_SCENARIO_HIGH_QUALITY_VIDEO_CALL:5,ZEGO_SCENARIO_STANDARD_CHATROOM:6,ZEGO_SCENARIO_HIGH_QUALITY_CHATROOM:7,ZEGO_SCENARIO_BROADCAST:8,ZEGO_SCENARIO_KARAOKE:9,ZEGO_SCENARIO_STANDARD_VOICE_CALL:10,ZEGO_SCENARIO_UNDEFINED:99}}},SpeedLogRsp:{$m:{1:["code","uint32",0],2:["message","string",""]}}},proto_switch_v3:{AnchorInfo:{$m:{1:["id_name","bytes",[]],2:["user_id","uint64",{low:0,high:0,unsigned:!0}],3:["nick_name","bytes",[]]}},Capabilities:{$m:{1:["video_codec","uint32",0],2:["gop_mode","uint32",0]}},CommonRsp:{$m:{1:["rsp_head","rtc.proto_switch_v3.RspHead",null]}},GatherInfo:{$m:{1:["gather_id","string",""]}},Header:{$m:{1:["cmd","uint32",0],2:["seq","uint32",0],3:["timestamp","int64",{low:0,high:0,unsigned:!1}],4:["controls","bytes",[]],5:["flags","bytes",[]],6:["context_key","uint32",0],101:["dev_traffic_label","bytes",[]]}},LiveroomProtoVersion:{$e:{PROTO_VERSION_NONE:0,RPOTO_V020000:131072}},LoginRoomReq:{$m:{1:["app_id","uint32",0],2:["biz_type","uint32",0],3:["room_id","bytes",[]],4:["room_name","bytes",[]],5:["role","uint32",0],6:["id_name","bytes",[]],7:["nick_name","bytes",[]],8:["device_id","string",""],9:["term_type","rtc.proto_switch_v3.TermType",0],10:["net_type","rtc.proto_switch_v3.NetType",0],11:["sdk_conn_type","rtc.proto_switch_v3.SdkConnType",0],12:["sdk_version","uint32",0],13:["biz_version","string",""],14:["client_stamp","bytes",[]],15:["login_logic","uint32",0],16:["third_token","bytes",[]],17:["login_token","bytes",[]],18:["relogin_token","bytes",[]],19:["switch_session_id","uint64",{low:0,high:0,unsigned:!0}],20:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],21:["room_create_flag","uint32",0],22:["user_state_flag","uint32",0],23:["user_count_limit","uint32",0],24:["relate_service","string",""],25:["need_gather_stream","uint32",0],26:["callback_data","bytes",[]],27:["service_flags","uint32",0],28:["license_token","bytes",[]],29:["relogin_type","rtc.proto_switch_v3.ReloginType",0],30:["Capabilities","rtc.proto_switch_v3.Capabilities",null]}},LoginRoomRsp:{$m:{1:["rsp_head","rtc.proto_switch_v3.RspHead",null],2:["switch_session_id","uint64",{low:0,high:0,unsigned:!0}],3:["user_session_id","uint64",{low:0,high:0,unsigned:!0}],4:["room_session_id","uint64",{low:0,high:0,unsigned:!0}],5:["user_id","uint64",{low:0,high:0,unsigned:!0}],6:["ret_timestamp","int64",{low:0,high:0,unsigned:!1}],7:["big_im_time_window","uint32",0],8:["liveroom_hb_interval","uint32",0],9:["liveroom_hb_timeout","uint32",0],10:["online_count","uint32",0],11:["anchor_info","rtc.proto_switch_v3.AnchorInfo",null],12:["relogin_token","bytes",[]],13:["userlist_merge_timeout","uint32",0],14:["userlist_interval","uint32",0],15:["token_remain_time","uint32",0],16:["trans_list_seq","uint32",0],17:["trans_channel_list","<rtc.proto_switch_v3.TransChannel",null],18:["stream_count","uint32",0],19:["stream_list_seq","uint32",0],20:["stream_info_list","<rtc.proto_switch_v3.StreamInfo",null],21:["stream_fetch_flag","uint32",0],22:["stream_list_push_merge_timeout","uint32",0],23:["stream_list_hb_merge_timeout","uint32",0],24:["relate_result_list","<rtc.proto_switch_v3.RelateResult",null],25:["gather_list_seq","uint32",0],26:["gather_info_list","<rtc.proto_switch_v3.GatherInfo",null]}},LogoutRoomReq:{$m:{2:["logout_check","bytes",[]]}},LogoutRoomRsp:{$m:{1:["rsp_head","rtc.proto_switch_v3.RspHead",null]}},MergePushHead:{$m:{1:["qos_flag","uint32",0],2:["send_time","int64",{low:0,high:0,unsigned:!1}]}},MergePushInfo:{$m:{1:["sub_cmd","uint32",0],2:["sub_seq","uint32",0],3:["msg_body","bytes",[]]}},MergePushReq:{$m:{1:["head","rtc.proto_switch_v3.MergePushHead",null],2:["message_list","<rtc.proto_switch_v3.MergePushInfo",null]}},MergePushRsp:{$m:{1:["message_list","<rtc.proto_switch_v3.MergePushRspInfo",null],2:["server_send_time","int64",{low:0,high:0,unsigned:!1}]}},MergePushRspInfo:{$m:{1:["sub_cmd","uint32",0],2:["sub_seq","uint32",0]}},NetType:{$e:{NT_NONE:0,NT_LINE:1,NT_WIFI:2,NT_2G:3,NT_3G:4,NT_4G:5,NT_UNKNOWN:32}},PushKickout:{$m:{1:["reason","uint32",0],2:["message","string",""],3:["is_need_relogin","uint32",0]}},PushReq:{$m:{1:["head","rtc.proto_switch_v3.PushReqHead",null],2:["msg_body","bytes",[]]}},PushReqHead:{$m:{1:["sub_cmd","uint32",0],2:["qos_flag","uint32",0],3:["send_time","int64",{low:0,high:0,unsigned:!1}]}},PushRsp:{$m:{1:["code","uint32",0],2:["message","string",""],3:["sub_cmd","uint32",0],4:["server_send_time","int64",{low:0,high:0,unsigned:!1}]}},RelateResult:{$m:{1:["service","string",""],2:["relate_result","uint32",0]}},ReloginType:{$e:{ReloginType_None:0,ReloginType_SdkAuto:1}},RspHead:{$m:{1:["code","uint32",0],2:["message","string",""]}},SdkConnType:{$e:{SdkConnType_None:0,SdkConnType_Tcp:1,SdkConnType_Websocket:2}},StreamAttrOptions:{$m:{1:["stream_resource","sint32",0],2:["stream_codec","sint32",0],3:["play_mode","uint32",0],4:["forbid_play_expire_time","int64",{low:0,high:0,unsigned:!1}],5:["censor_flag","int32",0]}},StreamInfo:{$m:{1:["stream_id","bytes",[]],2:["stream_sid","string",""],3:["id_name","bytes",[]],4:["nick_name","bytes",[]],5:["create_time","int64",{low:0,high:0,unsigned:!1}],6:["extra_info","bytes",[]],7:["title","bytes",[]],8:["stream_ver","uint32",0],9:["stream_attr","bytes",[]],10:["stream_src","uint32",0],11:["stream_state","uint32",0],12:["stream_type","uint32",0],13:["stream_nid","uint32",0],14:["need_gather","uint32",0],16:["stream_attr_opts","rtc.proto_switch_v3.StreamAttrOptions",null],17:["sdk_custom","bytes",[]]}},TermType:{$e:{TT_NONE:0,TT_PC:1,TT_IOS:2,TT_ANDROID:3,TT_MAC:4,TT_LINUX:5,TT_WEB:6,TT_MINI_PROGRAM:7,TT_UNKNOWN:32}},TransChannel:{$m:{1:["trans_channel","bytes",[]],2:["trans_seq_list","<rtc.proto_switch_v3.TransSeq",null]}},TransSeq:{$m:{1:["trans_type","bytes",[]],2:["trans_seq","uint32",0]}}},webproxy:{HTTPHeader:{$m:{1:["name","string",""],2:["val","string",""]}},HTTPRequest:{$m:{1:["appid","uint32",0],2:["biz_type","uint32",0],3:["mode","rtc.webproxy.Mode",0],4:["id_name","string",""],5:["token","string",""],6:["url","string",""],7:["method","rtc.webproxy.Method",0],8:["headers","<rtc.webproxy.HTTPHeader",null],9:["body","bytes",[]]}},HTTPResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","rtc.webproxy.HTTPResponseData",null]}},HTTPResponseData:{$m:{1:["status_code","int32",0],2:["headers","<rtc.webproxy.HTTPHeader",null],3:["body","bytes",[]]}},IntranetCheckRequest:{$m:{1:["appid","uint32",0],2:["biz_type","uint32",0],3:["mode","rtc.webproxy.Mode",0],4:["id_name","string",""],5:["token","string",""],6:["vrs_ipv4","fixed32",0],7:["vrs_ipv6","rtc.webproxy.IPv6Addr",null]}},IntranetCheckResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","rtc.webproxy.IntranetCheckResponseData",null]}},IntranetCheckResponseData:{$m:{1:["intranet","bool",!1]}},IPv6Addr:{$m:{1:["high","fixed64",{low:0,high:0,unsigned:!1}],2:["low","fixed64",{low:0,high:0,unsigned:!1}]}},Method:{$e:{METHOD_UNSET:0,METHOD_GET:1,METHOD_POST:2,METHOD_PUT:3,METHOD_PATCH:4,METHOD_DELETE:5,METHOD_HEAD:6,METHOD_OPTIONS:7}},Mode:{$e:{MODE_UNSET:0,MODE_ONLINE:1,MODE_TEST:2}},TurnInfoRequest:{$m:{1:["appid","uint32",0],2:["biz_type","uint32",0],3:["mode","rtc.webproxy.Mode",0],4:["id_name","string",""],5:["token","string",""]}},TurnInfoResponse:{$m:{1:["code","int32",0],2:["message","string",""],3:["data","rtc.webproxy.TurnInfoResponseData",null]}},TurnInfoResponseData:{$m:{1:["username","string",""],2:["password","string",""],3:["turn_ipv4","fixed32",0],4:["turn_ipv6","rtc.webproxy.IPv6Addr",null],5:["turn_port","uint32",0],6:["expiration_in_seconds","uint32",0],7:["turn_internal_ipv4","fixed32",0]}},WssBindRequest:{$m:{1:["appid","uint32",0],2:["biz_type","uint32",0],3:["mode","rtc.webproxy.Mode",0],4:["id_name","string",""],5:["token","string",""],6:["url","string",""],7:["ack","bool",!1]}},WssBindRequestAck:{$m:{}},WssBindResponse:{$m:{1:["code","int32",0],2:["message","string",""]}}},webrtc_cmd:{ActivateAudioPlayStreamReq:{$m:{1:["seq","uint32",0],2:["active","sint32",0]}},ActivateAudioPlayStreamRsp:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},ActivateSEIInsertReq:{$m:{1:["seq","uint32",0],2:["action","sint32",0],3:["info_type","uint32",0]}},ActivateSEIInsertRsp:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},ActivateVideoPlayStreamReq:{$m:{1:["seq","uint32",0],2:["active","sint32",0],3:["layer","sint32",0]}},ActivateVideoPlayStreamRsp:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},BroadcasterStatusAck:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},BroadcasterStatusNotify:{$m:{1:["seq","uint32",0],2:["status","uint32",0]}},ClientInfoAck:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},ClientInfoPush:{$m:{1:["seq","uint32",0],2:["peer_id","uint32",0],3:["clientip","string",""]}},ClosePeerAck:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},ClosePeerPush:{$m:{1:["seq","uint32",0],2:["reason","sint32",0],3:["err_info","string",""]}},ClosePeerReq:{$m:{1:["seq","uint32",0],2:["reason","sint32",0]}},ClosePeerRsp:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},HeartBeatMsgSetAck:{$m:{1:["seq","uint32",0],2:["ts","int64",{low:0,high:0,unsigned:!1}],3:["result","sint32",0]}},HeartBeatMsgSetPush:{$m:{1:["seq","uint32",0],2:["ts","int64",{low:0,high:0,unsigned:!1}],3:["payloads","<rtc.webrtc_cmd.HeatbeatPayload",null]}},HeatbeatPayload:{$m:{1:["p2p_net_stat_rsp","rtc.webrtc_cmd.Peer2PeerNetStatsGetRsp",null],2:["play_net_stat","rtc.webrtc_cmd.PlayNetStatus",null],3:["play_stats_rsp","rtc.webrtc_cmd.PlayStatsRsp",null],4:["net_quality_push","rtc.webrtc_cmd.NetQualityGradePush",null],5:["pub_net_stat","rtc.webrtc_cmd.PublishNetStatus",null],6:["pub_quality_grade_rsp","rtc.webrtc_cmd.NetQualityGradeRsp",null],7:["stream_status_push","rtc.webrtc_cmd.StreamStatusNotify",null],8:["code_err_push","rtc.webrtc_cmd.MediaCodecErrorNotify",null],9:["play_event_push","rtc.webrtc_cmd.PlayEventPush",null],10:["pub_event_push","rtc.webrtc_cmd.PublishEventPush",null]}},MediaCodecErrorAck:{$m:{1:["result","sint32",0],2:["seq","uint32",0]}},MediaCodecErrorNotify:{$m:{1:["media_type","sint32",0],2:["error_type","sint32",0],3:["seq","uint32",0]}},NetQualityGradeAck:{$m:{1:["result","sint32",0],2:["seq","uint32",0]}},NetQualityGradePush:{$m:{1:["tx_quality","sint32",0],2:["rx_quality","sint32",0],3:["seq","uint32",0]}},NetQualityGradeReq:{$m:{1:["tx_quality","sint32",0],2:["rx_quality","sint32",0],3:["seq","uint32",0]}},NetQualityGradeRsp:{$m:{1:["result","sint32",0],2:["seq","uint32",0]}},NetQualityInfoAck:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},NetQualityInfoPush:{$m:{1:["seq","uint32",0],2:["lossrate","uint32",0],3:["rtt","uint32",0]}},NetQualityProbeReq:{$m:{1:["seq","uint32",0],2:["action","sint32",0]}},NetQualityProbeRsp:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},Peer2PeerNetStatsGetReq:{$m:{1:["seq","uint32",0]}},Peer2PeerNetStatsGetRsp:{$m:{1:["seq","uint32",0],2:["result","sint32",0],3:["p2p_lost_rate","uint32",0],4:["p2p_rtt","uint32",0]}},PeerExtendParamPush:{$m:{1:["turn_username","string",""],2:["turn_auth_key","string",""],3:["candidate","string",""],4:["sdpMid","string",""],5:["sdpMLineIndex","sint32",0],6:["turn_urls","string",""],7:["peer_id","uint32",0]}},PeerExtendParams:{$m:{1:["keyframe_intv","sint32",0],2:["min_play_buf_level_ms","sint32",0],3:["tc_type","sint32",0],4:["video_content_type","sint32",0],5:["sei_filter_pass","sint32",0],6:["client_class_type","sint32",0],7:["video_stream_type","sint32",0],8:["ktv_device_delay","sint32",0],9:["sync_ntp","sint32",0],10:["auto_switch_turn_type","sint32",0],11:["zg_proxy","sint32",0],12:["coturn_internal","uint32",0],13:["play_jitter_level","sint32",0],14:["tc_focuson_mode","sint32",0],15:["tc_min_video_kbps","sint32",0],16:["proto_flags","uint32",0],17:["req_poster_type","uint32",0],18:["enable_vid_clock_rate_est","sint32",0]}},PlayEventPush:{$m:{1:["seq","uint32",0],2:["event","sint32",0]}},PlayEventPushAck:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},PlayNetStatus:{$m:{1:["audio_tx_bitrate","sint32",0],2:["video_tx_bitrate","sint32",0],3:["video_red_rate","uint32",0],4:["traffic_control_stat","sint32",0],5:["traffic_control_bandwidth","sint32",0]}},PlayStatsReq:{$m:{1:["seq","uint32",0],2:["audio_jitter_ms","uint32",0]}},PlayStatsRsp:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},PublishEventAck:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},PublishEventPush:{$m:{1:["seq","uint32",0],2:["event","sint32",0]}},PublishNetStatus:{$m:{1:["video_recv_bitrate","sint32",0],2:["traffic_control_stat","sint32",0],3:["video_lost_rate","uint32",0],4:["audio_recv_bitrate","sint32",0],5:["audio_lost_rate","uint32",0]}},RestartICEReq:{$m:{1:["ice_ufrag","string",""],2:["ice_pwd","string",""],3:["seq","uint32",0]}},RestartICERsp:{$m:{1:["result","sint32",0],2:["seq","uint32",0]}},StreamPropertyUpdate:{$m:{1:["enable_stream_alignment_when_mix","sint32",0],2:["seq","uint32",0]}},StreamPropertyUpdateAck:{$m:{1:["result","sint32",0],2:["seq","uint32",0]}},StreamStatusAck:{$m:{1:["seq","uint32",0],2:["result","sint32",0]}},StreamStatusNotify:{$m:{1:["seq","uint32",0],2:["mic_status","sint32",0],3:["camera_status","sint32",0]}},UserUnregisteredSEIFilterReq:{$m:{1:["sei_filter","string",""],2:["seq","uint32",0]}},UserUnregisteredSEIFilterRsp:{$m:{1:["result","sint32",0],2:["seq","uint32",0]}},VideoStreamSubscribeReq:{$m:{1:["type","uint32",0],2:["seq","uint32",0]}},VideoStreamSubscribeRsp:{$m:{1:["result","sint32",0],2:["seq","uint32",0]}},WebrtcCmdReqMsg:{$m:{2:["video_stream_sub","rtc.webrtc_cmd.VideoStreamSubscribeReq",null],5:["usr_sei_filter","rtc.webrtc_cmd.UserUnregisteredSEIFilterReq",null],6:["net_quality_grade","rtc.webrtc_cmd.NetQualityGradeReq",null],7:["net_quality_grade_push","rtc.webrtc_cmd.NetQualityGradePush",null],8:["peer_extend_param","rtc.webrtc_cmd.PeerExtendParams",null],9:["stream_property_update","rtc.webrtc_cmd.StreamPropertyUpdate",null],10:["peer_ext_params_push","rtc.webrtc_cmd.PeerExtendParamPush",null],11:["codec_error_notify","rtc.webrtc_cmd.MediaCodecErrorNotify",null],13:["close_peer","rtc.webrtc_cmd.ClosePeerReq",null],15:["close_peer_push","rtc.webrtc_cmd.ClosePeerPush",null],16:["stream_status","rtc.webrtc_cmd.StreamStatusNotify",null],17:["broadcaster_status","rtc.webrtc_cmd.BroadcasterStatusNotify",null],18:["publish_event","rtc.webrtc_cmd.PublishEventPush",null],19:["play_event","rtc.webrtc_cmd.PlayEventPush",null],20:["active_audio_play","rtc.webrtc_cmd.ActivateAudioPlayStreamReq",null],21:["active_video_play","rtc.webrtc_cmd.ActivateVideoPlayStreamReq",null],22:["client_info","rtc.webrtc_cmd.ClientInfoPush",null],23:["net_quality_probe","rtc.webrtc_cmd.NetQualityProbeReq",null],24:["net_quality_push","rtc.webrtc_cmd.NetQualityInfoPush",null],25:["active_sei_insert","rtc.webrtc_cmd.ActivateSEIInsertReq",null],26:["p2p_net_stats_get","rtc.webrtc_cmd.Peer2PeerNetStatsGetReq",null],27:["play_stats","rtc.webrtc_cmd.PlayStatsReq",null],28:["restart_ice","rtc.webrtc_cmd.RestartICEReq",null],29:["heartbeat_msg_push","rtc.webrtc_cmd.HeartBeatMsgSetPush",null]}},WebrtcCmdRspMsg:{$m:{2:["video_stream_sub","rtc.webrtc_cmd.VideoStreamSubscribeRsp",null],5:["usr_sei_filter","rtc.webrtc_cmd.UserUnregisteredSEIFilterRsp",null],6:["net_quality_grade","rtc.webrtc_cmd.NetQualityGradeRsp",null],7:["net_quality_grade_ack","rtc.webrtc_cmd.NetQualityGradeAck",null],8:["stream_property_update_ack","rtc.webrtc_cmd.StreamPropertyUpdateAck",null],9:["codec_error_notify_ack","rtc.webrtc_cmd.MediaCodecErrorAck",null],11:["close_peer","rtc.webrtc_cmd.ClosePeerRsp",null],13:["close_peer_ack","rtc.webrtc_cmd.ClosePeerAck",null],14:["stream_status_ack","rtc.webrtc_cmd.StreamStatusAck",null],15:["broadcaster_status_ack","rtc.webrtc_cmd.BroadcasterStatusAck",null],16:["active_audio_play","rtc.webrtc_cmd.ActivateAudioPlayStreamRsp",null],17:["active_video_play","rtc.webrtc_cmd.ActivateVideoPlayStreamRsp",null],18:["client_info_ack","rtc.webrtc_cmd.ClientInfoAck",null],19:["net_quality_probe","rtc.webrtc_cmd.NetQualityProbeRsp",null],20:["net_quality_ack","rtc.webrtc_cmd.NetQualityInfoAck",null],21:["active_sei_insert","rtc.webrtc_cmd.ActivateSEIInsertRsp",null],22:["p2p_net_stats_get","rtc.webrtc_cmd.Peer2PeerNetStatsGetRsp",null],23:["publish_event_ack","rtc.webrtc_cmd.PublishEventAck",null],24:["play_stats","rtc.webrtc_cmd.PlayStatsRsp",null],25:["restart_ice","rtc.webrtc_cmd.RestartICERsp",null],26:["play_event_ack","rtc.webrtc_cmd.PlayEventPushAck",null],27:["heartbeat_msg_ack","rtc.webrtc_cmd.HeartBeatMsgSetAck",null]}}},webrtc_proto_v2:{ActivateAudioPlayStreamReq:{$m:{1:["active","sint32",0]}},ActivateAudioPlayStreamRsp:{$m:{1:["result","sint32",0]}},ActivateSEIInsertReq:{$m:{1:["peer_id","uint32",0],2:["action","sint32",0],3:["info_type","uint32",0]}},ActivateSEIInsertRsp:{$m:{1:["peer_id","uint32",0],2:["result","sint32",0]}},ActivateVideoPlayStreamReq:{$m:{1:["active","sint32",0],2:["layer","sint32",0]}},ActivateVideoPlayStreamRsp:{$m:{1:["result","sint32",0]}},BroadcasterStatusAck:{$m:{1:["result","sint32",0]}},BroadcasterStatusNotify:{$m:{1:["status","uint32",0]}},CandidateInfoAck:{$m:{1:["result","sint32",0]}},CandidateInfoPush:{$m:{1:["infos","<rtc.webrtc_proto_v2.OneCandidateInfo",null]}},CandidateInfoReq:{$m:{1:["infos","<rtc.webrtc_proto_v2.OneCandidateInfo",null]}},CandidateInfoRsp:{$m:{1:["result","sint32",0]}},ClientInfoAck:{$m:{1:["result","sint32",0]}},ClientInfoPush:{$m:{1:["peer_id","uint32",0],2:["client_ip","string",""]}},CloseSessionAck:{$m:{1:["result","sint32",0]}},CloseSessionPush:{$m:{1:["reason","sint32",0],2:["err_info","string",""]}},CloseSessionReq:{$m:{1:["reason","sint32",0]}},CloseSessionRsp:{$m:{1:["result","sint32",0]}},CmdAck:{$m:{1:["peer_id","uint32",0],2:["cmd_id","uint32",0],3:["body","bytes",[]]}},CmdPush:{$m:{1:["peer_id","uint32",0],2:["cmd_id","uint32",0],3:["body","bytes",[]]}},CmdReq:{$m:{1:["peer_id","uint32",0],2:["cmd_id","uint32",0],3:["body","bytes",[]]}},CmdRsp:{$m:{1:["peer_id","uint32",0],2:["cmd_id","uint32",0],3:["body","bytes",[]]}},CmdType:{$e:{NONE:0,LOGIN_REQ:1,LOGIN_RSP:2,CREATE_SESSION_REQ:3,CREATE_SESSION_RSP:4,CREATE_SESSION_WITH_SDP_REQ:5,CREATE_SESSION_WITH_SDP_RSP:6,SESSION_RESET_PUSH:7,SESSION_RESET_ACK:8,PUBLISH_EVENT_PUSH:9,PLAY_EVENT_PUSH:10,MEDIA_DESC_REQ:11,MEDIA_DESC_RSP:12,CANDIDATE_INFO_REQ:13,CANDIDATE_INFO_RSP:14,CLOSE_SESSION_REQ:15,CLOSE_SESSION_RSP:16,MEDIA_DESC_PUSH:17,MEDIA_DESC_ACK:18,CANDIDATE_INFO_PUSH:19,CANDIDATE_INFO_ACK:20,CLOSE_SESSION_PUSH:21,CLOSE_SESSION_ACK:22,STREAM_STATUS_NOTIFY:23,STREAM_STATUS_NOTIFY_ACK:24,STREAM_STATUS_NOTIFY_PUSH:25,STREAM_STATUS_NOTIFY_PUSH_ACK:26,BROADCASTER_STATUS_NOTIFY:27,BROADCASTER_STATUS_ACK:28,ACTIVATE_AUDIO_PLAY_STREAM_REQ:29,ACTIVATE_AUDIO_PLAY_STREAM_RSP:30,ACTIVATE_VIDEO_PLAY_STREAM_REQ:31,ACTIVATE_VIDEO_PLAY_STREAM_RSP:32,CLIENT_INFO_PUSH:33,CLIENT_INFO_ACK:34,NET_QUALITY_PROBE_REQ:35,NET_QUALITY_PROBE_RSP:36,NET_QUALITY_INFO_PUSH:37,NET_QUALITY_INFO_ACK:38,ACTIVATE_SEI_INSERT_REQ:39,ACTIVATE_SEI_INSERT_RSP:40,PEER2_PEER_NET_STATS_GET_REQ:41,PEER2_PEER_NET_STATS_GET_RSP:42,CMD_REQ:43,CMD_RSP:44,CMD_PUSH:45,CMD_ACK:46,WEBRTC_DISPATCH_REQ:47,WEBRTC_DISPATCH_RSP:48}},CreateSessionReq:{$m:{1:["type","sint32",0],2:["stream_id","string",""],3:["turn_server_host","string",""],4:["roomid","string",""],5:["strAuthParam","string",""],6:["params","string",""],7:["area_type","int32",0],8:["area_id_list","<int32",null],9:["ipv6_prefer","int32",0],10:["trans_codec_id","int32",0],11:["trans_codec_suffix","string",""]}},CreateSessionRsp:{$m:{1:["result","sint32",0],2:["turn_server","string",""],3:["turn_username","string",""],4:["turn_auth_key","string",""],5:["session_id","uint32",0],6:["session_token","string",""],7:["gw_version","uint32",0],8:["gw_nodes","<string",null],9:["gw_nodes_ttl","uint32",0],10:["client_ip","string",""],11:["ips","<rtc.webrtc_proto_v2.IpResult",null],12:["ipv6s","<rtc.webrtc_proto_v2.IpResult",null],13:["peer_id","uint32",0],14:["trans_codec_suffix","string",""]}},CreateSessionWithSdpReq:{$m:{1:["type","sint32",0],2:["stream_id","string",""],3:["sdp","string",""],4:["mini_sdp","bytes",[]],5:["media_server_host","string",""],6:["strAuthParam","string",""],7:["roomid","string",""],8:["params","string",""],9:["params_ext","bytes",[]],10:["area_type","int32",0],11:["area_id_list","<int32",null],12:["ipv6_prefer","int32",0],13:["trans_codec_id","int32",0],14:["trans_codec_suffix","string",""]}},CreateSessionWithSdpRsp:{$m:{1:["result","sint32",0],2:["gw_version","uint32",0],3:["sdp","string",""],4:["mini_sdp","bytes",[]],5:["session_token","string",""],6:["gw_nodes","<string",null],7:["gw_nodes_ttl","uint32",0],8:["client_ip","string",""],9:["params_ext","bytes",[]],10:["ips","<rtc.webrtc_proto_v2.IpResult",null],11:["ipv6s","<rtc.webrtc_proto_v2.IpResult",null],12:["peer_id","uint32",0],13:["trans_codec_suffix","string",""]}},DenyInfo:{$m:{1:["action","uint32",0],2:["err","uint32",0],3:["ins","<rtc.webrtc_proto_v2.IpPort",null],4:["action_delay","uint32",0]}},Head:{$m:{1:["cmd","uint32",0],2:["seq","uint32",0],3:["session_id","uint32",0]}},IpPort:{$m:{1:["Ip","string",""],2:["Port","uint32",0]}},IpResult:{$m:{1:["ip","string",""],2:["port","uint32",0],3:["isbgp","int32",0],4:["idcid","uint32",0],5:["tcp_port","uint32",0],6:["idc_code","string",""],7:["flag","uint32",0],8:["priority","int64",{low:0,high:0,unsigned:!1}],9:["mask","uint32",0],10:["vid","string",""]}},LoginReq:{$m:{1:["appid","uint32",0],2:["user_id","string",""],3:["tokenType","int32",0],4:["token","string",""],5:["sessions","<rtc.webrtc_proto_v2.SessionInfo",null],6:["roomid","string",""],7:["sdk_version","uint32",0],8:["app","string",""],9:["net_mode","int32",0]}},LoginRsp:{$m:{1:["result","int32",0],2:["tokenType","int32",0],3:["token","string",""]}},MediaDescReq:{$m:{1:["type","uint32",0],2:["update","uint32",0],3:["sdp","string",""],4:["mini_sdp","bytes",[]],5:["params_ext","bytes",[]]}},MediaDescRsp:{$m:{1:["result","sint32",0],2:["sdp","string",""],3:["mini_sdp","bytes",[]]}},NetQualityInfoAck:{$m:{1:["peer_id","uint32",0],2:["result","sint32",0]}},NetQualityInfoPush:{$m:{1:["peer_id","uint32",0],2:["lossrate","uint32",0],3:["rtt","uint32",0]}},NetQualityProbeReq:{$m:{1:["peer_id","uint32",0],2:["action","sint32",0]}},NetQualityProbeRsp:{$m:{1:["peer_id","uint32",0],2:["result","sint32",0]}},OneCandidateInfo:{$m:{1:["candidate","string",""],2:["sdpMid","string",""],3:["sdpMLineIndex","sint32",0]}},Peer2PeerNetStatsGetReq:{$m:{1:["peer_id","uint32",0]}},Peer2PeerNetStatsGetRsp:{$m:{1:["result","sint32",0],2:["peer_id","uint32",0],3:["p2p_lost_rate","uint32",0],4:["p2p_rtt","uint32",0]}},PlayEventPush:{$m:{1:["event","sint32",0]}},PublishEventPush:{$m:{1:["event","sint32",0]}},SessionInfo:{$m:{1:["session_id","uint32",0],2:["session_token","string",""]}},SessionResetAck:{$m:{1:["result","sint32",0]}},SessionResetPush:{$m:{1:["dwTimeStamp","uint32",0],2:["cResetType","uint32",0],3:["session_ids","<uint32",null],4:["reason","sint32",0]}},StreamStatusNotify:{$m:{1:["mic_status","sint32",0],2:["camera_status","sint32",0]}},StreamStatusNotifyAck:{$m:{1:["result","sint32",0]}},StreamStatusNotifyPush:{$m:{1:["mic_status","sint32",0],2:["camera_status","sint32",0]}},StreamStatusNotifyPushAck:{$m:{1:["result","sint32",0]}},WebRTCDispatchReq:{$m:{1:["type","sint32",0],2:["stream_id","string",""],10:["area_type","int32",0],11:["area_id_list","<int32",null],12:["ipv6_prefer","int32",0],13:["trans_codec_id","int32",0],14:["trans_codec_suffix","string",""]}},WebRTCDispatchRsp:{$m:{1:["gw_nodes","<string",null],2:["gw_nodes_ttl","uint32",0],3:["client_ip","string",""],4:["result","sint32",0],5:["ips","<rtc.webrtc_proto_v2.IpResult",null],6:["ipv6s","<rtc.webrtc_proto_v2.IpResult",null]}}}}},"",Eh,!1);var Ch,zh=Eh.rtc,Dh=function(){return Dh=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Dh.apply(this,arguments)},Ph=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Ah=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Mh=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))};!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(Ch||(Ch={}));var xh=0,jh=function(){function t(t,i,e){this.servers=t,this.params=i,this.activeServer=e,this.isConnecting=!1,this._binaryType="blob",this.eventMap={},this.url="",this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.id=xh++,this.open()}return Object.defineProperty(t.prototype,"binaryType",{get:function(){return this._binaryType},set:function(t){this._binaryType=t},enumerable:!1,configurable:!0}),t.prototype.addEventListener=function(t,i,e){var n,s;this.eventMap[t]?null===(n=this.eventMap[t])||void 0===n||n.push(i):this.eventMap[t]=[i],"open"===t||null===(s=this.socket)||void 0===s||s.addEventListener(t,i,e)},t.prototype.removeEventListener=function(t,i,e){var n;this.eventMap[t]=(this.eventMap[t]||[]).filter((function(t){return t!==i})),"open"===t||null===(n=this.socket)||void 0===n||n.removeEventListener(t,i,e)},t.prototype.dispatchEvent=function(t){throw new Error("Method not implemented.")},Object.defineProperty(t.prototype,"readyState",{get:function(){var t;return this.isConnecting?Ch.CONNECTING:(null===(t=null==this?void 0:this.socket)||void 0===t?void 0:t.readyState)||Ch.CLOSED},enumerable:!1,configurable:!0}),t.prototype.createSocket=function(){return Ph(this,void 0,void 0,(function(){var t,i,e,n,s,r=this;return Ah(this,(function(o){switch(o.label){case 0:if(this.socket&&this.socket.readyState!==Ch.CLOSED)return[2];t=null,i=this.activeServer?Mh([this.activeServer],this.servers,!0):this.servers,e=function(e){var s,o,u;return Ah(this,(function(a){switch(a.label){case 0:o="wss://".concat(s=i[e],"/proxy/ws"),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,new Promise((function(t,i){var e=new WebSocket(o);Object.keys(r.eventMap).forEach((function(t){"open"!==t&&(r.eventMap[t]||[]).forEach((function(i){e.addEventListener(t,i)}))})),e.binaryType="arraybuffer",e.onclose=function(t){r.onclose&&r.onclose(t)},e.onerror=function(t){r.onerror&&r.onerror(t),i(t)};var n=0;e.onmessage=function(t){n++;var i=t.data;if(1===n);else if(2===n){var e=zh.webproxy.WssBindResponse.decode(new Uint8Array(i));if(0!==e.code)throw"zm.prx.1"+" cloud proxy token auth failed. result: ".concat(JSON.stringify(e));r.isConnecting=!1,(r.eventMap.open||[]).forEach((function(i){i(r,t)})),r.onopen&&r.onopen()}else r.onmessage&&r.onmessage(t)},e.onopen=function(i){r.socket=e,t(i),r.authProxy(e)}}))];case 2:return a.sent(),[3,4];case 3:return u=a.sent(),t=u,[2,"continue"];case 4:return n.onActiveServer&&(n.onActiveServer(s),n.onActiveServer=void 0),n.url=o,[2,"break"]}}))},n=this,s=0,o.label=1;case 1:return s<i.length?[5,e(s)]:[3,4];case 2:if("break"===o.sent())return[3,4];o.label=3;case 3:return s++,[3,1];case 4:return this.socket||setTimeout((function(){throw t}),0),[2]}}))}))},t.prototype.authProxy=function(t){var i=this.socket;if(i){var e=this.params,n=zh.webproxy.WssBindRequest.encode({appid:e.appid,biz_type:0,mode:1,id_name:e.userID,token:e.token,url:e.target,ack:!0}).finish();i.send(n)}},t.prototype.setParams=function(t){this.params=Dh(Dh({},this.params),t)},t.prototype.open=function(){this.isConnecting=!0,this.readyState!==Ch.CLOSED&&this.createSocket()},t.prototype.close=function(){var t;null===(t=this.socket)||void 0===t||t.close()},t.prototype.send=function(t){var i;null===(i=this.socket)||void 0===i||i.send(t)},t.prototype.onopen=function(){},t.prototype.onclose=function(t){},t.prototype.onerror=function(t){},t.prototype.onmessage=function(t){},Object.defineProperty(t.prototype,"bufferedAmount",{get:function(){var t;return(null===(t=this.socket)||void 0===t?void 0:t.bufferedAmount)||0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extensions",{get:function(){var t;return(null===(t=this.socket)||void 0===t?void 0:t.extensions)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protocol",{get:function(){var t;return(null===(t=this.socket)||void 0===t?void 0:t.protocol)||""},enumerable:!1,configurable:!0}),t}(),Lh=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},qh=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Uh=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},Bh=zh.webproxy;function Jh(t){for(var i=0,e=0;e<t.length;e++)i+=t[e].length;var n=new Uint8Array(i),s=0;for(e=0;e<t.length;e++)n.set(t[e],s),s+=t[e].length;return n}function Vh(t,i){return Lh(this,void 0,void 0,(function(){var e,n,s,r,o,u;return qh(this,(function(a){switch(a.label){case 0:e=new Uint8Array,n=[],s=Array.from(t),r=function(t){var r,o;return qh(this,(function(u){switch(u.label){case 0:return r=s[t][0],o=s[t][1],n.push("--"+i),o instanceof Blob?[4,new Promise((function(t){var i=new FileReader;i.onloadend=function(){var s=i.result;if(s){n.push('Content-Disposition: form-data; name="'+r+'"; filename="'+((null==o?void 0:o.name)||"blob")+'"',"Content-Type: "+o.type,"\r\n");var u=Uc(n.join("\r\n"));n=[];var a=new Uint8Array(s);e=Jh([e,u,a]),t(0)}else t(0)},i.readAsArrayBuffer(o)}))]:[3,2];case 1:return u.sent(),[3,3];case 2:n.push('Content-Disposition: form-data; name="'+r+'"',"",o),u.label=3;case 3:return[2]}}))},o=0,a.label=1;case 1:return o<s.length?[5,r(o)]:[3,4];case 2:a.sent(),a.label=3;case 3:return o++,[3,1];case 4:return n.push("--"+i+"--"),u=Uc(n.join("\r\n")),n=[],[2,e=Jh([e,u])]}}))}))}function Hh(t){return Lh(this,void 0,void 0,(function(){var i,e,n;return qh(this,(function(s){switch(s.label){case 0:for(i="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",e="----WebKitFormBoundary",n=0;n<16;n++)e+=i.charAt(Math.floor(62*Math.random()));return[4,Vh(t,e)];case 1:return[2,{body:s.sent(),contentType:"multipart/form-data; boundary="+e}]}}))}))}var Gh,Fh=function(){function t(t,i){this.proxyList=t,this.token=i,this.enable=!1,this.appID=0,this.userID="web_proxy_"+Date.now()}return Object.defineProperty(t.prototype,"urls",{get:function(){return this.proxyList.map((function(t){var i=t.port;return"".concat(t.hostName).concat(i?":"+i:"")}))},enumerable:!1,configurable:!0}),t.prototype.Ks=function(t){this.activeServer&&this.activeServer===t||(this.activeServer=t,this.turnInfo=void 0,this.turnExpireTime=void 0)},t.prototype.destroy=function(){this.proxyList=[]},t.prototype.init=function(t){this.appID=t.appID},t.prototype.createSocket=function(t,i){var e=this;if(!this.appID)throw"zego cloud proxy config error. can not init proxy.";var n=new jh(this.urls,{target:t,appid:this.appID,token:this.token,userID:this.userID},this.activeServer);return n.onActiveServer=function(t){e.Ks(t)},n},t.prototype.getTurnInfo=function(){var t;return Lh(this,void 0,void 0,(function(){var i,e,n;return qh(this,(function(s){switch(s.label){case 0:return this.turnExpireTime&&this.turnInfo&&Date.now()<this.turnExpireTime?[2,this.turnInfo]:(this.turnExpireTime=void 0,this.turnInfo=void 0,i=Bh.TurnInfoRequest.encode({appid:this.appID,biz_type:0,mode:1,id_name:this.userID,token:this.token}).finish(),[4,this.handleFetch("/turn/info",i)]);case 1:return e=s.sent(),(n=Bh.TurnInfoResponse.decode(new Uint8Array(e))).code||(this.turnInfo=n,this.turnExpireTime=Date.now()+.8*((null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.expiration_in_seconds)||0)*1e3),[2,n]}}))}))},t.prototype.handleFetch=function(t,i){return void 0===t&&(t="/"),Lh(this,void 0,void 0,(function(){var e,n,s,r,o,u,a;return qh(this,(function(c){switch(c.label){case 0:e=null,n=null,s=this.activeServer?Uh([this.activeServer],this.urls,!0):this.urls,r=0,c.label=1;case 1:if(!(r<s.length))return[3,7];u="https://".concat(o=s[r]).concat(t),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,fetch(u,{method:"post",body:i})];case 3:return e=c.sent(),this.Ks(o),[3,5];case 4:return a=c.sent(),n=a,[3,6];case 5:return[3,7];case 6:return r++,[3,1];case 7:if(n)throw n;return[4,null==e?void 0:e.arrayBuffer()];case 8:return[2,c.sent()||[]]}}))}))},t.prototype.intranetCheck=function(t,i){return Lh(this,void 0,void 0,(function(){var e,n;return qh(this,(function(s){switch(s.label){case 0:return e=Bh.IntranetCheckRequest.encode({appid:this.appID,biz_type:0,mode:1,id_name:this.userID,token:this.token,vrs_ipv4:t,vrs_ipv6:i}).finish(),[4,this.handleFetch("/intranet/check",e)];case 1:return n=s.sent(),[2,Bh.IntranetCheckResponse.decode(new Uint8Array(n))]}}))}))},t.prototype.startHttpRequest=function(t,i,e,n){var s=this,r=!1;((null==n?void 0:n.timeout)||0)>0&&setTimeout((function(){r||(r=!0,e&&e({status_code:-1,headers:[],body:Uc("request time out.")}))}),null==n?void 0:n.timeout),new Promise((function(i,e){return Lh(s,void 0,void 0,(function(){var n,s,r,o,u,a,c,h,f,l,d,v,m,p,g;return qh(this,(function(b){switch(b.label){case 0:return(n=null===(g=t.headers)||void 0===g?void 0:g.find((function(t){return"content-type"===t.name.toLowerCase()&&t.val.toLowerCase().includes("multipart/form-data")})))&&t.body instanceof FormData?[4,Hh(t.body)]:[3,2];case 1:s=b.sent(),r=s.contentType,t.body=s.body,n.val=r,b.label=2;case 2:o=t.body,"string"==typeof t.body&&(o=Uc(t.body)),u=Bh.HTTPRequest.encode({appid:this.appID,biz_type:0,mode:1,id_name:this.userID,url:t.location,token:this.token,method:t.method_no,headers:t.headers,body:o}).finish(),a=null,c=null,h=this.activeServer?Uh([this.activeServer],this.urls,!0):this.urls,f=0,b.label=3;case 3:if(!(f<h.length))return[3,9];l="https://".concat(h[f],"/proxy/http"),b.label=4;case 4:return b.trys.push([4,6,,7]),[4,fetch(l,{method:"post",body:u})];case 5:return a=b.sent(),c=null,[3,7];case 6:return d=b.sent(),c=d,[3,8];case 7:return[3,9];case 8:return f++,[3,3];case 9:return c?(e({status_code:-1,headers:[],body:Uc(JSON.stringify(c))}),[2]):[4,null==a?void 0:a.arrayBuffer()];case 10:if(v=b.sent()||[],m=Bh.HTTPResponse.decode(new Uint8Array(v)),p=null==m?void 0:m.data,0===(null==m?void 0:m.code)&&p){if(!t.origin)try{p.body=JSON.parse(Bc(p.body))}catch(t){p.body=Bc(p.body)}i(p)}else e({status_code:-1,headers:[],body:JSON.parse(Bc(p.body))});return[2]}}))}))})).then((function(t){!r&&i&&(r=!0,i(t))})).catch((function(t){!r&&e&&(r=!0,e&&e({status_code:-1,headers:[],body:Uc(JSON.stringify(t))}))}))},t}(),Yh=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Zh=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};!function(t){t[t.Accesshub=0]="Accesshub",t[t.Logger=1]="Logger",t[t.Detaillog=2]="Detaillog"}(Gh||(Gh={}));var Qh,Xh,Wh,Kh=function(){function t(t){this.tr=t}return t.prototype.init=function(t){},t.prototype.createSocket=function(t,i){try{return new WebSocket(this.ir(t,i))}catch(t){throw console.error(t),t}},t.prototype.ir=function(t,i){var e=this;return t.replace(/^(https?:\/\/|wss?:\/\/)([\w.-]+)(?::(\d+))?/,(function(t,n,s,r){var o="";if(e.tr){var u=e.tr,a=u.accesshubProxy,c=u.loggerProxy,h=u.detaillogProxy;switch(i){case 0:a&&(o=n+a);break;case 1:c&&(o=n+c);break;case 2:h&&(o=n+h)}}return o?(o.endsWith("/")&&(o=o.substring(0,o.length-1)),o):t}))},t.prototype.startHttpRequest=function(t,i,e,n){var s=this,r=!1;((null==n?void 0:n.timeout)||0)>0&&setTimeout((function(){r||(r=!0,e&&e({status_code:-1,headers:[],body:Uc("request time out.")}))}),null==n?void 0:n.timeout),new Promise((function(i,e){return Yh(s,void 0,void 0,(function(){var n,s,r,o,u,a;return Zh(this,(function(c){switch(c.label){case 0:n=t.body,s=null,r=null,o=this.ir(t.location,t.serviceType),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,fetch(o,{method:1===t.method_no?"get":"post",body:n})];case 2:return s=c.sent(),r=null,[3,4];case 3:return u=c.sent(),r=u,[3,4];case 4:return r?(e({status_code:-1,headers:[],body:Uc(JSON.stringify(r))}),[2]):[4,null==s?void 0:s.json()];case 5:return a=c.sent(),s?i({status_code:(null==s?void 0:s.status)||-1,body:a,headers:[]}):e({status_code:-1,headers:[],body:Uc("request failed.")}),[2]}}))}))})).then((function(t){!r&&i&&(r=!0,i(t))})).catch((function(t){!r&&e&&(r=!0,e&&e({status_code:-1,headers:[],body:Uc(JSON.stringify(t))}))}))},t.prototype.destroy=function(){},t}(),$h=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},tf=["relogin_token"],ef=["id_name","nick_name"],nf=$h($h(["stream_id"],ef,!0),["extra_info","title","stream_attr","stream_title"],!1),sf=["trans_type"],rf=["trans_channel"],of=$h([],ef,!0),uf=["msg_id","msg_client_id"],af=$h(["trans_type"],rf,!0),cf=$h([],rf,!0),hf=$h(["trans_type","trans_data"],ef,!0),ff=$h([],rf,!0),lf=$h([],hf,!0),df=["stop_stream_id_list"],vf=$h([],ef,!0),mf=["id_name","custom_reason"],pf=["stream_id_list"],gf=$h([],nf,!0),bf=$h($h([],ef,!0),["msg_content"],!1),_f=$h($h([],ef,!0),["msg_id","msg_content"],!1),yf=$h($h([],ef,!0),["trans_type","trans_data","trans_channel"],!1),wf=$h($h([],ef,!0),rf,!0),Sf=["trans_type","trans_data"],Ef=["sender_idname","sender_nickname","msg_content"],Of=[[1001,"LoginRoomReq"],[1002,"LoginRoomRsp"],[1003,"LogoutRoomReq"],[1004,"LogoutRoomRsp"],[1101,"PushReq"],[1102,"PushRsp"],[1103,"MergePushReq"],[1104,"MergePushRsp"],[1105,"PushKickout"],[10001,"PushUserInfoUpdated"],[10002,"PushUserKickout"],[10003,"PushUserLogReport"],[10004,"PushUserTokenExpire"],[11005,"PushSignalCustom"],[11001,"PushJoinliveRequest"],[11002,"PushJoinliveResult"],[11003,"PushJoinliveInvite"],[11004,"PushJoinliveStop"],[11008,"PushChannelMsg"],[12001,"PushStreamAdd"],[12002,"PushStreamDelete"],[12003,"PushStreamUpdate"],[13001,"PushIm"],[14001,"PushBigIm"],[15001,"PushTrans"],[15002,"PushUserTrans"],[301001,"EnterRoomReq"],[301002,"EnterRoomRsp"],[301003,"QuitRoomReq"],[301004,"QuitRoomRsp"],[301005,"HbReq"],[301006,"HbRsp"],[301007,"RenewTokenReq"],[301008,"RenewTokenRsp"],[301009,"SetUserAttrReq"],[301010,"SetUserAttrRsp"],[301011,"SetTransReq"],[301012,"SetTransRsp"],[301013,"GetTransReq"],[301014,"GetTransRsp"],[301015,"GetUserTransReq"],[301016,"GetUserTransRsp"],[302001,"AddStreamReq"],[302002,"AddStreamRsp"],[302003,"DeleteStreamReq"],[302004,"DeleteStreamRsp"],[302005,"UpdateStreamReq"],[302006,"UpdateStreamRsp"],[302007,"GetStreamListReq"],[302008,"GetStreamListRsp"],[303001,"SendImReq"],[303002,"SendImRsp"],[303003,"GetImReq"],[303004,"GetImRsp"],[303005,"SendBigImReq"],[303006,"SendBigImRsp"],[303009,"SignalLiveRequestReq"],[303010,"SignalLiveRequestRsp"],[303011,"SignalLiveResultReq"],[303012,"SignalLiveResultRsp"],[303013,"SignalLiveInviteReq"],[303014,"SignalLiveInviteRsp"],[303015,"SignalLiveStopReq"],[303016,"SignalLiveStopRsp"],[303017,"SignalLiveCustomReq"],[303018,"SignalLiveCustomRsp"],[303019,"SignalTransmitReq"],[303020,"SignalTransmitRsp"],[303023,"SendChannelMsgReq"],[303024,"SendChannelMsgRsp"],[304001,"GetUserlistReq"],[304002,"GetUserlistRsp"]],Tf=Of.reduce((function(t,i){var e=i[0];return t[e]=[12001,12002,12003].includes(e)?"PushStream":i[1],t}),{}),kf=Of.reduce((function(t,i){return t[i[1]]=i[0],t}),{}),Rf=o(3788),If=o(6440),Nf=o.n(If),Cf=o(4636),zf=o.n(Cf),Df=function(){function t(){}return t.prototype.md5Bytes=function(t){return this.wordArray2Uint8Array(zf()(this.uint8Array2WordArray(t)))},t.prototype.wordArray2Uint8Array=function(t){for(var i=t.words,e=t.sigBytes,n=new Uint8Array(e),s=0;s<e;s++){n[s]=i[s>>>2]>>>24-s%4*8&255}return n},t.prototype.uint8Array2WordArray=function(t){for(var i=t.length,e=[],n=0;n<i;n++)e[n>>>2]|=(255&t[n])<<24-n%4*8;return Nf().create(e,i)},t}(),Pf=function(){return Pf=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Pf.apply(this,arguments)},Af=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))};Rf.util.Long=jt,Rf.configure(),Qh=zh,Xh=zh.liveroom_cs_v3,Wh=zh.proto_switch_v3;var Mf,xf=1001,jf=1002,Lf=1003,qf=1004;!function(t){t[t.disconnected=0]="disconnected",t[t.broken=1]="broken",t[t.connected=2]="connected"}(Mf||(Mf={}));var Uf=function(){function t(t,i,e,n,s){var r,o,u,c,h,f,l,d,v=this;this.In=t,this.Nn=i,this._ua=e,this._dataReport=n,this.rtm=s,this.seq=0,this.er={},this.nr="",this.zPushSid="0",this.sr=[["user_session_id","session_id"],["liveroom_hb_interval","hearbeat_interval"],["liveroom_hb_timeout","hearbeat_timeout"],["big_im_time_window","bigim_time_window"],["trans_channel_list","trans_seqs"],["stream_list_seq","stream_seq"],["stream_info_list","stream_info"]],this.rr=100,this.ur=1e4,this.ar=2e3,this.cr=Qh,this.hr={},this.lr={},this.dr={},this.vr=[kf.PushReq,kf.MergePushReq,kf.PushKickout],this.mr=[kf.LoginRoomRsp,kf.LogoutRoomRsp,kf.PushKickout,kf.PushReq,kf.MergePushReq],this.pr=[1105],this.gr=Mf.disconnected,this.br=[11001,11002,11003,11004],this._r="",this.yr=new Df,this.wr=this._ua.getPCRequest(tu.BusinessService.SERVICE_SWITCH4LIVEROOM),this.switchSessionID=jt.fromInt(0),null===(r=this.wr)||void 0===r||r.on("connected",(function(t){v.Sr(t)})),null===(o=this.wr)||void 0===o||o.on("broken",(function(t){v.Er()})),null===(u=this.wr)||void 0===u||u.on("disconnected",(function(t,i){v.Or(t,i)})),null===(c=this.wr)||void 0===c||c.on("downLoadMessage",(function(t,i){v.handlePush(t,i)})),null===(h=this.wr)||void 0===h||h.on("exception",(function(t,i){v.In.info("zm.lrh.o.0 except "+JSON.stringify(t))})),null===(f=this.wr)||void 0===f||f.on("pcBrokenEvent",(function(t){var i=Oc,e=v.Mn.createSpan(a.H,{key:ec},{key:""},i.event);e.setAttributes({service_no:i.service_no(null==t?void 0:t.service_no),error:(null==t?void 0:t.code)||0}),e.end()})),null===(l=this.wr)||void 0===l||l.on("pcDisconnectedEvent",(function(t){var i=Tc,e=v.Mn.createSpan(a.H,{key:ec},{key:""},i.event);e.setAttributes({service_no:i.service_no(null==t?void 0:t.service_no),error:(null==t?void 0:t.code)||0}),e.end()})),null===(d=this.wr)||void 0===d||d.on("pcConnectedEvent",(function(t){var i=Ec,e=v.Mn.createSpan(a.H,{key:ec},{key:""},i.event);e.setAttributes({service_no:i.service_no(t.service_no),recv_time:i.recv_time((new Date).getTime()),proxy_link_sources:i.proxy_link_sources(t.proxy_link_sources),connect_stream:i.connect_stream(t.connect_stream)}),e.end()}))}return Object.defineProperty(t.prototype,"Tr",{get:function(){return Object.values(this.er)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nickName",{get:function(){return Uc(this.Nn.nickName)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"TermType",{get:function(){return this.Nn.ENV%2==0?e.TT_WEB:e.TT_MINIPROGRAM},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),t.prototype.isDisConnect=function(){return this.gr!==Mf.connected},t.prototype.getHeader=function(t,i){var e={cmd:t,seq:++this.seq,timestamp:(new Date).getTime()};this.kr&&(e.controls=this.kr),(null==i?void 0:i.contextKey)&&(e.context_key=null==i?void 0:i.contextKey);var n=Wh.Header.create(e),s=Wh.Header.encode(n).finish();return[e.seq,s]},Object.defineProperty(t.prototype,"isUaConnect",{get:function(){return this._ua.isConnect()},enumerable:!1,configurable:!0}),t.prototype.sendMessage=function(t,i,e,n,s,r,o){var u,a,c,h=this;if(void 0===r&&(r={timeout:6e3}),void 0===o&&(o=!0),this.In.info(Ku+" call"),"LoginRoomReq"!==t&&this.gr!==Mf.connected)return this.In.warn(Ku+" state "+this.gr),n&&n(Mt.SOCKET_CLOSE),-1;if(Lt(t))c=t;else if(Bt(c=kf[t]))return this.In.warn(Ku+" cmd not found "+t+" "+JSON.stringify(kf)),-1;var f,l=0;f=Bt(null==s?void 0:s.roomID)?null===(u=this.Nn.roomModulesList[0])||void 0===u?void 0:u.roomID:null==s?void 0:s.roomID,"LoginRoomReq"!==t&&f&&(l=this.lr[f]);var d=this.getHeader(c,{contextKey:l}),v=d[1],m=i,p=this.getHead(v.length,m.length),g=new Uint8Array(Array.from(p).concat(Array.from(v)).concat(Array.from(m)));if(o){var b={seq:this.seq,deleted:!1,sendTime:Date.now(),timeout:r.timeout,success:e,error:function(t,i,e){var s;h.In.info(Ku+" error "+i+" "+JSON.stringify(t)+" "+JSON.stringify(e)+" ".concat(!!n));var r=null==t?void 0:t.body,o=null==r?void 0:r.err_code,u=null===(s=null==t?void 0:t.header)||void 0===s?void 0:s.cmd,a=null==e?void 0:e.roomID;if(u!==kf.LoginRoomRsp){var c=h.Nn.roomModulesList.find((function(t){return t.roomID==a}));if([1002,105].indexOf(o)>-1)return u===kf.EnterRoomRsp&&c?c?void c.retryRoom(!1,!0):void h.In.error(Ku+" room no found ignore "):void h.rtm.retryRoom(!1,void 0,!0);if([141].includes(o)&&c)return void c.roomHandler.logoutByError({code:o,msg:null==r?void 0:r.err_message})}n&&n(t,i)},params:s};this.er[b.seq]=b}this.In.info(Ku+" seq: "+d[0]+" cmd: "+t);return null===(a=this.wr)||void 0===a||a.sendRequest({payload:g,ack:"LoginRoomReq"===t},(function(t){h.In.info(Ku+" fail")}),(function(){h.In.info(Ku+" ack")}),{}),d[0]},t.prototype.getHead=function(t,i){var e=new Uint8Array(7);return e[0]=49,e[1]=t>>8,e[2]=t-(e[1]<<8),e.set(new Uint8Array(Int32Array.from([i]).buffer).reverse(),3),e},t.prototype.handlePush=function(t,i){if(!(49!==t[0]||t.length<7)){var e=(t[1]<<8)+t[2],n=Wh.Header.decode(t.slice(7,7+e)),s=t.slice(7+e),r=s,o=(t[3]<<24)+(t[4]<<16)+(t[5]<<8)+t[6];if(o!=s.length&&this.In.warn(ta+" body len ".concat(o," != ").concat(s.length)),!Tf[n.cmd])return this.In.info($u+" cmd is not rtc"),void this.onSwitchMessage(n,r);var u=this.decodeResponseBody(n,r);if(this.vr.includes(n.cmd))this.handleSwitchPush(n,u);else{this.In.info($u+" down seq: "+n.seq+" "+(Tf[n.cmd]||n.cmd)+" "+JSON.stringify(this.Rr(u)));var a={header:this.transHeader(n),body:this.transRsp(u)},c=this.hr[n.context_key];Bt(c)||(a.header.room_id=c),this.handleSendCommandMsgRsp(a)}}},t.prototype.handleSwitchPush=function(t,i){var e,n,s,r,o=this,u=t.context_key,a=this.hr[u];if(a||this.pr.includes(t.cmd)){if(t.cmd===kf.PushReq){if((l=this.transRsp(i.head)).room_id=a,!this.Nn.roomModulesList.find((function(t){return t.roomID==a})))return void this.In.warn(ta+" room no found ignore ");var c={header:l,body:this.br.includes(i.head.sub_cmd)?{signal_msg:Bc(i.msg_body),sub_cmd:i.head.sub_cmd}:i.head.sub_cmd===kf.PushSignalCustom?{custommsg:Bc(i.msg_body)}:Tf[i.head.sub_cmd]?this.transRsp(this.Ir(Xh[Tf[i.head.sub_cmd]],i.msg_body)):{}};switch(i.head.sub_cmd){case kf.PushUserInfoUpdated:null===(e=c.body.user_action_list)||void 0===e||e.forEach((function(t){o.Nr(t,vf)}));break;case kf.PushUserKickout:this.Nr(c.body,mf);break;case kf.PushTrans:this.Nr(c.body,yf);break;case kf.PushUserTrans:this.Nr(c.body,wf),null===(n=c.body.trans_seq_list)||void 0===n||n.forEach((function(t){o.Nr(t,Sf)}));break;case kf.PushIm:null===(s=c.body.msg_list)||void 0===s||s.forEach((function(t){o.Nr(t,bf)}));break;case kf.PushChannelMsg:this.Nr(c.body,Ef),this.keysExist(c.body,["channel_type"]);break;case kf.PushStreamAdd:case kf.PushStreamDelete:case kf.PushStreamUpdate:null===(r=c.body.stream_info_list)||void 0===r||r.forEach((function(t){o.Nr(t,gf)}));break;case kf.PushUserTokenExpire:this.Nr(c.body.stop_stream_info,pf)}switch(this.In.info(ta+" push ".concat(t.seq," ").concat(JSON.stringify(this.Rr(c)))),i.head.sub_cmd){case kf.PushUserInfoUpdated:this.handlePushUserStateUpdateMsg(c);break;case kf.PushUserKickout:this.transKeysName(c.body,this.sr),this.handlePushKickout(c,!1);break;case kf.PushTrans:this.handlePushTransMsg(c);break;case kf.PushUserTrans:this.handlePushUserTransMsg(c);break;case kf.PushIm:this.handlePushRoomMsg(c);break;case kf.PushSignalCustom:this.handlePushCustomMsg(c);break;case kf.PushStreamAdd:case kf.PushStreamDelete:case kf.PushStreamUpdate:this.handlePushStreamMsg(c);break;case kf.PushJoinliveRequest:case kf.PushJoinliveResult:case kf.PushJoinliveInvite:case kf.PushJoinliveStop:this.handlePushSignalMsg(c);break;case kf.PushUserTokenExpire:this.handlePushTokenExpire(c);break;case kf.PushChannelMsg:this.handlePushChannelMsg(c);break;default:this.In.info(ta+" white "),this.onSwitchMessage(t,i)}if(1==i.head.qos_flag){var h=Wh.PushRsp.create({code:0,message:"",sub_cmd:i.head.sub_cmd,server_send_time:i.head.send_time}),f=Wh.PushRsp.encode(h).finish();this.sendMessage("PushRsp",f,void 0,void 0)}}else if(t.cmd===kf.MergePushReq){var l;if((l=this.transRsp(i.head)).room_id=a,!this.Nn.roomModulesList.find((function(t){return t.roomID==a})))return void this.In.warn(ta+" room no found ignore ");var d=[];i.message_list.forEach((function(t){var i,e;d.push({sub_cmd:t.sub_cmd,sub_seq:t.sub_seq}),t.sub_cmd===kf.PushBigIm&&(null===(i=(e=Xh.PushBigIm.decode(t.msg_body)).msg_list)||void 0===i||i.forEach((function(t){o.Nr(t,_f)})),t.msg_body=e)}));var v={header:l,body:this.transRsp(i)};if(delete v.body.head,this.handlePushMergeMsg(v),1==i.head.qos_flag){h=Wh.MergePushRsp.create({messages:d,server_send_time:i.head.send_time}),f=Wh.MergePushRsp.encode(h).finish();this.sendMessage("MergePushRsp",f,void 0,void 0)}}else if(t.cmd===kf.PushKickout){this.handlePushKickout({header:t,body:{reason:i.reason>900?i.reason-900:i.reason,msg:i.message,need_relogin:void 0!==i.is_need_relogin?i.is_need_relogin:0}},!0)}}else{this.In.warn(ta+" ctx key ".concat(u," not found"));var m={header:t,body:i};this.dr[u]?this.dr[u].push(m):this.dr[u]=[m]}},t.prototype.handlePushChannelMsg=function(t){},t.prototype.handlePushTokenExpire=function(t){var i,e,n=(null===(e=null===(i=null==t?void 0:t.body)||void 0===i?void 0:i.stop_stream_info)||void 0===e?void 0:e.stream_id_list)||[];n.length>0&&this.Nn.actionListener("_stopStream",n,{code:Mt.TOKEN_EXPIRED.code,message:Mt.TOKEN_EXPIRED.msg})},t.prototype.handlePushKickout=function(t,i){var e,n;if(i)Af([],this.Nn.roomModulesList,!0).forEach((function(i){i.roomHandler.handlePushKickout(t,!0,!0)}));else{var s=null===(e=null==t?void 0:t.header)||void 0===e?void 0:e.room_id,r=this.Nn.roomModulesList.find((function(t){return t.roomID==s}));if(this.longToStringNumber(t.body,["session_id"],"toString"),!r)return void this.In.error("zm.lrh.pk room no found ignore "+JSON.stringify(null===(n=t.header)||void 0===n?void 0:n.room_id));r.roomHandler.handlePushKickout(t)}},t.prototype.handlePushUserStateUpdateMsg=function(t){var i,e,n,s=null===(i=null==t?void 0:t.header)||void 0===i?void 0:i.room_id,r=this.Nn.roomModulesList.find((function(t){return t.roomID==s}));if(r){var o=t.body.user_action_list.map((function(t){return{Action:t.action,IdName:t.id_name,NickName:t.nick_name,Role:t.role,LoginTime:t.login_time.toString()}})),u=this.Nn.reporter.createSpan(a.H,{key:Oa.event,par:s},{key:""},Ha),c={body:{user_actions:o,user_list_seq:t.body.server_user_seq.toNumber(),room_id:s}};u.setAttributes({user_list_seq:null===(e=null==c?void 0:c.body)||void 0===e?void 0:e.user_list_seq,update_user:null===(n=null==c?void 0:c.body)||void 0===n?void 0:n.user_actions}),u.end(),r.userHandler.handlePushUserStateUpdateMsg(c)}else this.In.error("zm.lrh.puu room no found ignore "+JSON.stringify(t))},t.prototype.handlePushStreamMsg=function(t){},t.prototype.handlePushSignalMsg=function(t){},t.prototype.handlePushMergeMsg=function(t){},t.prototype.handlePushCustomMsg=function(t){},t.prototype.handlePushRoomMsg=function(t){},t.prototype.handlePushTransMsg=function(t){},t.prototype.handlePushUserTransMsg=function(t){},t.prototype.onSwitchMessage=function(t,i){},t.prototype.decodeResponseBody=function(t,i){var e=this.mr.includes(t.cmd)?"proto_switch_v3":"liveroom_cs_v3";return this.Ir(this.cr[e][Tf[t.cmd]],i)},t.prototype.login=function(t,i,e){var n,s,r=this;this.gr==Mf.disconnected&&(this.In.info(ea+" state disconnect"),this.closeRequest());var o=(new Date).getTime()+"",u={user_session_id:null!==(n=t.longSid)&&void 0!==n?n:jt.fromInt(0),net_type:Wo(),room_id:Uc(t.roomID),room_name:Uc(t.roomName),nick_name:this.nickName,role:this.Nn.role,third_token:Uc(t.token),room_create_flag:this.Nn.roomCreateFlag,user_state_flag:t.userStateUpdate?1:0,user_count_limit:t.maxMemberCount,relate_service:this.Nn.relateService.join()||""};if(t.isMulti){var a=Pf(Pf({},u),{conn_type:2});delete(f=Pf(Pf({},a),{room_id:t.roomID,room_name:t.roomName})).third_token,this.In.info(ea+" enter "+JSON.stringify(f));var c=Xh.EnterRoomReq.create(a),h=Xh.EnterRoomReq.encode(c).finish();this.sendMessage("EnterRoomReq",h,(function(e,n){var s;r.Cr(e,t),i&&i(e,n),(null===(s=e.header)||void 0===s?void 0:s.context_key)&&r.processPushMsgCache(e.header.context_key)}),(function(t,i){r.clearAllPushMsgCache(),e&&e(t,i)}),{roomID:t.roomID})}else{var f,l=Pf(Pf({},u),{app_id:this.Nn.appid,id_name:Uc(this.Nn.idName),device_id:this.Nn.deviceID,term_type:this.TermType,sdk_version:this.Nn.sdkVerNum,client_stamp:Uc(o),relogin_token:this.switchSessionID.notEquals(jt.fromInt(0))?Uc(this._r):"",switch_session_id:this.switchSessionID,user_session_id:null!==(s=t.longSid)&&void 0!==s?s:jt.fromInt(0),biz_type:0,biz_version:this.Nn.bizVersion||"",login_logic:this.Nn.isMultiRoom?3:1,sdk_conn_type:2});t.roomReasonState===Pt.Reconnecting&&(l.relogin_type=1),delete(f=Pf(Pf({},l),{id_name:this.Nn.idName,nick_name:this.Nn.nickName,client_stamp:o,k1_sign:void 0,relogin_token:this._r,room_id:t.roomID,room_name:t.roomName,user_session_id:t.longSid})).third_token,this.nr=t.token,this.In.info(ea+" login "+JSON.stringify(f)),this.In.remoteReport(ea+" token "+t.token);c=Wh.LoginRoomReq.create(l),h=Wh.LoginRoomReq.encode(c).finish();this.sendMessage("LoginRoomReq",h,(function(e,n){var s,o,u;r.In.info(ea+" login rsp"),r.switchSessionID=e.body.switch_session_id,(null===(s=null==e?void 0:e.header)||void 0===s?void 0:s.controls)&&(r.kr=null===(o=null==e?void 0:e.header)||void 0===o?void 0:o.controls),r.Cr(e,t),r._r=e.body.relogin_token,i&&i(e,n),(null===(u=e.header)||void 0===u?void 0:u.context_key)&&r.processPushMsgCache(e.header.context_key)}),(function(t,i){r.clearAllPushMsgCache(),e&&e(t,i)}))}},t.prototype.Cr=function(t,i){var e,n,s,r,o,u,a=this;(null===(e=t.header)||void 0===e?void 0:e.context_key)&&(this.lr[i.roomID]=t.header.context_key,this.hr[t.header.context_key]=i.roomID,t.header.room_id=i.roomID),this.Nr(t.body,tf),this.Nr(null===(n=t.body)||void 0===n?void 0:n.anchor_info,ef),null===(r=null===(s=t.body)||void 0===s?void 0:s.trans_channel_list)||void 0===r||r.forEach((function(t,i){var e;a.Nr(t,rf),null===(e=t.trans_seq_list)||void 0===e||e.forEach((function(t){a.Nr(t,sf)}))})),null===(u=null===(o=t.body)||void 0===o?void 0:o.stream_info_list)||void 0===u||u.forEach((function(i,e){a.Nr(t.body.stream_info_list[e],nf)})),this.longToStringNumber(t.body,["ret_timestamp"],"toString"),this.transKeysName(t.body,this.sr),this.keysExist(t.body,["token_remain_time","stream_seq"]),t.body.anchor_info={anchor_id_name:t.body.anchor_info.id_name,anchor_id:t.body.anchor_info.user_id,anchor_nick_name:t.body.anchor_info.nick_name}},t.prototype.transKeysName=function(t,i){i.forEach((function(i){Bt(t[i[0]])||(t[i[1]]=t[i[0]],delete t[i[0]])}))},t.prototype.keysExist=function(t,i){i.forEach((function(i){void 0===t[i]&&(t[i]=0)}))},t.prototype.longToStringNumber=function(t,i,e){i.forEach((function(i){jt.isLong(t[i])&&(t[i]=t[i][e]())}))},t.prototype.Nr=function(t,i){var e=this;Jt(t)&&i.forEach((function(i){if("[object Uint8Array]"===Object.prototype.toString.call(t[i]))try{t[i]=Bc(t[i])}catch(t){e.In.error("zm.lrh.bts "+i+" "+t)}else if("[object Array]"===Object.prototype.toString.call(t[i])){!t[i].some((function(t){return"[object Uint8Array]"!==Object.prototype.toString.call(t)}))&&(t[i]=t[i].map((function(t,n){try{return Bc(t)}catch(s){return e.In.error("zm.lrh.bts  "+" ".concat(n," ").concat(i," ").concat(s)),t}})))}}))},t.prototype.logout=function(t,i,e){var n=this;if(t.isMulti){this.In.info(sa+" quit "+t.roomID),this.clearPushMsgCacheByRoomID(t.roomID);var s=Xh.QuitRoomReq.create(o={}),r=Xh.QuitRoomReq.encode(s).finish();return this.sendMessage("QuitRoomReq",r,(function(e,s){n.handleLogoutRsp(t.roomID),i&&i(e,s)}),(function(i,s){n.handleLogoutRsp(t.roomID),e&&e(i,s)}),{roomID:t.roomID})}this.clearAllPushMsgCache();var o={logout_code:0,logout_check:this.yr.md5Bytes(Uc(this.nr)),user_session_id:t.longSid,logout_logic:this.Nn.isMultiRoom?3:1},u=this.Rr(o);this.In.info(sa+" logout "+JSON.stringify(u));s=Wh.LogoutRoomReq.create(o),r=Wh.LogoutRoomReq.encode(s).finish();return this.sendMessage("LogoutRoomReq",r,(function(e,s){n.handleLogoutRsp(t.roomID),i&&i(e,s)}),(function(i,s){n.handleLogoutRsp(t.roomID),e&&e(i,s)}),{roomID:t.roomID})},t.prototype.zr=function(){var t=this.Tr;this.In.info("zm.lrh.csml "+t.length),t.forEach((function(t){t&&t.error&&setTimeout((function(){t&&t.error&&t.error(Mt.TIMEOUT,t.seq)}),0)})),this.er={}},t.prototype.Dr=function(){var t=this,i=Date.now(),e=0,n=0,s=0;this.Tr.find((function(r){if(r.sendTime+r.timeout>i)return!1;if(delete t.er[r.seq],++n,null==r.error)++s;else{var o=r.error,u=r.seq;setTimeout((function(){o&&o(Mt.TIMEOUT,u)}),0)}return++e>=t.rr})),n>0&&this.In.info("zm.lrh.cmlt timeout: ".concat(n," , ").concat(s))},t.prototype.startCheck=function(){var t=this;this.Dr(),this.Pr=setTimeout((function(){t.startCheck()}),this.ar)},t.prototype.stopCheck=function(){this.zr(),clearTimeout(this.Pr)},t.prototype.handleSendCommandMsgRsp=function(t){var i=this.er[t.header.seq];if(null!=i){var e=i,n=null==e?void 0:e.params;delete this.er[t.header.seq],0===t.body.err_code?setTimeout((function(){e&&null!=e.success&&e.success(t,t.header.seq)}),0):setTimeout((function(){e&&null!=e.error&&e.error(t,t.header.seq,n)}),0)}},t.prototype.getReqHead=function(t){return{}},t.prototype.heartBeat=function(t,i,e,n){var s=this,r=Xh.HbReq.create({}),o=Xh.HbReq.encode(r).finish();this.sendMessage("HbReq",o,(function(i,e){var n,r;null===(n=i.body.trans_channel_list)||void 0===n||n.forEach((function(t,i){var e;s.Nr(t,rf),null===(e=t.trans_seq_list)||void 0===e||e.forEach((function(t){s.Nr(t,sf)}))})),null===(r=i.body.user_trans_channel_list)||void 0===r||r.forEach((function(t,i){var e;s.Nr(t,rf),null===(e=t.trans_seq_list)||void 0===e||e.forEach((function(t){s.Nr(t,sf)}))})),s.transKeysName(i.body,[["hb_interval","hearbeat_interval"],["hb_timeout","hearbeat_timeout"],["big_im_time_window","bigim_time_window"],["trans_channel_list","trans_seqs"]]),i.body.server_user_seq=i.body.user_seq.toNumber(),s.longToStringNumber(i.body,["ret_timestamp"],"toNumber"),t&&t(i,e)}),i,{roomID:null==e?void 0:e.roomID},{timeout:n})},t.prototype.fetchUserList=function(t,i,e,n){var s=this,r=Pf({},t),o=this.Rr(r);this.In.info(na+" "+JSON.stringify(o));var u=Xh.GetUserlistReq.create(r),a=Xh.GetUserlistReq.encode(u).finish();return this.sendMessage("GetUserlistReq",a,(function(t,e){var n,r;s.In.info(na+" suc "+e),null===(r=null===(n=t.body)||void 0===n?void 0:n.user_base_info_list)||void 0===r||r.forEach((function(i,e){s.Nr(t.body.user_base_info_list[e],of)})),s.transKeysName(t.body,[["user_base_info_list","user_baseinfos"]]),s.longToStringNumber(t.body,["server_user_seq","server_user_index","ret_user_index"],"toNumber"),i&&i(t,e)}),e,{roomID:null==n?void 0:n.roomID})},t.prototype.sendRoomMsg=function(t,i,e,n){var s=this,r={msg_category:t.msg_category,msg_type:t.msg_type,msg_content:Uc(t.msg_content)},o=this.Rr(r);this.In.info("zm.lrh.srm.1 "+JSON.stringify(o));var u=Xh.SendImReq.create(r),a=Xh.SendImReq.encode(u).finish();return this.sendMessage("SendImReq",a,(function(t,e){s.longToStringNumber(t.body,["msg_id"],"toNumber"),i&&i(t,e)}),e,{roomID:null==n?void 0:n.roomID})},t.prototype.sendReliableMessage=function(t,i,e,n){var s=this,r={trans_type:Uc(t.trans_type),trans_data:Uc(t.trans_data),trans_local_seq:t.trans_local_seq,trans_channel:Uc(t.trans_channel)},o=this.Rr(r);this.In.info("zm.lrh.srm.0 "+JSON.stringify(o));var u=Xh.SetTransReq.create(r),a=Xh.SetTransReq.encode(u).finish();return this.sendMessage("SetTransReq",a,(function(t,e){s.Nr(t.body,af),i(t,e)}),e,{roomID:null==n?void 0:n.roomID})},t.prototype.fetchReliableMessage=function(t,i,e,n){var s=this,r=t.fetch_array.map((function(t){return{trans_type:Uc(t.trans_type),trans_local_seq:t.trans_seq}})),o={trans_channel:Uc(t.trans_channel),trans_list:r},u=this.Rr(o);this.In.info("zm.lrh.frm "+JSON.stringify(u));var a=Xh.GetTransReq.create(o),c=Xh.GetTransReq.encode(a).finish();return this.sendMessage("GetTransReq",c,(function(t,e){var n;s.Nr(t.body,cf),null===(n=t.body.trans_list)||void 0===n||n.forEach((function(t){s.Nr(t,hf)})),i(t,e)}),e,{roomID:null==n?void 0:n.roomID})},t.prototype.fetchUserTransInfo=function(t,i,e,n){var s=this,r=t.fetch_array.map((function(t){return{trans_type:Uc(t.trans_type),trans_local_seq:t.trans_seq}})),o={trans_channel:Uc(t.trans_channel),user_trans_list:r},u=this.Rr(o);this.In.info("zm.lrh.futi "+JSON.stringify(u));var a=Xh.GetUserTransReq.create(o),c=Xh.GetUserTransReq.encode(a).finish();return this.sendMessage("GetUserTransReq",c,(function(t,e){var n;s.Nr(t.body,ff),null===(n=t.body.user_trans_list)||void 0===n||n.forEach((function(t){s.Nr(t,lf)})),i(t,e)}),e,{roomID:null==n?void 0:n.roomID})},t.prototype.sendCustomCommand=function(t,i,e,n){var s=this,r=t.dest_id_name.map((function(t){return{id_name:Uc(t)}})),o=Pf({to_user_list:r,push_message:Uc(t.custom_msg)},t),u=this.Rr(o);this.In.info(oa+" "+JSON.stringify(u));var a=Xh.SignalLiveCustomReq.create(o),c=Xh.SignalLiveCustomReq.encode(a).finish();return this.sendMessage("SignalLiveCustomReq",c,(function(t,e){i&&i(s.transRsp(t),e)}),(function(t,i){e&&e(t,i)}),{roomID:null==n?void 0:n.roomID})},t.prototype.sendRoomChannelMessage=function(t,i,e,n){var s=this,r=t.toUserIDList,o={channel_type:t.channelType,msg_type:t.msgType,msg_content:Uc(t.msgContent),to_user_list:r.map((function(t){return Uc(t)}))},u=this.Rr(o);this.In.info(oa+" "+JSON.stringify(u));var a=Xh.SendChannelMsgReq.create(o),c=Xh.SendChannelMsgReq.encode(a).finish();return this.sendMessage("SendChannelMsgReq",c,(function(t,i){e&&e(s.transRsp(t),i)}),(function(t,i){n&&n(t,i)}),{roomID:i})},t.prototype.sendBigRoomMessage=function(t,i,e,n){var s=this,r={msg_list:t.msgs.map((function(t){return{msg_category:t.msg_category,msg_type:t.msg_type,msg_timestamp:jt.fromNumber(Date.now()),msg_content:Uc(t.msg_content),msg_client_id:Uc(t.bigmsg_client_id)}}))},o=this.Rr(r);this.In.info("zm.lrh.sbrm "+JSON.stringify(o));var u=Xh.SendBigImReq.create(r),a=Xh.SendBigImReq.encode(u).finish();return this.sendMessage("SendBigImReq",a,(function(t,e){var n;null===(n=t.body.msg_list)||void 0===n||n.forEach((function(t){s.Nr(t,uf)})),i(t,e)}),e,{roomID:null==n?void 0:n.roomID})},t.prototype.sendSignalCmd=function(t,i,e,n){var s="";switch(t.sub_cmd){case Lf:s="SignalLiveInviteReq";break;case xf:s="SignalLiveRequestReq";break;case jf:s="SignalLiveResultReq";break;case qf:s="SignalLiveStopReq"}var r=t.dest_id_name.map((function(t){return{id_name:Uc(t)}})),o={push_message:Uc(t.signal_msg),to_user_list:r},u=this.Rr(o);this.In.info("zm.lrh.ssc "+JSON.stringify(u));var a=Xh[s].create(o),c=Xh[s].encode(a).finish();return this.sendMessage(s,c,i,e,{roomID:null==n?void 0:n.roomID})},t.prototype.sendStreamUpdate=function(t,i,e,n){var s,r=this;try{s=JSON.parse(t.stream_msg)}catch(t){}var o,u="";this.In.info(ra+" "+JSON.stringify(Pf(Pf({},t),{third_token:void 0}))),this.In.remoteReport(ra+" token "+t.third_token);var a=this.Nn.roomModulesList.find((function(t){return t.roomID==n.roomID}));if(!a)return this.In.error(ra+" room no found ignore "),-1;switch(t.sub_cmd){case 2001:u="AddStreamReq",o={stream_id:Uc(s.stream_id),extra_info:Uc(s.extra_info),client_req_seq:this.seq+1,third_token:Uc(t.third_token||""),stream_attr_opts:{stream_resource:t.stream_resource,stream_codec:t.stream_codec,censor_flag:s.inspect_flag||0}};break;case 2002:u="DeleteStreamReq",o={stream_id:Uc(s.stream_id),stream_sid:s.stream_sid,client_req_seq:this.seq+1};break;case 2003:u="UpdateStreamReq",o={stream_id:Uc(s.stream_id),stream_sid:s.stream_sid,client_req_seq:this.seq+1,extra_info:Uc(s.extra_info)}}var c=this.Rr(o);this.In.info(ra+" "+JSON.stringify(c));var h=Xh[u].create(o),f=Xh[u].encode(h).finish();return this.sendMessage(u,f,(function(t,e){r.In.info(ra+" suc "+u+" "+JSON.stringify(t)),t.header.room_id=a.roomID,i&&i(t,e)}),(function(t,i){r.In.info(ra+" fail "+u+" "+JSON.stringify(t)),e&&e(t,i)}),{roomID:null==n?void 0:n.roomID})},t.prototype.getStreamList=function(t,i,e,n){var s=this;if(this.Nn.roomModulesList.find((function(t){return t.roomID==n.roomID}))){var r={},o=this.Rr(r);this.In.info(ia+" "+JSON.stringify(o));var u=Xh.GetStreamListReq.create(r),a=Xh.GetStreamListReq.encode(u).finish();this.sendMessage("GetStreamListReq",a,(function(t,e){var n,r;null===(r=null===(n=t.body)||void 0===n?void 0:n.stream_info_list)||void 0===r||r.forEach((function(t){s.Nr(t,nf),t.create_time=t.create_time.toNumber()})),s.transKeysName(t.body,[["stream_list_seq","stream_seq"],["stream_info_list","stream_info"]]),i&&i(t,e)}),(function(t,i){e&&e(t,i)}),{roomID:null==n?void 0:n.roomID})}else this.In.error(ia+" room no found ignore "+n.roomID)},t.prototype.Rr=function(t){var i=this,e={};return Object.keys(t).forEach((function(n){["logout_check"].includes(n)?e[n]=t[n]:i.Ar(e,t,n,!0)})),e},t.prototype.transHeader=function(t){return t.timestamp=jt.isLong(t.timestamp)?t.timestamp.toString():t.timestamp,t},t.prototype.transRsp=function(t){var i=t&&t.rsp_head?this.transRspHead(t.rsp_head):{},e=Pf(Pf({},t),i);return delete e.rsp_head,e},t.prototype.Ar=function(t,i,e,n){var s=this;if(void 0===n&&(n=!1),jt.isLong(i[e]))t[e]=n?i[e].toString():i[e];else if("[object Object]"===Object.prototype.toString.call(i[e]))t[e]={},Object.keys(i[e]).forEach((function(r){return s.Ar(t[e],i[e],r,n)}));else if("[object Array]"===Object.prototype.toString.call(i[e])&&"[object Object]"===Object.prototype.toString.call(i[e][0])){t[e]=[];for(var r=function(r){var o={};Object.keys(i[e][r]).forEach((function(t){s.Ar(o,i[e][r],t,n)})),t[e].push(o)},o=0;o<i[e].length;o++)r(o)}else if(n&&"[object Uint8Array]"===Object.prototype.toString.call(i[e]))try{t[e]=Bc(i[e])}catch(s){t[e]=n?"~":i[e]}else t[e]=i[e]},t.prototype.transRspHead=function(t){return t?{err_code:t.code||0,err_message:t.message}:{}},t.prototype.Ir=function(t,i){return Pf({},t.decode(i))},t.prototype.Or=function(t,i){var e=this;this.In.info(ua+" call"),this.gr=Mf.disconnected,this.Nn.roomModulesList.forEach((function(t){var i=t.roomTryHandler;i&&e.isUaConnect&&(e.In.info(ua+" ua is connect"),i.retryLoginRoom())}))},t.prototype.Er=function(){this.In.info(aa+" call"),this.gr=Mf.broken,this.clearAllPushMsgCache(),this.Mr(aa)},t.prototype.Mr=function(t){var i=this;this.Nn.roomModulesList.forEach((function(e){var n=e.roomTryHandler,s=e.roomHandler;n&&(n.invalid(),n.onactive=function(e,n){i.In.info(t+" onactive"),s.transError(n),s.disconnectedHandle(n)},n.startMaxTime(),s._roomStateHandle("CONNECTING",Pt.Reconnecting,Mt.NETWORK_BROKEN))}))},t.prototype.Sr=function(t){this.In.info("zm.lrh.hc call "+t),this.gr=Mf.connected,t===tu.ConnectedType.AUTO&&this.rtm.retryRoom()},t.prototype.renewToken=function(t,i,e,n){var s=this,r={token:t.token},o=Xh.RenewTokenReq.create(r),u=Xh.RenewTokenReq.encode(o).finish(),a=this.Rr(r);this.In.info("zm.lrh.rt "+JSON.stringify(a)),this.sendMessage("RenewTokenReq",u,(function(t,e){s.Nr(t.body,df),s.keysExist(t.body,["token_remain_time"]),i&&i(t,e)}),e,{roomID:null==n?void 0:n.roomID})},t.prototype.reset=function(){this.In.info("zm.lrh.r.0 call "),this.gr=Mf.disconnected,this.switchSessionID=jt.fromInt(0),this.Pr&&clearTimeout(this.Pr)},t.prototype.closeRequest=function(){var t;null===(t=this.wr)||void 0===t||t.closeRequest()},t.prototype.resetSessionInfo=function(){this.switchSessionID=jt.fromInt(0)},t.prototype.processPushMsgCache=function(t){var i=this.dr[t];if(i){this.In.info($u+" processPushMsgCache ".concat(t,", msg len: ").concat(i.length));for(var e=0;e<i.length;e++){var n=i[e];this.handleSwitchPush(n.header,n.body)}delete this.dr[t]}},t.prototype.clearAllPushMsgCache=function(){var t=this;Object.keys(this.dr).forEach((function(i){var e=parseInt(i);delete t.dr[e]}))},t.prototype.clearPushMsgCacheByRoomID=function(t){var i=this.lr[t];i&&this.dr[i]&&delete this.dr[i]},t.prototype.handleLogoutRsp=function(t){var i=this.lr[t];i&&(delete this.hr[i],delete this.lr[t],this.dr[i]&&delete this.dr[i])},t}(),Bf=function(){function t(){this.defaultSetting={remote_log_level:"info",zip_log:0,detaillog_domain:"",http3:0,api_error_report:1,api_login:3e4,api_logout:3e4,api_start_publish:3e4,api_start_play:3e4,ip_stack_mode:1,publish_video_codec:"H264",camera_video_bitrate:800,screen_video_bitrate:1500,custom_video_bitrate:0,l3_play_buffer_ms:500,AEC:void 0,AGC:void 0,ANS:void 0,resource_mode:0,bitrate_mode:"default",auto_to_tcp:!1,udp_max_fail_num:2,probe_started_num:3,udp_or_tcp:"udp",hardware_encode:!1,camera_hard_encode:!1,custom_hard_encode:!1,bg_fps_stat:0,camera_width:720,camera_height:480,camera_framerate:15,camera_audio_bitrate:48,open_mini_sdp:!1,sound_level_api_type:x.useAnalyzer,sound_sample_interval:200,scenario_configs:[],dtx:0,peer_signal_over_dc:!1,ains:0,ains_mode:0,auto_switch_publish_video_codec:0,vid_clock_rate_est:0},this.userChangedKey={},this.arrObjKeys=["scenario"],this.arrObjItemKeys=["scenario_configs"],this.setting=JSON.parse(JSON.stringify(this.defaultSetting))}return t.prototype.setSetting=function(t,i){var e=Array.isArray(i)&&i.length>0;for(var n in t){var s=t[n];if(this.arrObjKeys.includes(n))for(var r in s)this.setting[n+"_"+r]=s[r];else if(Lt(s.ctrlmode)&&[1,2].includes(s.ctrlmode))this.setting[n]=s,this.setting[n+"_ctrlmode"]=s.ctrlmode;else for(var r in s)if(!(r.endsWith("_ctrlmode")||e&&-1==i.indexOf(r)))if(Bt(s[r+"_ctrlmode"]))void 0===s[r]?this.defaultSetting[r]&&(this.setting[r]=this.defaultSetting[r]):this.setting[r]=s[r];else{var o=s[r+"_ctrlmode"];1===o?this.userChangedKey[r]||(this.setting[r]=s[r]):2===o?this.setting[r]=s[r]:this.userChangedKey[r]||this.defaultSetting[r]&&(this.setting[r]=this.defaultSetting[r]),"number"==typeof o&&(this.setting[r+"_ctrlmode"]=s[r+"_ctrlmode"])}}},t.prototype.getSetting=function(t,i){return void 0===i&&(i=!1),this.arrObjItemKeys.includes(t)?this.setting[t]:i?2==this.setting[t+"_ctrlmode"]?this.setting[t]:void 0:this.setting[t]},t.prototype.setUserValue=function(t,i){2!==this.setting[t+"_ctrlmode"]&&(this.userChangedKey[t]=!0,this.setting[t]=i)},t.prototype.getCloudSettingScenario=function(t,i,e){var n=this;void 0===i&&(i=!1),void 0===e&&(e=!1);var s=(this.getSetting("scenario_configs")||[]).find((function(i){return i.scenario===t})),r={};if(s){var o=s.a_chn_count,u=s.a_bitrate,a=s.ctrlmode;[["ANS","ANS",s.ans_status,!0],["AGC","AGC",s.agc_status,!0],["AEC","AEC",s.aec_status,!0],["audioBitrate","camera_audio_bitrate",isNaN(u)?void 0:u/1e3,!1],["channelCount","",o,!1]].forEach((function(t){var s,o,u,c,h;s=t[0],o=t[1],c=t[3],h=a,"number"==typeof(u=t[2])?(i&&2===h||!i&&[1,2].includes(h))&&(c?(1===u&&(r[s]=!0),0===u&&(r[s]=!1)):r[s]=u):!e&&o&&(r[s]=n.getSetting(o,i))}))}else{if(e)return{};var c=this.getSetting("ANS",i);Ut(c)&&(r.ANS=c);var h=this.getSetting("AGC",i);Ut(h)&&(r.AGC=h);var f=this.getSetting("AEC",i);Ut(f)&&(r.AEC=f);var l=this.getSetting("camera_audio_bitrate",i);Lt(l)&&(r.audioBitrate=l)}return r},t.prototype.getSettingList=function(t,i){var e=this;return void 0===i&&(i=!1),t.map((function(t){return e.getSetting(t,i)}))},t.prototype.getSettingWithUserParams=function(t,i){if(this.arrObjItemKeys.includes(t))return this.setting[t];var e=this.setting[t],n=this.setting[t+"_ctrlmode"];return void 0!==n?2===n?e:1===n?null!=i?i:e:i:null!=i?i:e},t}(),Jf="init",Vf="room",Hf="rtc",Gf=function(){return Gf=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Gf.apply(this,arguments)},Ff=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Yf=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Zf=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},Qf=function(){function i(t,e,n,s,r,o,u){var h,f,l,d,m,p,g,b=this;this.In=n,this._dataReport=s,this.Mn=r,this.jr=u,this.dispatchServers=[],this.dispatchHttp3Servers=[],this.dispatchWssV6Servers=[],this.dispatchHttp3V6Servers=[],this.Lr=null,this.qr=1e3,this.version=v,this.id="",this._roomLoginResponseListener=function(){clearTimeout(b.cloudSettingTimer),b.cloudSettingTimer=setTimeout((function(){b.In.info(yu+" fetch cloud setting"),b.Ur()}),100)};var _=i.logConfigForPreset;(null==_?void 0:_.logLevel)&&this.logger.setLogLevel(_.logLevel),n.onConnected=function(t){var i=t.url;if(b.logger.info("".concat(gu," log connected ").concat(i)),i&&i.startsWith("wss://")){b.Nn.logDomain=i.split("/")[2];var e="wss://".concat(b.Nn.logDomain,"/zglog/tlog");b.logger.info("".concat(gu," event url ").concat(e)),b.Mn.setConfig({serverUrl:e})}},this.Nn=new Mc(this.In,this._dataReport),this.Nn.ENV=o,this.Nn.product=eu.product,this.Nn.advanceConfig=Gf(Gf({},this.Nn.advanceConfig),{customDomain:i.customDomain}),this.Br();var y=i.engineOptions;this.cloudSetting=new Wc(null==y?void 0:y.closeCloudSetting),this.getReportSeq=C,this.getSeq=N,this.Jr(),this.Nn.deviceID=function(t){void 0===t&&(t=0);var i=Fo("z_deviceID");if(i)return i;(new Date).getTime();var e=Xo(t);return Go("z_deviceID",e),e}(o),i.pageID||(i.pageID=Xo(o));var w=this.Nn.id=Xo(o);this.logger.info("".concat(gu," deviceID: ").concat(this.Nn.deviceID,", pageID: ").concat(i.pageID,", instID: ").concat(w)),this.Mn.init(t,o,this.Nn.deviceID),this.Mn.setLogger(this.In),this.Nn.reporter=this.Mn;var S,E=pa,O=this.Mn.createSpan(a.H,{key:""},{key:E.event},E.event,!0);e&&this.Vr(e);var T,k,R="Express";if((null===(h=this.jr)||void 0===h?void 0:h.reportData)&&(S=null===(l=null===(f=this.jr)||void 0===f?void 0:f.reportData)||void 0===l?void 0:l.version,R=(null===(m=null===(d=this.jr)||void 0===d?void 0:d.reportData)||void 0===m?void 0:m.project)||R),O.setAttributes({biz_type:E.biz_type(0),project:E.project(R),liveroom_version:E.liveroom_version(S),is_from_cache:E.is_from_cache(!1),sev_env:E.sev_env(this.Nn.testEnvironment?"test":"online"),framework:(null===(p=i.engineOptions)||void 0===p?void 0:p.framework)||void 0}),k=this.In,(T=t)&&Lt(T)&&ai(T)||(k.error("ccp.0 appid must be positive integer number and not empty"),0)){this.Nn.appid=t,this.Nn.configOK=!0,this.Nn.sdKVersion=this.version,this.Nn.testEnvironment&&(this.Nn.mode=tu.Mode.MODE_TEST),this.netAgent=new tu.ZegoConnectionAgent(i.proxyCtrl),this.In.setSessionInfo(this.Nn.appid,"","","","",this.version),this.netAgent.init(),this.netAgent.setLogger(this.In);var I={appID:this.Nn.appid,env:this.Nn.ENV,mode:this.Nn.mode};y&&y.pri&&(I.model=1),i.geoFenceType&&i.geoFenceAreaList&&(I.geoFencing={type:i.geoFenceType,list:i.geoFenceAreaList}),this.netAgent.setAppInfo(I),this.liveRoomHandler=new Uf(this.In,this.Nn,this.netAgent,this._dataReport,this);var z="";0===o?z="rtc":1===o&&(z="ali"),this.Nn.settingConfig=new Bf,this.cloudSetting.setLog(this.In),this.cloudSetting.init({productNum:iu,appID:t,env:o,pollingNotify:function(t,i){b.In.info(gu+" setting file changed "+t+" "+JSON.stringify(i)),b.Nn.actionListener("_cloudSettingNotify",t,i)},reportNotify:this.Hr.bind(this),online:!this.Nn.testEnvironment,connection:this.netAgent,inflate:this.In.inflate});var D=this.Gr("remote_log_level");D&&(this.In.info("".concat(gu," setting remote_log_level default ").concat(D)),this.In.setRemoteLogLevel(D));var P=this.Gr("zip_log");Bt(P)||(this.In.info("".concat(gu," setting zip_log default ").concat(P)),this.In.setZipLogConfig(P)),this.setAPIReports(),this.cloudSetting.setEnvVariable("environment",z);var A=this.cloudSetting.getSettingCache(Jf),M=this.cloudSetting.getSettingCache(Vf),x=!1,j=setTimeout((function(){b.In.warn("".concat(gu," time out, get cache settings failed!")),x=!0,b.Fr(),b.getStoreAppConfig(),O.setAttributes({use_na:E.use_na(1)}),O.end()}),500);Promise.all([A,M]).then((function(t){b.In.info("".concat(gu," get cloud config ").concat(x)),j&&clearTimeout(j);var i=null==t?void 0:t[0];b.Yr(null==i?void 0:i.setting),x||(b.Fr(),b.getStoreAppConfig());var e=b.Gr("remote_log_level",!0);e&&(b.In.info("".concat(gu,"  setting remote_log_level ").concat(e)),b.In.setRemoteLogLevel(e)),b.Zr();var n=b.Gr("zip_log");Bt(n)||(b.In.info("".concat(gu," setting zip_log ").concat(n)),b.In.setZipLogConfig(n)),b.setAPIReports();var s=b.Gr("report_script");if(s){var r=s.url,o=s.key,u=s.hash;b.In.info("".concat(gu," report script ").concat(r," ").concat(o," ").concat(u)),b.Mn.loadScript(!1,r,o,u),O.setAttributes({lua_md5:E.lua_md5(u)})}else b.Mn.loadScript(!1,"","","");var c=null==t?void 0:t[1];b.Yr(null==c?void 0:c.setting);var h=b.Mn.createSpan(a.H,{key:E.event},{key:""},Ya);h.setAttributes({files:Za([{name:Jf,content:JSON.stringify(null==i?void 0:i.setting),versions:JSON.stringify(null==i?void 0:i.versions),code:0,message:""},{name:Vf,content:JSON.stringify(null==c?void 0:c.setting),versions:JSON.stringify(null==c?void 0:c.versions),code:0,message:""}])}),h.end(),O.setAttributes({use_na:E.use_na(1)}),O.end()})).catch((function(t){if(j&&clearTimeout(j),O.setAttributes({use_na:E.use_na(1)}),O.end(),b.In.warn("".concat(gu,"  initConfig ").concat(JSON.stringify(t))),(null==t?void 0:t.code)===Mt.GEO_SET_ERROR.code)throw Error("GeoFencing set Error")})),this.In.info("".concat(gu," ").concat(null!==(g=null===navigator||void 0===navigator?void 0:navigator.appVersion)&&void 0!==g?g:""," ").concat(this.version,"  logVersion:").concat(Ac.ZegoLogger.logVersion)),this._bindWindowListener(),this.Nn.networkState=navigator?navigator.onLine?c.online:c.offline:c.online;var L="Firefox"===Bo()?null===navigator||void 0===navigator?void 0:navigator.userAgent:null===navigator||void 0===navigator?void 0:navigator.appVersion;O.setAttribute("sys_info",L||""),this.Qr(),this.In.setSessionInfo(this.Nn.appid,"","","","",this.version)}else this.In.error("".concat(gu," init sdk error")),this.Mn.setError(O,E.error.kInvalidParamError);_&&this.setLogConfig(_),this.Nn.onListener("roomLoginResponse",this._roomLoginResponseListener)}return Object.defineProperty(i.prototype,"logger",{get:function(){return this.In},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"stateCenter",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"modules",{get:function(){return{service:{sendMessage:function(t){},on:function(t,i){},registerRouter:function(t,i){}}}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isUseNetAgent",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isUaConnect",{get:function(){return this.netAgent.isConnect()},enumerable:!1,configurable:!0}),i.prototype.Gr=function(t,i){var e;return void 0===i&&(i=!1),null===(e=this.Nn.settingConfig)||void 0===e?void 0:e.getSetting(t,i)},i.prototype.Yr=function(t,i){var e;return null===(e=this.Nn.settingConfig)||void 0===e?void 0:e.setSetting(t,i)},Object.defineProperty(i.prototype,"reporter",{get:function(){return this.Mn},enumerable:!1,configurable:!0}),i.prototype.setEngineConfig=function(t){var i=t.roomRetryTime,e=t.isFlutter;i&&(this.Nn.roomRetryTime=i),Ut(e)&&(this.Nn.isFlutter=e)},i.prototype.destroyRTM=function(){this.Nn.roomModulesList.some((function(t){return!((null==t?void 0:t.isLogout())||t.roomState===Vc)}))&&this.logoutRoom(),this.Mn.setUnloadState(a.I),this.Mn.destroy(),this.Xr()},i.prototype.Jr=function(){this.proxyRes=Yo,this.getServerError=wo},i.prototype.Br=function(){var t=this.version.split(".").map((function(t){return parseInt(t)}));this.Nn.sdkVerNum=(0===this.Nn.ENV?p.SDKProject_ZegoWebRTC:p.SDKProject_ZegoMiniProgram)<<28|t[0]<<20|t[1]<<8|t[2]},i.prototype.Qr=function(){this.Mn.createSpan(a.H,{key:pa.event},{key:ga},ga,!0).end()},i.prototype.Zr=function(){var t=[],i=[],e=this.Nn.advanceConfig.customDomain;if((null==e?void 0:e.detaillog)&&""!==(null==e?void 0:e.detaillog))t.push("https://".concat(s=e.detaillog,"/log/userupload")),this.In.info(Iu+" set detaillog url by advance config "+JSON.stringify(t)),this.In.setZipLogUploadUrl(t,i);else if(this.Nn.geoFencing){var n=this.Nn.geoFencing;this.In.info(Iu+" geo log is  "+(o=n.detaillog)+" "+(u=n.wssV6Detaillog)),o&&""!==o&&(t.push("https://".concat(o,"/log/userupload")),this.In.info(Iu+" set detaillog url by geoFencing v4 "+JSON.stringify(t))),u&&""!==u&&(i.push("https://".concat(u,"/log/userupload")),this.In.info(Iu+" set detaillog url by geoFencing v6 "+JSON.stringify(t))),(t.length>0||i.length>0)&&this.In.setZipLogUploadUrl(t,i)}else{if(this.Gr("detaillog_domain")){var s=this.Gr("detaillog_domain");this.In.info("".concat(Iu," set detaillog domain by cloudsetting ").concat(s)),s&&""!==s&&t.push("https://".concat(s,"/log/userupload"))}else if(this.Nn.svrDomains){var r=this.Nn.svrDomains,o=r.detaillog,u=r.wssV6Detaillog;this.In.info("".concat(Iu," set detaillog domain by svr ").concat(o," ").concat(u)),o&&""!==o&&t.push("https://".concat(o,"/log/userupload")),u&&""!==u&&i.push("https://".concat(u,"/log/userupload"))}(t.length>0||i.length>0)&&this.In.setZipLogUploadUrl(t,i)}},i.prototype.getStoreAppConfig=function(){if(this.In.info(Ru+" call"),localStorage){var t=Fo(au+"_"+this.getAppID()+"_"+(this.Nn.mode||lu.modeNo));if(t){var i=Fo(cu+"_"+this.getAppID()+"_"+(this.Nn.mode||lu.modeNo));i||this.In.info(Ru+" no store config etag");try{var e=Ho(t,nu);if(e?(this.Nn.appConfig=JSON.parse(e),this.Mn.spanSetAttributes({key:pa.event},{is_from_cache:pa.is_from_cache(!0)}),this.Nn.actionListener("_appConfigRsp")):localStorage.removeItem(au+"_"+this.getAppID()+"_"+(this.Nn.mode||lu.modeNo)),i){var n=Ho(i,nu);this.Nn.appConfigEtag=parseInt(n)}}catch(t){this.In.warn(Ru+" "+JSON.stringify(t))}}else this.In.info(Ru+" no store config")}else this.In.warn(Ru+" no localstorage")},i.prototype.Fr=function(){var t,e,n,s,r,o,u=this;this.In.info(ku+" call"),this.netAgent.on("disconnected",(function(t){u.In.info("".concat(ku," netAgent disconnect ")+u.Nn.roomModulesList.length),u.Nn.roomModulesList.length>0&&u.netAgent.connectUa()})),this.netAgent.on("connected",(function(t){u.In.info("".concat(ku," netAgent connect stack ").concat(kt[u.netAgent.connectIPStackType])),u.Nn.agentConnectIPStackType=u.netAgent.connectIPStackType,u.Mn.setNetStateCheck();var i=u.Mn.createSpan(a.H,{key:oc},{key:""},oc);i.setAttributes(Gf({},t)),i.end(),u.fetchAppConfig(),u.retryRoom(!0)})),this.netAgent.on("connectFailed",(function(t){u.In.info("".concat(ku," netAgent connectFailed"));var i=u.Mn.createSpan(a.H,{key:uc},{key:""},uc);i.setAttributes(Gf({},t)),i.end()})),this.netAgent.on("h3BackToWss",(function(t){u.In.info("".concat(ku," netAgent h3BackToWss"));var i=u.Mn.createSpan(a.H,{key:ac},{key:""},ac);i.setAttributes(Gf({},t)),i.end()})),this.netAgent.on("broken",(function(t){u.In.info("".concat(ku," netAgent broken")),t===tu.BrokenType.CLOSE&&u.Nn.roomModulesList.forEach((function(t){t.resetSessionInfo()}))})),this.netAgent.on("dispatchEvent",(function(t,i,e){if(u.In.info("".concat(ku," dispatch")),"start"===i){var n=u.Mn.createSpan(a.H,{key:ec},{key:""},dc);u.Nn.requestList[t]=n}else if("end"===i){(n=u.Nn.requestList[t])&&(n.setAttributes({domain_list:vc(e.domains),http3_domain_list:mc(e.http3Domains),wss_v6_domain_list:pc(e.wssV6Domains),http3_v6_domain_list:gc(e.http3V6Domains)}),n.end())}})),this.netAgent.on("dispatchResultUpdate",(function(t){var i=t.servers,e=t.domains,n=t.http3Servers,s=t.http3Domains,r=t.wssV6Servers,o=t.http3V6Servers,a=t.wssV6Domains,c=t.http3V6Domains;u.In.info("".concat(ku," dispatchResult ").concat(JSON.stringify(t)));var h=u.Nn.netGeoFencing;if(1!==h.id)e&&e[0]&&(h.accesshub=e[0]),s&&s[0]&&(h.http3Accesshub=s[0]),a&&a[0]&&(h.wssV6Accesshub=a[0]),c&&c[0]&&(h.http3V6Accesshub=c[0]),u.setLocalGeoFencing();else{var f=function(t,i){var e=Vo(JSON.stringify(i),nu);Go(t+"_"+u.Nn.appid+"_"+(u.Nn.mode||lu.modeNo),e)};f(su,i),f(ru,n),f(ou,r),f(uu,o)}})),this.netAgent.on("svrAddrResultUpdate",(function(t){var i=t.accesshub_domain,e=t.logreport_domain,n=t.detaillog_domain,s=t.geofencing_id,r=t.accesshub_v6_domain,o=t.http3_v6_domain,a=t.logreport_v6_domain,c=t.detaillog_v6_domain;if(1!==s){var h=u.Nn.netGeoFencing;e&&(h.logreport=e),a&&(h.wssV6Logreport=a),n&&(h.detaillog=n),c&&(h.wssV6Detaillog=c),h.id=s,u.setLocalGeoFencing()}else{var f=Vo(JSON.stringify({accesshub_domain:i,logreport_domain:e,detaillog_domain:n,accesshub_v6_domain:r,http3_v6_domain:o,logreport_v6_domain:a,detaillog_v6_domain:c}),nu);Go(fu+"_"+u.Nn.appid+"_"+(u.Nn.mode||lu.modeNo),f)}e&&(u.stateCenter.svrDomains.logreport=e,a&&(u.stateCenter.svrDomains.wssV6Logreport=a),u.handleLogUpload(),u._onAppConfigUpdate&&u._onAppConfigUpdate({loggerDomains:[e]})),n&&(u.stateCenter.svrDomains.detaillog=n,c&&(u.stateCenter.svrDomains.wssV6Detaillog=c),u.Zr())})),this.netAgent.on("ipDetection",(function(t){var i,e,n=t.linkConnectDetection,s=t.ipList;if(n&&(u.In.info("".concat(ku," ip detection v4: ").concat(Nt[n.IPv4],", v6: ").concat(Nt[n.IPv6])),u.Nn.agentIpStackDetection=n),s){var r=u.Mn.createSpan(a.H,{key:pn},{key:""},Sr);r.setAttributes({ipv4:Er(null===(i=s.ipv4)||void 0===i?void 0:i[0]),ipv6:Er(null===(e=s.ipv6)||void 0===e?void 0:e[0])}),r.end()}})),this.netAgent.on("connectedEvent",(function(t,i,e){var n;if(u.In.info("".concat(ku," connect")),"start"===i){var s=u.Mn.createSpan(a.H,{key:pa.event},{key:ec},ec,!0);u.Nn.requestList[t]=s}else if("end"===i){if(s=u.Nn.requestList[t]){var r=e.connectEvents||[];s.setAttributes({request_count:sc(e.count),connect_id:nc(e.connectid),events:rc(r),error:(null===(n=r[0])||void 0===n?void 0:n.error)||0,ip_stack:u.netAgent.connectIPStackType}),s.end()}}})),this.netAgent.on("requestEvent",(function(t,i,e){if(u.In.info("".concat(ku," request")),"start"===i){var n=u.Mn.createSpan(a.H,{key:pa.event},{key:bc},bc,!0);u.Nn.requestList[t]=n}else if("end"===i){(n=u.Nn.requestList[t])&&(n.setAttributes({req_location:_c(e.na_req_location),http_code:e.status_code,error:e.err_code}),n.end())}})),this.netAgent.on("disConnectedEvent",(function(t){var i=t.duration,e=t.server,n=t.connectid;u.In.info("".concat(ku," disconnect"));var s=u.Mn.createSpan(a.H,{key:pa.event},{key:""},cc);s.setAttributes({url:fc(e),connect_duration:lc(i),connect_id:hc(n)}),s.end()})),this.netAgent.on("clientInfo",(function(t){var i=t.timeOffset,e=t.geofencingID;Lt(i)&&u.Mn.setTimeOffset(i),u.Wr(),Lt(e)&&(u.Nn.netGeoFencing.id=e)})),this.netAgent.on("heartBeatTimeout",(function(){u.Nn.actionListener("_uaHeartBeatTimeout")}));var c=At[this.Nn.selectIPStackMode];this.In.info("".concat(ku," select ip stack mode ").concat(c)),this.In.setSettingConfig({ipStackMode:this.Nn.selectIPStackMode}),this.netAgent.setSettingConfig({enableHttp3:void 0!==(null===(t=i.engineOptions)||void 0===t?void 0:t.http3)?!!i.engineOptions.http3:1===this.Gr("http3"),ipStackMode:this.Nn.selectIPStackMode,accesshubBypassConnectTime:null===(e=i.engineOptions)||void 0===e?void 0:e.accesshubBypassConnectTime,dispatchTag:null===(n=i.engineOptions)||void 0===n?void 0:n.appDispatchTag});var h=[],f=[],l=[],d=[],v=this.Kr(),m=v.detaillog;h=v.accesshub,l=v.wssV6Accesshub,this.stateCenter.svrDomains.logreport=v.logreport[0],this.stateCenter.svrDomains.detaillog=m[0],this.In.info("".concat(ku," hard domains ").concat(JSON.stringify(h)));var p=this.$r();if(this.In.info("".concat(ku," svr domains ").concat(JSON.stringify(h))),p){var g=p.accesshub_domain,b=p.logreport_domain,_=p.detaillog_domain,y=p.accesshub_v6_domain,w=p.logreport_v6_domain,S=p.detaillog_v6_domain;g&&(h=[g],this.stateCenter.svrDomains.accesshub=g),y&&(l=[y],this.Nn.svrDomains.wssV6Accesshub=y),b&&(this.stateCenter.svrDomains.logreport=b),w&&(this.Nn.svrDomains.wssV6Logreport=w),_&&(this.stateCenter.svrDomains.detaillog=_),S&&(this.Nn.svrDomains.wssV6Detaillog=S)}var E=null===(s=i.engineOptions)||void 0===s?void 0:s.accessDomains;E&&(h=E);var O=this.getGeoDomains();h=(null==O?void 0:O.domains)||h,f=(null==O?void 0:O.http3Domains)||f,l=(null==O?void 0:O.wssV6Domains)||l,d=(null==O?void 0:O.http3V6Domains)||d;var T=!1,k=this.io(),R=k.accesshub,I=k.logreport,N=k.detaillog;R&&""!==R&&(T=!0,h=[R],this.stateCenter.svrDomains.accesshub=R),I&&""!==I&&(this.stateCenter.svrDomains.logreport=I),N&&""!==N&&(this.stateCenter.svrDomains.detaillog=N),this.In.info("".concat(ku," advance config domains: ").concat(JSON.stringify(k),", set domains ").concat(JSON.stringify(h),", ")),this.In.info("".concat(ku," domains ").concat(JSON.stringify(h)," v6domains ").concat(JSON.stringify(l)));var C=h.map((function(t){return"wss://".concat(t,"/accesshub")})),z=f.map((function(t){return"https://".concat(t,"/accesshub")})),D=l.map((function(t){return"wss://".concat(t,"/accesshub")})),P=d.map((function(t){return"https://".concat(t,"/accesshub")}));if(this.netAgent.setNetAgentDefaultServers(C,D),this.dispatchServers=[],this.Nn.geoFencing||T||E)this.dispatchServers=C,this.dispatchHttp3Servers=z,this.dispatchWssV6Servers=D,this.dispatchHttp3V6Servers=P;else{var A=this.eo(),M=A.http3Servers,x=A.wssV6Servers,j=A.http3V6Servers;this.dispatchServers=A.servers,this.dispatchHttp3Servers=M,this.dispatchWssV6Servers=x,this.dispatchHttp3V6Servers=j}(null===(o=null===(r=this.stateCenter.advanceConfig)||void 0===r?void 0:r.customDomain)||void 0===o?void 0:o.logreport)?(this.handleLogUpload(),this.Zr()):this.handleLogUpload(),this.In.info(ku+" dispatch access servers ".concat(JSON.stringify(this.dispatchServers)," ").concat(JSON.stringify(this.dispatchHttp3Servers)," ").concat(JSON.stringify(this.dispatchWssV6Servers)," ").concat(JSON.stringify(this.dispatchHttp3V6Servers))),this.netAgent.setDispatchConnectServers(this.dispatchServers,this.dispatchHttp3Servers,this.dispatchWssV6Servers,this.dispatchHttp3V6Servers)},i.prototype.no=function(t){var i=t.split(".");return i[i.length-2]+"."+i[i.length-1]},i.prototype.io=function(){var t={},i=this.stateCenter.advanceConfig.customDomain;if(!i)return t;var e=i.accesshub,n=i.logreport,s=i.detaillog;return e&&(t.accesshub=e),n&&(t.logreport=n),s&&(t.detaillog=s),t},i.prototype._replaceMainDomain=function(t){var i,e,n,s;if(this.Nn.geoFencing){var r=this.no(null===(i=this.Nn.geoFencing)||void 0===i?void 0:i.accesshub);this.Nn.geoFencing.accesshub=null===(e=this.Nn.geoFencing)||void 0===e?void 0:e.accesshub.replace(r,t),this.Nn.geoFencing.logreport=null===(n=this.Nn.geoFencing)||void 0===n?void 0:n.logreport.replace(r,t),this.Nn.geoFencing.detaillog=null===(s=this.Nn.geoFencing)||void 0===s?void 0:s.detaillog.replace(r,t)}},i.prototype.hashMainDomain=function(){var t=lu.normalPriDomains.length,i=function(t,i){for(var e=0;t>0;)e+=t%10,t=Math.floor(t/10);return Math.floor(e/i)}(this.getAppID(),t);return lu.normalPriDomains[i%t]},i.prototype.Kr=function(){var t,i={accesshub:[],wssV6Accesshub:[],logreport:[],detaillog:[]},e=(null===(t=this.jr)||void 0===t?void 0:t.prefixDomain)||lu.prefixDomain,n=lu.wssV6preFixDomain,s=du,r=vu,o=this.hashMainDomain(),u=lu.normalPriDomains.filter((function(t){return t!==o}));return i.accesshub=Zf([o],u,!0).map((function(t){return e+"."+t})),i.wssV6Accesshub=Zf([o],u,!0).map((function(t){return n+"."+t})),i.logreport=[s+"."+o],i.detaillog=[r+"."+o],i},i.prototype.eo=function(){var t=this,i=function(i){var e=Fo(i+"_"+t.Nn.appid+"_"+(t.Nn.mode||lu.modeNo));if(!e)return[];var n=Ho(e,nu);if(n)try{return JSON.parse(n)}catch(t){return[]}return[]};return{servers:i(su),http3Servers:i(ru),wssV6Servers:i(ou),http3V6Servers:i(uu)}},i.prototype.$r=function(){var t=Fo(fu+"_"+this.Nn.appid+"_"+(this.Nn.mode||lu.modeNo));if(!t)return null;var i=Ho(t,nu);if(i)try{return JSON.parse(i)}catch(t){return null}return null},i.prototype.so=function(t){return lu.scheme+"://"+t+"/"+lu.location},i.prototype._bindWindowListener=function(){var t=this,i=navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i),e=Bo(),n=navigator.userAgent,s="micromessenger"==n.toLowerCase().match(/MicroMessenger/i),r=n.indexOf("Android")>-1||n.indexOf("Adr")>-1,o="";o=i||s&&r?"pagehide":"Firefox"===e?"beforeunload":"unload",window.addEventListener(o,(function(){return Ff(t,void 0,void 0,(function(){return Yf(this,(function(t){switch(t.label){case 0:return this.In.info(bu+" "+o),this.Mn.setUnloadState(a.I),this._onBeforePageUnload?[4,this._onBeforePageUnload()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this.logoutRoom(),[2]}}))}))})),window.addEventListener("offline",(function(){t.ro()})),window.addEventListener("online",(function(){t.oo()}))},i.prototype.retryRoom=function(t,i,e){if(void 0===t&&(t=!1),void 0===e&&(e=!1),this.logger.info("".concat("zm.rr"," retryNow:").concat(t," roomid:").concat(i,", resetSession:").concat(e)),i){var n=this.Nn.roomModulesList.find((function(t){return t.roomID==i}));n&&n.retryRoom(t,e)}else this.Nn.roomModulesList.forEach((function(i){null==i||i.retryRoom(t,e)}))},i.prototype.oo=function(){this.In.info(bu+" network is online"),this.Nn.networkState!==c.online&&(this.Nn.networkState=c.online,this.Xr())},i.prototype.Xr=function(){this.Lr&&(clearInterval(this.Lr),this.Lr=null)},i.prototype.uo=function(){var t=this;this.Xr(),this.In.info(ha+" start network online detection.."),this.Lr=setInterval((function(){t.Nn.networkState!==c.offline&&t.Xr(),t.isUaConnect&&(t.In.info(ha+" detected network online"),t.oo(),t.Xr())}),this.qr)},i.prototype.ro=function(){this.In.info(bu+" network is broken"),this.Nn.networkState!==c.offline&&(this.Nn.networkState=c.offline,this.uo())},i.prototype.setLogConfig=function(t){var i,e;this.In.info(_u+" call");var n=this.Mn.createSpan(a.H,{key:pa.event},{key:ya.event},ya.event);if(t.logLevel&&["debug","info","warn","error","report","disable"].includes(t.logLevel)&&(this.In.setLogLevel(t.logLevel),n.setAttributes({log_level:ya.log_level(t.logLevel)})),t.remoteLogLevel&&["debug","info","warn","error","report","disable"].includes(t.remoteLogLevel)&&n.setAttributes({remote_log_level:ya.remote_log_level(t.remoteLogLevel)}),qt(t.logURL)&&(t.logURL.startsWith("wss://")||t.logURL.startsWith("https://")))(null===(i=this.Nn.geoFencing)||void 0===i?void 0:i.logreport)?this.In.info(_u+" geo exist"):(this.In.setLogServer([t.logURL],[]),this.Nn.customSetLogURL=!0,0===this.Nn.ENV&&(this.Nn.logDomain=null===(e=this.In.url)||void 0===e?void 0:e.split("/")[2],this.Mn.setConfig({serverUrl:"wss://"+this.Nn.logDomain+"/zglog/tlog"}))),n.setAttributes({log_url:ya.log_url(t.logURL)}),n.end();else if(t.logURL)return this.In.error(_u+"log url must be a wss or https url"),this.Mn.setError(n,ya.error.kInvalidParamError),!1;return this.In.info(_u+" call success"),n.end(),!0},i.prototype.setDebugVerbose=function(t){var i=this.Mn.createSpan(a.H,{key:pa.event},{key:ba},ba);Ut(t)&&(this.Nn.debug=t,this.Nn.debugCustom=!0,i.setAttributes({debug:_a(t?"true":"false")})),i.end(),this.In.info("zm.sdv call success")},i.prototype.Vr=function(t){qt(t)&&t.indexOf("wss")>-1?this.Nn.debug=Zo(t):Array.isArray(t)&&t.length>0&&t.every((function(t){return qt(t)&&t.indexOf("wss")>-1}))?this.Nn.debug=Zo(t[0]):this.In.info(gu+" server wrong"),this.Nn.testEnvironment=this.Nn.debug},i.prototype.renewToken=function(t,i){var e,n,s=this,r=this.Mn.createSpan(a.H,{key:Oa.event,par:i},{key:""},Ia.event);if(!(Bt(i)||qt(i)&&""!=i))return this.In.error(Pu+" roomID must be string and no empty"),!1;var o=this.getRoomModules(i)||this.Nn.roomModulesList[0];if(!o)return this.In.error(Pu+" calling must after loginRoom"),this.Mn.setError(r,Ia.error.NOT_LOGIN),!1;if(qt(t)&&o.roomTryHandler){if(t===o.roomTryHandler.token)this.In.info(Pu+" token has not changed"),r.setAttributes({error:Ia.error.INPUT_PARAM.code,message:"token has not changed"}),r.end();else if(r.setAttributes({token:Ia.token(t)}),this.Nn.configRoomAuth){null===(e=this.liveRoomHandler)||void 0===e||e.renewToken({token:t},(function(i){var e,n,u,a,c;null===(e=o.roomTryHandler)||void 0===e||e.renewLocalToken(t,null===(n=null==i?void 0:i.body)||void 0===n?void 0:n.token_remain_time),s.cloudSetting.setToken(t);var h=(null===(u=null==i?void 0:i.body)||void 0===u?void 0:u.stop_stream_id_list)||(null===(c=null===(a=null==i?void 0:i.body)||void 0===a?void 0:a.stop_stream)||void 0===c?void 0:c.stream_id_list)||[];h.length>0&&s.Nn.actionListener("_stopStream",h,{code:Mt.NO_PUBLISH_AUTH.code,message:Mt.NO_PUBLISH_AUTH.msg}),s.Mn.setReporterInfo(s.Nn.idName||"",t),s.Nn.configCheckToken=!0,r.end(),s.In.info(Pu+" "+JSON.stringify(i))}),(function(i){var e,n,u=null===(e=null==i?void 0:i.body)||void 0===e?void 0:e.err_code;s.Mn.setError(r,i),!u||1000002014!==u&&2014!==u?s.In.error(Pu+" "+JSON.stringify(i)):(s.Nn.configCheckToken=!1,null===(n=o.roomTryHandler)||void 0===n||n.renewLocalToken(t),s.cloudSetting.setToken(t),s.In.warn(Pu+" "+JSON.stringify(i)))}),o)}else null===(n=o.roomTryHandler)||void 0===n||n.renewLocalToken(t),this.cloudSetting.setToken(t),this.Mn.setReporterInfo(this.Nn.idName||"",t),r.end();return!0}return qt(t)&&!o.roomTryHandler?(this.In.error(Pu+" calling must after loginRoom"),this.Mn.setError(r,Ia.error.NOT_LOGIN),!1):(this.In.error(Pu+" token must be string and not empty"),this.Mn.setError(r,Ia.error.INPUT_PARAM),!1)},i.prototype.setCloudSettingURLs=function(t){var i=this;this.In.info(Cu+" call "),Array.isArray(t)&&t.length>0&&t.every((function(t){return qt(t)&&t.indexOf("http")>-1}))&&this.cloudSetting.init({productNum:iu,appID:this.Nn.appid,env:this.Nn.ENV,pollingNotify:function(t,e){i.In.info(Cu+" setting file changed "+t+" "+JSON.stringify(e)),i.Nn.actionListener("_cloudSettingNotify",t,e)},reportNotify:this.Hr.bind(this),online:!this.Nn.testEnvironment,connection:this.netAgent})},i.prototype.loginRoom=function(t,i,e,n){var s=this;return this.In.info(yu+" call by user "+(null==e?void 0:e.userID)+" "+t+" "+this.version+" build: 2025-7-8 16:40:33"),new Promise((function(o,u){return Ff(s,void 0,void 0,(function(){var s,a,h,f,l,d,v,m,p,g,b,_,y,w,S=this;return Yf(this,(function(E){switch(E.label){case 0:return 1!==this.Nn.ENV?[3,2]:[4,new Promise((function(t){}))];case 1:E.sent(),E.label=2;case 2:if(s=function(t,i){void 0===i&&(i="");var n=S.Mn.getAPIErrorReport(Oa.event);S.Mn.takeAPIErrorReport(Oa.event,t,n,(null==e?void 0:e.userID)?{id_name:e.userID+""}:{}),u(t.code&&t.msg&&""!==i?{code:t.code,msg:t.msg+i}:t)},!(n=n||{}).maxMemberCount&&(n.maxMemberCount=0),f=(a=this.Nn).roomModulesList,l=Oa.error,!(h=a.isMultiRoom)&&f.length>0)return s(l.ROOM_COUNT_EXCEED),[2];for(d=0;d<f.length;d++){if((v=f[d]).roomID===t)return m=this.stateCenter.isFlutter?l.LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID:l.REPEATEDLY_LOGIN,this.stateCenter.isFlutter&&this.Nn.actionListener("roomStateChanged",t,Pt.LoginFailed,m.code,m.msg),s(this.stateCenter.isFlutter?l.LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID:l.REPEATEDLY_LOGIN),[2];if(p=v.roomTryHandler,h&&p&&p.user.userID!==e.userID)return s(l.DIFFERENT_USER_ID),[2]}if(g=new Qc(t,this.Nn,this.In,this._dataReport,this,this.liveRoomHandler),(b=g.roomTryHandler)||(b=new Cc(this.In,this.Nn,g),g.roomTryHandler=b),b.init(this.Nn.roomRetryTime),b.initRoom(g.roomHandler,t,i,e,n),b.loginCompleted=!1,g.roomHandler._roomStateHandle(Gc,Pt.Logining,{code:0,msg:""}),(_=Pc({roomID:{order:0,value:t,rules:[{name:$o.NOT_EMPTY,error:l.ROOM_ID_NULL},{name:$o.TYPE_STRING,error:l.INPUT_PARAM,extMsg:"roomID must be string"},{name:$o.MAX_LENGTH_128,error:l.ROOM_ID_TOO_LONG},{name:$o.ILLEGAL_CHARACTERS,error:l.ROOM_ID_INVALID_CHARACTER}]},token:{order:1,value:i,rules:[{name:$o.NOT_EMPTY,error:l.INPUT_PARAM},{name:$o.TYPE_STRING,error:l.INPUT_PARAM}]},user:{order:2,value:e,rules:[{name:$o.NOT_EMPTY,error:l.INPUT_PARAM,extMsg:" param user error."},{name:$o.TYPE_OBJECT,error:l.INPUT_PARAM,extMsg:" param user error."}]},"user.userID":{order:3,value:e.userID,rules:[{name:$o.NOT_EMPTY,error:l.USER_ID_NULL,extMsg:" param user error."},{name:$o.TYPE_STRING,error:l.INPUT_PARAM,extMsg:" param userID error."},{name:$o.MAX_LENGTH_64,error:l.USER_ID_TOO_LONG},{name:$o.ILLEGAL_CHARACTERS,error:l.USER_ID_INVALID_CHARACTER}]},"user.userName":{order:4,value:e.userName,rules:[{name:$o.TYPE_STRING,error:l.INPUT_PARAM,extMsg:" userName must be string."},{name:$o.MAX_LENGTH_256,error:l.USER_NAME_TOO_LONG}]},config:{order:5,value:n,rules:[]},"config.maxMemberCount":{order:6,value:n.maxMemberCount,rules:[{name:$o.TYPE_INTEGER,error:l.INPUT_PARAM,extMsg:" maxMemberCount must be integer number."}]}},{action:yu,logger:this.In}))!==zc)return g.roomHandler._roomStateHandle(Vc,Pt.LoginFailed,_.error,_.extMsg),s(_.error,_.extMsg),[2];if(y=this.ao(o,u,t,i,n),w=y.loginSpan,b.setLoginRoomCallback(y.interResolve,y.interReject),this.In.setSessionInfo(this.Nn.appid,"","",e.userID,"",this.version),this.Nn.roomModulesList.length>0&&1==this.Nn.isMultiRoom?g.isMulti=!0:Zf([],this.Nn.roomModulesList,!0).forEach((function(t){return t.roomHandler.logout()})),n&&(g.config=n),this.Nn.roomModulesList.push(g),this.netAgent&&(this.Nn.idName=e.userID,this.netAgent.setUserInfo(e.userID),this.Nn.actionListener("_roomLogin",t,i),this.isUaConnect&&this.fetchAppConfig(i)),this.cloudSetting.setUserID(e.userID),this.cloudSetting.setToken(i),this.cloudSetting.activePolling(),w.setAttributes({id_name:e.userID}),this.Mn.setCommonAttributes({id_name:e.userID}),this.Mn.setReporterInfo(e.userID,i),this.In.setTokenInfo(i,e.userID),this.Mn.setSpanInMap(w,{key:Oa.event,par:t}),this.Nn.setMultiRoom=!0,!this.isUaConnect){this.In.info(yu+" us is not connected"),g.roomHandler.setRunState(r.trylogin),b.startMaxTime();try{this.netAgent.connectUa()}catch(t){((null==t?void 0:t.message)+"").includes("execute")||this.In.warn(yu+" connect ua fail "+JSON.stringify(null==t?void 0:t.message))}return[2]}return this.Nn.networkState=c.online,b.retryLoginRoom(!0),[2]}}))}))}))},i.prototype.switchRoom=function(t,i,e){return void 0===t&&(t=""),void 0===i&&(i=""),Ff(this,void 0,void 0,(function(){var n,s,r,o=this;return Yf(this,(function(u){return this.In.info("".concat(Su," call by user fromRoomID:").concat(t," toRoomID:").concat(i)),(s=Pc({fromRoomID:{order:0,value:t,rules:[{name:$o.NOT_EMPTY,error:(n=Oa.error).ROOM_ID_NULL},{name:$o.TYPE_STRING,error:n.INPUT_PARAM,extMsg:"roomID must be string"},{name:$o.MAX_LENGTH_128,error:n.ROOM_ID_TOO_LONG},{name:$o.ILLEGAL_CHARACTERS,error:n.ROOM_ID_INVALID_CHARACTER}]},toRoomID:{order:1,value:i,rules:[{name:$o.NOT_EMPTY,error:n.ROOM_ID_NULL},{name:$o.TYPE_STRING,error:n.INPUT_PARAM,extMsg:"roomID must be string"},{name:$o.MAX_LENGTH_128,error:n.ROOM_ID_TOO_LONG},{name:$o.ILLEGAL_CHARACTERS,error:n.ROOM_ID_INVALID_CHARACTER}]},config:{order:2,value:e,rules:[{name:$o.NOT_EMPTY,error:n.INPUT_PARAM,extMsg:"param config error."},{name:$o.TYPE_OBJECT,error:n.INPUT_PARAM,extMsg:"param config must be object."}]},"config.token":{order:3,value:null==e?void 0:e.token,rules:[{name:$o.NOT_EMPTY,error:n.INPUT_PARAM},{name:$o.TYPE_STRING,error:n.INPUT_PARAM}]},"config.maxMemberCount":{order:4,value:null==e?void 0:e.maxMemberCount,rules:[{name:$o.TYPE_INTEGER,error:n.INPUT_PARAM,extMsg:"maxMemberCount must be integer number."}]}},{action:Su,logger:this.In}))!==zc?(this.In.error(Su+" params error:"+s.error.code),[2,Promise.reject({code:s.error.code,msg:s.extMsg?s.error.msg+" "+s.extMsg:s.error.msg})]):this.getRoomModules(t)?(r=this.getRoomModules(i),t===i||r?(this.In.error("".concat(Su," params error: ").concat(Mt.LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID.code)),[2,Promise.reject(Mt.LOGIN_BEFORE_LOGOUT_BY_SAME_ROOMID)]):(this.stateCenter.actionListener("_beforeSwitchRoom",t),this.logoutRoom(t,!0),[2,new Promise((function(t,n){o.loginRoom(i,(null==e?void 0:e.token)||"",{userID:o.getUserID(),userName:o.getUserName()},{userUpdate:null==e?void 0:e.isUserStatusNotify,maxMemberCount:null==e?void 0:e.maxMemberCount}).then((function(e){o.stateCenter.actionListener("_afterSwitchRoom",i,!0),t(e)})).catch((function(t){o.stateCenter.actionListener("_afterSwitchRoom",i,!1),n(t)}))}))])):(this.In.error("".concat(Su," params error: ").concat(Mt.ROOM_ROOMID_INCORRECT.code)),[2,Promise.reject(Mt.ROOM_ROOMID_INCORRECT)])}))}))},i.prototype.handleLogUpload=function(){var t,i;if(this.In.info(Tu+" call"),this.Nn.customSetLogURL)this.In.info(Tu+" set custom log");else if(this.In.url&&this.In.logConnected)this.In.info(Tu+" log is connected");else{var e=[],n=[],s=this.Nn.advanceConfig.customDomain;if(s&&s.logreport)e.push(u=s.logreport),this.Nn.logDomain=u;else if(this.Nn.geoFencing){var r=this.Nn.geoFencing,o=r.wssV6Logreport;(u=r.logreport)&&e.push(u),o&&n.push(o)}else if(this.Nn.testEnvironment)this.Nn.logDomain="weblogger-hk-test.zegocloud.com",e.push(this.Nn.logDomain);else if(0===this.stateCenter.ENV){if(this.Nn.svrDomains){var u,a=this.Nn.svrDomains;o=a.wssV6Logreport;(u=a.logreport)&&e.push(u),o&&n.push(o)}}else if(1===this.stateCenter.ENV){this.Nn.logDomain=lu.logreportDomain,e.push(this.Nn.logDomain);var c=null===(i=null===(t=this.Nn.appConfig)||void 0===t?void 0:t.app_config)||void 0===i?void 0:i.domain;if(c){var h="weblogger".concat(this.Nn.appid,"-api.").concat(c);e.push(h)}}if(0===this.Nn.ENV){var f=e.map((function(t){return"wss://".concat(t,"/").concat(lu.rtcLogPath)})),l=n.map((function(t){return"wss://".concat(t,"/").concat(lu.rtcLogPath)}));(f.length>0||l.length>0)&&this.In.setLogServer(f,l)}else{f=e.map((function(t){return"https://".concat(t,"/httplog")}));this.In.setLogServer(f,[])}}},i.prototype.fetchAppConfigByTargetToken=function(t,i){return Ff(this,void 0,void 0,(function(){var e,n,s,r,o,u,a=this;return Yf(this,(function(c){switch(c.label){case 0:if(this.In.info(Ou+" call"),!i)return this.In.warn(Ou+" user not exist"),[2];if(e=this.getUserID(),n="",s=null,t)n=t;else{if(!(this.Nn.roomModulesList.length>0))return this.In.warn(Ou+" token not exist"),[2];n=this.getToken()}!this.In.roomid&&this.In.setSessionInfo(this.Nn.appid,"player-no-room","",i,"",this.Nn.sdKVersion),c.label=1;case 1:return c.trys.push([1,5,6,7]),this.netAgent.isConnect()?[3,3]:[4,new Xt((function(t){var i=0,e=function(){i&&clearTimeout(i),a.netAgent.off("connected",e),t(!0)};i=setTimeout((function(){a.netAgent.off("connected",e),t(!1)}),5e3),a.netAgent.on("connected",e)}))];case 2:if(!c.sent())return this.In.error(Ou+" ua not connected"),[2];this.In.info(Ou+" ua connected"),c.label=3;case 3:return this.netAgent.setUserInfo(i),[4,this.netAgent.getAppConfigByAgent("init",n,5e3,this.Nn.appConfigEtag,{isSpecial:!1})];case 4:return r=c.sent(),o=r.data,0===r.code&&(this.handleLogUpload(),s=o),[3,7];case 5:return u=c.sent(),this.In.error(Ou+" token not validated"+u),[3,7];case 6:return e&&this.netAgent.setUserInfo(e),this.In.info(Ou+" call success"),[2,s];case 7:return[2]}}))}))},i.prototype.fetchAppConfig=function(t){return Ff(this,void 0,void 0,(function(){var i,e,n,s,r,o,u,c,h,f,l,d,v,m,p;return Yf(this,(function(g){switch(g.label){case 0:if(this.Nn.appConfigFetched)return this.In.warn(Eu+" config fetched"),[2];if(!this.getUserID())return this.In.warn(Eu+" user not exist"),[2];if(i="",t)i=t;else{if(!(this.Nn.roomModulesList.length>0))return this.In.warn(Eu+" token not exist"),[2];i=this.getToken()}e=this.Mn.createSpan(a.H,{key:pa.event},{key:""},yc),this.In.info(yu+" initConfig etag: "+this.Nn.appConfigEtag),-1!==this.Nn.appConfigEtag&&this.Nn.appConfig.speedlog_config&&void 0===this.Nn.appConfig.speedlog_config.charge_info_report_cycle&&(this.Nn.appConfigEtag=-1,this.In.warn(yu+" reset etag")),n=!!this.Nn.appConfig,g.label=1;case 1:return g.trys.push([1,3,,4]),[4,this.netAgent.getAppConfigByAgent("init",i,5e3,this.Nn.appConfigEtag,{isSpecial:!1})];case 2:if(s=g.sent(),r=s.code,o=s.data,u=s.etag,c=s.retryCount,e.setAttributes({trigger_reason:wc(this.Nn.appConfig?"refresh":"normal"),try_count:Sc(c||0)}),e.end(),this.Nn.appConfigFetched=!0,this.In.info(yu+" initConfig code:"+r+" data: "+JSON.stringify(o)+" etag: "+u),this.Nn.appConfigEtag!==u){if(0==Object.keys(o).length)return this.In.info(yu+" initConfig data null"),[2];this.Nn.appConfig={app_config:o.app_config,media_config:{publish_config:(h=o.media_config).publish_config,play_config:h.play_config},speedlog_config:Gf(Gf({},f=o.speedlog_config),{charge_info_report_no_playing:f.charge_info_report_no_playing||0})},this.Nn.appConfigEtag=u,l=JSON.stringify(this.Nn.appConfig),d=Vo(l,nu),Go(au+"_"+this.getAppID()+"_"+(this.Nn.mode||lu.modeNo),d),v=Vo(this.Nn.appConfigEtag+"",nu),Go(cu+"_"+this.getAppID()+"_"+(this.Nn.mode||lu.modeNo),v)}return!n&&this.Nn.appConfig&&this.Nn.actionListener("_appConfigRsp"),!this.Nn.netAppConfig&&this.Nn.appConfig&&(this.Nn.netAppConfig=Object.assign(this.Nn.appConfig),this.Nn.actionListener("_netAppConfigRsp",this.Nn.netAppConfig)),[3,4];case 3:return m=g.sent(),this.In.error(yu+" fail "+JSON.stringify(m)),e.setAttributes({error:null==m?void 0:m.code}),e.end(),[20012,20008,20019].includes(null==m?void 0:m.code)&&(p=20019===(null==m?void 0:m.code)?JSON.parse(JSON.stringify(Mt.SDK_NOT_SPECIAL)):JSON.parse(JSON.stringify(Mt.APPID_INVALID)),this.Nn.roomModulesList.forEach((function(t){t.roomTryHandler&&t.roomTryHandler.loginFail(p)}))),[3,4];case 4:return[2]}}))}))},i.prototype.Ur=function(){var t,i=this;null===(t=this.cloudSetting)||void 0===t||t.fetchMultiSetting([Jf,Vf,Hf]).then((function(t){var e;if(i.In.info(yu+" settingConfig "+JSON.stringify(t)),t){i.Yr(null===(e=null==t?void 0:t[Jf])||void 0===e?void 0:e.setting,["remote_log_level","zip_log","detaillog_domain"]),i.Nn.actionListener("_settingCanFetch",null==t?void 0:t[Hf]);var n=i.Gr("remote_log_level",!0);n&&(i.In.info("".concat(yu,"  setting remote_log_level ").concat(n)),i.In.setRemoteLogLevel(n));var s=i.Gr("zip_log");Bt(s)||(i.In.info("".concat(gu," force setting zip_log ").concat(s)),i.In.setZipLogConfig(s,!0)),i.Zr(),i.setAPIReports();var r=i.Gr("report_script");if(r){var o=r.url,u=r.key,a=r.hash;i.In.info("".concat(yu," report script ").concat(o," ").concat(u," ").concat(a)),i.Mn.loadScript(!0,o,u,a)}}})).catch((function(t){i.In.warn(yu+" settingConfig "+JSON.stringify(t))})),this.Nn.onListener("_cloudSettingNotify",(function(t,e){var n=i.cloudSetting.getEnvVariables()||{},s=i.Mn.createSpan(a.H,{key:pa.event},{key:""},Qa);if(s.setAttributes({request_kv:Xa(n),files:Wa([{name:t,content:e.setting,versions:e.versions,code:null==e?void 0:e.code,message:null==e?void 0:e.message}])}),s.end(),t===Jf){i.Yr(null==e?void 0:e.setting,["remote_log_level"]);var r=i.Gr("remote_log_level");r&&(i.In.info(yu+" setting remote_log_level "+r),i.In.setRemoteLogLevel(r))}}))},i.prototype.Hr=function(t,i,e){0!==(null==e?void 0:e.code)||!1===(null==e?void 0:e.polling)?"request_start"===i?this.Mn.createSpan(a.H,{key:pa.event},{key:Ka,par:t+""},Ka,!0):"request_end"===i&&this.Mn.spanEnd({key:Ka,par:t+""},{request_detail:$a(null==e?void 0:e.reportData),files:tc(null==e?void 0:e.files),code:null==e?void 0:e.code,request_params:null==e?void 0:e.params,request_kv:null==e?void 0:e.requestKV}):this.In.info("zm.crn not report")},i.prototype.ao=function(t,i,e,n,s){var r=this,o=Oa,u=this.Mn.createSpan(a.I,{key:pa.event},{key:""},o.event);u.setAttributes({svr_env:o.svr_env(this.Nn.testEnvironment?"test":"online"),token:o.token(n)}),s&&(Ut(s.userUpdate)&&u.setAttribute("user_state_update",o.user_state_update(s.userUpdate?1:0)),Lt(s.maxMemberCount)&&u.setAttributes({max_member_cnt:o.max_member_cnt(s.maxMemberCount)}));return{interResolve:function(i){var n,s=r.getRoomSessionID(e),a=r.getRoomModules(e),c=r.getSessionId(e);u.setAttributes({room_id:o.room_id(e),room_sid_string:o.room_sid_string(s),liveroom_sid_string:o.liveroom_sid_string(c),try_cnt:o.try_cnt(null===(n=null==a?void 0:a.roomTryHandler)||void 0===n?void 0:n.retryActiveCount),room_mode:o.room_mode(r.Nn.isMultiRoom?1:0),role:o.role(r.Nn.role),audience_create_room:o.audience_create_room(r.Nn.roomCreateFlag?1:0),max_member_cnt:o.max_member_cnt((null==a?void 0:a.maxMemberCount)||0),user_name:r.Nn.nickName}),u.end(),t(i)},interReject:function(t,n){var s,a,c;void 0===n&&(n=""),u.setAttributes({room_id:o.room_id(e)}),t.code<2e9&&t.code>1e9||t.code<1e6?(a=Eo(t.code,t.msg),c=Oo(t.code)):a={code:t.code,message:t.msg},a&&r.Mn.setError(u,{code:a.code,msg:a.message+n}),c&&Mt[c]&&(t.code=Mt[c].code,(null===(s=t.msg)||void 0===s?void 0:s.includes("unknown"))&&(t.msg=Mt[c].msg)),i(t.code&&t.msg&&""!==n?{code:t.code,msg:t.msg+n}:t)},loginSpan:u}},i.prototype.logoutRoom=function(t,i){var e=this;this.In.info(wu+" call by user "+t);var n=[];if(this.Nn.roomModulesList.length){if(void 0===t)Zf([],this.Nn.roomModulesList,!0).forEach((function(t){e.co(t),n.push(t.roomID),t.roomHandler.logout(!0)})),this.cloudSetting.uninit();else{if(!qt(t)||""==t)throw this.In.error(wu+" roomID must be string and not empty"),this.co(void 0,s=Ca.error.ROOM_ROOMID_INCORRECT),this.Nn.isFlutter&&this.Nn.actionListener("roomStateChanged",t,Pt.LogoutFailed,s.code,s.msg),s;var s,r=this.getRoomModules(t);if(!r)throw this.In.error(wu+" room not exist "+t),this.co(void 0,s=Ca.error.ROOM_ROOMID_INCORRECT,t),this.Nn.isFlutter&&this.Nn.actionListener("roomStateChanged",t,Pt.LogoutFailed,s.code,s.msg),s;this.co(r),n.push(t),r.roomHandler.logout(!1,i),0===this.Nn.roomModulesList.length&&this.cloudSetting.uninit()}this.Mn.deleteCommonAttributes(["id_name"]),this.Mn.clearRoomSpans(n)}else{this.In.warn(wu+" no room");var o={code:0,msg:"no room login"};this.Nn.actionListener("roomStateChanged",t,Pt.Logout,o.code,o.msg)}},i.prototype.uploadLog=function(){var t=this;return new Promise((function(i,e){t.In.info("zm.zip.udlg call"),t.In.uploadStorageLog().then((function(){t.In.info("zm.zip.udlg call success"),i({errorCode:0,extendedData:"upload logs success!"})})).catch((function(i){t.In.error("zm.zip.udlg upload zip log failed, result: "+((null==i?void 0:i.message)||"unknown")),e({errorCode:Mt.UPLOAD_LOG_ERROR.code,extendedData:Mt.UPLOAD_LOG_ERROR.msg+", result: "+((null==i?void 0:i.message)||"unknown")})}))}))},i.prototype.sendCustomCommand=function(t,i,e){return new Promise((function(t,i){console.error(d),i()}))},i.prototype._sendCustomCommand=function(t,i,e){return new Promise((function(t,i){console.error(d),i()}))},i.prototype.sendRoomChannelMessage=function(t,i,e,n,s){return new Promise((function(t,i){console.error(d),i()}))},i.prototype.sendBroadcastMessage=function(t,i){return new Promise((function(t,i){console.error(d),i()}))},i.prototype._sendBroadcastMessage=function(t,i,e,n){return void 0===e&&(e=1),void 0===n&&(n=1),new Promise((function(t,i){console.error(d),i()}))},i.prototype.setRoomExtraInfo=function(t,i,e){return new Promise((function(t,i){console.error(d),i()}))},i.prototype._setRoomExtraInfo=function(t,i,e){return new Promise((function(t,i){console.error(d),i()}))},i.prototype.sendBarrageMessage=function(t,i){return new Promise((function(t,i){console.error(d),i()}))},i.prototype._sendBarrageMessage=function(t,i,e,n){return void 0===e&&(e=1),void 0===n&&(n=1),new Promise((function(t,i){console.error(d),i()}))},i.prototype.sendRelayMessage=function(t,i,e,n,s){console.error("not support")},i.prototype.requestJoinLive=function(t,i,e,n,s){return console.error(d),!1},i.prototype.inviteJoinLive=function(t,i,e,n,s){return console.error(d),!1},i.prototype.endJoinLive=function(t,i,e,n){return console.error(d),!1},i.prototype.respondJoinLive=function(t,i,e,n,s){return console.error(d),!1},i.prototype.getVersion=function(){return this.version},i.prototype.setSdkBizVersion=function(t){qt(t)&&""!==t&&(this.Nn.bizVersion=t)},i.prototype.on=function(t,i){var e=this.Mn.createSpan(a.H,{key:ga},{key:""},wa.event);return e.setAttributes({listener:wa.listener(t)}),this.Nn.listenerList[t]?Ht(i)?(-1==this.Nn.listenerList[t].indexOf(i)&&this.Nn.listenerList[t].push(i),e.end(),!0):(this.In.error(zu+" listener callBack must be funciton"),this.Mn.setError(e,wa.error.INPUT_PARAM," listener callBack must be function"),!1):(this.In.error(zu+" event "+t+" no found"),this.Mn.setError(e,wa.error.INPUT_PARAM," event "+t+" no found"),!1)},i.prototype.off=function(t,i){var e=this.Mn.createSpan(a.H,{key:ga},{key:""},Sa);if(e.setAttributes({listener:Ea(t)}),!this.Nn.listenerList[t])return this.In.error(Du+" listener no found"),this.Mn.setError(e,wa.error.INPUT_PARAM," event "+t+" no found"),!1;var n=this.Nn.listenerList[t];if(i){var s=n.indexOf(i);s>=0&&n.splice(s,1)}else this.Nn.listenerList[t]=[];return e.end(),!0},i.prototype._on=function(t,i){return this.Nn.listenerList[t]?Ht(i)?(-1==this.Nn.listenerList[t].indexOf(i)&&this.Nn.listenerList[t].push(i),!0):(this.In.error(zu+" listener callBack must be funciton"),!1):(this.In.error(zu+" event "+t+" no found"),!1)},i.prototype._off=function(t,i){if(!this.Nn.listenerList[t])return this.In.error(Du+" listener no found"),!1;var e=this.Nn.listenerList[t];return i?e.splice(e.indexOf(i),1):this.Nn.listenerList[t]=[],!0},i.prototype.isTestEnvironment=function(){return this.Nn.testEnvironment},i.prototype.isLogin=function(t){var i=this.getRoomModules(t)||this.Nn.roomModulesList[0];return!!i&&i.isLogin()},i.prototype.getMultiRoom=function(){return this.Nn.isMultiRoom},i.prototype.getAppID=function(){return this.Nn.appid},i.prototype.getUserID=function(){return this.Nn.idName},i.prototype.getUserName=function(){return this.Nn.nickName},i.prototype.getToken=function(t){return(this.getRoomModules(t)||this.Nn.roomModulesList[0]).token},i.prototype.setRoomCreateFlag=function(t){this.Nn.roomCreateFlag=t},i.prototype.setRole=function(t){this.Nn.role=t},i.prototype.getSessionId=function(t){var i=this.getRoomModules(t)||this.Nn.roomModulesList[0];return i?i.userSidString:"0"},i.prototype.getRoomSessionID=function(t){var i=this.getRoomModules(t)||this.Nn.roomModulesList[0];return i?i.roomSidString:"0"},i.prototype.getAppConfig=function(){return this.Nn.appConfig},i.prototype.setTestPackageSize=function(t){this.stateCenter.configOK&&(this.Nn.testNetPackageSize=t)},i.prototype.setAccess=function(t){},i.prototype.enableMultiRoom=function(t){var i=this.Mn.createSpan(a.H,{key:pa.event},{key:""},Fa.event);return Ut(t)?(i.setAttribute("is_multi",Fa.is_multi(t)),this.Nn.roomModulesList.length>0||this.Nn.setMultiRoom?(this.In.error(Au+" multi room can only be set once before first login"),this.Mn.setError(i,Fa.error.kInvalidParamError),!1):(i.end(),this.Nn.isMultiRoom=t,this.Nn.setMultiRoom=!0,!0)):(this.In.error(Au+" param must be boolean"),this.Mn.setError(i,Fa.error.kAlreadyLoginError),!1)},i.prototype.getRoomModules=function(t){return this.Nn.roomModulesList.find((function(i){return i.roomID==t}))},i.prototype._onAppConfigUpdate=function(t){},i.prototype._onBeforePageUnload=function(){},i.use=function(t){switch(t.type){case"Message":case"Live":t.install(i,Qc,Uf)}},i.setGeoFence=function(t,e){if(![0,1,2].includes(t))throw new Error("GeoFencing set Error");if(!e.every((function(t){return pu.find((function(i){return i===t}))})))throw new Error("GeoFencing set Error");i.geoFenceType=t,i.geoFenceAreaList=e},i.setEngineOptions=function(t){if(t.geoFenceType){if(![0,1,2].includes(t.geoFenceType))throw new Error("GeoFencing set Error");i.geoFenceType=t.geoFenceType}if(t.geoFenceAreaList){if(!t.geoFenceAreaList.every((function(t){return mu.find((function(i){return i.id===t}))})))throw new Error("GeoFencing set Error");i.geoFenceAreaList=t.geoFenceAreaList}if(t.dataReportCustomerContext&&ai(t.dataReportCustomerContext,!0)&&yh.setReportCustomerContext(t.dataReportCustomerContext),t.customDomain&&t.customDomain&&"object"==typeof t.customDomain){if(t.customDomain.accesshub&&"string"!=typeof t.customDomain.accesshub)throw new Error("config of customDomain.accesshub should be a string.");if(t.customDomain.logreport&&"string"!=typeof t.customDomain.logreport)throw new Error("config of customDomain.logreport should be a string.");if(t.customDomain.detaillog&&"string"!=typeof t.customDomain.detaillog)throw new Error("config of customDomain.detaillog should be a string.");i.customDomain=t.customDomain}i.engineOptions=Gf(Gf({},i.engineOptions||{}),t)},i.presetLogConfig=function(t){var i={};if(t.logLevel&&["debug","info","warn","error","report","disable"].includes(t.logLevel)&&(i.logLevel=t.logLevel),qt(t.logURL)&&(t.logURL.startsWith("wss://")||t.logURL.startsWith("https://")))i.logURL=t.logURL;else if(t.logURL)throw new Error("log url must be a wss or https url");return this.logConfigForPreset=Gf({},i),!0},i.prototype.resetRoomTokenTimer=function(t,i){var e=this.getRoomModules(t)||this.Nn.roomModulesList[0];e&&i&&i>0&&e.roomHandler.resetTokenTimer(1e3*i)},i.prototype.isDisConnect=function(){return this.liveRoomHandler.isDisConnect()},i.prototype.sendMessage=function(t,i,e,n){this.liveRoomHandler.sendMessage(t,i,e,n)},i.prototype.getNetworkInfo=function(){var t;return(null===(t=this.netAgent)||void 0===t?void 0:t.getNetworkTimeInfo())||{timestamp:0,maxDeviation:0}},i.prototype.setProtoFormat=function(t){if(void 0===t&&(t="json"),!["json","pb"].includes(t))throw new Error("Failed to execute 'setProtoFormat': Arguments 'format' must be 'json' or 'pb'.");this.Nn.protoFormat=t},i.prototype.setSdkLoginRelateService=function(t){Array.isArray(t)&&t.every((function(t){return qt(t)}))&&(this.Nn.relateService=t)},i.prototype.getRoomID=function(){return this.Nn.roomid},i.prototype.getServerTimeOffset=function(){return this.Nn.serverTimeOffset},i.prototype.getReqHead=function(t){var i;return i=qt(t)&&""!==t&&this.getRoomModules(t)||this.Nn.roomModulesList[0],this.liveRoomHandler.getReqHead(i)},i.prototype.sendSwitchMessage=function(t,i){throw this.In.error("".concat("zm.ssm"," ").concat(Mt.WHITE_BOARD_VERSION_ERROR.msg)),Mt.WHITE_BOARD_VERSION_ERROR},i.prototype.onSwitchMessage=function(t){t&&this.liveRoomHandler&&(this.liveRoomHandler.onSwitchMessage=t)},i.prototype.onAppConfigUpdate=function(t){t&&(this._onAppConfigUpdate=t)},i.prototype.onBeforePageUnload=function(t){t&&(this._onBeforePageUnload=t)},i.prototype.getProtoVer=function(){return t.SWITCH_TWO},i.prototype.sendBusinessMessage=function(t,i,e){return Lt(t)&&i?this.liveRoomHandler.sendMessage(t,i,void 0,void 0,e,void 0,!1):-1},i.prototype.co=function(t,i,e){var n=this,s=Ca.event,r=this.Mn.getAPIErrorReport(s);if(i)r&&this.Mn.takeAPIErrorReport(s,i,r);else{var o=this.Mn.createSpan(a.I,{key:pa.event},{key:s,par:null==t?void 0:t.roomID},s,!0);if(o.setAttributes({is_multi:Ca.is_multi(this.Nn.isMultiRoom),is_send_cmd_net:Ca.is_send_cmd_net(!0)}),t){var u=t.roomHandler;u.updateTimes(),o.setAttributes({room_id:Ca.room_id(null==t?void 0:t.roomID),room_sid_string:Ca.room_sid_string(null==t?void 0:t.roomSidString),liveroom_sid_string:Ca.liveroom_sid_string(null==t?void 0:t.userSidString),valid_d:u.validTime,total_d:u.totalTime,tempbroken_cnt:u.brokenCounts})}else qt(e)&&o.setAttributes({room_id:Ca.room_id(e),valid_d:0,total_d:0,tempbroken_cnt:0});i?this.Mn.setError(o,i):o.end(),setTimeout((function(){n.Mn.flush()}),200)}},i.prototype.getMsgSpan=function(t,i,e){return void 0===e&&(e=!1),this.Mn.createSpan(a.H,{key:Oa.event,par:i},{key:t,par:i},t,e)},i.prototype.Wr=function(){var t=this;Lt(this.netAgent.timeOffset)&&this.Mn.setTimeOffset(this.netAgent.timeOffset),this.ho=setTimeout((function(){t.Wr()}),9e5)},i.prototype.setNetAgentHBMode=function(t){this.netAgent.setHeartBeatMode(t)},i.prototype.setLocalGeoFencing=function(){var t=this.Nn.netGeoFencing;if((null==t?void 0:t.id)&&(null==t?void 0:t.accesshub)){var i=Vo(JSON.stringify(this.Nn.netGeoFencing),nu);Go(hu+"_"+this.Nn.appid+"_"+(this.Nn.mode||lu.modeNo),i),this.Nn.netGeoFencing={}}},i.prototype.getLocalGeoFencing=function(){var t=Fo(hu+"_"+this.Nn.appid+"_"+(this.Nn.mode||lu.modeNo));if(!t)return this.In.info(Nu+" no local geo"),null;var i=Ho(t,nu);if(i)try{return JSON.parse(i)}catch(t){return this.In.warn(Nu+" local geo descrypt fail"),null}return null},i.prototype.getGeoDomains=function(){var t,e,n,s;if(i.geoFenceType&&i.geoFenceAreaList){this.In.info("".concat(ku," geo type ").concat(i.geoFenceType," area ").concat(i.geoFenceAreaList.join(",")));var r=void 0,o=[],u=[],a=[],c=[],h=this._getGeoFencingIDAndDomain(i.geoFenceType,i.geoFenceAreaList);if(!h)throw this.In.warn("".concat(ku," geofencing not exist")),Mt.GEO_SET_ERROR;var f=this.getLocalGeoFencing(),l=!1;if(null==f?void 0:f.id){var d=h.find((function(t){return t.id===(null==f?void 0:f.id)}));d&&(l=!0,r={id:null==f?void 0:f.id,accesshub:(null==f?void 0:f.accesshub)||(null==d?void 0:d.accesshub),logreport:(null==f?void 0:f.logreport)||(null==d?void 0:d.logreport),detaillog:(null==f?void 0:f.detaillog)||(null==d?void 0:d.detaillog),http3Accesshub:(null==f?void 0:f.http3Accesshub)||(null==d?void 0:d.http3Accesshub)||"",wssV6Accesshub:(null==f?void 0:f.wssV6Accesshub)||(null==d?void 0:d.wssV6Accesshub),http3V6Accesshub:(null==f?void 0:f.http3V6Accesshub)||(null==d?void 0:d.http3V6Accesshub)||"",wssV6Detaillog:(null==f?void 0:f.wssV6Detaillog)||"",wssV6Logreport:(null==f?void 0:f.wssV6Logreport)||""},f.accesshub&&o.push(f.accesshub),d.accesshub&&o.push(d.accesshub),f.http3Accesshub&&u.push(f.http3Accesshub),f.wssV6Accesshub&&a.push(f.wssV6Accesshub),d.wssV6Accesshub&&a.push(d.wssV6Accesshub),f.http3V6Accesshub&&c.push(f.http3V6Accesshub))}if(!l){var v=h[0],m=v.accesshub;r={id:v.id,accesshub:m,logreport:v.logreport,detaillog:v.detaillog,wssV6Accesshub:v.wssV6Accesshub},o.push(m)}this.Nn.geoFencing=r,this.In.info("".concat(ku," use geo ").concat(JSON.stringify(this.Nn.geoFencing))),t=o,e=u,n=a,s=c}return{domains:t,http3Domains:e,wssV6Domains:n,http3V6Domains:s}},i.prototype._getGeoFencingIDAndDomain=function(t,i){var e=this.hashMainDomain(),n=JSON.parse(JSON.stringify(mu));n.forEach((function(t){t.accesshub+="."+e,t.logreport+="."+e,t.detaillog+="."+e,t.wssV6Accesshub+="."+e}));var s=[];return 1===t?i.forEach((function(t){var i=n.find((function(i){return i.id===t}));i&&s.push(i)})):2===t&&(s=JSON.parse(JSON.stringify(n)),i.forEach((function(t){var i=n.find((function(i){return i.id===t}));i&&(s=s.filter((function(t){return t.id!==(null==i?void 0:i.id)})),i.relative_geofencings.forEach((function(t){s=s.filter((function(i){return i.id!==t}))})))}))),s.length>0?s:null},i.setCloudProxyConfig=function(t,i,e){var n;e?this.proxyCtrl||(this.proxyCtrl=new Fh(t,i)):(null===(n=this.proxyCtrl)||void 0===n||n.destroy(),this.proxyCtrl=null)},i.setLocalProxyConfig=function(t,i){var e;i?this.proxyCtrl||(this.proxyCtrl=new Kh(t)):(null===(e=this.proxyCtrl)||void 0===e||e.destroy(),this.proxyCtrl=null)},i.prototype.setAPIReports=function(){var t=this.Nn.settingConfig.getSettingList(["api_error_report","api_login","api_logout","api_start_publish","api_start_play"]),i=t[0],e=t[2],n=t[3],s=t[4],r=function(t,i){return t?i:0};this.Mn.setAPIErrorReport("/sdk/login",r(i,t[1])),this.Mn.setAPIErrorReport("/sdk/logout",r(i,e)),this.Mn.setAPIErrorReport("/sdk/start_publish",r(i,n)),this.Mn.setAPIErrorReport("/sdk/start_play",r(i,s))},i.customDomain={},i.proxyCtrl=null,i.pageID="",i}(),Xf=function(){function t(t,i,e,n){var s;void 0===e&&(e=0),null===(s=Qf.proxyCtrl)||void 0===s||s.init({appID:t}),this.logger=new Ac.ZegoLogger(e,Qf.proxyCtrl||void 0),this.dataReport=new Ac.ZegoDataReport(this.logger),this.reporter=new yh(this.logger),this.zegoWebRTM=new Qf(t,i,this.logger,this.dataReport,this.reporter,e,n)}return t.prototype.enableMultiRoom=function(t){return this.zegoWebRTM.enableMultiRoom(t)},t.prototype.loginRoom=function(t,i,e,n){return this.zegoWebRTM.loginRoom(t,i,e,n)},t.prototype.switchRoom=function(t,i,e){return this.zegoWebRTM.switchRoom(t,i,e)},t.prototype.logoutRoom=function(t){return this.zegoWebRTM.logoutRoom(t)},t.prototype.renewToken=function(t,i){return this.zegoWebRTM.renewToken(t,i)},t.prototype.sendBarrageMessage=function(t,i){return this.zegoWebRTM.sendBarrageMessage(t,i)},t.prototype.sendBroadcastMessage=function(t,i){return this.zegoWebRTM.sendBroadcastMessage(t,i)},t.prototype.sendCustomCommand=function(t,i,e){return this.zegoWebRTM.sendCustomCommand(t,i,e)},t.prototype.setRoomExtraInfo=function(t,i,e){return this.zegoWebRTM.setRoomExtraInfo(t,i,e)},t.prototype.setLogConfig=function(t){return this.zegoWebRTM.setLogConfig(t)},t.presetLogConfig=function(t){return Qf.presetLogConfig(t)},t.prototype.setDebugVerbose=function(t){return this.zegoWebRTM.setDebugVerbose(t)},t.prototype.on=function(t,i){return this.zegoWebRTM.on(t,i)},t.prototype.getVersion=function(){return this.zegoWebRTM.getVersion()},t.prototype.off=function(t,i){return this.zegoWebRTM.off(t,i)},t.use=function(t){Qf.use(t)},t.setGeoFence=function(t,i){Qf.setGeoFence(t,i)},t.setEngineOptions=function(t){Qf.setEngineOptions(t)},t.setCloudProxyConfig=function(t,i,e){Qf.setCloudProxyConfig(t,i,e)},t.setLocalProxyConfig=function(t,i){Qf.setLocalProxyConfig(t,i)},t}(),Wf=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},Kf=function(){function t(){}return t.getSDPVideoCodec=function(t){var i={H264:[],H265:[],VP8:[],VP9:[],OTHER:[]};if(!t.includes("m=video"))return i;var e=/m=video.+/.exec(t)[0];return(e=e.match(/[\s|\d]+/g)[1].replace(" ","")).split(" ").forEach((function(e){var n=new RegExp("a=rtpmap:"+e+".+").exec(t)[0];n.includes("H264")?i.H264.push(e):n.includes("H265")?i.H265.push(e):n.includes("VP8")?i.VP8.push(e):n.includes("VP9")?i.VP9.push(e):i.OTHER.push(e)})),i.OTHER.forEach((function(e){var n=new RegExp("a=fmtp:"+e+".+apt=(\\d+)").exec(t),s=n&&n[1];s&&(i.H264.includes(s)?i.H264.push(e):i.H265.includes(s)?i.H265.push(e):i.VP8.includes(s)?i.VP8.push(e):i.VP9.includes(s)&&i.VP9.push(e))})),i},t.getSDPByVideDecodeType=function(i,e,n,s){var r={str:"",arr:[],obj:{H264:[],H265:[],VP8:[],VP9:[],OTHER:[]}};if(!i.includes("m=video"))return i;var o=/m=video.+/.exec(i)[0];o=o.match(/[\s|\d]+/g)[1].replace(" ",""),r.str=o,r.arr=r.str.split(" "),r.obj=t.getSDPVideoCodec(i);var u=[];if("VP9"===e?u=Wf(Wf(Wf([],r.obj.H265,!0),r.obj.H264,!0),r.obj.VP8,!0):"VP8"===e?u=Wf(Wf(Wf([],r.obj.H265,!0),r.obj.H264,!0),r.obj.VP9,!0):"H264"===e?u=Wf(Wf(Wf([],r.obj.H265,!0),r.obj.VP8,!0),r.obj.VP9,!0):"H265"===e&&(u=Wf(Wf(Wf([],r.obj.VP8,!0),r.obj.H264,!0),r.obj.VP9,!0)),"H264"==e&&Ut(n)){var a=function(t){return function(i){return!!i.includes("profile-level-id=")&&(t?!i.includes("profile-level-id=42e01f"):i.includes("profile-level-id=42e01f"))}},c=function(t){return function(i){if(!i.includes("profile-level-id="))return!1;switch(t){case pt.BASE_LINE:return!i.includes("profile-level-id=42");case pt.MAIN:return!i.includes("profile-level-id=4d");case pt.HIGH:return!i.includes("profile-level-id=64");default:return!1}}},h=function(t){return function(){var e=[];return r.obj.H264.forEach((function(n){for(var s=new RegExp("a=fmtp:"+n+".+\\s\\n","g").exec(i)||[],r=0,o=t;r<o.length;r++){0!==s.filter(o[r]).length&&e.push(n)}var u=new RegExp("a=fmtp:"+n+".+apt=(\\d+)").exec(i),a=u&&u[1];a&&e.includes(a)&&e.push(n)})),e}};u=u.concat(function(){for(var t=[],i=0,e=Bt(s)||s!==$.HARD_SOFT_ENCODEC_FIRST?Bt(s)||s!==$.HIGH_PROFILE_FIRST?[h([c(pt.BASE_LINE),a(n)]),h([c(pt.BASE_LINE),a(!n)]),h([a(n)]),h([a(!n)])]:[h([c(pt.HIGH),a(n)]),h([c(pt.HIGH),a(!n)]),h([a(n)]),h([a(!n)])]:[h([a(n),c(pt.BASE_LINE)]),h([a(n)]),h([a(!n),c(pt.BASE_LINE)]),h([a(!n)])];i<e.length;i++){if(t=(0,e[i])(),new Set(t).size!==r.obj.H264.length)break;t=[]}return t}())}return u.forEach((function(t){var e=r.arr.indexOf(t);e>=0&&r.arr.splice(e,1);var n=new RegExp("a=rtpmap:"+t+".+\\s\\n","g"),s=new RegExp("a=rtcp-fb:"+t+".+\\s\\n","g"),o=new RegExp("a=fmtp:"+t+".+\\s\\n","g");i=(i=(i=i.replace(n,"")).replace(s,"")).replace(o,"")})),i=i.replace(o,r.arr.join(" "))},t}(),$f=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},tl=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},il=function(){function t(){var t=this,i=Wt.createElement("canvas"),e=i.getContext("2d");e.fillStyle="rgba(255, 255, 255, 0)";try{this.fo=i.captureStream()}catch(t){console.error("canvas captureStream error",t)}this.lo=setInterval((function(){e.fillText("test",Math.floor(640*Math.random()),Math.floor(480*Math.random()))}),33),this.do=setTimeout((function(){t.vo&&t.vo("Detection timeout"),t.hangup()}),5e3)}return t.prototype.checkSupportByType=function(t,i){return $f(this,void 0,void 0,(function(){var i,e,n=this;return tl(this,(function(s){switch(s.label){case 0:return this.checkType=t,i={},this.mo=new RTCPeerConnection(i),this.po=new RTCPeerConnection(i),e=new Xt((function(t){return n.vo=t})),this.mo.addEventListener("icecandidate",(function(t){return n.onIceCandidate(n.mo,t)})),this.po.addEventListener("icecandidate",(function(t){return n.onIceCandidate(n.po,t)})),this.mo.addEventListener("iceconnectionstatechange",(function(i){"connected"===n.mo.iceConnectionState&&(n.bo=setTimeout((function(){return $f(n,void 0,void 0,(function(){var i=this;return tl(this,(function(e){switch(e.label){case 0:return[4,this.mo.getStats()];case 1:return e.sent().forEach((function(e){if("outbound-rtp"===e.type&&"video"===e.kind){var n=void 0!==e.framesEncoded&&e.framesEncoded>0;i._o=!0,i.yo=n,i.wo&&i.detectIsSupported(t)}})),[2]}}))}))}),1e3))})),this.po.addEventListener("iceconnectionstatechange",(function(i){"connected"===n.po.iceConnectionState&&(n.So=setTimeout((function(){return $f(n,void 0,void 0,(function(){var i=this;return tl(this,(function(e){switch(e.label){case 0:return[4,this.po.getStats()];case 1:return e.sent().forEach((function(e){if("inbound-rtp"===e.type&&"video"===e.kind){var n=void 0!==e.framesDecoded&&e.framesDecoded>0;i.wo=!0,i.Eo=n,i._o&&i.detectIsSupported(t)}})),[2]}}))}))}),1e3))})),this.fo.getTracks().forEach((function(t){return n.mo.addTrack(t,n.fo)})),[4,this.check(t)];case 1:return s.sent(),[4,e];case 2:return[2,s.sent()]}}))}))},t.prototype.check=function(t,i){return $f(this,void 0,void 0,(function(){var e,n;return tl(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),i&&Ht(this.mo.addTransceiver)&&(this.mo.addTransceiver("video",{direction:"sendonly"}),this.mo.addTransceiver("audio",{direction:"sendonly"})),[4,this.mo.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})];case 1:return(e=s.sent()).sdp=Kf.getSDPByVideDecodeType(e.sdp,t),this.onCreateOfferSuccess(e),[3,3];case 2:return n=s.sent(),this.onCreateSessionDescriptionError(n),[3,3];case 3:return[2]}}))}))},t.prototype.onCreateOfferSuccess=function(t){return $f(this,void 0,void 0,(function(){var i,e,n,s;return tl(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.mo.setLocalDescription(t)];case 1:return r.sent(),[3,3];case 2:return i=r.sent(),this.onSetSessionDescriptionError(i),[2];case 3:return r.trys.push([3,5,,6]),[4,this.po.setRemoteDescription(t)];case 4:return r.sent(),[3,6];case 5:return e=r.sent(),this.onSetSessionDescriptionError(e),[2];case 6:return r.trys.push([6,9,,10]),[4,this.po.createAnswer()];case 7:return n=r.sent(),[4,this.onCreateAnswerSuccess(n)];case 8:return r.sent(),[3,10];case 9:return s=r.sent(),this.onCreateSessionDescriptionError(s),[2];case 10:return[2]}}))}))},t.prototype.onCreateAnswerSuccess=function(t){return $f(this,void 0,void 0,(function(){var i,e;return tl(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.po.setLocalDescription(t)];case 1:return n.sent(),[3,3];case 2:return i=n.sent(),this.onSetSessionDescriptionError(i),[2];case 3:return n.trys.push([3,5,,6]),[4,this.mo.setRemoteDescription(t)];case 4:return n.sent(),[3,6];case 5:return e=n.sent(),this.onSetSessionDescriptionError(e),[2];case 6:return[2]}}))}))},t.prototype.onIceCandidate=function(t,i){return $f(this,void 0,void 0,(function(){var e;return tl(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getOtherPc(t).addIceCandidate(i.candidate)];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),console.error(this.checkType,"".concat(this.getPcName(t)," addIceCandidate error"),e),this.hangup(),this.vo(e),[3,3];case 3:return"_zgp_remotePc"===this.getPcName(t)&&i.candidate&&(this.iceCandidate=!0),[2]}}))}))},t.prototype.getOtherPc=function(t){return t===this.mo?this.po:this.mo},t.prototype.getPcName=function(t){return t===this.mo?"_zgp_localPc":"_zgp_remotePc"},t.prototype.onCreateSessionDescriptionError=function(t){console.error("Failed to create session description: ".concat(t.toString())),this.hangup(),this.vo(t)},t.prototype.onSetSessionDescriptionError=function(t){console.error("Failed to set session description: ".concat(t.toString())),this.hangup(),this.vo(t)},t.prototype.detectIsSupported=function(t){this.vo(!(!this.yo||!this.Eo)||"The browser does not support ".concat(t," format")),this.hangup()},t.prototype.hangup=function(){this.mo.close(),this.po.close(),this.fo.getTracks().forEach((function(t){return t.stop()})),this.do&&(clearTimeout(this.do),this.do=null),this.bo&&(clearTimeout(this.bo),this.bo=null),this.So&&(clearTimeout(this.So),this.So=null),this._o=!1,this.wo=!1,this.lo&&(clearInterval(this.lo),this.lo=null)},t}();const el="[a-fA-F\\d:]",nl=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${el})|(?<=${el})(?=\\s|$))`:"",sl="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",rl="[a-fA-F\\d]{1,4}",ol=`\n(?:\n(?:${rl}:){7}(?:${rl}|:)|                                    // 1:2:3:4:5:6:7::  1:2:3:4:5:6:7:8\n(?:${rl}:){6}(?:${sl}|:${rl}|:)|                             // 1:2:3:4:5:6::    1:2:3:4:5:6::8   1:2:3:4:5:6::8  1:2:3:4:5:6::1.2.3.4\n(?:${rl}:){5}(?::${sl}|(?::${rl}){1,2}|:)|                   // 1:2:3:4:5::      1:2:3:4:5::7:8   1:2:3:4:5::8    1:2:3:4:5::7:1.2.3.4\n(?:${rl}:){4}(?:(?::${rl}){0,1}:${sl}|(?::${rl}){1,3}|:)| // 1:2:3:4::        1:2:3:4::6:7:8   1:2:3:4::8      1:2:3:4::6:7:1.2.3.4\n(?:${rl}:){3}(?:(?::${rl}){0,2}:${sl}|(?::${rl}){1,4}|:)| // 1:2:3::          1:2:3::5:6:7:8   1:2:3::8        1:2:3::5:6:7:1.2.3.4\n(?:${rl}:){2}(?:(?::${rl}){0,3}:${sl}|(?::${rl}){1,5}|:)| // 1:2::            1:2::4:5:6:7:8   1:2::8          1:2::4:5:6:7:1.2.3.4\n(?:${rl}:){1}(?:(?::${rl}){0,4}:${sl}|(?::${rl}){1,6}|:)| // 1::              1::3:4:5:6:7:8   1::8            1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::${rl}){0,5}:${sl}|(?::${rl}){1,7}|:))             // ::2:3:4:5:6:7:8  ::2:3:4:5:6:7:8  ::8             ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})?                                             // %eth0            %1\n`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),ul=new RegExp(`(?:^${sl}$)|(?:^${ol}$)`),al=new RegExp(`^${sl}$`),cl=new RegExp(`^${ol}$`),hl=t=>t&&t.exact?ul:new RegExp(`(?:${nl(t)}${sl}${nl(t)})|(?:${nl(t)}${ol}${nl(t)})`,"g");hl.v4=t=>t&&t.exact?al:new RegExp(`${nl(t)}${sl}${nl(t)}`,"g"),hl.v6=t=>t&&t.exact?cl:new RegExp(`${nl(t)}${ol}${nl(t)}`,"g");var fl=hl;const{toString:ll}=Object.prototype;const dl={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function vl(t,i={}){if("[object RegExp]"!==ll.call(t))throw new TypeError("Expected a RegExp instance");const e=Object.keys(dl).map((e=>("boolean"==typeof i[e]?i[e]:t[e])?dl[e]:"")).join(""),n=new RegExp(i.source||t.source,e);return n.lastIndex="number"==typeof i.lastIndex?i.lastIndex:t.lastIndex,n}function ml(t,i,{timeout:e}={}){try{return function(t){const i=(...i)=>t(...i);return Object.defineProperty(i,"name",{value:`functionTimeout(${t.name||"<anonymous>"})`,configurable:!0}),i}((()=>vl(t).test(i)))()}catch(t){throw t}}const pl={timeout:400};function gl(t){return!(t.length>45)&&ml(fl.v6({exact:!0}),t,pl)}function bl(t){return!(t.length>15)&&ml(fl.v4({exact:!0}),t,pl)}function _l(t){return[t>>24&255,t>>16&255,t>>8&255,255&t].join(".")}function yl(t){var i=t.split(".");return(parseInt(i[0])<<24)+(parseInt(i[1])<<16)+(parseInt(i[2])<<8)+parseInt(i[3])}function wl(t){var i=t.split(".");return i?(parseInt(i[1])<<24|parseInt(i[2])<<16|parseInt(i[3])<<8|parseInt(i[4]))>>>0:0}function Sl(t){return gl(t)}function El(t){return function(t){return bl(t)}(t)?kt.IPv4:Sl(t)?kt.IPv6:-1}function Ol(t){var i=t.match(/^[^:]*:(.*?):[^:]*$/);return i?i[1]:""}var Tl=function(){return Tl=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Tl.apply(this,arguments)},kl=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Rl=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Il=gn.error.te;function Nl(t,i){return kl(this,void 0,void 0,(function(){return Rl(this,(function(e){return i&&Ht(t.addTransceiver)&&(t.addTransceiver("video",{direction:"sendonly"}),t.addTransceiver("audio",{direction:"sendonly"})),[2,t.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0})]}))}))}function Cl(t,i,e,n,s){return kl(this,void 0,void 0,(function(){var r,o,u,a,c,h,f,l;return Rl(this,(function(d){switch(d.label){case 0:return r={webRTC:!1,customCapture:!1,camera:!1,microphone:!1,videoCodec:{H264:!1,H265:!1,VP8:!1,VP9:!1},screenSharing:t,errInfo:{}},n&&"screenSharing"===n?(i({result:t,errInfo:r.errInfo}),[2]):n&&"customCapture"!==n||(((o=Wt.createElement("video")).captureStream||o.mozCaptureStream)&&(r.customCapture=!0),"customCapture"!==n)?(u=navigator&&navigator.mediaDevices&&navigator.mediaDevices.getUserMedia,a=function(){var t="https:"!==window.location.protocol&&"file:"!==window.location.protocol&&-1==window.location.hostname.indexOf("127.0.0.1")&&-1==window.location.hostname.indexOf("localhost");if(t)throw console.error("webrtc requires https or localhost"),new Error("webrtc requires https or localhost");return!t}(),n&&"camera"!==n&&"microphone"!==n?[3,9]:u?a?[3,1]:(r.camera=!1,r.microphone=!1,console.error("webrtc requires https or localhost"),[3,9]):[3,9]):(i({result:r.customCapture,errInfo:r.errInfo}),[2]);case 1:if(n&&"camera"!==n)return[3,5];d.label=2;case 2:return d.trys.push([2,4,,5]),[4,Vl({video:!0,audio:!1})];case 3:return(c=d.sent())&&(r.camera=!0)&&c.getTracks().forEach((function(t){t.stop()})),[3,5];case 4:return h=d.sent(),r.errInfo.camera={name:h.name,message:h.message},console.error("camera devices detect error: ",h.name,h.message),[3,5];case 5:if(n&&"microphone"!==n)return[3,9];d.label=6;case 6:return d.trys.push([6,8,,9]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1})];case 7:return(f=d.sent())&&(r.microphone=!0)&&f.getTracks().forEach((function(t){return t.stop()})),[3,9];case 8:return l=d.sent(),r.errInfo.microphone={name:l.name,message:l.message},console.error("microphone devices detect error: ",l.name,l.message),[3,9];case 9:return"camera"===n||"microphone"===n?(i({result:r[n],errInfo:r.errInfo}),[2]):(function(t,i,e,n){kl(this,void 0,void 0,(function(){var s,r,o,u,a,c,h,f,l,d;return Rl(this,(function(v){switch(v.label){case 0:return s={webRTC:!1,H264:!1,VP8:!1,VP9:!1,H265:!1},e?1!==i||"VP8"!==e&&"H264"!==e?[3,2]:[4,(d=new il).checkSupportByType(e,n)]:[3,2];case 1:return Ut(r=v.sent())?(s[e]=r,[2,t(s)]):(s[e]=!1,[2,t(s,r)]);case 2:if("webRTC"!==e&&1!==i)return[3,7];v.label=3;case 3:return v.trys.push([3,5,,6]),[4,Nl(new RTCPeerConnection,n)];case 4:return v.sent(),s.webRTC=!0,[3,6];case 5:return o=v.sent(),t&&t(s,o),[3,6];case 6:if("webRTC"===e)return[2,t(s)];v.label=7;case 7:if(1===i){for(u="",c=[],h=0,f=a=["VP8","H264"];h<f.length;h++)l=f[h],d=new il,c.push(d.checkSupportByType(l));return Promise.all(c).then((function(i){i.forEach((function(t,i){Ut(t)?s[a[i]]=!0:(s[a[i]]=!1,u=t)})),u?t(s,u):t(s)})),[2]}try{Nl(new RTCPeerConnection,n).then((function(i){if(s.webRTC=!0,i&&i.sdp){var n=i.sdp.split("\r\n");if(s.H264=n.some((function(t){return t.startsWith("a=rtpmap:")&&t.indexOf("H264/")>-1})),"H264"===e)return t(s);if(s.VP8=n.some((function(t){return t.startsWith("a=rtpmap:")&&t.indexOf("VP8/")>-1})),"VP8"===e)return t(s);s.VP9=n.some((function(t){return t.startsWith("a=rtpmap:")&&t.indexOf("VP9/")>-1})),s.H265=n.some((function(t){return t.startsWith("a=rtpmap:")&&t.indexOf("H265/")>-1})),t&&t(s)}}))}catch(i){t&&t(s,i)}return[2]}}))}))}((function(t,e){n||(r.videoCodec.H264=t.H264,r.videoCodec.H265=t.H265,r.videoCodec.VP8=t.VP8,r.videoCodec.VP9=t.VP9,r.webRTC=t.webRTC),e&&(qt(e)?r.errInfo.extendedDate=e:r.errInfo.webRTC={name:e.name,message:e.message},console.error("videoCodec detect error: "+e)),i&&i(n?{result:t[n],errInfo:r.errInfo}:r)}),e,n,s),[2])}}))}))}var zl=function(t){return Jt(t)&&void 0!==t.videoQuality&&[1,2,3].includes(t.videoQuality)&&(delete t.width,delete t.height,delete t.frameRate,delete t.bitRate),t};function Dl(t){var i={};for(var e in t){var n=t[e];if(n instanceof Object){var s=n instanceof MediaStream||n instanceof HTMLElement;i[e]=s?n:Dl(n)}else void 0!==n&&(i[e]=n)}return i}function Pl(t){return Uint8Array.from(Array.from(window.unescape(encodeURIComponent(t))).map((function(t){return t.charCodeAt(0)})))}var Al=function(t){return t.split("\nm=").map((function(t,i){return(i>0?"m="+t:t).trim()+"\r\n"}))};function Ml(t){var i=function(t,i){return function(t){return t.trim().split("\n").map((function(t){return t.trim()}))}(t).filter((function(t){return 0===t.indexOf(i)}))},e=Al(t),n=[],s=[];return e.forEach((function(t,e){var r=function(t){var e=i(t,"a=mid:")[0];if(e)return e.substr(6)}(t),o=i(t,"a=candidate:").map((function(t){return s.push(t),Tl(Tl({},function(t){for(var i,e={foundation:(i=0===t.indexOf("a=candidate:")?t.substring(12).split(" "):t.substring(10).split(" "))[0],component:parseInt(i[1],10),protocol:i[2].toLowerCase(),priority:parseInt(i[3],10),ip:i[4],address:i[4],port:parseInt(i[5],10),type:i[7]},n=8;n<i.length;n+=2)switch(i[n]){case"raddr":e.relatedAddress=i[n+1];break;case"rport":e.relatedPort=parseInt(i[n+1],10);break;case"tcptype":e.tcpType=i[n+1];break;case"ufrag":e.ufrag=i[n+1],e.usernameFragment=i[n+1];break;default:e[i[n]]=i[n+1]}return e}(t)),{mid:r})}));n.push.apply(n,o)})),[n,s]}function xl(t){var i=Ml(t)[0];if(i.length>0){var e=i[0].ip,n=El(e)===kt.IPv6?"[".concat(e,"]"):e;return["turn:".concat(n,":3478?transport=udp"),"turn:".concat(n,":443?transport=tcp"),"turn:".concat(n,":3478?transport=tcp")]}return[]}function jl(t){var i=t.match(/a=ice-ufrag:(\S+)/);return i?i[1]:""}function Ll(t){var i=t.match(/a=ice-pwd:(\S+)/);return i?i[1]:""}function ql(t){var i=t.split(":");return t.replace(":"+i[i.length-1],"")}function Ul(t){var i=q.RTC;switch(t){case 1:case 3:i=q.CDN;break;case 2:i=q.L3;break;default:i=q.RTC}return i}function Bl(t){return qt(t)&&Number(t.split(".")[0])||0}function Jl(t,i,e,n){var s=t.version,r=t.name.toLowerCase(),o=Bl(s);return r===i&&(0===n&&o<e||(1===n&&o===e||2===n&&o>e))}function Vl(t){var i=this;return new Xt((function(e,n){return kl(i,void 0,void 0,(function(){var i,s,r,o,u,a;return Rl(this,(function(c){switch(c.label){case 0:i=[Tl({},t),Tl(Tl({},t),{video:{width:360}}),Tl(Tl({},t),{video:{width:640}}),Tl(Tl({},t),{video:{width:720}}),Tl(Tl({},t),{video:{width:854}}),Tl(Tl({},t),{video:{width:1280}})],s=null,r=null,o=0,c.label=1;case 1:if(!(o<i.length))return[3,6];u=i[o],c.label=2;case 2:return c.trys.push([2,4,,5]),[4,navigator.mediaDevices.getUserMedia(u)];case 3:return s=c.sent(),[3,6];case 4:return a=c.sent(),r=a,[3,5];case 5:return o++,[3,1];case 6:return s?e(s):n(r),[2]}}))}))}))}function Hl(t,i,e){var n=JSON.parse(JSON.stringify(t));if(i.forEach((function(t){var i=n.indexOf(t);i>=0&&(n.splice(i,1),n.push(t))})),!e){var s=n.findIndex((function(i){return i===t[0]}));s>0&&(n.splice(s,1),n.unshift(t[0]))}return n}function Gl(t,i,e){var n=JSON.parse(JSON.stringify(t));if(i.forEach((function(t){var i=n.findIndex((function(i){return i.ip===t.ip}));i>=0&&(n.splice(i,1),n.push(t))})),!e){var s=n.findIndex((function(i){return i.ip===t[0].ip}));s>0&&(n.splice(s,1),n.unshift(t[0]))}return n}function Fl(t){return t.ip+":"+t.port}function Yl(t,i){return t.findIndex((function(t){return i.includes(t.ip)&&i.includes(t.port+"")}))}function Zl(t,i){var e;if("chrome"===i||"safari"===i)switch(t){case 0:e="tls";break;case 1:e="tcp";break;case 2:e="udp"}else if("firefox"===i)switch(t){case 0:e="tcp";break;case 5:e="udp"}return e}function Ql(t,i){if(void 0===i&&(i="video"),!(t instanceof MediaStream))return null;for(var e="video"==i,n=document.querySelectorAll(i),s=null,r=0;r<n.length;r++){var o=n[r],u=o.srcObject;if(u&&(u===t||(e?u.getVideoTracks()[0]===t.getVideoTracks()[0]:u.getAudioTracks()[0]===t.getAudioTracks()[0]))){if(o.currentTime)return o;s=o}}return s}function Xl(t,i){void 0!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.enumerateDevices?navigator.mediaDevices.enumerateDevices().then((function(i){for(var e=[],n=[],s=[],r=0;r<i.length;r++){var o=i[r];"audioinput"===o.kind&&e.push({deviceName:o.label,deviceID:o.deviceId}),"audiooutput"===o.kind&&n.push({deviceName:o.label,deviceID:o.deviceId}),"videoinput"===o.kind&&s.push({deviceName:o.label,deviceID:o.deviceId})}t&&t({microphones:e,speakers:n,cameras:s})})).catch((function(t){console.error("enumerate devices wrong "+t),i&&i(Bn.bn)})):i&&i(Bn.ie)}function Wl(t,i){if(Bt(t))return i(Il," bitrate is required when videoQuality is 4"),!1;if(Lt(t)){if(!ko(t,0,10240))return i(Il," bitrate must be integer number"),!1;if(!function(t,i){return!(t>10240&&(i(Il," bitrate cannot greater than 10 Mbps"),1))}(t,i))return!1}else i(Il," bitrate must be number");return!0}function Kl(t,i,e,n){if(!Jt(t))return{result:!1,message:"Invalid constraint. Constraint Extend must be a object"};if(0===Object.keys(t).length)return{result:!1,message:"".concat(i," can not be a empty object")};for(var s=0,r=["exact","ideal","max","min"];s<r.length;s++){var o=r[s],u=t[o];if(Lt(u)&&!ai(u,!1))return{result:!1,message:" ".concat(o," of ").concat(i," must be integer number")};if(Lt(e)&&Lt(u)&&u<e)return{result:!1,message:" ".concat(o," of ").concat(i," must greater than ").concat(e)};if(Lt(n)&&Lt(u)&&u>n)return{result:!1,message:" ".concat(o," of ").concat(i," cannot greater than ").concat(n)}}return{result:!0,message:"Constraint Extend OK."}}function $l(t,i,e,n,s){var r=Kl(t,i,n,s);return r.result||e&&e(Il,r.message),r.result}function td(t,i,e){for(var n=0,s=t;n<s.length;n++){var r=s[n],o=i[r];if(Bt(o))return e&&e(Il," ".concat(r," is required when videoQuality is 4")),!1;if(Lt(o)&&!ai(o,!1))return e&&e(Il," ".concat(r," must be integer number")),!1;if(Lt(o)&&("width"===r||"height"===r)&&o<0)return e&&e(Il," ".concat(r," must greater than 0.")),!1;if(Lt(o)&&"width"===r&&o>7680)e&&e(Il," ".concat(r," cannot greater than 7680."));else if(Lt(o)&&"height"===r&&o>4320)e&&e(Il," ".concat(r," cannot greater than 4320."));else if(Jt(o)){if("width"===r&&!$l(o,r,e,0,7680))return!1;if("height"===r&&!$l(o,r,e,0,4320))return!1;if("frameRate"===r&&!$l(o,r,e))return!1}else if(!Lt(o)&&Jt(o))return e&&e(Il," ".concat(r," must be number or object")),!1}return!0}function id(t){return t&&"live"===t.readyState?!0===t.enabled?0:3:2}function ed(t){return(Lt(t)?t:t.exact?t.exact:t.ideal?t.ideal:t.min||t.max)||0}function nd(t){if(!function(t){return!!/^(\d{1,3}\.){3}\d{1,3}$/.test(t)&&t.split(".").map((function(t){return parseInt(t,10)})).every((function(t){return t>=0&&t<=255}))}(t))throw new Error("Invalid IPv4 address");var i=t.split(".").map((function(t){return parseInt(t,10)})).map((function(t){return t.toString(16).padStart(2,"0")}));return"64:ff9b::".concat(i[0]).concat(i[1],":").concat(i[2]).concat(i[3])}var sd=function(t){Array.isArray(t.ips)&&(t.ips=t.ips.map((function(t){var i=t.priority,e=t.vid;return{ip:t.ip,port:t.port,priority:jt.isLong(i)?i.toString():i,vid:e}}))),Array.isArray(t.ipv6s)&&(t.ipv6s=t.ipv6s.map((function(t){var i=t.priority,e=t.vid;return{ip:t.ip,port:t.port,priority:jt.isLong(i)?i.toString():i,vid:e}})))},rd="zc.0",od="zc.1",ud="zc.cs",ad="zc.ds",cd="zc.sps.0",hd="zc.sps.1",fd="zc.sps.0.0",ld="zc.sps.1.0",dd="zc.smsi.0",vd="zc.psh.0",md="zc.psh.1",pd="zc.tsh.rngn.0",gd="zc.tsh.rngn.1",bd="zc.tsh.dgnb",_d="zc.s.cmt",yd="zc.s.sss",wd="zsc.ssgn",Sd="zsc.ccns",Ed="zsc.ucgl",Od="zc.p.0.sp.0",Td="zc.p.ps",kd="zc.p.0.ocpss",Rd="zc.p.0.ocos",Id="zc.p.0.oslds",Nd="zc.p.0.ogrd",Cd="zc.p.0.orci.1",zd="zc.p.0.oic",Dd="zc.p.0.ocsc",Pd="zc.p.0.oicsc",Ad="zc.p.0.spqt",Md="zc.p.0.upq",xd="zc.p.0.orrs",jd="zc.p.0.orcs",Ld="zc.p.0.sci",qd="zc.p.0.psr",Ud="zc.p.0.od",Bd="zc.p.0.ssl.0",Jd="zc.p.0.heb",Vd="zc.p.0.ss",Hd="zc.p.0.sgn",Gd="zc.p.0.hdgn",Fd="zc.p.0.scd",Yd="zc.p.0.scg",Zd="zc.p.0.tc",Qd="zc.p.1.sp.0",Xd="zc.p.ocpss.1",Wd="zc.p.hcsws.1",Kd="zc.p.ocos.1",$d="zc.p.oslds.1",tv="zc.p.ormd.1",iv="zc.p.oic.1",ev="zc.p.oicsc.1",nv="zc.p.rp.1",sv="zc.p.spqt.1",rv="zc.p.upq.1",ov="zc.p.gs.1",uv="zc.p.orrs.1",av="zc.p.orcs.1",cv="zc.p.orss.1",hv="zc.p.ogrs.1",fv="zc.p.sci.1",lv="zc.p.psr.1",dv="zc.p.ssl.1",vv="zc.p.1.sgn",mv="zc.p.1.hdgn",pv="zc.p.1.scd",gv="zc.p.1.scg",bv="zc.p.1.oce",_v="zc.p.1.smsbpm",yv="zc.p.1.sms",wv="zc.p.1.mst",Sv="zc.p.1.spsf",Ev="zc.uslq",Ov="zc.sr.uud",Tv="zc.hpqd.pl",kv="zc.hpqd.pu",Rv="zc.hcid.pu",Iv="zc.sr.sd",Nv="zc.sr.chdtr",Cv="zc.sr.sprd",zv="zc.sr.srptc.0",Dv="zc.sr.cic.0",Pv="zc.sr.cnia.0",Av="zc.p.scv",Mv="zc.sh.msbss",xv="zc.sh.ms",jv="zc.sh.psl",Lv="zc.srs",qv="zc.irs",Uv="zc.ssh",Bv="zc.ups.0",Jv="zc.vam.rv",Vv="zc.vam.iwg",Hv="zc.vam.vam",Gv="zc.svc",Fv="zc.sac",Yv="zc.rp",Zv="zc.emo",Qv="zc.asi",Xv="zc.mpsv.0",Wv="zc.mpsa.0",Kv="zc.mm",$v="zc.mpsv.1",tm="zc.mpsa.1",im="zc.mapa.1",em="zc.mapv.1",nm="zc.ht",sm=function(){function t(t,i){this.In=t,this.Oo=i,this.debug=!1,this.testEnvironment=!1,this.pullLimited=!0,this.useNetAgent=!0,this.configOK=!1,this.relateService=[],this.role=2,this.maxMemberCount=0,this.roomCreateFlag=1,this.netMode=z.Default,this.callbackList={},this.experimentalAPIList={onRecvRoomMuteVideoStream:0,onRecvRoomMuteAudioStream:0,onRecvRoomChannelMessage:0,onVolumeDuckingUpdate:0},this.publishStreamList={},this.streamUrlMap={},this.cmdCallback={},this.customUrl=[],this.customPlayUrl=[],this.turnToTcp=!1,this.turnOverTcpOnly=void 0,this.audioEffectBuffer={},this.audioBitRate=48e3,this.cdnSeq=0,this.engineDestroy=!1,this.listenerList={roomStreamUpdate:[],streamExtraInfoUpdate:[],playerStateUpdate:[],publisherStateUpdate:[],screenSharingEnded:[],publishQualityUpdate:[],playQualityUpdate:[],remoteCameraStatusUpdate:[],remoteMicStatusUpdate:[],soundLevelUpdate:[],capturedSoundLevelUpdate:[],videoDeviceStateChanged:[],audioDeviceStateChanged:[],deviceError:[],_deviceError:[],_remoteCameraStatusUpdate:[],_remoteMicStatusUpdate:[],_streamUpdated:[],receiveRealTimeSequentialData:[],beautyEffectOverload:[],playerRecvSEI:[],beautyEffectError:[],_engineConfigUpdate:[],backgroundEffectError:[],exceptionUpdate:[],networkQuality:[],mixerSoundLevelUpdate:[],autoMixerSoundLevelUpdate:[],mixerRelayCDNStateUpdate:[],_engineDestroy:[],recvExperimentalAPI:[],playerVideoTrackUpdate:[],playerAudioTrackUpdate:[],publisherVideoEncoderChanged:[],_recaptureStream:[]},this.reportList={},this.reportSeqList={startPublish:{},rePublish:{},startPlay:{},rePlay:{},stopPublish:{},stopPlay:{}},this.streamTrigger={},this.audioStreamList={},this.deviceInfos=null,this.deviceChangeTimer=null,this.deviceStateOut=!1,this.customUa=!1,this.streamRetryTime=300,this.serverRetryTime=90,this.checkList=[],this.anchor_info={anchor_id:"",anchor_id_name:"",anchor_nick_name:""},this.clientIP="",this.accessClientIp="",this.isMultiOuter=!1,this.roomList=[],this.isMultiRoom=!1,this.browser="",this.unregisterSeiFilter="",this.isTestMode=!1,this.debugLog=!1,this.netAppConfigDelay=0,this.seiConfig={emulationPreventionByte:!1},this.playAccelerate=!0,this.autoSwitchDeviceSetting={camera:!1,microphone:!1},this.unSendMessageList=[],this.scenario=j.Default,this.testStreamRetryMode=0,this.testStreamRetryCount=10,this.supportDispatchByPass=!1,this.testStreamStatusSeq=0,this.engineConfig={keepAudioTrack:!0,playClearLastFrame:!0,previewClearLastFrame:!0,mixingAudioDelay:0,baseMixingAudioDelay:0,adaptCustomUA:!1,allowReplaceEmptyTrack:!1,publishQualityInterval:0,playQualityInterval:0,enableMiniSDP:!1,keepRtcWhenSignalDisconnected:!0,autoRecaptureOnShow:!1,datachannelOption:{ordered:!0},connectMediaServerInAdvance:!0,switchRoomNotStopPlay:!1,enableReferenceBitrate:!0,speechEnhanceLogLevel:1},this.To=!0,this.ko=!1,this.player265Validated=!1,this.player265ReceiverList=[],this.miniSdpError=0,this.debugVerboseUpdateList={streamProbeState:[],chargeInfosUpdate:[],startConnectWebRTCServer:[]},this.logReportCallback=yo,this.unregisterCallback=So,this.decodeServerError=Eo,this.getLiveRoomError=Oo,this.getServerError=wo,this.mergeStreamList=To,this.actionSuccessCallback=_o,this.checkValidNumber=ko,this.uint8arrayToBase64=Mo,this.getSeq=N,this.getReportSeq=C,this.cdnSeqV2=(new Date).getTime()}return Object.defineProperty(t.prototype,"networkState",{get:function(){var t;return null===(t=this.rtm)||void 0===t?void 0:t.stateCenter.networkState},set:function(t){var i;(null===(i=this.rtm)||void 0===i?void 0:i.stateCenter)&&!Bt(t)&&(this.rtm.stateCenter.networkState=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFlutter",{get:function(){return!!this.engineConfig.isFlutter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectIPStackMode",{get:function(){return this.settingConfig.getSettingWithUserParams("ip_stack_mode",uy.ipStackMode)||_t.IPv4Prefer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMiniSdp",{get:function(){if(!this.To&&!this.ko)return!1;if(!window.WebAssembly||!window.Worker)return!1;if(Jl(this.browserInfo,"chrome",78,0))return!1;var t=this.settingConfig.getSetting("open_mini_sdp");return!!Ut(t)&&(this.In.info("zc.c.ims setting: "+t),t)},enumerable:!1,configurable:!0}),t.prototype.setIsMiniSdp=function(t){var i;null===(i=this.settingConfig)||void 0===i||i.setUserValue("open_mini_sdp",t)},Object.defineProperty(t.prototype,"streamCenter",{get:function(){return this.Ro},set:function(t){this.Ro=t},enumerable:!1,configurable:!0}),t.prototype.getRequestId=function(){return this.idName+"-"+N()},t.prototype.addListener=function(t,i){var e=this.reporter.createSpan(a.H,{key:dn},{key:""},vn.event);return e.setAttributes({listener:t}),this.listenerList[t]?Ht(i)?(-1==this.listenerList[t].indexOf(i)&&this.listenerList[t].push(i),e.end(),!0):(this.In.error("zc.o.0 listener callBack must be funciton"),this.reporter.setError(e,vn.error.te," listener callBack must be function"),!1):(this.In.error("zc.o.0 event "+t+" no found"),this.reporter.setError(e,vn.error.te," event "+event+" no found"),!1)},t.prototype.actionListener=function(t){for(var i=this,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!["playQualityUpdate","publishQualityUpdate","soundLevelUpdate","capturedSoundLevelUpdate","playerRecvSEI","_remoteCameraStatusUpdate","_remoteMicStatusUpdate","_streamUpdated","_deviceError","networkQuality","exceptionUpdate","mixerSoundLevelUpdate","autoMixerSoundLevelUpdate","mixerRelayCDNStateUpdate"].includes(t)&&this.listenerList[t]){var s=this.reporter.createSpan(a.H,{key:dn},{key:""},gs);s.setAttributes({listener:t,listener_params:JSON.stringify(e)}),["deviceError","streamExtraInfoUpdate","publisherStateUpdate","playerStateUpdate","roomStreamUpdate"].includes(t)&&this.In.info("zc.al ".concat(t," ").concat(JSON.stringify(e))),s.end()}this.listenerList[t]&&this.listenerList[t].forEach((function(n){try{setTimeout((function(){n.apply(void 0,e)}),0)}catch(e){i.In.error("zc.sc.al "+t+" "+e)}}))},t.prototype.deleteListener=function(t,i){var e=this.reporter.createSpan(a.H,{key:dn},{key:""},mn.event);if(e.setAttributes({listener:t}),!this.listenerList[t])return this.In.error("zc.o.1 listener no found"),this.reporter.setError(e,mn.error.te," event "+event+" no found"),!1;this.In.info("zc.o.1 "+"".concat(t," cb:")+typeof i);var n=this.listenerList[t];if(i){var s=n.indexOf(i);s>=0&&n.splice(s,1)}else this.listenerList[t]=[];return e.end(),!0},t.prototype.getRoomByRoomID=function(t){return this.roomList.find((function(i){return i.roomID==t}))},t.prototype.getPlayRoom=function(t){return this.roomList.find((function(i){return!!i.streamList.find((function(i){return i.stream_id==t}))}))},t.prototype.onExperimentalAPICallback=function(t){this.actionListener("recvExperimentalAPI",t)},t.prototype.destroy=function(){this.Ro=null},t.prototype.onDebugVerboseCallBack=function(t){for(var i=[],e=1;e<arguments.length;e++)i[e-1]=arguments[e];this.debugVerboseUpdateList[t]&&this.debugVerboseUpdateList[t].forEach((function(t){t.apply(void 0,i)}))},t}(),rm=function(){return rm=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},rm.apply(this,arguments)},om=fs,um="zb.sh.usi",am=function(){function t(t,i,e,n,s){this.In=t,this.Nn=i,this.rtm=e,this.Ro=n,this.us=s,this.Io=0,this.No=0,this.Co=0,this.zo=!1,this.Do=null,this.Po=2e3,this.Ao=5e3,this.mixStreamTaskList={},this.mixRequestIdList=[],this.mixStreamHbList={},this.roomID=s,this.logger=t,this.stateCenter=i}return Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reporter",{get:function(){return this.Mn},enumerable:!1,configurable:!0}),t.prototype._setCDNInfo=function(t,i){var e=i.urls_flv,n=i.urls_m3u8,s=i.urls_flv_plus,r=i.urls_m3u8_plus,o=i.urls_https_flv,u=i.urls_https_m3u8,a=i.urls_rtmp;t.urlFlv=Gt(e)?e[0]||"":qt(e)?e:"",t.urlHls=Gt(n)?n[0]||"":qt(n)?n:"",t.urlFlvPlus=Gt(s)?s[0]||"":qt(s)?s:"",t.urlHlsPlus=Gt(r)?r[0]||"":qt(r)?r:"",t.urlHttpsFlv=Gt(o)?o[0]||"":qt(o)?o:"",t.urlHttpsHls=Gt(u)?u[0]||"":qt(u)?u:"",t.urlRtmp=Gt(a)?a[0]||"":qt(a)?a:""},t.prototype.onStreamUpdated=function(t,i,e){},t.prototype.onStreamExtraInfoUpdated=function(t,i){},t.prototype.onStreamAttrUpdated=function(t,i){},t.prototype.handleStreamStart=function(t,i){var e="zb.sh.hss";ti(this.In,e,"stream update"),this.room=i,t.body?(this.Po=t.body.stream_list_hb_wait_merge_time||2e3,this.Ao=t.body.stream_list_push_merge_timeout||5e3,this.zo=!1,this.handleFullUpdateStream(t.body.stream_seq,t.body.stream_info||[],!0),this._handleReconnectStream(t.body.stream_info),ii(this.In,e)):this.In.error(e+" server response wrong")},t.prototype.onFullUpdateStream=function(t){},t.prototype.onPublishStateUpdate=function(t,i,e,n){},t.prototype._updateStreamInfo=function(t,i,e,n,s,r){var o,u,a,c=this;void 0===e&&(e=""),ti(this.In,um);var h=e,f=null===(o=this.room)||void 0===o?void 0:o.streamList.find((function(i){return i.stream_id===t}));f||this.In.info(um+" stream not in room cmd "+i);var l={stream_id:t,extra_info:h};if(2002!==i&&2003!==i||(l.stream_sid=(null==f?void 0:f.stream_sid)||""),2001===i&&this.Ro.publisherList[t]){var d=this.Ro.publisherList[t].publisher;l.inspect_flag=(null===(u=null==d?void 0:d.publishOption)||void 0===u?void 0:u.inspectFlag)||0}var v=JSON.stringify(l),m=rm({sub_cmd:i,stream_msg:v,third_token:null===(a=this.room)||void 0===a?void 0:a.token},r||{stream_resource:1,stream_codec:0}),p=this.room,g=this.rtm.liveRoomHandler.sendStreamUpdate(m,(function(e,s){c.handleStreamUpdateRsp(e,t,i),n&&n(e,s)}),(function(o,u){var a=c.room,h=c.rtm.stateCenter.roomModulesList.find((function(t){return t.roomID===(null==a?void 0:a.roomID)})),f=function(){return(null==h?void 0:h.isTryLogin())||"CONNECTING"===(null==h?void 0:h.roomState)},l=function(){c.In.warn(um+" resend stream update "+i),c._updateStreamInfo(t,i,e,n,s,r)};if(a&&((null==h?void 0:h.isLogin())||f())&&o.code&&o.code==Ni.code&&a.streamInfoList[t].seq==u){setTimeout((function(){if(2001==i&&c.Nn.publishStreamList[t]&&c.Nn.publishStreamList[t].state==T.update_info||2002==i)if(f()){var e=function(t,i){var n=function(){c.rtm.stateCenter.offListener("_roomStateUpdate",e)};t===(null==a?void 0:a.roomID)&&"CONNECTED"===i?(l(),n()):t===(null==a?void 0:a.roomID)&&"DISCONNECTED"===i&&n()};c.rtm.stateCenter.onListener("_roomStateUpdate",e)}else l();else s&&s(Ni)}),0)}else if(o.body&&o.body.err_code){var d=O+o.body.err_code,v=Ji;[1011,1000002002].includes(v.code)&&(v=Mi),s&&s(v,u);var m="";v.code===Ji.code&&(m=JSON.stringify({server_code:d})),i===k&&c.onPublishStateUpdate(Z,t,v,m)}}),{sessionID:null==p?void 0:p.sessionID,roomID:null==p?void 0:p.roomID,roomSessionID:null==p?void 0:p.roomSessionID});[2001,2002].includes(i)&&(this.room.streamInfoList[t]={seq:g}),ei(this.In,um,"cmd: "+i+", roomid: ".concat(null==p?void 0:p.roomID,", stream: ").concat(t))},t.prototype.updateStreamInfo=function(t,i,e,n,s,r){var o=this;if(void 0===e&&(e=""),this.room){var u;if(2001===i||2002===i)(u=this.Mn.createSpan(a.H,{key:ln,par:this.us},{key:""},us)).setAttributes({stream_update_type:as(2001===i?"stream added":2002===i?"stream deleted":""),stream_extra_info:cs(e),stream_id:hs(t)});this._updateStreamInfo(t,i,e,(function(t,e){[2001,2002].includes(i)&&(u.setAttributes({send_seq:e}),u&&u.end()),n&&n(t,e)}),(function(t,e){[2001,2002].includes(i)&&(u.setAttributes({send_seq:e}),o.Mn.setError(u,t)),s&&s(t,e)}),r)}else this.In.warn(um+" "+ci)},t.prototype.handleStreamUpdateRsp=function(t,i,e){var n,s,r,o;if(this.rtm.isDisConnect())this.In.warn("zb.sh.hsur not login");else if(0==t.body.err_code){this.In.info("zb.sh.hsur stream seq "+this.No+" server seq "+t.body.stream_seq);var u=this.room;if(u){if(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.token_remain_time)this.Nn.getRoomByRoomID(null===(s=null==t?void 0:t.header)||void 0===s?void 0:s.room_id)?this.rtm.resetRoomTokenTimer(t.header.room_id,t.body.token_remain_time):this.In.error("zb.sh.hsur room no found ignore "+JSON.stringify(null===(r=t.header)||void 0===r?void 0:r.room_id));this.handleStreamSync(t,i,e);var a=u.streamInfoList[i],c=null===(o=t.header)||void 0===o?void 0:o.seq;a&&a.seq===c?delete u.streamInfoList[i]:this.In.info("zb.sh.hsur ".concat(JSON.stringify(i)," udp stream info; rsp seq: ").concat(c,", cur seq: ").concat(null==a?void 0:a.seq," "))}else this.In.info("hsur.0 room no found")}else this.In.error("zb.sh.hsur stream update error "+t.body.err_code)},t.prototype.handleStreamSync=function(t,i,e){if(this.handleStreamRsp(this.room,i,{stream_id:i,stream_sid:t.body.stream_sid,stream_ver:t.body.stream_ver,stream_nid:t.body.stream_nid,id_name:this.Nn.idName,nick_name:this.Nn.nickName},e),t.body.stream_seq>this.No+1)return this.In.info("zb.sh.hss.1 seq diff server: "+t.body.stream_seq+" client "+this.No),void this.fetchStreamList();this.No=t.body.stream_seq;var n=this.room.streamList.find((function(t){return t.stream_id==i}));n&&t.body.stream_ver>n.stream_ver&&this.fetchStreamList(i)},t.prototype.handleStreamRsp=function(t,i,e,n){var s=this.Nn.publishStreamList[i],r=t.streamList.find((function(t){return t.stream_id==i}));if(this.In.info("hsur.0 cmd "+n+" "+!!r),r&&2002===n){var o=t.streamList.findIndex((function(t){return t.stream_id==i}));this.In.info("hsur.0 stream index "+o),o>-1&&t.streamList.splice(o,1)}s?(s.state==T.update_info&&(s.state=T.publishing,2001!==n||r||t.streamList.push(e),this.onPublishStateUpdate(Y,i,{code:0,message:""})),r&&r.stream_sid!==e.stream_sid&&(this.In.info("hsur.0 update sid. "+i+" origin:"+r.stream_sid+", new:"+e.stream_sid),r.stream_sid=e.stream_sid)):this.In.info("hsur.0 stream is not exist")},t.prototype.handleFetchStreamListRsp=function(t,i){var e,n,s,r,o,u,a="zb.sh.hfslr";if(ti(this.In,a,i),this.zo=!1,this.Mn.spanEnd({key:om.event,par:this.us},{stream_seq:om.stream_seq(null===(e=t.body)||void 0===e?void 0:e.stream_seq),stream_size:om.stream_size(null===(s=null===(n=t.body)||void 0===n?void 0:n.stream_info)||void 0===s?void 0:s.length),stream_list:om.stream_list(null===(r=t.body)||void 0===r?void 0:r.stream_info),error:(null===(o=null==t?void 0:t.body)||void 0===o?void 0:o.err_code)||(null==t?void 0:t.code),message:(null===(u=null==t?void 0:t.body)||void 0===u?void 0:u.err_message)||(null==t?void 0:t.msg)}),0===t.body.err_code)if(this.No!==t.body.stream_seq){if(this.No>t.body.stream_seq)return this.In.error(a+" less seq"),void this.fetchStreamList(i);if(this.Co>t.body.stream_seq)this.In.info(a+" less than max fetch stream seq ");else{var c=t.body.stream_info;i&&(c=t.body.stream_info.filter((function(t){return t.stream_id===i}))),this.handleFullUpdateStream(t.body.stream_seq,c),ei(this.In,a)}}else this.In.info(a+" same seq");else this.In.info(a+" server error="+t.body.err_code)},t.prototype.syncPublishStreamList=function(){var t,i="zb.sh.spsl";ti(this.In,i);var e=function(i){var e=n.Nn.publishStreamList[i];if(e.state===T.publishing){var s=n.room.streamList.findIndex((function(t){return t.stream_id===i}));if(e.roomID===n.room.roomID&&-1===s){var r=void 0;(null===(t=n.Ro.publisherList[i])||void 0===t?void 0:t.publisher)&&(r=n.Ro.publisherList[i].publisher.getStreamAddOptions()),e.state=T.update_info,n.updateStreamInfo(i,k,e.extra_info,(function(t){}),void 0,r)}}},n=this;for(var s in this.Nn.publishStreamList)e(s);ei(this.In,i)},t.prototype.handleFullUpdateStream=function(t,i,e){var n=this;void 0===e&&(e=!1);var s="zb.sh.hfus";ti(this.In,s),this.No=t,this.Co<t&&(this.Co=t),this.In.debug(s+" server seq "+this.No),i=i.filter((function(t){return 1!==t.stream_type})),this.Nn.mergeStreamList(this.Nn.idName,this.room.streamList,i,(function(t,i,e,r){0!==t.length&&(n.In.debug(s+" callback addstream"),n.onStreamUpdated(n.us,1,n.makeCallbackStreamList(t))),0!==i.length&&(n.In.debug(s+" callback delstream"),n.onStreamUpdated(n.us,0,n.makeCallbackStreamList(i))),0!==e.length&&(n.In.debug(s+" callback updatestream"),n.onStreamExtraInfoUpdated(n.us,n.makeCallbackStreamList(e))),0!==r.length&&(n.In.warn(s+" callback updateAttrstream"),n.onStreamAttrUpdated(n.us,n.makeCallbackStreamList(r)))})),e||this.syncPublishStreamList(),ei(this.In,s)},t.prototype.handlePushStreamUpdateMsg=function(t){var i="zb.sh.hpsum";ti(this.In,i,JSON.stringify(t));var e=t.body.stream_info;if(e&&0!==e.length){if(e=e.filter((function(t){return 1!==t.stream_type})),this.No+1!==t.body.stream_seq)return ti(this.In,i,"updatestream 1"),void this.fetchStreamList();if(t.body.stream_seq<this.Co)return ti(this.In,i,"updatestream 2"),void this.fetchStreamList();switch(this.No=t.body.stream_seq,t.body.stream_cmd){case H:this.Mo(e);break;case G:this.xo(e);break;case F:this._handleUpdatedStreamList(e)}ei(this.In,i)}else this.In.info(i+", emtpy list")},t.prototype.Mo=function(t){var i="zb.sh.hasl";ti(this.In,i);for(var e,n=[],s=0;s<t.length;s++)if(t[s].anchor_id_name!=this.Nn.idName&&t[s].id_name!=this.Nn.idName&&t[s].user_id!==this.Nn.idName){e=!1;for(var r=0;r<this.room.streamList.length;r++)if(t[s].stream_id===this.room.streamList[r].stream_id){e=!0;break}e||n.push(t[s])}else this.In.debug("hdsl.0 have self stream added");if(0!==n.length){this.In.debug(i+" callback addstream");for(var o=0;o<n.length;o++){this.room.streamList.push(n[o]);var u=this.Ro.playerList[n[o].stream_id];null==u||u.setStreamAdd()}this.onStreamUpdated(this.us,1,this.makeCallbackStreamList(n))}ei(this.In,i)},t.prototype.xo=function(t){var i="zb.sh.hdsl";ti(this.In,i);for(var e=[],n=0;n<t.length;n++)if(t[n].anchor_id_name!=this.Nn.idName&&t[n].id_name!=this.Nn.idName&&t[n].user_id!==this.Nn.idName){for(var s=this.room.streamList.length-1;s>=0;s--)if(t[n].stream_id===this.room.streamList[s].stream_id){this.room.streamList.splice(s--,1),e.push(t[n]);break}}else this.In.debug(i+" have self stream deleted");0!==e.length&&(this.In.debug(i+" callback delstream"),this.onStreamUpdated(this.us,0,this.makeCallbackStreamList(e))),ii(this.In,i)},t.prototype._handleUpdatedStreamList=function(t){var i="zb.sh.husl";ti(this.In,i);for(var e=[],n=[],s=0;s<t.length;s++)if(t[s].anchor_id_name!=this.Nn.idName&&t[s].id_name!=this.Nn.idName&&t[s].user_id!==this.Nn.idName){for(var r=0;r<this.room.streamList.length;r++)if(t[s].stream_id===this.room.streamList[r].stream_id){t[s].extra_info!==this.room.streamList[r].extra_info&&(this.room.streamList[r]=t[s],e.push(t[s])),t[s].stream_attr_opts&&JSON.stringify(t[s].stream_attr_opts)!==JSON.stringify(this.room.streamList[r].stream_attr_opts)&&(this.room.streamList[r]=t[s],n.push(t[s]));break}}else this.In.debug("hsul.0 have self stream updated");0!==e.length&&(this.In.debug(i+" callback updatestream"),this.onStreamExtraInfoUpdated(this.us,this.makeCallbackStreamList(e))),0!==n.length&&(this.In.warn(i+" callback updateAttrStream"),this.onStreamAttrUpdated(this.us,this.makeCallbackStreamList(n))),ei(this.In,i)},t.prototype.fetchStreamList=function(t){var i,e,n,s=this,r="zb.sh.fsl";ti(this.In,r);var o=this.Mn.createSpan(a.H,{key:ln,par:this.us},{key:om.event,par:this.us},om.event,!0);return this.rtm.isDisConnect()?(this.In.info(r+" state error"),void this.Mn.setError(o,om.error.NOT_LOGIN)):this.zo?(this.In.info(r+" already doing"),void this.Mn.setError(o,om.error.te," already doing")):(this.zo=!0,this.In.info(r+" send fetch request"),this.rtm.liveRoomHandler.getStreamList({},(function(i){s.handleFetchStreamListRsp(i,t)}),(function(t){}),{roomID:null===(i=this.room)||void 0===i?void 0:i.roomID,sessionID:null===(e=this.room)||void 0===e?void 0:e.sessionID,roomSessionID:null===(n=this.room)||void 0===n?void 0:n.roomSessionID}),void ei(this.In,r))},t.prototype._handleReconnectStream=function(t){var i,e,n,s,r,o,u,a="zb.sh.hrs";ti(this.In,a);var c=this.Ro.publisherList;this.In.info(a+" publish "+Object.keys(this.Ro.publisherList));var h=function(a){if((null===(e=null===(i=c[a])||void 0===i?void 0:i.room)||void 0===e?void 0:e.roomID)!==f.us)return"continue";var h=t.find((function(t){return t.stream_id==a})),l=h&&!(h.anchor_id_name===f.Nn.idName||h.id_name===f.Nn.idName||h.user_id===f.Nn.idName);if(f.In.info("zb.sh.hrs stream ".concat(a," ").concat(!!h," ").concat(l," ").concat(null===(n=c[a].publisher)||void 0===n?void 0:n.state)),6!=(null===(s=c[a].publisher)||void 0===s?void 0:s.state)&&1!==c[a].state||h&&!l){if((7==(null===(r=c[a].publisher)||void 0===r?void 0:r.state)||2===c[a].state)&&!(null===(u=null===(o=c[a])||void 0===o?void 0:o.retryStreamHandler)||void 0===u?void 0:u.maxTimer)&&t.find((function(t){return t.stream_id==a}))){f.updateStreamInfo(a,v=R);for(var d=0;d<f.room.streamList.length;d++)if(f.room.streamList[d].stream_id==a){f.room.streamList.splice(d--,1);break}}}else{var v=k,m=void 0;c[a].publisher&&(m=c[a].publisher.getStreamAddOptions()),f.updateStreamInfo(a,v,f.Nn.publishStreamList[a].extra_info,void 0,void 0,m)}},f=this;for(var l in c)h(l);ii(this.In,a)},t.prototype.makeCallbackStreamList=function(t){var i,e=[];this.Nn.appConfig&&(i=this.Nn.appConfig.media_config.play_config.resource_info.filter((function(t){return[M.CDN,M.DG].includes(t.resource_type)})));if(t&&t.length>0)for(var n=0;n<t.length;n++){var s=t[n].stream_id;if(i&&i.length)for(var r=0;r<i.length;r++){for(var o=i[r].resource_type==M.DG?"_plus":"",u=[],a=[],c=[],h=0;h<i[r].service_info.length;h++){var f=i[r].service_info[h],l=f.protocol,d=f.url_template.replace("{STREAM_NAME}",s);switch(l){case g.FLV:u.push(d);break;case g.HLS:a.push(d);break;case g.RTMP:c.push(d)}}t[n]["urls_flv"+o]=u,t[n]["urls_m3u8"+o]=a,t[n]["urls_rtmp"+o]=c}var v={user:{userID:t[n].anchor_id_name||t[n].id_name,userName:t[n].anchor_nick_name||t[n].nick_name},extraInfo:t[n].extra_info,streamID:t[n].stream_id,roomID:"",urlFlv:"",urlFlvPlus:"",urlRtmp:"",urlHls:"",urlHlsPlus:"",urlHttpsFlv:"",urlHttpsHls:"",streamGID:t[n].stream_gid,closeType:t[n].close_type,stream_attr_opts:t[n].stream_attr_opts};this._setCDNInfo(v,t[n]),e.push(v)}return e},t.prototype.sendHttpPBRequest=function(t,i,e,n,s){var r,o;null===(r=this.rtm.netAgent)||void 0===r||r.startHttpRequest2({interfaceID:t.interfaceID,resID:t.resID||"",body:i,ack:!1,idName:this.Nn.idName,method:2,token:(null===(o=this.room)||void 0===o?void 0:o.token)||"",mode:this.Nn.testEnvironment?2:1,reduceRspHeaders:!0},(function(t,i){e&&e(t,i)}),(function(t){n&&n(t)}),null,{timeout:(null==s?void 0:s.timeout)||4e3,extras:{protoCmd:t.protoCmd}})},t.prototype.sendMixRequest=function(t,i,e,n,s){var r=this;void 0===s&&(s=2);var o=function(o,u){var a=o.status_code,c=o.body,h=o.code,f=o.message;return Bt(h)||0===h?a&&200!==a?(s--,void(502===a&&s>0?r.sendMixRequest(t,i,e,n,s):n&&n(a,c))):void(e&&e(c,u)):h===Ni.code&&s>0?(s--,void r.sendMixRequest(t,i,e,n,s)):void(n&&n(-1,{},{code:h,message:f}))};this.sendHttpPBRequest(t,i,(function(t,i){o(t,i)}),(function(t){o(t)}))},t.prototype.sendRTMPRequest=function(t,i,e,n){var s=this.rtm.netAgent,r=this.Nn.appid,o=i.streamID,u="/v1/jsrtmp/dispatch/".concat(t,"/").concat(o,"/").concat(i.actionType,"/").concat(s.clientIP),a=this.room;s.startHttpRequest({service:1,headers:[{name:"Token-Appid",val:r+""},{name:"Token-Str",val:(null==a?void 0:a.token)||""},{name:"Token-Userid",val:this.Nn.idName},{name:"Token-Biztype",val:"2"},{name:"Net-Mode",val:this.Nn.netMode+""}],body:{},idName:this.Nn.idName,method_no:1,ack:!1,location:u},(function(t){e(t)}),(function(t,i,e){n(t)}))},t.prototype._publishTarget=function(t,i,e){},t.prototype.updateStreamExtraInfo=function(t,i,e,n){ti(this.In,"zb.sh.usei");var s=I;this.Nn.publishStreamList[t]&&this.Nn.publishStreamList[t].state>=T.update_info?(this.Nn.publishStreamList[t].extra_info=i,this.updateStreamInfo(t,s,i,e,n)):this.Nn.publishStreamList[t]&&this.Nn.publishStreamList[t].state===T.tryPublish?(this.Nn.publishStreamList[t].extra_info=i,e({errorCode:0})):n(so.error.Rn)},t.prototype.getMixStreamStatus=function(t){},t.prototype.setStreamExtraInfo=function(t,i,e,n){this.updateStreamExtraInfo(t,i,e,n)},t.prototype._publishTargetWeb=function(t,i,e){},t.prototype.patchStreamList=function(t){var i=this;if(Lt(t.body.stream_refresh)&&0!==t.body.stream_refresh)return this.In.info(jv+" stream refresh "),void this.fetchStreamList();this.In.info(jv+" stream seq "+this.No+" "+JSON.stringify(this.Do)),t.body.stream_seq>this.No&&!this.Do&&(this.Do={},ti(this.In,jv,"update stream "+this.No+" server "+t.body.stream_seq),this.jo&&clearTimeout(this.jo),this.jo=setTimeout((function(){i.handleMergeTimeout()}),this.Po)),this.Io=t.body.stream_seq},t.prototype.getStreamSeq=function(){return this.No},t.prototype.mergeStreamByStreamSeq=function(t,i,e){var n=this;this.Do||(this.In.warn(Mv+" new merge stream list "+this.No+" server "+i),this.Do={},this.jo&&clearTimeout(this.jo),this.jo=setTimeout((function(){n.handleMergeTimeout()}),this.Ao)),this.In.info(Mv+" ".concat(this.Do," ").concat(t," ").concat(i," ").concat(e)),this.Do[i]={cmd:t,streamList:e}},t.prototype.handleMergeTimeout=function(){if(this.Do){var t=Object.keys(this.Do).map((function(t){return+t})).sort((function(t,i){return t-i}));t[t.length-1]-t[0]+1===t.length||t[t.length-1]>=this.Io?this.mergeStream(t):(this.Do=null,this.fetchStreamList())}},t.prototype.mergeStream=function(t){var i=this;this.In.info(xv+" merge streamList "+this.No+" streamSeqList "+t.join(","));var e=t[t.length-1],n=[];t.forEach((function(t){if(i.Do&&i.Do[t])switch(i.Do[t].cmd){case H:i.Do[t].streamList.forEach((function(t){var i=n.findIndex((function(i){return i.stream_id==t.stream_id}));-1!==i&&n.splice(i),n.push(t)}));break;case G:i.Do[t].streamList.forEach((function(t){var i=n.findIndex((function(i){return i.stream_id==t.stream_id}));-1!==i&&n.splice(i)}));break;case F:i.Do[t].streamList.forEach((function(t){var i=n.findIndex((function(i){return i.stream_id==t.stream_id}));-1!==i&&n.splice(i),n.push(t)}))}})),this.Do=null,this.In.info(xv+" "+n),this.handleFullUpdateStream(e,n)},t.prototype.reset=function(){this.Io=0,this.Do=null,this.mixStreamTaskList={},this.mixRequestIdList=[],this.mixStreamHbList={},this.jo&&(clearTimeout(this.jo),this.jo=void 0),this.Po=2e3,this.Ao=5e3},t}(),cm=function(){function t(){this.handlerListMap={}}return t.prototype.addEventHandler=function(t,i){if(this.handlerListMap[t]||(this.handlerListMap[t]=[]),!Ht(i))throw new Error("Params callBack is not a Function");return-1==this.handlerListMap[t].indexOf(i)&&this.handlerListMap[t].push(i),!0},t.prototype.removeEventHandler=function(t,i){return!!this.handlerListMap[t]&&(this.handlerListMap[t]=i?this.handlerListMap[t].filter((function(t){return t!==i})):[],!0)},t.prototype.emit=function(t){for(var i=[],e=1;e<arguments.length;e++)i[e-1]=arguments[e];this.handlerListMap[t]&&this.handlerListMap[t].forEach((function(e){try{e.apply(void 0,i)}catch(i){console.error('Fail to execute callback of event "'.concat(t,'" : ').concat(i))}}))},t}(),hm=cm,fm="zg_autoplay_wrapper";function lm(){return navigator.language.includes("zh")}var dm=function(){function t(){this.content='Media play failed. Click the "Resume"to resume.',this.Lo=null;var t=document.createElement("style");t.type="text/css";var i=".zg_autoplay_mask{position:fixed;top:0;left:0;right:0;bottom:0;width:100vw;height:100vh;display:flex;justify-content:center;align-items:center;background:rgba(0,0,0,0.5);z-index:1500}.zg_autoplay_mask div:not(.zg_autoplay_action_wrapper){display:block!important}.".concat(fm,"{padding:14px;background:#fff;border-radius:3px;box-shadow:1px 1px 10px#988e8d;border:1px solid#d1cfcf;max-width:500px}.").concat(fm,"a{color:#2473E8}.zg_autoplay_header{overflow:hidden;text-overflow:ellipsis;font-size:16px;font-weight:600}.zg_autoplay_content{margin:8px 0}.zg_autoplay_action_wrapper{width:100%;display:flex!important;align-items:center;justify-content:right;float:right}.zg_autoplay_collapse{margin-right:auto;cursor:pointer}.zg_autoplay_question{height:100%;line-height:16px;cursor:pointer}.zg_autoplay_action_confirm{margin-left:8px;color:#fff;background:#0072ff;padding:4px 12px;outline:none;border:1px solid;border-radius:3px;font-weight:bold}.zg_autoplay_action_confirm:hover{opacity:0.9}.zg_autoplay_collapse,.zg_autoplay_action_confirm,.zg_autoplay_content,.zg_autoplay_question{font-size:14px}@media screen and(max-width:750px){.").concat(fm,"{width:80vw}}");t.appendChild(document.createTextNode(i)),Wt.head.appendChild(t),lm()&&(this.content="浏览器阻止音视频播放,请点击“恢复播放”。"),this.qo=new hm}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.createDialog=function(){var t=Wt.createElement("template"),i=Wt.createElement("div");i.className="zg_autoplay_mask";var e=Wt.createElement("div");e.className=fm;var n=Wt.createElement("div");n.className="zg_autoplay_header",n.textContent=location.host;var s=Wt.createElement("div");s.className="zg_autoplay_content",s.textContent=this.content;var r=Wt.createElement("div");r.className="zg_autoplay_action_wrapper",e.appendChild(n),e.appendChild(s),e.appendChild(r),i.appendChild(e),t.content.appendChild(i);var o=Wt.createElement("button");o.className="zg_autoplay_action_confirm",o.innerText=lm()?"恢复播放":"Resume",o.onclick=this.onConfirm.bind(this);var u=t.content.firstChild;return r&&r.appendChild(o),u},t.prototype.onConfirm=function(t){t&&t.stopPropagation(),this.qo.emit("allowPlay"),this.deleteDiaLog()},t.prototype.deleteDiaLog=function(){this.Lo&&(Wt.body.removeChild(this.Lo),this.Lo=null)},t.prototype.addDiaLog=function(){this.Lo=this.Lo||this.createDialog(),Wt.body.appendChild(this.Lo),this.Lo.onclick=this.onConfirm.bind(this)},t.prototype.on=function(t,i){return this.qo.addEventHandler(t,i)},t.prototype.off=function(t,i){return this.qo.removeEventHandler(t,i)},t.instance=null,t}(),vm=function(){function t(t,i){this.In=t,this.Uo=i}return t.prototype.info=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.In.info(t.join(""),{streamid:this.Uo})},t.prototype.warn=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.In.warn(t.join(""),{streamid:this.Uo})},t.prototype.error=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.In.error(t.join(""),{streamid:this.Uo})},t.prototype.debug=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.In.debug(t.join(""),{streamid:this.Uo})},t}();function mm(t,i){return new vm(t,i)}var pm,gm=function(){return gm=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},gm.apply(this,arguments)},bm=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},_m=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},ym=th(),wm=/^(?=.*MicroMessenger)(?=.*HONOR).*$/.test(ym||""),Sm=dm.getInstance(),Em=function(){function t(t,i,e){var n=this;this.previewer=i,this.Bo=null,this.Jo=null,this.inited=!1,this.container=null,this.Vo=null,this.jr={enableVideoAutoplayDialog:!0,enableAudioAutoplayDialog:!0,clearLastFrame:!0,useAudioElement:!0},this.Ho=_i((function(t,i,e){n.Go.emit("autoplayFailed",i,e),(t?n.jr.enableVideoAutoplayDialog:n.jr.enableAudioAutoplayDialog)?Sm.addDiaLog():Wt.body.addEventListener("mousedown",n.Fo.resumePlayByClickBody),n.Yo.warn("zc.zsv id:".concat(n.id," autoplay failed"))}),600),this.Zo=!1,this.Qo=!1,this.Xo=_i(this.Wo,20),this.Fo={visibilitychange:function(){var t;Wt.hidden||n.Qo||!ch()||(n.Yo.info("zc.zsv id: ".concat(n.id," page show, recover audio")),n.jr.useAudioElement&&n.Jo?n.Jo.srcObject=n.Jo.srcObject:(n.Yo.info("zc.ac.rs id: ".concat(n.id," page show")),n.ac.resume()),n.Xo(n.Jo,!0)),Wt.hidden||n.Zo||!ch()||(null===(t=n.Bo)||void 0===t?void 0:t.paused)&&(n.Yo.info("zc.zsv id: ".concat(n.id," page show, recover video")),n.Wo(n.Bo,!0))},focus:function(t){!n.Qo&&ih()&&(fh().startsWith("16")&&(n.Yo.info("zc.zsv id: ".concat(n.id," page focus, recover audio")),n.Xo(n.Jo,!0)))},canPlayAudio:function(t){n.Go.emit("canPlayAudio",t)},canPlayVideo:function(t){n.Go.emit("canPlayVideo",t)},resumePlayByClickBody:function(){return bm(n,void 0,void 0,(function(){return _m(this,(function(t){switch(t.label){case 0:return this.Yo.info("zc.zsv id:".concat(this.id," resume by click dom_body")),[4,this.resume()];case 1:return t.sent(),Wt.body.removeEventListener("mousedown",this.Fo.resumePlayByClickBody),[2]}}))}))}},this.inited=!0,this.jr=gm(gm({},this.jr),e);var s=this.id="".concat(t.id);this.Yo=mm(this.In,(null==i?void 0:i.streamId)||""||void 0),this.Yo.info("zc.sv.c id:".concat(s,"  isLocal: ").concat(this.isLocal));var r=Wt.createElement("div");r.id="zg-rtc-player_".concat(s),r.setAttribute("style","width:100%;height:100%;position:relative;background-color:black;overflow:hidden;");var o=t.getVideoTracks()[0],u=t.getAudioTracks()[0],a=Kt(void 0,void 0,"safari"!==this.browser);a.id="zg-rtc-video_".concat(s),a.setAttribute("style","width:100%;height:100%;object-fit:contain;"),a.srcObject=new MediaStream,a.addEventListener("canplay",this.Fo.canPlayVideo),o&&a.srcObject.addTrack(o);var c=Wt.createElement("audio");c.id="zg-rtc-audio_".concat(s),c.setAttribute("autoplay",""),c.setAttribute("playsinline",""),c.setAttribute("muted",""),c.muted=!0,c.srcObject=this.Ko=new MediaStream,c.addEventListener("canplay",this.Fo.canPlayAudio),u&&c.srcObject.addTrack(u),"object"==typeof WeixinJSBridge&&"function"==typeof WeixinJSBridge.invoke&&WeixinJSBridge.invoke("getNetworkType",{},(function(){n.Yo.info("zc.zsv id:".concat(n.id," weixin load media")),c.load(),a.load()})),this.$o=r,this.Bo=a,this.Jo=c,this.Go=new hm,this.tu=function(){n.resume()},Sm.on("allowPlay",this.tu),window.addEventListener("focus",this.Fo.focus),Wt.addEventListener("visibilitychange",this.Fo.visibilitychange)}return Object.defineProperty(t.prototype,"video",{get:function(){return this.Bo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audio",{get:function(){return this.Jo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ac",{get:function(){return this.previewer.ac},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"browser",{get:function(){return this.previewer.Nn.browser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"In",{get:function(){return this.previewer.logger},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLocal",{get:function(){return this.previewer instanceof zp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isMounted",{get:function(){return!!this.$o.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_hasAudio",{get:function(){var t,i;return"live"===(null===(i=null===(t=this.Ko)||void 0===t?void 0:t.getTracks()[0])||void 0===i?void 0:i.readyState)&&!this.Qo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_hasVideo",{get:function(){var t,i,e;return!!(null===(t=this.Bo)||void 0===t?void 0:t.parentNode)&&"live"===(null===(e=null===(i=this.Bo.srcObject)||void 0===i?void 0:i.getTracks()[0])||void 0===e?void 0:e.readyState)},enumerable:!1,configurable:!0}),t.prototype.resume=function(t,i){return void 0===i&&(i=["audio","video"]),bm(this,void 0,void 0,(function(){var e=this;return _m(this,(function(n){return this.Yo.info("zc.zsv resume call: ".concat(t,", kindList: ").concat(i,", id:").concat(this.id,", isLocal: ").concat(this.isLocal)),i.forEach((function(i){return bm(e,void 0,void 0,(function(){var e,n,s=this;return _m(this,(function(r){switch(r.label){case 0:return n="audio"===i?this.Jo:this.Bo,((e="audio"===i)?this._hasAudio:this._hasVideo)?!e||this.jr.useAudioElement?[3,1]:(this.Yo.info("zc.zsv resume id:".concat(this.id," ac: ")+this.ac.state),this.ac.resume(),[3,4]):[3,4];case 1:return t&&n?(n.srcObject=n.srcObject,[4,new Xt((function(t){var i=setTimeout((function(){s.Yo.info("zc.zsv id:".concat(s.id," resume play ").concat(e?"audio":"video"," timeout")),t(0)}),1e3),r=function(){clearTimeout(i),n.removeEventListener("canplay",r),t(0)};n.addEventListener("canplay",r)}))]):[3,3];case 2:r.sent(),r.label=3;case 3:null==n||n.play().catch((function(t){s.Yo.info("zc.zsv id:".concat(s.id," resume failed. err:")+t.message)})),r.label=4;case 4:return[2]}}))}))})),[2]}))}))},t.prototype.checkIfClearLastFrame=function(){return bm(this,void 0,void 0,(function(){return _m(this,(function(t){switch(t.label){case 0:return this.jr.clearLastFrame?[4,this.resume(!0,["video"])]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t.prototype.play=function(t,i){void 0===i&&(i={}),this.Yo.info("zc.zsv play: ".concat(typeof t,", ").concat(JSON.stringify(i),", id:").concat(this.id," isLocal:").concat(this.isLocal?"1":"0 streamid:"+this.previewer.streamId,","));var e=(i=gm({},i)).enableAutoplayDialog;Ut(e)&&(i.enableVideoAutoplayDialog=e,i.enableAudioAutoplayDialog=e,delete i.enableAutoplayDialog),this.playVideo(t,i),this.playAudio(i,!this.isLocal)},t.prototype.playVideo=function(t,i){void 0===i&&(i={}),this.Yo.info("zc.zsv.pv id:".concat(this.id," play: ").concat(typeof t,", ").concat(JSON.stringify(i)," isLocal:").concat(this.isLocal));var e=null;if(qt(t)?e=Wt.getElementById(t):Zt(t)&&(e=t),!e)throw this.Yo.error("zc.zsv.pv id:".concat(this.id," no element isLocal:").concat(this.isLocal)),"Execute `play` failed, container not exist";i&&"enableAutoplayDialog"in i&&(i.enableVideoAutoplayDialog=i.enableAutoplayDialog,delete i.enableAutoplayDialog),this.jr=gm(gm({},this.jr),i);var n=this.jr,s=n.objectFit,r=n.mirror;this.Bo&&(void 0!==s&&(this.Bo.style.objectFit=s),Ut(r)&&(this.Bo.style.transform=r?"rotateY(180deg)":"")),!e.contains(this.$o)&&e.appendChild(this.$o),this.container=e,this.Zo=!1,this.Wo(this.Bo,!0)},t.prototype.playAudio=function(t,i){void 0===i&&(i=!0),this.Yo.info("zc.zsv.pa id:".concat(this.id," play: ").concat(JSON.stringify(t)," isLocal:").concat(this.isLocal)),t&&"enableAutoplayDialog"in t&&(t.enableAudioAutoplayDialog=t.enableAutoplayDialog,delete t.enableAutoplayDialog),this.jr=gm(gm({},this.jr),t);var e=!0;if("safari"===this.browser){var n=ym.match(/Version\/([\d\.]+)/);if(n)"13.1.2"!==n[1]||this.jr.useAudioElement||(e=!1)}e||(this.Yo.warn("zc.zsv.pa id:".concat(this.id," safari 13.1.2 cannot use audio ctx render.")),this.jr.useAudioElement=!0);var s=i,r=this.jr.muted;this.Jo&&Ut(r)&&(s=!r),this.Qo=!s,this.Wo(this.Jo,s)},t.prototype.stop=function(){this.Yo.info("zc.zsv stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this.stopAudio(),this.stopVideo()},t.prototype.stopAudio=function(){this.Yo.info("zc.zsv.sa stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this.Qo=!0,this.Wo(this.Jo,!1)},t.prototype.stopVideo=function(){var t;this.Yo.info("zc.zsv.sv stop id:".concat(this.id," isLocal:").concat(this.isLocal)),this.Wo(this.Bo,!1);var i=null===(t=this.$o)||void 0===t?void 0:t.parentNode;i&&i.removeChild(this.$o)},t.prototype.setVideo=function(t,i){return void 0===i&&(i=!1),bm(this,void 0,void 0,(function(){return _m(this,(function(e){switch(e.label){case 0:return[4,this.setTrack(!0,t,i)];case 1:return e.sent(),[2]}}))}))},t.prototype.setAudio=function(t,i){return void 0===i&&(i=!1),bm(this,void 0,void 0,(function(){return _m(this,(function(e){switch(e.label){case 0:return[4,this.setTrack(!1,t,i)];case 1:return e.sent(),[2]}}))}))},t.prototype.setTrack=function(t,i,e){return void 0===e&&(e=!1),bm(this,void 0,void 0,(function(){var n,s,r;return _m(this,(function(o){switch(o.label){case 0:return this.Yo.info("zc.zsv set id:".concat(this.id," track: ").concat(t,", ").concat(null==i?void 0:i.id,", ").concat(e,", ").concat(null==i?void 0:i.readyState," isLocal:").concat(this.isLocal)),(n=t?this.Bo:this.Jo)?(s=n.srcObject)?i?[3,1]:((r=s.getTracks()).forEach((function(t){null==s||s.removeTrack(t),n.srcObject=n.srcObject})),this.Go.emit("_trackChange",t?"video":"audio"),[3,5]):[2]:[2];case 1:if(!(i instanceof MediaStreamTrack))return[3,5];if((r=s.getTracks()).includes(i))return[3,5];if(r.forEach((function(t){null==s||s.removeTrack(t)})),s.addTrack(i),this.jr.useAudioElement||this.iu(!0),this.Go.emit("_trackChange",i.kind,i),this.Wo(n,!(t?this.Zo:this.Qo)),!e)return[3,5];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.resume(!0,[t?"video":"audio"])];case 3:return o.sent(),[3,5];case 4:return o.sent(),[3,5];case 5:return[2]}}))}))},t.prototype.setMirror=function(t){var i=this.jr.mirror=!!t;this.Bo&&(this.Bo.style.transform=i?"rotateY(180deg)":"")},t.prototype.setVideoMuted=function(t){return this.Yo.info("zc.zsv id:".concat(this.id," mute video: ").concat(t," isLocal:").concat(this.isLocal)),this.Zo=t,this.Wo(this.Bo,!t)},t.prototype.setAudioMuted=function(t){return this.Yo.info("zc.zsv id:".concat(this.id," mute audio: ").concat(t," isLocal:").concat(this.isLocal)),this.Qo=t,this.Wo(this.Jo,!t)},t.prototype.setVolume=function(t){if(this.Yo.info("zc.zsv id:".concat(this.id," volume: ").concat(t," isLocal:").concat(this.isLocal)),this.Jo){var i=t>100?1:t/100;return this.Jo.volume=i,this.eu&&(this.eu.gain.value=i),this.Jo.volume==i}return!1},t.prototype.takeStreamSnapshot=function(t){var i=this.Bo;if(!i)return"";if(!i.srcObject)return"";var e=$t(this.Bo.videoWidth,this.Bo.videoHeight),n=e.getContext("2d");n&&n.drawImage(this.Bo,0,0,e.width,e.height);var s=e.toDataURL("image/"+(null==t?void 0:t.imageType)||0,null==t?void 0:t.quality),r="png";return(null==t?void 0:t.imageType)&&(r=["png","jpeg"].includes(null==t?void 0:t.imageType)?null==t?void 0:t.imageType:"png"),(null==t?void 0:t.save)&&e.toBlob((function(i){var e=window.URL.createObjectURL(i),n=Wt.createElement("a");n.style.display="none",n.href=e;var s=(null==t?void 0:t.fileName)||"snapshot"+Date.now();n.download=s+"."+r,Wt.body.appendChild(n),n.click(),setTimeout((function(){Wt.body.removeChild(n),window.URL.revokeObjectURL(e)}),100)})),s},t.prototype.getVideoHeight=function(){return this.Bo?this.Bo.videoHeight:0},t.prototype.getVideoWidth=function(){return this.Bo?this.Bo.videoWidth:0},t.prototype.iu=function(t){if(void 0===t&&(t=!1),this.Vo?t&&(this.Vo.disconnect(),this.Vo=this.ac.createMediaStreamSource(this.Ko)):this.Vo=this.ac.createMediaStreamSource(this.Ko),!this.eu){var i=this.eu=this.ac.createGain();this.Jo&&(i.gain.value=this.Jo.volume)}return this.Vo.connect(this.eu),{gainNode:this.eu,srcNode:this.Vo}},t.prototype.Wo=function(t,i,e){var n,s,r=this;if(void 0===e&&(e=0),!t||!this.$o)return!1;var o=!this.jr.useAudioElement,u="VIDEO"===t.tagName;if(this.Yo.info("zc.zsv id:".concat(this.id," mount play ").concat(t.tagName)),i){if(!u&&o){t.muted=!0,t.pause(),t.remove(),this.iu().gainNode.connect(this.ac.destination);var a="running";this.Yo.info("zc.zsv id:".concat(this.id," render use audio context: ")+this.ac.state),this.ac.state!==a&&this.ac.resume().then((function(){r.ac.state!==a&&r.Ho(u,t)}))}else if("live"===(null===(s=null===(n=null==t?void 0:t.srcObject)||void 0===n?void 0:n.getTracks()[0])||void 0===s?void 0:s.readyState)){var c=null,h=function(){t.oncanplay=null,c&&(clearTimeout(c),c=null),t.play().then((function(){wm&&!u&&(r.Yo.info("zc.ac.rs id:".concat(r.id," honor suspend ac")),r.ac.resume()),r.Yo.info("zc.zsv id:".concat(r.id," render  ").concat(t.tagName," use element success"))})).catch((function(i){r.Yo.warn("zc.zsv 2: id:".concat(r.id," ").concat(t.tagName," play() error: ").concat(i.message," isLocal:").concat(r.isLocal));var e=r._hasVideo,n=r._hasAudio;!(i.message||"").includes("interrupted")&&(r._isMounted&&u&&e||!u&&n)&&r.Ho(u,t,i)}))};t.muted=!0,u||(this.eu&&this.eu.disconnect(),t.muted=!1,t.srcObject=t.srcObject),wm&&!u&&(this.Yo.info("zc.ac.rs id:".concat(this.id," honor resume ac")),this.ac.suspend()),t.play().catch((function(i){r.Yo.warn("zc.zsv 1: id:".concat(r.id," ").concat(t.tagName," play() error: ").concat(i.message," isLocal:").concat(r.isLocal))})),c=window.setTimeout((function(){h()}),1e3),t.oncanplay=function(){h()},t.onerror=function(){var i,n,s,o,a=!(u?r.Zo:r.Qo);r.Yo.error("zc.zsv id:".concat(r.id," ").concat(t.tagName," onerror:  ").concat(null===(i=t.error)||void 0===i?void 0:i.code," ").concat(null===(n=t.error)||void 0===n?void 0:n.message," ; times: ").concat(e," ; enable: ").concat(a)),a&&t.error&&(0===e&&3===(null===(s=t.error)||void 0===s?void 0:s.code)?(r.Yo.info("zc.zsv decode failed. retry again"),r.Wo(t,a,e++)):(r.Yo.info("zc.zsv not retry on error. ".concat(e," ").concat(null===(o=t.error)||void 0===o?void 0:o.code)),r.Ho(u,t,t.error)))},!t.parentNode&&u&&this.$o.appendChild(t)}}else if(t.muted=!0,t.remove(),t.pause(),!u){o&&this.eu&&this.eu.disconnect();var f=5*Math.random()+4;setTimeout((function(){!u&&!t.parentNode&&t.readyState>3&&t.load()}),1e3*f)}return!0},t.prototype.on=function(t,i){return!!i&&this.Go.addEventHandler(t,i)},t.prototype.off=function(t,i){return this.Go.removeEventHandler(t,i)},t.prototype.useAudioOut=function(t){var i;return bm(this,void 0,void 0,(function(){var e;return _m(this,(function(n){switch(n.label){case 0:return e=null===(i=this.Jo)||void 0===i?void 0:i.setSinkId,e?[4,e.call(this.Jo,t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.destroy=function(){this.stop(),this.Bo&&(this.Bo.removeEventListener("canplay",this.Fo.canPlayVideo),this.Bo=null),this.Jo&&(this.Jo.removeEventListener("canplay",this.Fo.canPlayAudio),this.Jo=null),window.removeEventListener("focus",this.Fo.focus),Wt.removeEventListener("visibilitychange",this.Fo.visibilitychange),Wt.body.removeEventListener("mousedown",this.Fo.resumePlayByClickBody),Sm.off("allowPlay",this.tu),this.inited=!1,this.tu=null},t.prototype.getAudioNodeAndStopRender=function(){var t=this.Jo,i=this.jr;t&&(t.muted=!0,t.remove(),t.pause());var e=this.iu(!0).gainNode;return i.useAudioContext&&e.disconnect(),e},t}(),Om=function(){function t(t,i){this.source=t,this.destination=i,this.audioNodeList=[],this.source.disconnect(),this.source.connect(this.destination)}return Object.defineProperty(t.prototype,"destinationNode",{get:function(){return this.destination},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this.isEmpty()?null:this.audioNodeList[this.audioNodeList.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"secondToLastNode",{get:function(){return this.audioNodeList.length<2?null:this.audioNodeList[this.audioNodeList.length-2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this.isEmpty()?null:this.audioNodeList[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"secondNode",{get:function(){return this.audioNodeList.length<2?null:this.audioNodeList[1]},enumerable:!1,configurable:!0}),t.prototype.pushBack=function(t){this.lastNode?(this.lastNode.disconnect(),this.lastNode.connect(t),t.connect(this.destination)):(this.source.disconnect(),this.source.connect(t),t.connect(this.destination)),this.audioNodeList.push(t)},t.prototype.popBack=function(){this.lastNode&&(this.lastNode.disconnect(),this.secondToLastNode?(this.secondToLastNode.disconnect(),this.secondToLastNode.connect(this.destination)):(this.source.disconnect(),this.source.connect(this.destination))),this.audioNodeList.pop()},t.prototype.pushFront=function(t){this.source.disconnect(),this.source.connect(t),t.connect(this.firstNode?this.firstNode:this.destination),this.audioNodeList.unshift(t)},t.prototype.popFront=function(){this.source.disconnect(),this.firstNode&&(this.firstNode.disconnect(),this.source.connect(this.secondNode?this.secondNode:this.destination)),this.audioNodeList.shift()},t.prototype.remove=function(t){var i=this.audioNodeList.indexOf(t);if(-1!==i){if(t.disconnect(),i-1>=0){var e=this.audioNodeList[i-1];e.disconnect(),e.connect(this.lastNode!=t?this.audioNodeList[i+1]:this.destination)}else this.source.disconnect(),this.source.connect(this.lastNode!=t?this.audioNodeList[i+1]:this.destination);this.audioNodeList.splice(i,1)}},t.prototype.isConnected=function(t){return-1!==this.audioNodeList.indexOf(t)},t.prototype.isEmpty=function(){return 0===this.audioNodeList.length},t.prototype.replaceSource=function(t){this.source.disconnect(),t.connect(this.firstNode?this.firstNode:this.destination),this.source=t},t.prototype.replaceDestination=function(t){this.lastNode?(this.lastNode.disconnect(),this.lastNode.connect(t)):(this.source.disconnect(),this.source.connect(t)),this.destination=t},t}(),Tm=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},km=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Rm=function(){function t(){this.isFirstNode=!0,this.isLastNode=!0,this.hasAnother=!1}return t.prototype.connect=function(t){return Tm(this,void 0,void 0,(function(){return km(this,(function(i){switch(i.label){case 0:return this.next=t,this.output?[4,t.setInput(this.output)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2,t]}}))}))},t.prototype.disconnect=function(t){return Tm(this,void 0,void 0,(function(){return km(this,(function(i){switch(i.label){case 0:return this.next?[4,this.next.setInput(null,t)]:[3,2];case 1:i.sent(),this.next=void 0,i.label=2;case 2:return[2]}}))}))},t.prototype.setNodePos=function(t,i,e){void 0!==t&&(this.isFirstNode=t),void 0!==i&&(this.isLastNode=i),"boolean"==typeof e&&(this.hasAnother=!e)},t}(),Im=function(){function t(){}return t.createError=function(t,i){return{code:t.code,message:t.message+(i?" "+i:"")}},t}(),Nm=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Cm=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},zm=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Dm=Im.createError,Pm=function(t){function i(i,e){var n=t.call(this)||this;return n.track=i,n.streamCenter=e,n.isFirstNode=!1,n.isLastNode=!1,n}return Nm(i,t),Object.defineProperty(i.prototype,"output",{get:function(){return{track:this.track}},enumerable:!1,configurable:!0}),i.prototype.setInput=function(t){return Cm(this,void 0,void 0,(function(){return zm(this,(function(t){throw Dm({code:-1,message:"Can not set track input to VideoSourceNode"})}))}))},i.prototype.process=function(){},i.prototype.destory=function(){this.track&&(this.streamCenter.trackUtils.stopTrack(this.track),this.track=null),this.next=null},i}(Rm),Am=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Mm=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},xm=function(){function t(t,i,e,n,s){this.nu=t,this.su=i,this.Ro=e,this.browser=n,this.preview=s,this.ru=[],this._vcMgr=void 0,this.nu.connect(this.su)}return Object.defineProperty(t.prototype,"vcMgr",{get:function(){return this._vcMgr},set:function(t){this._vcMgr||(this._vcMgr=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastNode",{get:function(){return this.isEmpty()?null:this.ru[this.ru.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"secondToLastNode",{get:function(){return this.ru.length<2?null:this.ru[this.ru.length-2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstNode",{get:function(){return this.isEmpty()?null:this.ru[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"secondNode",{get:function(){return this.ru.length<2?null:this.ru[1]},enumerable:!1,configurable:!0}),t.prototype.pushBack=function(t){return Am(this,void 0,void 0,(function(){return Mm(this,(function(i){switch(i.label){case 0:return this.lastNode?(this.lastNode.setNodePos(void 0,!1),[4,this.lastNode.connect(t)]):[3,3];case 1:return i.sent(),t.setNodePos(!1),[4,t.connect(this.su)];case 2:return i.sent(),[3,6];case 3:return[4,this.nu.connect(t)];case 4:return i.sent(),t.setNodePos(!0),[4,t.connect(this.su)];case 5:i.sent(),i.label=6;case 6:return this.ru.push(t),[2]}}))}))},t.prototype.popBack=function(){return Am(this,void 0,void 0,(function(){return Mm(this,(function(t){switch(t.label){case 0:return this.lastNode?[4,this.lastNode.disconnect()]:[3,7];case 1:return t.sent(),this.secondToLastNode?[4,this.secondToLastNode.disconnect()]:[3,4];case 2:return t.sent(),this.secondToLastNode.setNodePos(void 0,!0),[4,this.secondToLastNode.connect(this.su)];case 3:return t.sent(),[3,7];case 4:return[4,this.nu.disconnect()];case 5:return t.sent(),[4,this.nu.connect(this.su)];case 6:t.sent(),t.label=7;case 7:return this.ru.pop(),[2]}}))}))},t.prototype.pushFront=function(t){return Am(this,void 0,void 0,(function(){return Mm(this,(function(i){switch(i.label){case 0:return[4,this.nu.disconnect()];case 1:return i.sent(),this.firstNode&&t.setNodePos(void 0,void 0,!1),[4,this.nu.connect(t)];case 2:return i.sent(),this.firstNode?(this.firstNode.setNodePos(!1),t.setNodePos(!0,!1),[4,t.connect(this.firstNode)]):[3,4];case 3:return i.sent(),[3,6];case 4:return t.setNodePos(!0,!0),[4,t.connect(this.su)];case 5:i.sent(),i.label=6;case 6:return this.ru.unshift(t),[2]}}))}))},t.prototype.popFront=function(){return Am(this,void 0,void 0,(function(){return Mm(this,(function(t){switch(t.label){case 0:return[4,this.nu.disconnect()];case 1:return t.sent(),this.firstNode?[4,this.firstNode.disconnect()]:[3,6];case 2:return t.sent(),this.secondNode?(this.secondNode.setNodePos(!1),[4,this.nu.connect(this.secondNode)]):[3,4];case 3:return t.sent(),[3,6];case 4:return[4,this.nu.connect(this.su)];case 5:t.sent(),t.label=6;case 6:return this.ru.shift(),[2]}}))}))},t.prototype.remove=function(t){return Am(this,void 0,void 0,(function(){var i,e,n;return Mm(this,(function(s){switch(s.label){case 0:return-1===(i=this.ru.indexOf(t))?[3,13]:[4,t.disconnect()];case 1:return s.sent(),e=this.ru[i+1],i-1>=0?[4,(n=this.ru[i-1]).disconnect()]:[3,7];case 2:return s.sent(),this.lastNode==t?[3,4]:(n.setNodePos(void 0,!1),[4,n.connect(e)]);case 3:return s.sent(),[3,6];case 4:return n.setNodePos(void 0,!0),[4,n.connect(this.su)];case 5:s.sent(),s.label=6;case 6:return[3,12];case 7:return[4,this.nu.disconnect()];case 8:return s.sent(),this.lastNode==t?[3,10]:(e.setNodePos(!0),[4,this.nu.connect(e)]);case 9:return s.sent(),[3,12];case 10:return[4,this.nu.connect(this.su)];case 11:s.sent(),s.label=12;case 12:this.ru.splice(i,1),s.label=13;case 13:return[2]}}))}))},t.prototype.isConnected=function(t){return-1!==this.ru.indexOf(t)},t.prototype.isEmpty=function(){return 0===this.ru.length},t.prototype.getSourceTrack=function(){var t;return null===(t=this.nu.output)||void 0===t?void 0:t.track},t.prototype.getDestinationTrack=function(){var t;return null===(t=this.su.output)||void 0===t?void 0:t.track},t.prototype.replaceNewSourceByTrack=function(t,i,e){var n,s,r,o;return void 0===i&&(i=!0),Am(this,void 0,void 0,(function(){var u;return Mm(this,(function(a){switch(a.label){case 0:return(("firefox"===(u=this.browser)||"safari"===u)&&null!==(null===(n=this.vcMgr)||void 0===n?void 0:n.renderTrack)&&null!==t&&(null===(s=this.vcMgr)||void 0===s?void 0:s.renderTrack)!==t||"safari"===u&&(null==e?void 0:e.handleTrackType)===ut.changeResolution)&&(null===(r=this.preview.backgroundProcessor)||void 0===r||r.pauseRender(!0)),[4,null===(o=this.vcMgr)||void 0===o?void 0:o.checkInit(t,e)];case 1:return a.sent(),[4,this.replaceSource(new Pm(t,this.Ro),i)];case 2:return a.sent(),[2]}}))}))},t.prototype.replaceSource=function(t,i){return void 0===i&&(i=!0),Am(this,void 0,void 0,(function(){return Mm(this,(function(e){switch(e.label){case 0:return this.su.setReplaceRemote(i),this.firstNode?[4,t.connect(this.firstNode)]:[3,2];case 1:return e.sent(),[3,4];case 2:return[4,t.connect(this.su)];case 3:e.sent(),e.label=4;case 4:return this.nu=t,this.su.setReplaceRemote(),[2]}}))}))},t.prototype.replaceDestination=function(t){return Am(this,void 0,void 0,(function(){return Mm(this,(function(i){switch(i.label){case 0:return this.lastNode?[4,this.lastNode.disconnect()]:[3,3];case 1:return i.sent(),[4,this.lastNode.connect(t)];case 2:return i.sent(),[3,6];case 3:return[4,this.nu.disconnect()];case 4:return i.sent(),[4,this.nu.connect(t)];case 5:i.sent(),i.label=6;case 6:return this.su=t,[2]}}))}))},t.prototype.destroy=function(){for(var t,i=0;i<this.ru.length;i++){this.ru[i].disconnect()}this.ru=[],this.su.destroy(),this.nu.destory(),null===(t=this.vcMgr)||void 0===t||t.destroy()},t}(),jm=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Lm=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},qm=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Um=Im.createError,Bm=function(t){function i(i,e){var n=t.call(this)||this;return n.ou=i,n.browser=e,n.isFirstNode=!1,n.isLastNode=!1,n.track=null,n.uu=!0,n}return jm(i,t),i.prototype.setReplaceRemote=function(t){void 0===t&&(t=!0),this.uu=t},i.prototype.setInput=function(t){return Lm(this,void 0,void 0,(function(){var i,e,n,s,r=this;return qm(this,(function(o){switch(o.label){case 0:if(null==(null==t?void 0:t.track))return[2];if(!this.ou.localStream)throw Um({code:-1,message:"preview haven't been inited."});return this.track=i=null==t?void 0:t.track,this.ou.localStream.getVideoTracks()[0]===i?[3,4]:(e=this.ou.localStream,(null==(n=this.ou.zegoCaptureStream)?void 0:n.stream)&&(e=n.stream),s=this.ou.Ro.getPublishList(e),this.uu&&0!==s.length?[4,Xt.all(s.map((function(t){return Lm(r,void 0,void 0,(function(){var e;return qm(this,(function(n){return(null===(e=t.publisher)||void 0===e?void 0:e.previewer)?[2,t.publisher.replacePublishedTrack(i,!0)]:[2]}))}))})))]:[3,2]);case 1:return o.sent(),[3,4];case 2:return[4,this.ou.replacePreviewTrack(i,!0)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},Object.defineProperty(i.prototype,"output",{get:function(){return{track:this.track}},enumerable:!1,configurable:!0}),i.prototype.connect=function(t){return Lm(this,void 0,void 0,(function(){return qm(this,(function(t){throw Um({code:-1,message:"video destination node cann't connect any video node."})}))}))},i.prototype.disconnect=function(){return Lm(this,void 0,void 0,(function(){return qm(this,(function(t){throw Um({code:-1,message:"video destination node cann't disconnect any video node."})}))}))},i.prototype.destroy=function(){this.track=null},i}(Rm),Jm=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Vm=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Hm=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))};!function(t){t[t.inited=0]="inited",t[t.noInit=1]="noInit",t[t.initing=2]="initing"}(pm||(pm={}));var Gm=function(){function t(t,i,e){var n=this;this.In=t,this.au=i,this.customVC=e,this.canvasTrack=null,this.gl=null,this.cu=0,this.hu=0,this.fu=pm.noInit,this.hasBeautyTask=!1,this.hasBackgroundTask=!1,this.backgroundLoop=null,this.eventHandler={visibilitychange:function(){if(Wt.hidden){var t=function(){return Jm(n,void 0,void 0,(function(){return Vm(this,(function(i){switch(i.label){case 0:return this.backgroundLoop=window.setTimeout(t,Math.floor(1e3/this.fps)),!Wt.hidden&&this.backgroundLoop?(clearTimeout(this.backgroundLoop),this.backgroundLoop=null,[2]):[4,this.renderAFrame()];case 1:return i.sent(),[2]}}))}))};t()}else n.backgroundLoop&&(clearTimeout(n.backgroundLoop),n.backgroundLoop=null)}},this.fps=15,this.lu=new hm}return Object.defineProperty(t.prototype,"initState",{set:function(t){this.fu=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inited",{get:function(){return this.fu===pm.inited},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beautyAndBackgroundProcess",{get:function(){return this.hasBackgroundTask&&this.hasBeautyTask},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderTrack",{get:function(){return this.du},enumerable:!1,configurable:!0}),t.prototype.init=function(t,i){var e;return Jm(this,void 0,void 0,(function(){var n;return Vm(this,(function(s){switch(s.label){case 0:if(this.fu!=pm.noInit)return[3,4];this.fu=pm.initing,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.renderVideo(t,i)];case 2:return s.sent(),this.fu=pm.inited,this.onInited(),[3,4];case 3:return n=s.sent(),this.fu=pm.noInit,this.onRenderFail(n),n.code===xe.code&&"ended"===(null===(e=this.du)||void 0===e?void 0:e.readyState)&&this.resetVideo(),[3,4];case 4:return[2]}}))}))},t.prototype.checkInit=function(t,i){return Jm(this,void 0,void 0,(function(){return Vm(this,(function(e){switch(e.label){case 0:return!t||"live"!==t.readyState||this.du===t&&(null==i?void 0:i.handleTrackType)!==ut.changeResolution?[3,2]:(this.fu=pm.noInit,[4,this.init(t,i)]);case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},t.prototype.renderVideo=function(t,i){var e;return Jm(this,void 0,void 0,(function(){var n,s,r;return Vm(this,(function(o){switch(o.label){case 0:return this.In.info("".concat(Jv," call")),null===t?(this.du=t,[2]):this.du==t&&(null==i?void 0:i.handleTrackType)!==ut.changeResolution?[2]:(this.du=t,this.videoEl||(this.videoEl=Kt(),null===(e=this.videoEl)||void 0===e||e.setAttribute("style","display:none")),[4,this.getPlayingVideo(this.videoEl,t,i)]);case 1:if(o.sent(),n=t.getSettings(),s=n.width||this.videoEl.videoWidth,r=n.height||this.videoEl.videoHeight,n.frameRate&&this.fps!==n.frameRate&&(this.fps=n.frameRate,this.In.info(Jv+" set target fps: "+this.fps)),this.In.info(Jv+" video canvas render: width "+n.width+" height "+n.height),!s||!r)throw this.In.error(Jv+" resolution of track is wrong"),xe;return this.originWidth=s,this.originHeight=r,this.videoEl.setAttribute("width",s.toString()),this.videoEl.setAttribute("height",r.toString()),"safari"!==this.au||(null==i?void 0:i.handleTrackType)!==ut.replaceNew&&(null==i?void 0:i.handleTrackType)!==ut.changeResolution||this.resetCanvas(),this.initWegGl(),[2]}}))}))},t.prototype.getPlayingVideo=function(t,i,e){return Jm(this,void 0,void 0,(function(){var e,n,s=this;return Vm(this,(function(r){switch(r.label){case 0:return t.srcObject?((e=t.srcObject).getTracks().forEach((function(t){return e.removeTrack(t)})),e.addTrack(i),"safari"!==(n=this.au)&&"firefox"!==n||(t.srcObject=e)):t.srcObject=new MediaStream([i]),[4,new Promise((function(i,e){var n=function(){0==t.videoWidth||0==t.videoHeight?e(xe):i(void 0)};if(null==t?void 0:t.paused){var r=null,o=function(){n(),r&&(clearTimeout(r),r=null),t&&t.removeEventListener("playing",o)};r=window.setTimeout((function(){r&&(clearTimeout(r),r=null),r=window.setTimeout((function(){s.In.warn(Jv+" video track error"),t&&t.removeEventListener("playing",o),e(xe)}),1e3),t.play().catch((function(t){console.error(t)}))}),1e3),t&&t.addEventListener("playing",o),t&&t.play()}else t&&t.play(),setTimeout((function(){n()}),1e3)}))];case 1:return r.sent(),[2]}}))}))},t.prototype.resetVideo=function(){var t;this.destroyVideo(),this.videoEl=Kt(),null===(t=this.videoEl)||void 0===t||t.setAttribute("style","display:none")},t.prototype.initWegGl=function(){var t;if(this.In.info("".concat(Vv," call")),this.canvasEl||(this.In.info("".concat(Vv," no canvas")),this.customVC?(this.canvasEl=document.getElementById("render_canvas"),this.canvasEl.width=this.originWidth,this.canvasEl.height=this.originHeight):this.canvasEl=$t(this.originWidth,this.originHeight)),this.gl||(this.gl=null===(t=this.canvasEl)||void 0===t?void 0:t.getContext("webgl")),!this.gl)return this.In.warn("".concat(Vv," no gl")),void this.handleInitError({code:1001});this.In.info("".concat(Vv," end"))},t.prototype.resetCanvas=function(){this.canvasEl=null,this.gl=null,this.canvasTrack=null},t.prototype.getCanvasTrack=function(t){return this.In.info("".concat(Hv," get track")),this.canvasTrack&&!t||!this.canvasEl||(this.canvasTrack=this.canvasEl.captureStream(this.fps).getVideoTracks()[0]),this.canvasTrack},t.prototype.startRenderTask=function(){var t=this;this.In.info("".concat(Hv," start task"));var i=function(){return Jm(t,void 0,void 0,(function(){return Vm(this,(function(t){switch(t.label){case 0:return this.hu=requestAnimationFrame(i),[4,this.renderAFrame()];case 1:return t.sent(),[2]}}))}))};this.hu=requestAnimationFrame(i),Wt.removeEventListener("visibilitychange",this.eventHandler.visibilitychange),Wt.addEventListener("visibilitychange",this.eventHandler.visibilitychange,!1)},t.prototype.stopRenderTask=function(){this.In.info("".concat(Hv," stop task")),this.hu&&(cancelAnimationFrame(this.hu),this.hu=0),Wt.removeEventListener("visibilitychange",this.eventHandler.visibilitychange)},t.prototype.renderAFrame=function(){return Jm(this,void 0,void 0,(function(){var t,i,e;return Vm(this,(function(n){return t=Date.now(),i=1e3/this.fps,(e=this.cu?t-this.cu:i)>=i&&(this.cu=t-(e-i),this.videoEl&&this.videoEl.paused&&this.videoEl.play(),this.videoEl&&this.videoEl.videoWidth>6&&this.videoEl.videoHeight>6&&this.lu.emit("renderFrame")),[2]}))}))},t.prototype.on=function(t,i){return!!i&&this.lu.addEventHandler(t,i)},t.prototype.off=function(t,i){return this.lu.removeEventHandler(t,i)},t.prototype.actionListener=function(t){for(var i,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];(i=this.lu).emit.apply(i,Hm([t],e,!1))},t.prototype.setRenderTask=function(t,i){this.In.info("".concat(Hv," set task ").concat(t," ").concat(i)),"beauty"===i&&(this.hasBeautyTask=t),"background"===i&&(this.hasBackgroundTask=t),this.hasBeautyTask&&!this.hasBackgroundTask?this.startRenderTask():this.stopRenderTask()},t.prototype.resetResolution=function(t,i){this.originWidth=t,this.originHeight=i},t.prototype.handleInitError=function(t){throw t},t.prototype.onInited=function(){},t.prototype.onRenderFail=function(t){},t.prototype.onRenderSuc=function(){},t.prototype.destroyVideo=function(){this.videoEl&&(this.videoEl.pause(),this.videoEl.remove(),this.videoEl.srcObject=null,this.videoEl=null)},t.prototype.destroy=function(){this.In.info("".concat(Hv," dt")),this.destroyVideo(),this.canvasEl&&(this.canvasEl.remove(),this.canvasEl=null),this.canvasTrack=null,this.du=null,this.gl=null,this.stopRenderTask(),this.hasBeautyTask=!1,this.hasBackgroundTask=!1,this.backgroundLoop&&clearTimeout(this.backgroundLoop),this.backgroundLoop=null},t}();function Fm(t,i,e,n,s){void 0===e&&(e=1e3),void 0===n&&(n=200);var r=t.createAnalyser();r.fftSize=2048,i.connect(r);var o=null,u=0,a=r.fftSize,c=null,h=null,f=0;function l(){var t=0;if(r.getFloatTimeDomainData){h||(h=new Float32Array(a)),r.getFloatTimeDomainData(h);for(var i=0;i<h.length;i++)t=Math.max(t,Math.abs(h[i]))}else{c||(c=new Uint8Array(a)),r.getByteTimeDomainData(c);for(i=0;i<c.length;i++)t=Math.max(t,Math.abs(c[i]-128));t/=128}var d=.005;n<=100?d=.5:n<=200?d=.3:n<=300?d=.15:n<=500?d=.07:n<=1e3&&(d=.05),t>(u*=d)&&(u=t),u>1&&(u=1);var v=Date.now();return 0==f&&(f=v),(v-f>=e||n>=e)&&(f=v,s&&s(u)),n&&(o=window.setTimeout((function(){o&&clearTimeout(o),l()}),n))}return e<100&&(e=100),n<100&&(n=100),e<n&&(n=e),n&&(o=window.setTimeout((function(){l()}),n)),"running"!==t.state&&t.resume(),{analyzer:r,destroy:function(){r.disconnect(),null!==o&&(clearInterval(o),n=0,o=null),u=0,c=null,h=null},setInterval:function(t){t>30&&(e=t)}}}var Ym,Zm,Qm,Xm,Wm,Km,$m,tp,ip,ep,np,sp,rp,op,up,ap,cp,hp,fp,lp,dp,vp,mp,pp,gp,bp=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},_p=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},yp="zc.smw",wp=new Blob(['\nclass VolumeMeter extends AudioWorkletProcessor {\n  constructor() {\n    super();\n    this.volume = 0;\n    this.intervalTime = 1000;\n    this.tick = this.intervalTime;\n    this.isStop = false;\n    this.port.onmessage = event => {\n      const { data } = event;\n      switch (data.name) {\n        case "setIntervalTime":\n          this.intervalTime = data.intervalTime;\n          break;\n        case "stop":\n          this.isStop = true;\n          break;\n      }\n    };\n  }\n  process(inputs) {\n    const input = inputs[0];\n    if (this.isStop) {\n      return false;\n    }\n    if (input.length > 0) {\n      const buffer = input[0];\n      let maxVal = this.volume;\n      for (let i = 0; i < buffer.length; i++) {\n        if (maxVal < buffer[i]) {\n          maxVal = buffer[i];\n        }\n      }\n      this.volume = maxVal;\n      this.tick -= buffer.length;\n      if (this.tick < 0) {\n        this.tick += (this.intervalTime / 1000) * sampleRate;\n        this.port.postMessage({ volume: this.volume });\n        this.volume = 0;\n      }\n    }\n    return true;\n  }\n}\ntry {\n  registerProcessor("meter", VolumeMeter);\n} catch (error) {\n  \n}  \n'],{type:"application/javascript"}),Sp=function(){function t(){}return t.addModuleToContext=function(t,i){return bp(this,void 0,void 0,(function(){var e;return _p(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),i.info(yp+" worklet addModule call"),[4,t.audioWorklet.addModule(URL.createObjectURL(wp))];case 1:return n.sent(),i.info(yp+" worklet addModule success"),this.isSuccess=!0,[2];case 2:return e=n.sent(),i.warn(yp+" worklet addModule catch error. ".concat(null==e?void 0:e.message)),[3,3];case 3:return[2]}}))}))},t.isSuccess=!1,t}(),Ep=function(){function t(t,i,e,n){void 0===e&&(e=1e3),void 0===n&&(n=200),this.In=t,this.Nn=i,this.vu=e,this.mu=n,this.pu=null,this.gu=null,this.bu=null,this.volume=0,this.onSoundLevelUpdate=function(t){}}return t.prototype.preload=function(t){return bp(this,void 0,void 0,(function(){return _p(this,(function(i){switch(i.label){case 0:return!Sp.isSuccess?[4,Sp.addModuleToContext(t,this.In)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))},t.prototype.initAudioWorklet=function(t,i){return bp(this,void 0,void 0,(function(){var e,n,s=this;return _p(this,(function(r){switch(r.label){case 0:if(this.pu)return[3,5];r.label=1;case 1:if(r.trys.push([1,3,,4]),function(t){return!!Ht(t.createAnalyser)}(t)&&this.Nn.settingConfig.getSetting("sound_level_api_type")!==x.useWorklet)throw"use analyzer";return this.In.info(yp+" use AudioWorklet. "),[4,this.preload(t)];case 2:return r.sent(),(e=this.pu=new AudioWorkletNode(t,"meter")).port.onmessage=function(t){s.onSoundLevelUpdate&&s.onSoundLevelUpdate(t.data.volume||0)},i.connect(e).connect(t.destination),this.setInterval(this.vu),[3,4];case 3:return n=r.sent(),this.In.info(yp+" not use AudioWorklet. "+n),this.bu=Fm(t,i,this.vu,this.mu,(function(t){s.onSoundLevelUpdate&&s.onSoundLevelUpdate(t||0)})),[3,4];case 4:return[3,6];case 5:i.connect(this.pu).connect(t.destination),r.label=6;case 6:return[2]}}))}))},t.prototype.getSrcSource=function(i,e){var n=e.getAudioTracks()[0],s=e.id,r=t.sourceList[s]||{},o=r.source,u=r._ac,a=r.trackid;return o&&u===i&&a===(null==n?void 0:n.id)||(o&&o.disconnect(),o=i.createMediaStreamSource(e),t.sourceList[s]={source:o,_ac:u=i,trackid:a=n.id}),o},t.prototype.replaceSrcSource=function(i,e){var n;t.sourceDisConnect(e);var s=this.getSrcSource(i,e);return(null===(n=this.bu)||void 0===n?void 0:n.analyzer)&&s.connect(this.bu.analyzer),s},t.sourceDisConnect=function(i){var e=i.id,n=(t.sourceList[e]||{}).source;n&&(n.disconnect(),delete t.sourceList[e])},t.prototype.setInterval=function(t){var i=this.pu;this.vu=t,i&&i.port.postMessage({name:"setIntervalTime",intervalTime:t}),this.bu&&this.bu.setInterval(t)},t.prototype.destroy=function(){this.gu&&(this.gu.onaudioprocess=null,this.gu.disconnect()),this.bu&&(this.bu.destroy(),this.bu=null),this.pu&&(this.pu.port.postMessage({name:"stop"}),this.pu.port.onmessage=null,this.pu.port.close(),this.pu.disconnect(),this.In.info(yp+" close worklet")),this.pu=null,this.gu=null},t.sourceList={},t}(),Op=function(){function t(t,i){this.ac=t,this.In=i,this.useScript=!1,this._u=null,this.yu=null,this.wu=4096}return t.prototype.setAudioFrameCallback=function(t,i,e,n){var s,r,o,u=this;this.In.info("zc.apdp.safc.0 ".concat(t.id," ").concat(i," ").concat(JSON.stringify(n)));var a=(null==n?void 0:n.frameSize)||this.wu;if(i)if(this.Vo||(this.Vo=this.ac.createMediaStreamSource(t)),this.useScript)this._u||(this._u=this.ac.createScriptProcessor(a),this._u.onaudioprocess=function(t){for(var i=0;i<t.outputBuffer.numberOfChannels;i+=1)for(var n=t.outputBuffer.getChannelData(i),s=0;s<n.length;s+=1)n[s]=0;var r=t.inputBuffer.numberOfChannels,o=[];try{if(r>0)for(var a=0;a<r;a++){var c=t.inputBuffer.getChannelData(a);o.push(c)}e&&e({channels:o,channelCount:r,sampleRate:t.inputBuffer.sampleRate})}catch(t){u.In.info("zc.apdp.safc.0 script fail ".concat(t.toString()))}},this.In.info("zc.apdp.safc.0 create _zgp_scriptNode")),this.Vo.connect(this._u),this._u.connect(this.ac.destination);else{if(!this.yu){try{this.yu=new AudioWorkletNode(this.ac,"audio-pcm-data-processor",{processorOptions:{bufferSize:a}})}catch(t){this.In.error("zc.apdp.safc.0 create worklet fail ".concat(t.toString()))}this.yu&&(this.yu.port.onmessage=function(t){if("process"===t.data.type)try{var i=t.data;e&&e({channels:i.channels,channelCount:i.channelCount,sampleRate:i.sampleRate})}catch(t){}},this.In.info("zc.apdp.safc.0 init worklet"))}this.yu&&this.Vo.connect(this.yu),null===(s=this.yu)||void 0===s||s.connect(this.ac.destination)}else{try{this.yu&&(null===(r=this.Vo)||void 0===r||r.disconnect(this.yu)),this._u&&(null===(o=this.Vo)||void 0===o||o.disconnect(this._u))}catch(t){this.In.info("zc.apdp.safc.0 ".concat(JSON.stringify(t)))}this.Vo=null}},t.prototype.replaceSource=function(t){var i,e;if(this.In.info("zc.apdp.rs.0 ".concat(t.id)),this.Vo){var n=this.ac.createMediaStreamSource(t);this.yu&&(null===(i=this.Vo)||void 0===i||i.disconnect(this.yu),n.connect(this.yu)),this._u&&(null===(e=this.Vo)||void 0===e||e.disconnect(this._u),n.connect(this._u)),this.Vo=null,this.Vo=n}},t.prototype.destroy=function(){var t,i;this.In.info("zc.apdp.ds.0 call"),this.yu&&(this.yu.port.close(),null===(t=this.Vo)||void 0===t||t.disconnect(this.yu),this.yu.disconnect(),this.In.info("zc.apdp.ds.0 destroy worklet")),this._u&&(this._u.onaudioprocess=null,null===(i=this.Vo)||void 0===i||i.disconnect(this._u),this._u.disconnect(),this.In.info("zc.apdp.ds.0 close script processor")),this.yu=null,this._u=null,this.Vo=null,this.In.info("zc.apdp.ds.0 end")},t}(),Tp=function(){function t(){this.listenerMap=new WeakMap}return t.prototype.bind=function(t,i){this.listenerMap.has(t)||this.listenerMap.set(t,[]);var e=this.listenerMap.get(t),n={add:function(t,s){return"addEventListener"in i?(e.push((function(){return i.removeEventListener(t,s)})),i.addEventListener(t,s)):"on"in i&&(e.push((function(){return i.off(t,s)})),i.on(t,s)),n}};return n},t.prototype.cleanup=function(t){var i=this.listenerMap.get(t);i&&(i.forEach((function(t){return t()})),this.listenerMap.delete(t))},t}(),kp=function(){return kp=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},kp.apply(this,arguments)},Rp=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Ip=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Np=["videoInput","videoQuality","facingMode","width","height","frameRate","videoOptimizationMode"],Cp=["audioInput","channelCount","ANS","AGC","AEC"],zp=function(){function t(t,i,e,n,s){this.In=t,this.Nn=i,this.Ro=e,this.previewType=n,this.onlyPreview=s,this.Su={width:0,height:0,frameRate:0,bitRate:0,minBitrate:0,startBitrate:"default",keyFrameInterval:2,channelCount:1,audioBitrate:48e3,contentHint:""},this.rtcViewer=null,this.streamFromCanvas=!1,this.streamFromCanvasTrack=null,this.previewSuc=!1,this.soundLevel=0,this.hasEmptyAudioTrack=!1,this.Eu=null,this.voiceProccessor=null,this.lastTrackEndTime={audio:0,video:0},this.script=null,this.mic=null,this.eventListenerManager=new Tp,this.Ou=null,this._videoTrack=null,this.cloneVideoTrack=null,this.originVideoTrack=null,this.originAudioTrack=null,this.activateSEIConfig=null,this.Tu=!0,this.hasStopCaptureVideo=!1,this.ku=!0,this.gainNode=null,this.cameraMaxResolution={},this.enableDualStream=!1,this.lowStreamConfig={width:160,height:120,frameRate:15,bitRate:50},this.Ru=null,this.syncVideoEnabled=!1,this.syncAudioEnabled=!1,this.hasMicTrack=!0,this.soundMeterWorklet=null,this.audioMixManager=null,this.volume=100,this.volumeFactor=1,this.logger=t,this.stateCenter=i,this.streamCenter=e,n&&(this.videoPreviewType=n,this.audioPreviewType=n)}return Object.defineProperty(t.prototype,"localStream",{get:function(){return this.fo},set:function(t){this.fo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoInfo",{get:function(){return this.Su},set:function(t){this.Su=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mediaStreamConfig",{get:function(){return this.Iu},set:function(t){this.Iu=t},enumerable:!1,configurable:!0}),t.prototype.getEmptyAudioTrack=function(){if(!this.Eu){var t=this.Ro.ac.createMediaStreamDestination(),i=t?t.stream:null,e=this.Eu=i?i.getAudioTracks()[0]:null;this.In.info("zp.geat "+"empty audio id: ".concat(null==e?void 0:e.id))}return this.Eu},t.prototype.checkAudioExceptionEnded=function(t){var i;t&&(this.Ro.trackUtils.isTrackStopBySDK(t)||this.fo&&"camera"===this.audioPreviewType&&this.Ro.getPublishList(this.fo).length>0&&t.id===(null===(i=this.Ou)||void 0===i?void 0:i.id)&&(this.Nn.actionListener("_deviceError",Oe,t.label,"micro"),this.Nn.actionListener("deviceError",Oe,t.label),this.Ro.checkDeviceChange&&this.Ro.checkDeviceChange()))},t.prototype.checkVideoExceptionEnded=function(t){var i;t&&(this.Ro.trackUtils.isTrackStopBySDK(t)||this.fo&&"camera"===this.videoPreviewType&&this.Ro.getPublishList(this.fo).length>0&&t.id===(null===(i=this.videoTrack)||void 0===i?void 0:i.id)&&(this.Nn.actionListener("_deviceError",Te,t.label,"camera"),this.Nn.actionListener("deviceError",Te,t.label),this.Ro.checkDeviceChange&&this.Ro.checkDeviceChange()))},t.prototype.bindAudioTrackEvent=function(t){var i=this;this.eventListenerManager.bind(t,t).add("ended",(function(){i.logger.info("zp.pv.te audio track ended"),i.lastTrackEndTime.audio=performance.now(),i.checkAudioExceptionEnded(t)})).add("mute",(function(){i.logger.info("zp.pv.te audio track mute")})).add("unmute",(function(){i.logger.info("zp.pv.te audio track unmute")}))},t.prototype.bindVideoTrackEvent=function(t){var i=this;this.eventListenerManager.bind(t,t).add("ended",(function(){i.logger.info("zp.pv.te video track ended"),i.lastTrackEndTime.video=performance.now(),i.checkVideoExceptionEnded(t)})).add("mute",(function(){i.logger.info("zp.pv.te video track mute")})).add("unmute",(function(){i.logger.info("zp.pv.te video track unmute")}))},t.prototype.removeAudioTrackEvent=function(t){this.eventListenerManager.cleanup(t)},t.prototype.removeVideoTrackEvent=function(t){this.eventListenerManager.cleanup(t)},Object.defineProperty(t.prototype,"audioTrack",{get:function(){var t;return this.Ou||(null===(t=this.fo)||void 0===t?void 0:t.getAudioTracks()[0])||null},set:function(t){this.Ou!==t&&(this.Ou&&this.removeAudioTrackEvent(this.Ou),this.Ou=t,t&&!this.onlyPreview&&this.bindAudioTrackEvent(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoTrack",{get:function(){var t;return this._videoTrack||(null===(t=this.fo)||void 0===t?void 0:t.getVideoTracks()[0])||null},set:function(t){this._videoTrack!==t&&(this._videoTrack&&this.removeVideoTrackEvent(this._videoTrack),this._videoTrack=t,t&&!this.onlyPreview&&this.bindVideoTrackEvent(t))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAudioEnabled",{get:function(){return this.Tu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVideoEnabled",{get:function(){return this.ku},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"muteImage",{get:function(){return this.Ru},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoNodeQueue",{get:function(){if(!this.Nu){if(!this._videoTrack)throw new Error("cannot use video node queue, because videoTrack of previewer haven't been inited.");var t=new Pm(this._videoTrack,this.Ro),i=new Bm(this,this.Nn.browser);this.Nu=new xm(t,i,this.Ro,this.Nn.browser,this),this.vcMgr&&(this.Nu.vcMgr=this.vcMgr)}return this.Nu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVideoNodeQueueEnabled",{get:function(){return this.Nu&&!this.Nu.isEmpty()},enumerable:!1,configurable:!0}),t.prototype.getDestinationTrack=function(){return!this.Nu||this.Nu.isEmpty()?null:this.videoNodeQueue.getDestinationTrack()},Object.defineProperty(t.prototype,"ac",{get:function(){return this.Ro.ac},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"acMgr",{get:function(){return this.Ro.acMgr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vcMgr",{get:function(){if(!this._vcMgr){if(!this._videoTrack)throw new Error("cannot use video node queue, because videoTrack of previewer haven't been inited.");this._vcMgr=new Gm(this.logger,this.Nn.browser,this.Ro.isCustomVC),this.Nu&&(this.Nu.vcMgr=this.vcMgr)}return this._vcMgr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"containBackgroundProcess",{get:function(){var t=this;return"compositing"===this.previewType?this.inputStreamOptions.some((function(i){if(i.stream){var e=t.Ro.checkPreview(i.stream);return null==e?void 0:e.isBackgroundBlur}})):!!this.isBackgroundBlur},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"micTrack",{get:function(){return this.hasMicTrack&&"camera"===this.audioPreviewType&&this.audioTrack||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVideoEffectStarting",{get:function(){return!!this.videoEffect&&this.videoEffect.isStarting},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isVideoEffectEnabled",{get:function(){return!!this.videoEffect&&this.videoEffect.enabled},enumerable:!1,configurable:!0}),t.prototype.getMediaStreamConstraints=function(t,i){var e={audio:null,video:null},n=fh();if(n&&n.includes("11_4")||(t=rg(this.Nn,this.In,t),t=zl(t)),e.audio=!0,e.video={width:this.Nn.settingConfig.getSetting("camera_width")||640,height:this.Nn.settingConfig.getSetting("camera_height")||480,frameRate:this.Nn.settingConfig.getSetting("camera_framerate")||15,bitRate:this.Nn.settingConfig.getSetting("camera_video_bitrate")},t.audio){var s=this.Nn.settingConfig.getCloudSettingScenario(this.Nn.scenario);this.logger.info("zp.gmsc.2 audio cloud config "+JSON.stringify(s));var r=s.ANS,o=s.AGC,u=s.AEC;e.audio={},t.audioInput&&"undefined"!==t.audioInput&&(e.audio.deviceId={exact:t.audioInput}),e.audio.noiseSuppression=r,e.audio.autoGainControl=o,e.audio.echoCancellation=u,Ut(t.ANS)&&(e.audio.noiseSuppression=t.ANS),Ut(t.AGC)&&(e.audio.autoGainControl=t.AGC),Ut(t.AEC)&&(e.audio.echoCancellation=t.AEC),e.audio.channelCount=Lt(t.channelCount)?t.channelCount:1}else!1===t.audio&&(e.audio=!1);if(t.video){var a=640,c=480,h=15,f=this.Nn.settingConfig.getSetting("camera_video_bitrate");if(1===t.videoQuality?(a=yt.width,c=yt.height,h=yt.frameRate,f=yt.bitRate):2===t.videoQuality?(a=wt.width,c=wt.height,h=wt.frameRate,f=wt.bitRate):3===t.videoQuality?(a=St.width,c=St.height,h=St.frameRate,f=St.bitRate):(a=t.width||640,c=t.height||480,h=t.frameRate||15,f=t.bitRate||this.Nn.settingConfig.getSetting("camera_video_bitrate"),this.In.info("zp.gmsc.2 quality: ",t.videoQuality)),i&&!t.videoQuality&&(t.width&&(a=t.width),t.height&&(c=t.height),t.frameRate&&(h=t.frameRate),t.bitRate&&(f=t.bitRate)),!1===t.horizontal){var l=c;c=a,a=l}if(!0===t.isSwitch){l=c;c=a,a=l}e.video={width:a,height:c,frameRate:h,bitRate:f},null!=t.facingMode?e.video.facingMode=t.facingMode:t.videoInput&&"undefined"!=t.videoInput&&(e.video.deviceId={exact:t.videoInput}),this.In.info("zp.gmsc.2 width: "+a+" height: "+c+" rate: "+h)}else!1===t.video&&(e.video=!1);return{mediaStreamConstraints:e,mediaStreamConfig:t}},t.prototype.startPreview=function(t,i,e,n){return Rp(this,void 0,void 0,(function(){var s,r,o;return Ip(this,(function(u){switch(u.label){case 0:if(this.In.info("zp.sv.2 called "+JSON.stringify(t)),this.Iu=kp({},t),!1===t.video&&this.deleteConstraints(this.Iu,Np),!1===t.audio&&this.deleteConstraints(this.Iu,Cp),this.In.info("zp.sv.2 store "+JSON.stringify(this.Iu)),s=function(t){i(t)},Yt(t.source)||Qt(t.source)){try{r=this.Cu(t),s&&s(r)}catch(t){e(t)}return[2]}return void 0!==navigator.mediaDevices&&null!=navigator.mediaDevices.getUserMedia?[3,1]:(e&&e(gn.error.ie),[2]);case 1:return u.trys.push([1,3,,4]),[4,this.zu(t,n)];case 2:return r=u.sent(),s&&s(r),[3,4];case 3:return o=u.sent(),e(o),[3,4];case 4:return[2]}}))}))},Object.defineProperty(t.prototype,"hasUserSetBitrate",{get:function(){var t,i=this.Iu,e=i.bitRate;return void 0!==(null!==(t=null!=e?e:i.bitrate)&&void 0!==t?t:i.videoQuality)},enumerable:!1,configurable:!0}),t.prototype.zu=function(t,i){var e,n;return Rp(this,void 0,void 0,(function(){var s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S,E,O,T,k,R,I,N,C,z=this;return Ip(this,(function(D){switch(D.label){case 0:s=this.getMediaStreamConstraints(t),o=s.mediaStreamConfig,u={},(r=s.mediaStreamConstraints).video?u=kp({},r.video):Bt(o.bitRate)||(u.bitRate=o.bitRate),this.Su=kp(kp({},this.Su),u),this.Su.audioBitrate=1e3*o.audioBitrate||48e3,this.Su.startBitrate=o.startBitrate||this.Nn.settingConfig.getSetting("bitrate_mode"),this.Su.minBitrate=o.minBitrate,this.Su.keyFrameInterval=o.keyFrameInterval||this.Su.keyFrameInterval,qt(t.videoOptimizationMode)&&(this.Su.contentHint=t.videoOptimizationMode),this.logger.info("zp.sv.2 update video info  ".concat(JSON.stringify(this.Su),", onlyPreview: ").concat(this.onlyPreview)),r.audio&&(a=this.Nn.settingConfig.getCloudSettingScenario(this.Nn.scenario,!0),h=a.channelCount,f=a.AEC,l=a.AGC,d=a.ANS,this.logger.info("zp.sv.2 scenario ".concat(c=a.audioBitrate," ").concat(h," ").concat(f," ").concat(l," ").concat(d)),c&&(this.Su.audioBitrate=1e3*c),h&&(r.audio.channelCount=h,this.Su.channelCount=h),Ut(f)&&(this.logger.info("zp.sv.2 setting AEC "+f),this.Iu.AEC=r.audio.echoCancellation=f),Ut(l)&&(this.logger.info("zp.sv.2 setting AGC "+l),this.Iu.AGC=r.audio.autoGainControl=l),Ut(d)&&(this.logger.info("zp.sv.2 setting ANS "+d),this.Iu.ANS=r.audio.noiseSuppression=d)),r.video instanceof Object&&(r.video.width=this.Nn.settingConfig.getSetting("camera_width",!0)||r.video.width,r.video.height=this.Nn.settingConfig.getSetting("camera_height",!0)||r.video.height,r.video.frameRate=this.Nn.settingConfig.getSetting("camera_framerate",!0)||r.video.frameRate),this.Iu.video=!!r.video,this.Iu.audio=!!r.audio,o.unlimitedCaptureResolution&&r.video.width&&(r.video.width={ideal:4096},r.video.height={ideal:2160},this.In.info("zp.sv.2 capture max resolution of camera")),this.logger.info("zp.sv.2 constraints "+JSON.stringify(r)),i.setAttribute("preview_conf",gn.preview_conf(r)),v=function(t){var i=gn.error.oe;return i.message=i.message+" "+t.name+" "+t.message,"NotAllowedError"===t.name||"SecurityError"===t.name?(i=kp({},gn.error.ue)).message=t.name+": "+i.message:"NotReadableError"===t.name?(i=kp({},gn.error.ae)).message=t.name+": "+i.message:"OverconstrainedError"===t.name&&((i=kp({},gn.error.ce)).message=t.name+": "+i.message+(t.constraint?". such as "+t.constraint:"")),i},m=function(t,i){return new Xt((function(e){z.In.info("zp.sv.2 recapture call"),Xl((function(n){var s=n.cameras,r=n.microphones;if(z.In.info("zp.sv.2 recapture devices "+i+" "+s.length+" "+r.length),"video"===i){if(!(s.length>0))return void e(void 0);var o=s[0].deviceID;z.In.info("zp.sv.2 recapture video "+o),t.video.deviceId={exact:o}}else if("audio"===i){if(!(r.length>0))return void e(void 0);var u=r[0].deviceID;z.In.info("zp.sv.2 recapture audio "+u),t.audio.deviceId={exact:u}}navigator.mediaDevices.getUserMedia(t).then((function(t){z.In.info("zp.sv.2 recapture success"),e(t)})).catch((function(t){e(void 0)}))}),(function(t){z.In.warn("zp.sv.2 recapture getDevices err:",t.message),e(void 0)}))}))},p=null,D.label=1;case 1:return D.trys.push([1,3,,6]),[4,navigator.mediaDevices.getUserMedia(r)];case 2:return(p=D.sent()).getTracks().forEach((function(t){if(jo(t,z.In,"zp.sv.2"),"video"===t.kind){var i=t.getSettings(),e=i.height,n=i.frameRate;z.In.info("zp.sv.2 track settings ".concat(i.width," ").concat(e," ").concat(n))}})),this.In.info("zp.sv.2 success"),[3,6];case 3:return g=D.sent(),this.In.info("zp.sv.2 failed "+g.name+" "+g.message),"NotFoundError"!==g.name?[3,5]:(_=!1===r.video,y=!1,w=!1,(b=!1===r.audio)&&(y=Bt(null===(e=r.video)||void 0===e?void 0:e.videoInput)),_&&(w=Bt(null===(n=r.audio)||void 0===n?void 0:n.audioInput)),this.In.info("zp.sv.2 failed "+(S=b&&y||_&&w)+" "+(E=b?"video":"audio")),S?[4,m(r,E)]:[3,5]);case 4:(O=D.sent())&&(p=O),D.label=5;case 5:if(!p)throw v(g);return[3,6];case 6:return this.fo=p,this.previewSuc=!0,this.initMediaTrack(p),this.Su&&((T=p.getVideoTracks()[0])&&(k=T.getSettings(),R=k.width,I=k.height,N=k.frameRate,Jt(this.Su.width)&&R&&(this.Su.width=R),Jt(this.Su.height)&&I&&(this.Su.height=I),Jt(this.Su.frameRate)&&N&&(this.Su.frameRate=N)),C=Jt(r.audio)&&r.audio.channelCount,this.Su.channelCount=C||(this.audioTrack&&this.audioTrack.getSettings?this.audioTrack.getSettings().channelCount:1)),[2,p]}}))}))},t.prototype.Cu=function(t){if(Yt(t.source)){var i=t.source.getVideoTracks(),e=i.length>0?i[0].getSettings():{width:0,height:0,frameRate:0};return this.In.debug("zp.sv.2 use external media stream"),this.previewSuc=!0,this.fo=new MediaStream(t.source),this.initMediaTrack(this.fo),this.Su={width:e.width||0,height:e.height||0,frameRate:e.frameRate||0,bitRate:t.bitRate||this.Nn.settingConfig.getSetting("custom_video_bitrate"),startBitrate:t.startBitrate||this.Nn.settingConfig.getSetting("bitrate_mode"),minBitrate:t.minBitrate,keyFrameInterval:t.keyFrameInterval,channelCount:t.channelCount||(this.audioTrack&&this.audioTrack.getSettings?this.audioTrack.getSettings().channelCount:1),audioBitrate:1e3*t.audioBitrate||48e3,contentHint:""},qt(t.videoOptimizationMode)&&(this.Su.contentHint=t.videoOptimizationMode),this.fo}if(Qt(t.source)){var n=this.captureStream(t.source,t);if(n)return this.Su.bitRate=t.bitRate||this.Nn.settingConfig.getSetting("custom_video_bitrate"),this.previewSuc=!0,this.initMediaTrack(n),n;throw gn.error.ie}return new MediaStream},t.prototype.captureStream=function(t,i){var e,n,s,r;if(!t)return this.In.info("zp.cs.2 no local video"),null;var o=this.streamCenter.captureStreamElementMap.get(t);if(o)this.In.info("zp.cs.2 stream has capture"),r=o.clone();else{var u=void 0;if(t.captureStream)u=t.captureStream(),this.In.debug("zp.cs.2 captureStream");else{if(!t.mozCaptureStream)return this.In.info("zp.cs.2 don't support"),null;u=t.mozCaptureStream();var a=null===(e=this.acMgr)||void 0===e?void 0:e.getMediaElementRenderer(t);null==a||a.setVoiceChangeNode(a.effectMode,a.voiceChangerNode,!0),this.In.debug("zp.cs.2 mozCaptureStream")}this.streamCenter.captureStreamElementMap.set(t,u),r=u.clone()}if(0==r.getTracks().length)return this.In.error("zp.cs.2 external capture tracks no found"),null;this.In.info("zp.cs.2 tracks: "+r.getTracks().length),this.fo=r;var c=null===(s=null===(n=r.getVideoTracks())||void 0===n?void 0:n[0])||void 0===s?void 0:s.getSettings();return this.Su={width:t.videoWidth,height:t.videoHeight,frameRate:(null==c?void 0:c.frameRate)||0,bitRate:i.bitRate||this.Nn.settingConfig.getSetting("custom_video_bitrate"),channelCount:i.channelCount||(this.audioTrack&&this.audioTrack.getSettings?this.audioTrack.getSettings().channelCount:1),audioBitrate:1e3*i.audioBitrate||48e3,startBitrate:i.startBitrate||this.Nn.settingConfig.getSetting("bitrate_mode"),minBitrate:i.minBitrate,keyFrameInterval:i.keyFrameInterval,contentHint:""},qt(i.videoOptimizationMode)&&(this.Su.contentHint=i.videoOptimizationMode),this.In.debug("zp.cs.2 called success"),this.fo},t.prototype.stopPreview=function(){var t,i,e,n=this;if(this.In.info("zp.sv.2.1 called"),this.fo){var s=this.rtcViewer;s&&s.destroy(),this.videoEffect&&(this.videoEffect.setBeautyEffectOptions(!1),this.videoEffect.destroy()),this.Du&&this.Du.destroy(),this.voiceProccessor&&this.voiceProccessor.destroy(),null===(t=this.Nn.backgroundBlurManager)||void 0===t||t.releaseMap(this.fo),this.backgroundProcessor&&(this.backgroundProcessor.release(),this.backgroundProcessor=null),this.streamCompositor&&(this.streamCompositor=null),this.Nu&&this.videoNodeQueue.destroy(),this.Ro.trackUtils.stopTrack(this.cloneVideoTrack),this.cloneVideoTrack=null,this.muteImageAnID&&cancelAnimationFrame(this.muteImageAnID),this.stopSoundLevel(),this.Ro.trackUtils.stopTrack(this.originVideoTrack),this.originVideoTrack=null,this.Ro.trackUtils.stopTrack(this.originAudioTrack),this.originAudioTrack=null,this.Ro.trackUtils.stopTrack(this.videoTrack),this.videoTrack=null,this.Ro.trackUtils.stopTrack(this.audioTrack),this.audioTrack=null,Ep.sourceDisConnect(this.fo),null===(i=this.audioMixManager)||void 0===i||i.stopAudioManager(),this.Pu(),!this.zegoCaptureStream&&this.fo.getTracks().forEach((function(t){n.Ro.trackUtils.stopTrack(t)})),this.fo=null,!this.zegoCaptureStream&&(null===(e=this.lowStream)||void 0===e||e.getTracks().forEach((function(t){return n.Ro.trackUtils.stopTrack(t)}))),this.lowStream=void 0,this.Su={width:0,height:0,frameRate:0,bitRate:0,minBitrate:0,startBitrate:"default",keyFrameInterval:2,channelCount:1,audioBitrate:48e3,contentHint:""}}},t.prototype.enableMicrophone=function(t){var i=this;if(!this.localStream)return this.In.error("zp.em.2 no localStream"),!1;var e=this.localStream.getAudioTracks()[0];e.enabled=t;var n=this.Ro,s=n.isMicEnabled&&t;this.audioTrack&&(this.audioTrack.enabled=s);var r=n.getPublishList(this.localStream).map((function(t){return t.publisher}));return r.length&&r.forEach((function(n){return Rp(i,void 0,void 0,(function(){var i,s;return Ip(this,(function(r){switch(r.label){case 0:return i=!t,(s=n.audioSender)?i?[4,s.replaceTrack(null)]:[3,2]:[2];case 1:return r.sent(),[3,4];case 2:return[4,s.replaceTrack(e)];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))})),this.Au(s,3),this.Tu=t,this.In.debug("zp.em.2 call success. "+t),!0},t.prototype.updatePublisherStreamMicStatus=function(t,i){this.Au(this.Tu&&t,i)},t.prototype.Au=function(t,i){if(this.fo){var e=this.Ro.getPublishList(this.fo).map((function(t){return t.publisher}));e.length&&e.forEach((function(e){e.sendStreamStatus(e.camera_status,t?0:i)}))}},t.prototype.updatePublisherStreamCameraStatus=function(t,i){if(this.fo){var e=this.Ro.getPublishList(this.fo).map((function(t){return t.publisher}));e.length&&e.forEach((function(e){e.sendStreamStatus(t?0:i,e.mic_status)}))}},t.prototype.enableMicrophoneOnly=function(t){return this.fo?this.micTrack?(this.micTrack.enabled=this.Tu&&t,this.updatePublisherStreamMicStatus(t,3),this.In.debug("zp.emo.2 call success"),!0):(this.In.info("zp.emo.2 no micTrack"),!0):(this.In.error("zp.em.2 no localStream"),!1)},t.prototype.enableCamera=function(t,i,e){var n;return Rp(this,void 0,void 0,(function(){var s,r,o,u,a,c,h,f,l=this;return Ip(this,(function(d){switch(d.label){case 0:return this.localStream&&this.videoTrack?(s=this.videoTrack,u=this.lowStream,this.Ru&&(t?t&&(this.isVideoNodeQueueEnabled?setTimeout((function(){var t=l.videoNodeQueue.getDestinationTrack();t&&l.replacePreviewTrack(t,!0)}),800):this.videoTrack&&this.replacePreviewTrack(this.videoTrack,!1)):(r=this.Mu(this.Ru),this.localStream.removeTrack(this.localStream.getVideoTracks()[0]),this.localStream.addTrack(r),this.rtcViewer&&this.rtcViewer.setVideo(r),u&&(o=r.clone()))),e&&!t||!s?e&&!t&&((null===(n=this.videoEffect)||void 0===n?void 0:n.enabled)||this.isVideoNodeQueueEnabled?this.In.warn("zp.ec.2 Unable to keep the preview screen when beauty is turned on"):(a=this.cloneVideoTrack,this.cloneVideoTrack=this.videoTrack.clone(),this.cloneVideoTrack.enabled=!0,this.replacePreviewTrack(this.cloneVideoTrack,!1,{retainTrack:!0}),i.trackUtils.stopTrack(a))):(s.enabled=t,this.xu(t,s)),s&&(s.enabled=t),this.isVideoNodeQueueEnabled?((c=this.videoNodeQueue.getDestinationTrack())&&(c.enabled=t),!t?[4,this.videoNodeQueue.replaceNewSourceByTrack(null,!1)]:[3,2]):[3,5]):(this.In.error("zp.ec.2 video track no found"),[2,!1]);case 1:d.sent(),d.label=2;case 2:return t&&s?[4,this.videoNodeQueue.replaceNewSourceByTrack(s,!1)]:[3,4];case 3:d.sent(),d.label=4;case 4:d.label=5;case 5:return null==u||u.getVideoTracks().forEach((function(i){i.enabled=t})),h=i.checkPreview(this.localStream),(f=i.getPublishList(this.localStream).map((function(t){return t.publisher}))).length&&f.forEach((function(i){var e=!i.sideMediaConfig.isSEIStart,n=i.getVideoSenders();n&&n.forEach((function(s,a){return Rp(l,void 0,void 0,(function(){var c,f,l=this;return Ip(this,(function(d){switch(d.label){case 0:return t?[3,8]:this.Ru?(i.setSendMuteImage(!0),i.isTcVideoPasued()?[3,4]:n.length>1&&0===a&&o?[4,null==s?void 0:s.replaceTrack(o)]:[3,2]):[3,5];case 1:return d.sent(),[3,4];case 2:return r?[4,null==s?void 0:s.replaceTrack(r)]:[3,4];case 3:d.sent(),d.label=4;case 4:return[3,7];case 5:return e?i.isTcVideoPasued()?[3,7]:[4,s.replaceTrack(null)]:[3,7];case 6:d.sent(),d.label=7;case 7:return[3,20];case 8:return t?(i.setSendMuteImage(!1),c=0,this.isVideoNodeQueueEnabled?(c=800,f=this.videoNodeQueue.getDestinationTrack(),i.isTcVideoPasued()||!f||s.track===f?[3,10]:[4,null==s?void 0:s.replaceTrack(f)]):[3,11]):[3,20];case 9:d.sent(),d.label=10;case 10:return[3,19];case 11:return i.isTcVideoPasued()||s.track===this.videoTrack?[3,19]:(null==h?void 0:h.streamFromCanvas)?[3,17]:n.length>1&&0===a?u?[4,null==s?void 0:s.replaceTrack(u.getVideoTracks()[0])]:[3,13]:[3,14];case 12:d.sent(),d.label=13;case 13:return[3,16];case 14:return[4,null==s?void 0:s.replaceTrack(this.videoTrack)];case 15:d.sent(),d.label=16;case 16:return[3,19];case 17:return[4,null==s?void 0:s.replaceTrack(h.streamFromCanvasTrack)];case 18:d.sent(),d.label=19;case 19:c?setTimeout((function(){l.muteImageAnID&&clearInterval(l.muteImageAnID)}),c):this.muteImageAnID&&clearInterval(this.muteImageAnID),d.label=20;case 20:return[2]}}))}))}));var s=l.Ru&&!t?0:id(l.videoTrack);i.sendStreamStatus(s,i.mic_status)})),this.ku=t,this.In.info("zp.ec.2 call success"),[2,!0]}}))}))},t.prototype.xu=function(t,i){var e=this;if(Jl(this.Nn.browserInfo,"chrome",86,2)&&Jl(this.Nn.browserInfo,"chrome",92,0)&&t&&!Bt(i.getSettings().width)&&i.getSettings().width>0){var n=i.getSettings().width-1,s=i.getSettings().height-1,r=i.getSettings().frameRate;i.applyConstraints({width:n,height:s,frameRate:r}).then((function(){i.applyConstraints({width:e.videoInfo.width,height:e.videoInfo.height,frameRate:r})}))}},t.prototype.stopCaptureVideo=function(){return Rp(this,void 0,void 0,(function(){var t,i,e,n,s=this;return Ip(this,(function(r){switch(r.label){case 0:return t=this.lowStream,this.videoTrack?(i=this.videoTrack.enabled,e="safari"===this.Nn.browser,this.hasStopCaptureVideo=!0,n=function(){return Rp(s,void 0,void 0,(function(){return Ip(this,(function(i){switch(i.label){case 0:return this.videoTrack&&(this.videoTrack.enabled=!1),t&&(t.getVideoTracks()[0].enabled=!1),[4,new Promise((function(t){setTimeout((function(){t(void 0)}),1e3)}))];case 1:return i.sent(),[2]}}))}))},this.Nn.engineConfig.previewClearLastFrame?e?[3,2]:(this.videoTrack.enabled=!1,t&&(t.getVideoTracks()[0].enabled=!1),[4,new Xt((function(t){setTimeout((function(){t(void 0)}),200)}))]):[3,7]):[2];case 1:r.sent(),r.label=2;case 2:return this.isVideoNodeQueueEnabled?e?[4,n()]:[3,4]:[3,6];case 3:r.sent(),r.label=4;case 4:return[4,this.videoNodeQueue.replaceNewSourceByTrack(null,!1)];case 5:r.sent(),r.label=6;case 6:return this.Ro.trackUtils.stopTrack(this.videoTrack),this.Ro.trackUtils.stopTrack(null==t?void 0:t.getVideoTracks()[0]),this.stopCanvasStreamTrack(),this.videoTrack.enabled=i,[3,12];case 7:return this.isVideoNodeQueueEnabled?e?[4,n()]:[3,9]:[3,11];case 8:r.sent(),r.label=9;case 9:return[4,this.videoNodeQueue.replaceNewSourceByTrack(null,!1)];case 10:r.sent(),r.label=11;case 11:this.Ro.trackUtils.stopTrack(this.videoTrack),this.Ro.trackUtils.stopTrack(null==t?void 0:t.getVideoTracks()[0]),this.stopCanvasStreamTrack(),r.label=12;case 12:return[2]}}))}))},t.prototype.startSoundLevel=function(){var t;if(this.fo&&0!=this.fo.getAudioTracks().length){null===(t=this.soundMeterWorklet)||void 0===t||t.destroy();var i=this.Ro.getCloudSoundInterval();try{var e=this,n=this.Ro.createSoundLevel(this.ac,this.fo,this.Ro.soundLevelInterval,i,(function(t){e.soundLevel=100*t})),s=n.mic;this.soundMeterWorklet=n.soundMeter,this.mic=s}catch(t){this.In.error(Bd+" get sound level failed "+t)}}},t.prototype.stopSoundLevel=function(){var t;this.soundLevel=0,null===(t=this.soundMeterWorklet)||void 0===t||t.destroy(),this.soundMeterWorklet=null,this.mic=null},t.prototype.restartSoundLevel=function(){this.Ro.soundLevelDelegate?(this.stopSoundLevel(),this.startSoundLevel()):this.stopSoundLevel()},t.prototype.setBeautyEffect=function(t,i){return Rp(this,void 0,void 0,(function(){return Ip(this,(function(t){return[2]}))}))},t.prototype.setMuteImage=function(t){this.Ru=t},t.prototype.syncTrackState=function(t,i){i.enabled=t.enabled},t.prototype.replacePreviewTrack=function(t,i,e){var n;return void 0===i&&(i=!1),void 0===e&&(e={}),Rp(this,void 0,void 0,(function(){var s,r,o,u,a,c,h;return Ip(this,(function(f){return this.In.info("zsc.rpt.0 call "+"".concat(t.kind," ").concat(i," ").concat(JSON.stringify(e))),t&&t.kind&&this.localStream?(s=!0===(null==e?void 0:e.retainTrack),o=!(r="audio"===t.kind),u=r?"audioTrack":"videoTrack",this.syncAudioEnabled&&r&&this.audioTrack&&this.syncTrackState(this.audioTrack,t),o&&this.syncVideoEnabled&&this.videoTrack&&this.syncTrackState(this.videoTrack,t),r&&this.insertableaudio&&this.insertableaudio.track.id!==t.id&&(t=this.insertableaudio.getInsertableStreamTrack(t)),!s&&o&&!i&&this.isVideoNodeQueueEnabled?(this.In.info("zsc.rpt.0 videoNodeQueue replaceNewSource"),null===(n=this.Nu)||void 0===n||n.replaceNewSourceByTrack(t,void 0,kp({},e))):r&&this.audioNodeQueue&&!e.isTrackProcessedFromOriginalStream?((a=new MediaStream).addTrack(t),c=this.ac.createMediaStreamSource(a),this.audioNodeQueue.replaceSource(c),this.voiceProccessor&&rh()&&t!==this.Eu&&this.voiceProccessor.resetWorklet()):r&&!this.audioNodeQueue&&this.destNode&&!e.isTrackProcessedFromOriginalStream?(this.createSrcNode(t,!0).connect(this.destNode),this.In.info("zsc.rpt.0 replace audio track with audio mix.")):(this.In.info("zsc.rpt.0 replace local ".concat(t.kind," track")),(h=this.localStream.getTracks().find((function(i){return i.kind===t.kind})))!==t&&(h&&(this.localStream.removeTrack(h),r?this.removeAudioTrackEvent(h):this.removeVideoTrackEvent(h)),this.localStream.addTrack(t)),this.rtcViewer&&(this.rtcViewer.setTrack(o,t),"safari"===this.Nn.browser&&this.rtcViewer.resume(!0)),!s&&o&&this.enableDualStream&&this.createLowStream()),i||s||e.isTrackProcessedFromOriginalStream||(this.In.info("zsc.rpt.0 setTrack ".concat(u)),this[u]=t,"REMOVE"===e.handleTrack&&o&&(this.localStream.removeTrack(t),this.rtcViewer&&this.rtcViewer.setTrack(!0,null),this[u]=null)),this.Ro.soundLevelDelegate&&this.soundMeterWorklet&&(this.mic=this.soundMeterWorklet.replaceSrcSource(this.ac,this.localStream)),r&&this.streamCompositor&&this.streamCompositor.replaceSource(this.localStream),e.isCamera&&(r?this.audioPreviewType="camera":this.videoPreviewType="camera"),this.In.info("zsc.rpt.0 end"),[2]):[2]}))}))},t.prototype.updateZegoStreamCaptureTrack=function(t){var i=this.zegoCaptureStream;if(i){var e="video"==t.kind?i.originVideoStream:i.originAudioStream;if(e){var n=this.Ro.checkPreview(e);this.In.info("zsc.uzsct replace zego preivew"),null==n||n.replacePreviewTrack(t)}}},t.prototype.createLowStream=function(){var t,i,e,n,s,r=null===(t=this.fo)||void 0===t?void 0:t.getVideoTracks()[0];if(r){var o=r.getSettings().height,u=r.getSettings().width,a=th(),c=hh(),h=a.indexOf("Android")>-1||a.indexOf("Adr")>-1;this.In.info("zp.cls w: "+u+" h: "+o+" "+h+" "+c);var f=Lt(null===(i=this.Su)||void 0===i?void 0:i.width)&&Lt(null===(e=this.Su)||void 0===e?void 0:e.height)&&o==this.Su.width&&u==this.Su.height;if(c&&h&&f){var l=o;o=u,u=l}var d=o&&u?o/u:1;try{var v,m=this.lowStreamConfig,p=m.width,g=m.frameRate;if(v=Math.round(d*this.lowStreamConfig.width),this.In.info("zp.cls lw: "+p+" lh: "+v),"firefox"===this.Nn.browser)this.lowStream=this.getStreamThroughCanvas(this.fo,{w:p,h:v,fps:g});else{this.lowStream=null===(n=this.fo)||void 0===n?void 0:n.clone();var b=null===(s=this.lowStream)||void 0===s?void 0:s.getVideoTracks()[0];null==b||b.applyConstraints({width:p,height:v,frameRate:g})}}catch(t){this.In.error("zp.cls "+t)}}},t.prototype.initAudioNodeQueue=function(t){if(!this.audioTrack||!this.fo)return!1;var i=this.createSrcNode(this.audioTrack),e=this.createDestNode(this.fo);return this.audioNodeQueue=new Om(i,e),!0},t.prototype.createSrcNode=function(t,i,e){var n;void 0===i&&(i=!1),void 0===e&&(e=!1);var s=t||this.audioTrack;if(s===(null===(n=this.destNode)||void 0===n?void 0:n.stream.getAudioTracks()[0])&&(this.In.info("zp.pv.csn use empty track"),s=this.getEmptyAudioTrack()),this.srcNode&&!e){if(!i)return this.srcNode;this.srcNode.disconnect(),this.In.info("zp.pv.csn recreate src")}var r=new MediaStream;s&&r.addTrack(s);var o=this.ac.createMediaStreamSource(r);return e||(this.srcNode=o),this.In.info("zp.pv.csn "+"create src audio id: ".concat(null==s?void 0:s.id,", ").concat(null==s?void 0:s.label,",i")),o},t.prototype.isOriginEmptyTrack=function(){return!this.audioTrack||this.Eu===this.audioTrack},t.prototype.createDestNode=function(t){if(this.destNode)return this.destNode;var i=this.destNode=this.destNode||this.ac.createMediaStreamDestination(),e=i.stream.getAudioTracks()[0];this.In.info("zp.pv.cdn "+"create dest audio id: ".concat(null==e?void 0:e.id,", ").concat(null==e?void 0:e.label,",i"));var n=this.rtcViewer;for(var s in this.Ro.publisherList){var r=this.Ro.publisherList[s];if(r.localStream==t){var o=r.publisher.audioSender;o&&(o.replaceTrack(e),this.In.info("zc.pv.cdn change sender audio track"));break}}var u=t.getAudioTracks()[0];return u&&(t.removeTrack(u),!this.isOriginEmptyTrack()&&e&&(e.enabled=this.Tu)),t.addTrack(e),n&&n.setAudio(e),i},t.prototype.initMediaTrack=function(t){t.getVideoTracks().length>0&&(this.videoTrack=t.getVideoTracks()[0],this.originVideoTrack=this.videoTrack),t.getAudioTracks().length>0&&(this.audioTrack=t.getAudioTracks()[0],this.originAudioTrack=this.audioTrack)},t.prototype.onAudioTrackChange=function(t){},t.prototype.getViewer=function(){return!this.fo||this.rtcViewer&&this.rtcViewer.inited||(this.rtcViewer=new Em(this.fo,this,{clearLastFrame:this.Nn.engineConfig.previewClearLastFrame})),this.rtcViewer},t.prototype.getStreamThroughCanvas=function(t,i){var e,n=this;if(0==t.getVideoTracks().length)return t;var s=null===(e=t.getVideoTracks()[0])||void 0===e?void 0:e.getSettings(),r=s.width,o=s.height,u=s.frameRate;if(!r||!o||!u)return t;var a=Kt(),c=Wt.createElement("canvas"),h=c.getContext("2d");a.setAttribute("style","display:none"),c.setAttribute("style","display:none"),c.width=(null==i?void 0:i.w)||r,c.height=(null==i?void 0:i.h)||o,new Xt((function(t,i){var e=null,s=function(){e&&clearTimeout(e),a&&a.removeEventListener("playing",s),t(void 0)};a&&a.addEventListener("playing",s),e=window.setTimeout((function(){n.In.error("zc.gstc play canvas video timeout"),a.play(),e=window.setTimeout((function(){i()}),3e3)}),2e3)})).then((function(){var e=(null==i?void 0:i.fps)||u||15;n.ju&&(clearInterval(n.ju),n.ju=null),n.ju=setInterval((function(){var e,n=null===(e=t.getVideoTracks()[0])||void 0===e?void 0:e.getSettings();c.width=(null==i?void 0:i.w)||n.width||a.videoWidth,c.height=(null==i?void 0:i.h)||n.height||a.videoHeight,null==h||h.drawImage(a,0,0,c.width,c.height)}),1e3/e)})),a.srcObject=t,a.play().catch((function(t){n.In.error("zc.gstc play canvas video error: "+t.message)}));var f=c.captureStream((null==i?void 0:i.fps)||15),l=f.getVideoTracks()[0];if(l.stop=function(){var t;n.In.info("zc.gstc stop canvas track:"+l.id),n.ju&&(clearInterval(n.ju),n.ju=null),a&&(null===(t=a.srcObject)||void 0===t||t.getVideoTracks().forEach((function(t){t.stop()})),a.pause(),a.remove(),a=null),c&&(c.remove(),c=null)},Yt(t)&&t.getAudioTracks().length){var d=t.getAudioTracks()[0];f.addTrack(d)}return f},t.prototype.stopCanvasStreamTrack=function(){this.streamFromCanvas&&this.streamFromCanvasTrack&&(this.Ro.trackUtils.stopTrack(this.streamFromCanvasTrack),this.streamFromCanvasTrack=null),this.ju&&(clearInterval(this.ju),this.ju=null)},t.prototype.updateVideoInfo=function(t){var i={width:t.width,height:t.height,frameRate:t.frameRate,bitRate:t.bitRate,minBitrate:t.minBitrate,keyFrameInterval:t.keyFrameInterval};return this.In.info("zc.pv.uvi input video info: ".concat(JSON.stringify(i))),this.Su=kp(kp(kp({},this.Su),i),{bitRate:this.Su.bitRate||i.bitRate,minBitrate:this.Su.bitRate||i.bitRate}),kp({},this.Su)},t.prototype.updateAudioInfo=function(t){var i={};return this.In.info("zc.pv.uai input audio info: ".concat(JSON.stringify(i))),this.Su=kp(kp({},this.Su),i),kp({},this.Su)},t.prototype.setVideoInfo=function(t){if(t){var i=t.width,e=t.height,n=t.frameRate,s=t.bitRate,r=t.startBitrate,o=t.minBitrate,u=t.keyFrameInterval,a=t.channelCount,c=t.audioBitrate,h=t.contentHint;void 0!==i&&(this.Su.width=i),void 0!==e&&(this.Su.height=e),void 0!==n&&(this.Su.frameRate=n),void 0!==s&&(this.Su.bitRate=s),void 0!==r&&(this.Su.startBitrate=r),void 0!==o&&(this.Su.minBitrate=o),void 0!==u&&(this.Su.keyFrameInterval=u),void 0!==a&&(this.Su.channelCount=a),void 0!==c&&(this.Su.audioBitrate=c),void 0!==h&&(this.Su.contentHint=h)}},t.prototype.updateMediaStreamConstraints=function(t,i){var e=this;this.In.info("zc.pv.umsc ".concat(JSON.stringify(t))),"video"===i?Np.forEach((function(i){return e.Iu[i]=t[i]})):Cp.forEach((function(i){return e.Iu[i]=t[i]}))},t.prototype.deleteConstraints=function(t,i){i.forEach((function(i){return delete t[i]}))},t.prototype.setVolumeFactorByUserCount=function(t){var i,e=this.Nn.engineConfig.choirRole;if(this.fo){this.In.info("zc.pv.svf ".concat(null===(i=this.fo)||void 0===i?void 0:i.id," count: ").concat(t,", mic: ").concat(!!this.micTrack,", choir role: ").concat(e));var n=this.volumeFactor,s=[1,2].includes(e);if(this.micTrack&&s)for(var r=[[0,1],[3,1],[4,.9],[8,.7],[12,.5],[16,.45],[20,.4],[24,.35],[1/0,.3]],o=0;o<r.length;o++){var u=r[o][0],a=r[o+1];if(!a){this.In.error("zc.pv.svf error: no map factor");break}if(t>=u&&t<a[0]){n=a[1];break}}else n=1===e?.6:1;this.audioMixManager&&this.audioMixManager.setVolumeFactor(1===e?.6:1),this.In.info("zc.pv.svf factor: ".concat(n)),this.setVolume(void 0,n)}},t.prototype.setVolume=function(t,i){var e,n,s;this.In.info("zc.pv.scv volume: ".concat(t,", factor: ").concat(i,"; origin: ").concat(this.volume,", ").concat(this.volumeFactor)),void 0===t?t=this.volume:this.volume=t,void 0===i?i=this.volumeFactor:this.volumeFactor=i;var r=this.gainNode;r||(this.audioNodeQueue||this.initAudioNodeQueue(),r=this.ac.createGain(),null===(e=this.audioNodeQueue)||void 0===e||e.pushFront(r),this.gainNode=r);var o=t/100*this.volumeFactor;if(Lt(o)){var u=!1;r.gain.value!=o&&(u=!0,r.gain.value=o),this.In.info("zc.pv.scv ".concat(this.audioPreviewType," ").concat(null===(s=this.fo)||void 0===s?void 0:s.id,"  volume: ").concat(o,". hasChanged: ").concat(u))}else this.In.error("zc.pv.scv ".concat(this.audioPreviewType," ").concat(null===(n=this.fo)||void 0===n?void 0:n.id,"  volume error: ").concat(o))},t.prototype.Mu=function(t){var i=$t(t.width,t.height),e=i.getContext("2d");return this.muteImageAnID=setInterval((function(){t&&(null==e||e.drawImage(t,0,0))}),100),i.captureStream().getVideoTracks()[0]},t.prototype.setAudioFrameCallback=function(t,i){if(this.In.info("zc.pv.safc call"),this.fo){this.Du||(this.Du=new Op(this.ac,this.In));var e=null!==t;this.audioNodeQueue||this.initAudioNodeQueue(),this.audioNodeQueue&&this.Du.setAudioFrameCallback(this.audioNodeQueue.destinationNode.stream,e,(function(i){t&&t(i)}),i)}else this.In.info("zc.pv.safc no localStream")},t.prototype.Pu=function(){this.Du&&(this.Du.destroy(),this.Du=null)},t}();function Dp(t,i){if(t&&!Yt(t)&&t.zegoStream){if(i.info("cu.gs type:zego"),Yt(t.stream))return t.stream;throw new Error("The ZegoLocalStream type requires first calling the capture api to capture the stream")}return t}!function(t){t[t.Off=0]="Off",t[t.TurningOn=1]="TurningOn",t[t.On=2]="On"}(Ym||(Ym={})),function(t){t[t.World=0]="World",t[t.Team=1]="Team",t[t.SecretTeam=2]="SecretTeam"}(Zm||(Zm={})),function(t){t[t.All=0]="All",t[t.World=1]="World",t[t.Team=2]="Team"}(Qm||(Qm={})),function(t){t[t.All=0]="All",t[t.World=1]="World",t[t.Team=2]="Team"}(Xm||(Xm={})),function(t){t[t.Song=0]="Song",t[t.Accompaniment=1]="Accompaniment",t[t.AccompanimentClip=2]="AccompanimentClip",t[t.AccompanimentSegment=3]="AccompanimentSegment"}(Wm||(Wm={})),function(t){t[t.Count=0]="Count",t[t.User=1]="User",t[t.Room=2]="Room",t[t.Master=3]="Master"}(Km||(Km={})),function(t){t[t.VendorDefault=0]="VendorDefault",t[t.Vendor1=1]="Vendor1",t[t.Vendor2=2]="Vendor2",t[t.Vendor3=4]="Vendor3"}($m||($m={})),function(t){t[t.PortraitSegmentation=0]="PortraitSegmentation"}(tp||(tp={})),function(t){t[t.NONE=0]="NONE",t[t.MEN_TO_CHILD=1]="MEN_TO_CHILD",t[t.MEN_TO_WOMEN=2]="MEN_TO_WOMEN",t[t.WOMEN_TO_CHILD=3]="WOMEN_TO_CHILD",t[t.WOMEN_TO_MEN=4]="WOMEN_TO_MEN",t[t.FOREIGNER=5]="FOREIGNER",t[t.OPTIMUS_PRIME=6]="OPTIMUS_PRIME",t[t.ANDROID=7]="ANDROID",t[t.ETHEREAL=8]="ETHEREAL",t[t.MALE_MAGNETIC=9]="MALE_MAGNETIC",t[t.FEMALE_FRESH=10]="FEMALE_FRESH",t[t.MAJOR_C=11]="MAJOR_C",t[t.MINOR_A=12]="MINOR_A",t[t.HARMONIC_MINOR=13]="HARMONIC_MINOR",t[t.FEMALE_ENERGETIC=14]="FEMALE_ENERGETIC",t[t.RICHNESS=15]="RICHNESS",t[t.MUFFLED=16]="MUFFLED",t[t.ROUNDNESS=17]="ROUNDNESS",t[t.FALSETTO=18]="FALSETTO",t[t.FULLNESS=19]="FULLNESS",t[t.CLEAR=20]="CLEAR",t[t.HIGHLY_RESONANT=21]="HIGHLY_RESONANT",t[t.LOUD_CLEAR=22]="LOUD_CLEAR"}(ip||(ip={})),function(t){t[t.None=0]="None",t[t.SoftRoom=1]="SoftRoom",t[t.LargeRoom=2]="LargeRoom",t[t.ConcertHall=3]="ConcertHall",t[t.Valley=4]="Valley",t[t.RecordingStudio=5]="RecordingStudio",t[t.Basement=6]="Basement",t[t.KTV=7]="KTV",t[t.Popular=8]="Popular",t[t.Rock=9]="Rock",t[t.VocalConcert=10]="VocalConcert",t[t.GramoPhone=11]="GramoPhone",t[t.EnhancedKTV=12]="EnhancedKTV"}(ep||(ep={})),function(t){t[t.None=0]="None",t[t.Local=1]="Local",t[t.Publish=2]="Publish",t[t.All=3]="All"}(np||(np={})),function(t){t[t.AI=0]="AI",t[t.AIBalanced=1]="AIBalanced",t[t.AIAggressive=2]="AIAggressive"}(sp||(sp={})),function(t){t[t.AspectFill=0]="AspectFill",t[t.AspectFit=1]="AspectFit"}(rp||(rp={})),function(t){t[t.ZegoFontTypeSourceHanSans=0]="ZegoFontTypeSourceHanSans",t[t.ZegoFontTypeAlibabaSans=1]="ZegoFontTypeAlibabaSans",t[t.ZegoFontTypePangMenZhengDaoTitle=2]="ZegoFontTypePangMenZhengDaoTitle",t[t.ZegoFontTypeHappyZcool=3]="ZegoFontTypeHappyZcool"}(op||(op={})),function(t){t[t.ZegoAudioMixModeRaw=0]="ZegoAudioMixModeRaw",t[t.ZegoAudioMixModeFocused=1]="ZegoAudioMixModeFocused"}(up||(up={})),function(t){t[t.ZegoAudioCodecIDNormal=1]="ZegoAudioCodecIDNormal",t[t.ZegoAudioCodecIDNormal2=2]="ZegoAudioCodecIDNormal2",t[t.ZegoAudioCodecIDLow3=6]="ZegoAudioCodecIDLow3"}(ap||(ap={})),function(t){t[t.ZegoEncodeProfileDefault=0]="ZegoEncodeProfileDefault",t[t.ZegoEncodeProfileBaseline=1]="ZegoEncodeProfileBaseline",t[t.ZegoEncodeProfileMain=2]="ZegoEncodeProfileMain",t[t.ZegoEncodeProfileHigh=3]="ZegoEncodeProfileHigh"}(cp||(cp={})),function(t){t[t.Off=0]="Off",t[t.On=1]="On"}(hp||(hp={})),function(t){t[t.PortraitSegmentation=0]="PortraitSegmentation"}(fp||(fp={})),function(t){t[t.ZegoGeoFenceTypeNone=0]="ZegoGeoFenceTypeNone",t[t.ZegoGeoFenceTypeInclude=1]="ZegoGeoFenceTypeInclude",t[t.ZegoGeoFenceTypeExclude=2]="ZegoGeoFenceTypeExclude"}(lp||(lp={})),function(t){t[t.ZegoDefined=0]="ZegoDefined",t[t.UserUnregister=1]="UserUnregister"}(dp||(dp={})),function(t){t[t.TrafficControlFocusOnLocalOnly=0]="TrafficControlFocusOnLocalOnly",t[t.TrafficControlFocusOnRemote=1]="TrafficControlFocusOnRemote"}(vp||(vp={})),function(t){t[t.NoVideo=0]="NoVideo"}(mp||(mp={})),function(t){t[t.Allow=0]="Allow",t[t.NotAllow=1]="NotAllow"}(pp||(pp={})),function(t){t[t.video=0]="video",t[t.audio=1]="audio",t[t.videoAndAudio=2]="videoAndAudio"}(gp||(gp={}));var Pp=function(){function t(t){this.zegoStream=t}return Object.defineProperty(t.prototype,"active",{get:function(){return this.zegoStream.active},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.zegoStream.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoCaptureStream",{get:function(){return this.zegoStream.originVideoStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioCaptureStream",{get:function(){return this.zegoStream.originAudioStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stream",{get:function(){return this.zegoStream.stream},enumerable:!1,configurable:!0}),t.prototype.getAudioTracks=function(){return this.zegoStream.getAudioTracks()},t.prototype.getVideoTracks=function(){return this.zegoStream.getVideoTracks()},t.prototype.getTracks=function(){return this.zegoStream.getTracks()},Object.defineProperty(t.prototype,"videoDeviceId",{get:function(){return this.zegoStream.videoDeviceId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioDeviceId",{get:function(){return this.zegoStream.audioDeviceId},enumerable:!1,configurable:!0}),t.prototype.on=function(t,i){return this.zegoStream.on(t,i)},t.prototype.off=function(t,i){return this.zegoStream.off(t,i)},t.prototype.startCaptureMicrophone=function(t){return this.zegoStream.startCaptureMicrophone(t)},t.prototype.startCaptureCamera=function(t){return this.zegoStream.startCaptureCamera(t)},t.prototype.startCaptureCameraAndMicrophone=function(t,i){return this.zegoStream.startCaptureCameraAndMicrophone(t,i)},t.prototype.startCaptureCustomAudio=function(t){return this.zegoStream.startCaptureCustomAudio(t)},t.prototype.startCaptureCustomVideo=function(t){return this.zegoStream.startCaptureCustomVideo(t)},t.prototype.startCaptureCustomVideoAndAudio=function(t,i){return this.zegoStream.startCaptureCustomVideoAndAudio(t,i)},t.prototype.startCaptureScreen=function(t){return this.zegoStream.startCaptureScreen(t)},t.prototype.startCaptureScreenWithAudio=function(t,i){return this.zegoStream.startCaptureScreenWithAudio(t,i)},t.prototype.stopCaptureAudio=function(){return this.zegoStream.stopCaptureAudio()},t.prototype.stopCaptureVideo=function(){return this.zegoStream.stopCaptureVideo()},t.prototype.playAudio=function(t){this.zegoStream.playAudio(t)},t.prototype.playCaptureAudio=function(t){this.zegoStream.playCaptureAudio(t)},t.prototype.playVideo=function(t,i){this.zegoStream.playVideo(t,i)},t.prototype.playCaptureVideo=function(t,i){this.zegoStream.playCaptureVideo(t,i)},t.prototype.takeStreamSnapshot=function(t){return this.zegoStream.takeStreamSnapshot(t)},t.prototype.resumeVideo=function(){return this.zegoStream.resumeVideo()},t.prototype.resumeAudio=function(){return this.zegoStream.resumeAudio()},t.prototype.stopVideo=function(){this.zegoStream.stopVideo()},t.prototype.stopAudio=function(){this.zegoStream.stopAudio()},t.prototype.stopPlayCaptureVideo=function(){this.zegoStream.stopPlayCaptureVideo()},t.prototype.stopPlayCaptureAudio=function(){this.zegoStream.stopPlayCaptureAudio()},t.prototype.setVolume=function(t){return this.zegoStream.setVolume(t)},t.prototype.useAudioOutputDevice=function(t){return this.zegoStream.setAudioOutputDevice(t)},t}(),Ap=Pp,Mp=function(){return Mp=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Mp.apply(this,arguments)},xp=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},jp=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Lp=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))},qp=function(){function t(t,i,e,n,s){var r=this;this.jr=t,this.In=i,this.Ro=e,this.Nn=n,this.Lu=s,this.id="zego-stream-"+Date.now().toString(16),this.originVideoStream=null,this.originAudioStream=null,this.audioMuted=!0,this.audioCaptureMuted=!0,this.stream=null,this.qu=[],this.Uu=[],this.Fo={autoplayFailed:function(t,i){r.Go.emit("autoplayFailed",t,i)},autoplayCaptureFailed:function(t,i){r.Go.emit("autoplayCaptureFailed",t,i)},canPlayAudio:function(t){r.Go.emit("canPlayAudio",t)},canPlayVideo:function(t){r.Go.emit("canPlayVideo",t)},canPlayCaptureVideo:function(t){r.Go.emit("canPlayCaptureVideo",t)},canPlayCaptureAudio:function(t){r.Go.emit("canPlayCaptureAudio",t)},videoTrackChanged:function(t){r.Go.emit("videoTrackChanged",t)},audioTrackChanged:function(t){r.Go.emit("audioTrackChanged",t)},captureVideoTrackChanged:function(t){r.Go.emit("captureVideoTrackChanged",t)},captureAudioTrackChanged:function(t){r.Go.emit("captureAudioTrackChanged",t)}},this.Bu=!1,this.Ju=!1,this.Vu=null,this.Hu=[],this.Gu=null,this.Fu=null,this.Yu="",this.Zu="",this.Qu=null,this.Xu=null,this.Go=new hm,this.autoPlay&&!t.view&&this.In.error("zcs.c if you want to play the stream automatically, the view parameter is required.")}return Object.defineProperty(t.prototype,"active",{get:function(){var t,i;return(null===(t=this.originAudioStream)||void 0===t?void 0:t.active)||(null===(i=this.originVideoStream)||void 0===i?void 0:i.active)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this.jr.view||null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoPlay",{get:function(){return!!Ut(this.jr.autoPlay)&&this.jr.autoPlay},enumerable:!1,configurable:!0}),t.prototype.getAudioTracks=function(){var t;return this.In.info("zcs.gats call"),(null===(t=this.originAudioStream)||void 0===t?void 0:t.getAudioTracks())||[]},t.prototype.getVideoTracks=function(){var t;return this.In.info("zcs.gvts call"),(null===(t=this.originVideoStream)||void 0===t?void 0:t.getVideoTracks())||[]},t.prototype.getTracks=function(){return Lp(Lp([],this.getAudioTracks(),!0),this.getVideoTracks(),!0)},Object.defineProperty(t.prototype,"aCaptureViewer",{get:function(){return this.Vu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewer",{get:function(){return this.Gu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoDeviceId",{get:function(){var t=this.originVideoStream&&this.originVideoStream.getVideoTracks()[0];return t&&this._getDeviceIdByTrack(t)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioDeviceId",{get:function(){var t=this.originAudioStream&&this.originAudioStream.getAudioTracks()[0];return t&&this._getDeviceIdByTrack(t)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Wu",{get:function(){return this.Lu.publishStreamHandler},enumerable:!1,configurable:!0}),t.prototype.on=function(t,i){return!!i&&this.Go.addEventHandler(t,i)},t.prototype.off=function(t,i){return this.Go.removeEventHandler(t,i)},t.prototype.startPublish=function(){},t.prototype.resetPublish=function(){this.Ku()},t.prototype._getDeviceIdByTrack=function(t){return t&&t.getSettings().deviceId||""},t.prototype.$u=function(t,i){var e=Jt(t)?t:{};return i.call(this,e)},t.prototype.ta=function(t,i){var e=this;if(this.In.info("zcs.uos call type:"+i),0==i){if(this.originVideoStream=t,this.autoPlay||this.Ju){var n=this.Hu.map((function(t){return{container:t.container,option:t.jr}}));this.stopPlayCaptureVideo(),(null==n?void 0:n.length)||(n=[{container:this.jr.captureView||null,option:{}}]),n.forEach((function(t){return t.container&&e.playCaptureVideo(t.container,t.option)}))}this.Fo.captureVideoTrackChanged(this.originVideoStream.getVideoTracks()[0])}else this.originAudioStream=t,this.audioCaptureMuted||(this.stopPlayCaptureAudio(),this.playCaptureAudio()),this.Fo.captureAudioTrackChanged(this.originAudioStream.getAudioTracks()[0])},Object.defineProperty(t.prototype,"isPublish",{get:function(){for(var t in this.Ro.publisherList){if(this.Ro.publisherList[t].localStream==this.stream)return!0}return!1},enumerable:!1,configurable:!0}),t.prototype.updateStreamAudioTrack=function(t,i,e){return void 0===t&&(t=function(){}),void 0===i&&(i=function(){}),void 0===e&&(e=0),xp(this,void 0,void 0,(function(){var n,s,r,o,u,a,c=this;return jp(this,(function(h){switch(h.label){case 0:if(this.In.info("zcs.uat call"),!this.originAudioStream||this.isPublish&&0==e||!this.stream)return[2];if(!(n=this.checkPreview(this.originAudioStream))||!n.audioTrack)return this.In.info("zcs.uat not preview"),[2];s=this.Xu,r=n.audioTrack,o=function(i){c.Xu=n.audioTrack,c.Fo.audioTrackChanged(n.audioTrack),t(i)},h.label=1;case 1:return h.trys.push([1,3,,4]),this.stream&&this.ia(this.stream,this.stream,this.originAudioStream,!0),[4,this._updateStreamTrack(s,r,o,i)];case 2:return u=h.sent(),this.In.info("zcs.uat success"),[2,u];case 3:return a=h.sent(),this.In.info("zcs.uat fail"),[2,a];case 4:return[2]}}))}))},t.prototype.updateStreamVideoTrack=function(t,i,e){return void 0===t&&(t=function(){}),void 0===i&&(i=function(){}),void 0===e&&(e=0),xp(this,void 0,void 0,(function(){var n,s,r,o,u,a=this;return jp(this,(function(c){switch(c.label){case 0:if(this.In.info("zcs.uvt call"),!this.originVideoStream||this.isPublish&&0==e||!this.stream)return this.In.info("zcs.uvt not capture"),[2];if(n=this.Qu,!(s=this.checkPreview(this.originVideoStream))||!s.videoTrack)return this.In.info("zcs.uvt not preview"),[2];r=s.videoTrack,o=function(i){a.Qu=s.videoTrack,a.Fo.videoTrackChanged(s.videoTrack),t(i)},c.label=1;case 1:return c.trys.push([1,3,,4]),this.stream&&this.ia(this.stream,this.originVideoStream,this.stream,!0),[4,this._updateStreamTrack(n,r,o,i)];case 2:return c.sent(),this.Zu=this.Yu,this.In.info("zcs.uvt success"),[3,4];case 3:return u=c.sent(),this.In.info("zcs.uvt fail"),[2,u];case 4:return[2]}}))}))},t.prototype.updateStreamVideoAndAudio=function(t,i,e){return void 0===t&&(t=function(){}),void 0===i&&(i=function(){}),void 0===e&&(e=0),xp(this,void 0,void 0,(function(){var n,s,r,o,u;return jp(this,(function(a){switch(a.label){case 0:this.In.info("zcs.uva call"),n=!this.originVideoStream,s=!this.originAudioStream,r=function(i){n=!0,s&&t(i)},o=function(i){s=!0,n&&t(i)},a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.updateStreamVideoTrack(r,i,e)];case 2:return a.sent(),[4,this.updateStreamAudioTrack(o,i,e)];case 3:return a.sent(),[3,5];case 4:return u=a.sent(),i(u),this.In.info("zcs.uva error:".concat(JSON.stringify(u))),[3,5];case 5:return[2]}}))}))},t.prototype._updateStreamTrack=function(t,i,e,n){return xp(this,void 0,void 0,(function(){var s,r,o,u,a,c;return jp(this,(function(h){switch(h.label){case 0:return h.trys.push([0,6,,7]),this.In.info("zcs.ut call"),s=this.stream&&this.checkPreview(this.stream),this.stream&&s?(r={errorCode:0,extendedData:""},t?[3,2]:(this.In.info("zcs.ut add"),[4,this.Wu.handleTrack("ADD",this.stream,i,e,n)])):(this.In.info("zcs.ut stream:".concat(!this.stream,", previewer:").concat(!s)),[2]);case 1:return r=h.sent(),[3,5];case 2:return t.id==i.id?[3,5]:(this.In.info("zcs.ut replace"),o=!1,this.Yu&&this.Zu&&this.Yu!==this.Zu&&(o=!0),[4,this.Lu.replaceTrack(this.stream,i,void 0,{isReplaceNew:o,isCaptureStream:!0})]);case 3:return r=h.sent(),this.Ro.trackUtils.stopTrack(t),u=this.Ro.getPublisher(this.stream),(a=null==u?void 0:u.previewer.videoInfo.bitRate)?[4,null==u?void 0:u.setBitrate(a)]:[3,5];case 4:h.sent(),h.label=5;case 5:return e(r),[3,7];case 6:return c=h.sent(),n(c),[3,7];case 7:return[2]}}))}))},t.prototype.ea=function(t,i){var e;if(!this.stream){var n=[];if(this.originAudioStream){var s=this.checkPreview(this.originAudioStream);s&&s.audioTrack&&(n.push(s.audioTrack),this.Xu=s.audioTrack)}if(this.originVideoStream){var r=this.checkPreview(this.originVideoStream);r&&r.videoTrack&&(n.push(r.videoTrack),this.Qu=r.videoTrack)}this.stream=new MediaStream(n)}var o=this.checkPreview(this.stream);if(!o){var u={},a=rg(this.Nn,this.In);if(Bt(t.bitrate)||(u.bitRate=t.bitrate),Bt(t.minBitrate)||(u.minBitrate=t.minBitrate),Bt(t.startBitrate)||(u.startBitrate=t.startBitrate),u.audioBitrate=Lt(t.audioBitrate)?1e3*t.audioBitrate:1e3*(a.audioBitrate||48),"camera"===i){var c=this.Nn.settingConfig.getSetting("camera_audio_bitrate",!0),h=this.Nn.settingConfig.getSetting("camera_video_bitrate",!0);Lt(u.audioBitrate)&&Lt(c)&&(u.audioBitrate=1e3*c),Lt(u.bitRate)&&Lt(h)&&(u.bitRate=h)}u.channelCount=Bt(t.channelCount)?a.channelCount||1:t.channelCount,o=this.createZegoStreamPreview(this.stream,!1,void 0,u),this.stream=this.Lu.getStreamByCanvas(this.stream)}this.stream&&this.ia(this.stream,this.originVideoStream,this.originAudioStream,!0),o&&0===(null===(e=this.stream)||void 0===e?void 0:e.getAudioTracks().length)&&this.Lu.setEmptyAudioTrack(this.stream,o),this.Lu.initCopyMusic(this.stream),o.zegoCaptureStream=this,this.Zu=this.Yu,this.Fu=o},t.prototype.createZegoStreamPreview=function(t,i,e,n){var s=new zp(this.In,this.Nn,this.Ro,e,i);return this.Ro.previewStreamList.push(s),s.localStream=t,s.mediaStreamConfig={},n&&(s.videoInfo=Mp(Mp({},s.videoInfo),n),s.mediaStreamConfig.bitRate=n.bitRate),s.initMediaTrack(t),"screen"==e&&this.Lu.addShareScreenEnd(t),s},t.prototype.checkPreview=function(t){return this.Ro.checkPreview(t)},t.prototype.ia=function(t,i,e,n){if(void 0===n&&(n=!1),t){var s=this.checkPreview(t);if(s){var r=i&&this.checkPreview(i),o=e&&this.checkPreview(e),u={},a={},c=!1;if(s.previewType=(null==r?void 0:r.previewType)||(null==o?void 0:o.previewType),r){var h=r.videoInfo,f=r.mediaStreamConfig;s.previewType=r.previewType,s.videoPreviewType=r.videoPreviewType,s.previewSuc=!0,u=Mp({videoQuality:s.mediaStreamConfig.videoQuality,bitRate:s.mediaStreamConfig.bitRate},f),c=f.video;var l=Mp({},h);if(Lp(Lp([],Cp,!0),["audioBitrate"],!1).forEach((function(t){delete l[t]})),n){["bitRate","startBitrate","minBitRate"].forEach((function(t){delete l[t]}));var d=s.videoInfo.bitRate,v=s.hasUserSetBitrate;if(this.In.info("zcs.up ".concat(s.previewType," hasUserSetBitrate: ").concat(v,", bitrate: ")+d),r.mediaStreamConfig.videoQuality&&[1,2,3].includes(r.mediaStreamConfig.videoQuality)||!d||!v){var m=h.bitRate,p=this.Nn.settingConfig.getSetting("camera_video_bitrate",!0);Lt(m)&&Lt(p)&&(this.In.info("zcs.up ".concat(s.previewType," cloud videoBitrate ").concat(p)),m=p),this.In.info("zcs.up ".concat(s.previewType," videoBitrate changed ").concat(d," to ").concat(m)),l.bitRate=m}this.isPublish&&delete l.keyFrameInterval}a=Mp({},l)}if(o){h=o.videoInfo;var g=(f=o.mediaStreamConfig).audio,b=f.AEC,_=f.AGC,y=f.ANS,w=f.audioBitrate,S=f.channelCount,E=f.audioInput;s.audioPreviewType=o.audioPreviewType,s.previewSuc=!0,this.isPublish||(a.channelCount=h.channelCount);var O=s.videoInfo.audioBitrate;n&&O||(this.In.info("zcs.up ".concat(n," audioBitrate changed ").concat(O," to ").concat(h.audioBitrate)),a.audioBitrate=h.audioBitrate),u=Mp(Mp({},u),{audio:g,AEC:b,AGC:_,ANS:y,audioBitrate:w,channelCount:S,audioInput:E})}u.video=c,s.mediaStreamConfig=u,s.videoInfo=Mp(n?Mp({},s.videoInfo):{},a)}}},t.prototype._getVideoBitrate=function(t){return Lt(this.jr.videoBitrate)?Mp(Mp({},t),{bitrate:this.jr.videoBitrate}):Mp(Mp({},t),this.jr.videoBitrate)},t.prototype._getAudioBitrate=function(t){return t.audioBitrate=this.jr.audioBitrate,t},t.prototype._createStream=function(t,i,e,n,s){return xp(this,void 0,void 0,(function(){var r,o,u,a,c,h,f,l,d,v,m;return jp(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),r=e==gp.video||e==gp.videoAndAudio,o=e==gp.audio||e==gp.videoAndAudio,t=this._getVideoBitrate(t),t=this._getAudioBitrate(t),this.In.info("zcs.cs config:"+JSON.stringify(((v={})[i]=t,v))),[4,this.Lu.createStream((m={},m[i]=t,m))];case 1:return u=p.sent(),this.Yu=i,a=this.checkPreview(u),c=(null==a?void 0:a.originVideoTrack)||u.getVideoTracks()[0],h=(null==a?void 0:a.originAudioTrack)||u.getAudioTracks()[0],o&&r?(f=new MediaStream([c]),l=new MediaStream([h]),this.createZegoStreamPreview(f,!0,i),this.createZegoStreamPreview(l,!0,i),this.ia(f,u,null),this.ia(l,null,u),this.Uu.push(f),this.qu.push(l),this.ta(f,0),this.ta(l,1),!this.stream&&a?(this.stream=u,this.Xu=h,this.Qu=c,a.zegoCaptureStream=this,this.Fu=a):this.updateStreamVideoAndAudio(n,s,0)):r?(this.ta(u,0),this.Uu.push(u),this.stream?this.updateStreamVideoTrack(n,s,0):this.ea(t,i)):o&&(l=new MediaStream([h]),this.createZegoStreamPreview(l,!0,i),this.ia(l,null,u),this.ta(l,1),this.qu.push(l),this.qu.push(u),this.stream?this.updateStreamAudioTrack(n,s,0):this.ea(t,i)),this.isPublish||(this.autoPlay||this.Bu)&&this.autoPlay&&this.playVideo(),this.Ku(),n({errorCode:0,extendedData:""}),[3,3];case 2:return d=p.sent(),s({errorCode:d.errorCode||d.code,extendedData:d.extendedData||d.msg}),[3,3];case 3:return[2]}}))}))},t.prototype.startCaptureMicrophone=function(t){var i=this;return void 0===t&&(t={}),new Xt((function(e){return xp(i,void 0,void 0,(function(){var i,n,s,r,o,u,a,c;return jp(this,(function(h){switch(h.label){case 0:this.In.info("".concat(i="zcs.scm"," call ").concat(JSON.stringify(t))),h.label=1;case 1:return h.trys.push([1,3,,4]),n={},(null===(u=this.jr.camera)||void 0===u?void 0:u.audio)&&Jt(null===(a=this.jr.camera)||void 0===a?void 0:a.audio)&&(n=Mp({},Dl(null===(c=this.jr.camera)||void 0===c?void 0:c.audio))),s=this.na("microphone",i),n=Mp(Mp(Mp({},n),s),Dl(t)),r=Mp({audio:!0,video:!1,audioInput:n.input},n),[4,this._createStream(r,"camera",1,e,e)];case 2:return h.sent(),this.In.info("zcs.scm success"),[3,4];case 3:return o=h.sent(),e(o),this.In.info("zcs.scm fail"),[3,4];case 4:return[2]}}))}))}))},t.prototype.startCaptureCamera=function(t){var i=this;return void 0===t&&(t={}),new Xt((function(e){return xp(i,void 0,void 0,(function(){var i,n,s,r,o,u,a,c;return jp(this,(function(h){switch(h.label){case 0:this.In.info("".concat(i="zcs.scc"," call ").concat(JSON.stringify(t))),h.label=1;case 1:return h.trys.push([1,3,,4]),n={},(null===(u=this.jr.camera)||void 0===u?void 0:u.video)&&Jt(null===(a=this.jr.camera)||void 0===a?void 0:a.video)&&(n=Mp({},Dl(null===(c=this.jr.camera)||void 0===c?void 0:c.video))),s=this.na("camera",i),n=Mp(Mp(Mp({},n),s),Dl(t)),r=Mp({audio:!1,video:!0,videoInput:n.input,videoQuality:n.quality,videoOptimizationMode:n.optimizationMode},n),[4,this._createStream(r,"camera",0,e,e)];case 2:return h.sent(),this.In.info("zcs.scc success"),[3,4];case 3:return o=h.sent(),e(o),this.In.info("zcs.scc fail"),[3,4];case 4:return[2]}}))}))}))},t.prototype.startCaptureCameraAndMicrophone=function(t,i){var e=this;return void 0===t&&(t={}),void 0===i&&(i={}),new Xt((function(n){return xp(e,void 0,void 0,(function(){var e,s,r,o,u,a,c,h,f,l,d,v,m;return jp(this,(function(p){switch(p.label){case 0:this.In.info("".concat(e="zcs.sccm"," call c:").concat(JSON.stringify(t),", m:").concat(JSON.stringify(i))),p.label=1;case 1:return p.trys.push([1,3,,4]),s={},(null===(h=this.jr.camera)||void 0===h?void 0:h.video)&&Jt(null===(f=this.jr.camera)||void 0===f?void 0:f.video)&&(s=Mp({},Dl(null===(l=this.jr.camera)||void 0===l?void 0:l.video))),r=this.na("camera",e),s=Mp(Mp(Mp({},s),r),Dl(t)),o={},(null===(d=this.jr.camera)||void 0===d?void 0:d.audio)&&Jt(null===(v=this.jr.camera)||void 0===v?void 0:v.audio)&&(o=Mp({},Dl(null===(m=this.jr.camera)||void 0===m?void 0:m.audio))),u=this.na("microphone",e),o=Mp(Mp(Mp({},o),u),Dl(i)),a=Mp(Mp(Mp({audio:!0,video:!0,videoInput:null==s?void 0:s.input,videoQuality:null==s?void 0:s.quality,videoOptimizationMode:null==s?void 0:s.optimizationMode},s),{audioInput:null==o?void 0:o.input}),o),[4,this._createStream(a,"camera",2,n,n)];case 2:return p.sent(),this.In.info("zcs.sccm success"),[3,4];case 3:return c=p.sent(),n(c),this.In.info("zcs.sccm fail"),[3,4];case 4:return[2]}}))}))}))},t.prototype.autoCapture=function(){var t=this;return new Xt((function(i,e){return xp(t,void 0,void 0,(function(){var t,n,s,r,o,u,a,c,h,f,l,d;return jp(this,(function(v){switch(v.label){case 0:this.In.info("zcs.ac call"),v.label=1;case 1:return v.trys.push([1,23,,24]),r=(n=this.jr).custom,o=n.screen,(s=n.camera)?(this.In.info("zcs.ac camera:".concat(JSON.stringify(s))),l=s.video,(f=s.audio)&&l?(u=Jt(l)?l:void 0,a=Jt(f)?f:void 0,[4,this.startCaptureCameraAndMicrophone(u,a)]):[3,3]):[3,8];case 2:return t=v.sent(),[3,7];case 3:return f?[4,this.$u(f,this.startCaptureMicrophone)]:[3,5];case 4:return t=v.sent(),[3,7];case 5:return l?[4,this.$u(l,this.startCaptureCamera)]:[3,7];case 6:t=v.sent(),v.label=7;case 7:return[3,22];case 8:return o?(this.In.info("zcs.ac screen:".concat(JSON.stringify(o))),l=o.video,(f=o.audio)?(c=l,h=f,Ut(l)&&(c={}),Ut(f)&&(h={}),[4,this.startCaptureScreenWithAudio(c,h)]):[3,10]):[3,13];case 9:return t=v.sent(),[3,12];case 10:return[4,this.$u(l,this.startCaptureScreen)];case 11:t=v.sent(),v.label=12;case 12:return[3,22];case 13:return r?(this.In.info("zcs.ac custom:".concat(JSON.stringify(r))),l=r.video,(f=r.audio)&&l&&f.source===l.source?[4,this.startCaptureCustomVideoAndAudio(l,f)]:[3,15]):[3,20];case 14:return t=v.sent(),[3,19];case 15:return f?[4,this.$u(f,this.startCaptureCustomAudio)]:[3,17];case 16:t=v.sent(),v.label=17;case 17:return l?[4,this.$u(l,this.startCaptureCustomVideo)]:[3,19];case 18:t=v.sent(),v.label=19;case 19:return[3,22];case 20:return[4,this.startCaptureCameraAndMicrophone({},{})];case 21:t=v.sent(),v.label=22;case 22:return t||e({errorCode:$i.code,extendedData:$i.message}),0!==(null==t?void 0:t.errorCode)?e(t):i(t),[3,24];case 23:return d=v.sent(),e(d),[3,24];case 24:return[2]}}))}))}))},t.prototype.startCaptureCustomAudio=function(t){var i=this;return new Xt((function(e){return xp(i,void 0,void 0,(function(){var i,n,s,r,o;return jp(this,(function(u){switch(u.label){case 0:if(this.In.info("".concat(i="zcs.scca"," call ").concat(JSON.stringify(t))),(n=this.sa(t)).errorCode)return e(n),[2];u.label=1;case 1:return u.trys.push([1,3,,4]),s=this.na("customAudio",i),[4,this._createStream(Mp(Mp(Mp(Mp({},Dl(null===(o=this.jr.custom)||void 0===o?void 0:o.audio)),s),Dl(t)),{audio:!0}),"custom",1,e,e)];case 2:return u.sent(),this.In.info("".concat(i," success")),[3,4];case 3:return r=u.sent(),e(r),this.In.info("".concat(i," fail")),[3,4];case 4:return[2]}}))}))}))},t.prototype.startCaptureCustomVideo=function(t){var i=this;return new Xt((function(e){return xp(i,void 0,void 0,(function(){var i,n,s,r,o,u;return jp(this,(function(a){switch(a.label){case 0:if(this.In.info("".concat(i="zcs.sccv"," call ").concat(JSON.stringify(t))),(n=this.sa(t)).errorCode)return e(n),[2];a.label=1;case 1:return a.trys.push([1,3,,4]),s=this.na("customVideo",i),r=Object.assign({},Dl(null===(u=this.jr.custom)||void 0===u?void 0:u.video),s,Dl(t)),[4,this._createStream(Mp({videoOptimizationMode:r.optimizationMode},r),"custom",0,e,e)];case 2:return a.sent(),this.In.info("".concat(i," success")),[3,4];case 3:return o=a.sent(),e(o),this.In.info("".concat(i," fail")),[3,4];case 4:return[2]}}))}))}))},t.prototype.startCaptureCustomVideoAndAudio=function(t,i){var e=this;return new Xt((function(n){return xp(e,void 0,void 0,(function(){var e,s,r,o,u,a,c,h,f,l,d,v,m,p,g;return jp(this,(function(b){switch(b.label){case 0:if(this.In.info("".concat(e="zcs.sccva"," call v:").concat(JSON.stringify(t)," a:").concat(JSON.stringify(i))),(s=this.sa(t)).errorCode)return n(s),[2];if((r=this.sa(i)).errorCode)return n(r),[2];b.label=1;case 1:return b.trys.push([1,7,,8]),o=this.na("customAudio",e),u=this.na("customVideo",e),t.source!=i.source?[3,3]:[4,this._createStream(Mp(Mp(Mp(Mp(Mp(Mp(Mp({videoOptimizationMode:t.optimizationMode||u.optimizationMode||(null===(f=null===(h=this.jr.custom)||void 0===h?void 0:h.video)||void 0===f?void 0:f.optimizationMode)},Dl(null===(l=this.jr.custom)||void 0===l?void 0:l.video)),Dl(null===(d=this.jr.custom)||void 0===d?void 0:d.audio)),u),o),Dl(t)),Dl(i)),{audio:!0}),"custom",2,n,n)];case 2:return b.sent(),[3,6];case 3:return a={video:!1,audio:!1},[4,this._createStream(Mp(Mp(Mp(Mp({videoOptimizationMode:t.optimizationMode||u.optimizationMode||(null===(m=null===(v=this.jr.custom)||void 0===v?void 0:v.video)||void 0===m?void 0:m.optimizationMode)},null===(p=this.jr.custom)||void 0===p?void 0:p.video),u),t),{video:!0}),"custom",0,(function(t){a.video=!0,a.audio&&n(t)}),n)];case 4:return b.sent(),[4,this._createStream(Mp(Mp(Mp(Mp({},null===(g=this.jr.custom)||void 0===g?void 0:g.audio),o),i),{audio:!0}),"custom",1,(function(t){a.audio=!0,a.video&&n(t)}),n)];case 5:b.sent(),b.label=6;case 6:return this.In.info("zcs.sccva success"),[3,8];case 7:return c=b.sent(),n(c),this.In.info("zcs.sccva fail"),[3,8];case 8:return[2]}}))}))}))},t.prototype.startCaptureScreen=function(t){var i=this;return void 0===t&&(t={}),new Xt((function(e,n){return xp(i,void 0,void 0,(function(){var i,n,s,r,o,u,a,c;return jp(this,(function(h){switch(h.label){case 0:this.In.info("".concat(i="zcs.scs"," call ").concat(JSON.stringify(t))),h.label=1;case 1:return h.trys.push([1,3,,4]),n={},(null===(u=this.jr.screen)||void 0===u?void 0:u.video)&&Jt(null===(a=this.jr.screen)||void 0===a?void 0:a.video)&&(n=Mp({},Dl(null===(c=this.jr.screen)||void 0===c?void 0:c.video))),s=this.na("screenVideo",i),n=Mp(Mp(Mp({},n),s),Dl(t)),r=Mp(Mp({videoOptimizationMode:n.optimizationMode,videoQuality:n.quality},n),{audio:!1}),[4,this._createStream(r,"screen",0,e,e)];case 2:return h.sent(),this.In.info("".concat(i," success")),[3,4];case 3:return o=h.sent(),e(o),this.In.info("".concat(i," fail")),[3,4];case 4:return[2]}}))}))}))},t.prototype.startCaptureScreenWithAudio=function(t,i){var e=this;return void 0===t&&(t={}),void 0===i&&(i={}),new Xt((function(n,s){return xp(e,void 0,void 0,(function(){var e,s,r,o,u,a,c,h,f,l,d,v,m;return jp(this,(function(p){switch(p.label){case 0:this.In.info("".concat(e="zcs.scs"," call v:").concat(JSON.stringify(t)," a:").concat(JSON.stringify(i))),p.label=1;case 1:return p.trys.push([1,3,,4]),s={},(null===(h=this.jr.screen)||void 0===h?void 0:h.video)&&Jt(null===(f=this.jr.screen)||void 0===f?void 0:f.video)&&(s=Mp({},Dl(null===(l=this.jr.screen)||void 0===l?void 0:l.video))),r=this.na("screenVideo",e),s=Mp(Mp(Mp({},s),r),Dl(t)),o={},(null===(d=this.jr.screen)||void 0===d?void 0:d.audio)&&Jt(null===(v=this.jr.screen)||void 0===v?void 0:v.audio)&&(o=Mp({},Dl(null===(m=this.jr.screen)||void 0===m?void 0:m.audio))),u=this.na("screenAudio",e),o=Mp(Mp(Mp({},o),u),Dl(i)),a=Mp(Mp(Mp({videoOptimizationMode:s.optimizationMode,videoQuality:s.quality},s),o),{audio:!0}),[4,this._createStream(a,"screen",2,n,n)];case 2:return p.sent(),this.In.info("zcs.scs success"),[3,4];case 3:return c=p.sent(),n(c),this.In.info("zcs.scs fail"),[3,4];case 4:return[2]}}))}))}))},t.prototype.stopCaptureAudio=function(){var t=this;return new Xt((function(i){var e,n,s=!0;if(t.originAudioStream){t.In.info("zcs.sca call stop capture");var r=t.originAudioStream.getAudioTracks()[0];(null===(e=t.stream)||void 0===e?void 0:e.getAudioTracks()[0])&&t.isPublish&&t.stream&&(t.In.info("zcs.sca stop audio"),s="camera"===(null===(n=t.Fu)||void 0===n?void 0:n.audioPreviewType)?t.Fu.enableMicrophoneOnly(!1):t.Wu.enableMicrophone(t.stream,!0),t.Fu&&(t.Fu.syncAudioEnabled=!1)),t.In.info("zcs.sca stop result:"+s),s&&(r.stop(),t.originAudioStream=null,t.stopPlayCaptureAudio(),t.Ku())}i(s)}))},t.prototype.stopCaptureVideo=function(){var t;return xp(this,void 0,void 0,(function(){var i,e,n,s,r=this;return jp(this,(function(o){switch(o.label){case 0:if(i=!0,this.In.info("zcs.scv call stop capture"),!this.originVideoStream)return[3,7];e=this.originVideoStream.getVideoTracks()[0],n=null===(t=this.stream)||void 0===t?void 0:t.getVideoTracks()[0],o.label=1;case 1:return o.trys.push([1,6,,7]),n?this.Fu?(this.In.info("zcs.scv stop stream video"),"camera"!=this.Fu.videoPreviewType?[3,3]:[4,this.Wu.enableCameraCapturing(this.Fu,!1)]):[3,5]:[3,5];case 2:return i=o.sent(),[3,5];case 3:return[4,this.Fu.stopCaptureVideo()];case 4:o.sent(),i=!0,o.label=5;case 5:return this.In.info("zcs.scv stop result:"+i),i&&(this.Ro.trackUtils.stopTrack(e),this.originVideoStream=null,this.stopPlayCaptureVideo(),this.Uu.forEach((function(t){return r.Lu.destroyStream(t)})),this.Uu=[],this.Ku()),[3,7];case 6:return s=o.sent(),this.In.error("zcs.scv "+JSON.stringify(s)),i=!1,[3,7];case 7:return[2,i]}}))}))},t.prototype.ra=function(t,i){void 0===i&&(i=!1);var e=t&&this.checkPreview(t);if(!e)throw new Error("The stream does not exist, you must first capture the stream");return i&&e?new Em(t,e,{clearLastFrame:this.Nn.engineConfig.previewClearLastFrame}):(null==e?void 0:e.getViewer())||null},t.prototype.oa=function(){var t,i,e;this.Gu=this.ra(this.stream),null===(t=this.Gu)||void 0===t||t.on("canPlayAudio",this.Fo.canPlayAudio),null===(i=this.Gu)||void 0===i||i.on("canPlayVideo",this.Fo.canPlayVideo),null===(e=this.Gu)||void 0===e||e.on("autoplayFailed",this.Fo.autoplayFailed)},t.prototype.playAudio=function(t){var i;if(this.In.info("zcs.pa call"),!this.stream)return this.In.warn("zcs.pa You need to capture the audio stream first");this.Gu||this.oa(),null===(i=this.Gu)||void 0===i||i.playAudio(t,!0),this.audioMuted=!1},t.prototype.playCaptureAudio=function(t){var i,e,n;if(this.In.info("zcs.pca call"),!this.originAudioStream)return this.In.warn("zcs.pca You need to capture the audio stream first");this.Vu||(this.Vu=this.ra(this.originAudioStream),null===(i=this.Vu)||void 0===i||i.on("canPlayAudio",this.Fo.canPlayCaptureAudio),null===(e=this.Vu)||void 0===e||e.on("autoplayFailed",this.Fo.autoplayCaptureFailed)),this.audioCaptureMuted=!1,null===(n=this.Vu)||void 0===n||n.playAudio(t,!0)},t.prototype.playVideo=function(t,i){var e;if(this.In.info("zcs.pv call"),this.stream){if(this.Gu&&this.Gu.inited||(this.oa(),null===(e=this.Gu)||void 0===e||e.setAudioMuted(this.audioMuted)),this.Gu){var n=t||this.view;n&&Zt(n)?(this.Gu.playVideo(n,i),this.Bu=!0):this.In.error("zcs.pv Execute `playVideo` failed, container not exist")}}else this.In.warn("zcs.pv You need to capture the video stream first")},t.prototype.playCaptureVideo=function(t,i){this.In.info("zcs.pcv call");var e=this.Hu[0]||null;if(this.originVideoStream){if(!e||this.jr.multiplacePreview){if(!(e=this.ra(this.originVideoStream,e&&this.jr.multiplacePreview)))return;e.on("canPlayVideo",this.Fo.canPlayCaptureVideo),e.on("autoplayFailed",this.Fo.autoplayCaptureFailed),this.Hu.push(e)}var n=t||this.jr.captureView;n&&Zt(n)?(e.playVideo(n,i),this.Ju=!0):this.In.error("zcs.pcv Execute `playVideo` failed, container not exist")}else this.In.warn("zcs.pv You need to capture the video stream first")},t.prototype.updatePlayVideo=function(){this.Gu&&this.stream?this.Gu.setVideo(this.stream.getVideoTracks()[0]):this.autoPlay&&this.playVideo()},t.prototype.updatePlayAudio=function(){this.Gu&&this.stream&&this.Gu.setAudio(this.stream.getAudioTracks()[0])},t.prototype.takeStreamSnapshot=function(t){var i;return(null===(i=this.Gu)||void 0===i?void 0:i.takeStreamSnapshot(t))||""},t.prototype.resumeVideo=function(){var t;return null===(t=this.Gu)||void 0===t?void 0:t.resume(!0,["video"])},t.prototype.resumeAudio=function(){var t;return null===(t=this.Gu)||void 0===t?void 0:t.resume(!0,["audio"])},t.prototype.stopVideo=function(){var t;null===(t=this.Gu)||void 0===t||t.stopVideo(),this.Bu=!1},t.prototype.stopAudio=function(){this.Gu&&(this.Gu.stopAudio(),this.audioMuted=!0)},t.prototype.stopPlayCaptureVideo=function(){this.Hu.forEach((function(t){t.stopVideo(),t.destroy()})),this.Hu=[],this.Ju=!1},t.prototype.stopPlayCaptureAudio=function(){this.Vu&&(this.Vu.destroy(),this.Vu=null,this.audioCaptureMuted=!0)},t.prototype.setVolume=function(t){return!!this.Gu&&this.Gu.setVolume(t)},t.prototype.setAudioOutputDevice=function(t){if(this.Gu)return this.Gu.useAudioOut(t)},t.prototype._destroyCacheStream=function(t){var i=this;return t.filter((function(t){return!!t.active||(i.Lu.destroyStream(t),!1)}))},t.prototype.Ku=function(){this.qu=this._destroyCacheStream(this.qu),this.Uu=this._destroyCacheStream(this.Uu)},t.prototype.na=function(t,i){var e=this.stream&&this.checkPreview(this.stream);if(!this.stream||!e)return this.In.info("".concat(i," stream:").concat(!this.stream,", previewer:").concat(!e)),{};var n={},s=e.mediaStreamConfig,r=e.videoPreviewType,o=e.audioPreviewType;if(s){switch(t){case"camera":if("camera"===r){var u=s.quality;n={input:s.videoInput,quality:s.videoQuality||u,facingMode:s.facingMode,width:s.width,height:s.height,frameRate:s.frameRate,optimizationMode:s.optimizationMode,keyFrameInterval:s.keyFrameInterval}}break;case"microphone":if("camera"===o)n={ANS:s.ANS,AGC:s.AGC,AEC:s.AEC,channelCount:s.channelCount};break;case"customVideo":"custom"===r&&(n={optimizationMode:s.optimizationMode,keyFrameInterval:s.keyFrameInterval});break;case"customAudio":"custom"===o&&(n={channelCount:s.channelCount});break;case"screenVideo":if("screen"===r){var a=null==e?void 0:e.mediaStreamConfig;u=a.quality;n={quality:a.videoQuality||u,width:a.width,height:a.height,frameRate:a.frameRate,sourceID:a.sourceID,optimizationMode:a.optimizationMode,keyFrameInterval:a.keyFrameInterval,captureElement:a.captureElement}}break;case"screenAudio":if("screen"===o){var c=null==e?void 0:e.mediaStreamConfig;n={ANS:c.ANS,AGC:c.AGC,AEC:c.AEC}}}n=n&&Dl(n)}return n},t.prototype.sa=function(t){return(null==t?void 0:t.source)&&(Qt(null==t?void 0:t.source)||Yt(null==t?void 0:t.source))?{errorCode:0,extendedData:""}:{errorCode:Hi.code,extendedData:Hi.message+" source not exist or error"}},t.prototype.destroy=function(){var t,i=this;this.originAudioStream&&(this.originAudioStream=null),this.originVideoStream&&(this.originVideoStream=null),this.stream&&(this.Lu.destroyStream(this.stream),this.stream=null),this.qu.forEach((function(t){return i.Lu.destroyStream(t)})),this.Uu.forEach((function(t){return i.Lu.destroyStream(t)})),this.qu=[],this.Uu=[],this.stopPlayCaptureVideo(),this.stopPlayCaptureAudio(),this.stopVideo(),this.stopAudio(),null===(t=this.Gu)||void 0===t||t.destroy(),this.Gu=null,this.Go=new hm},t}(),Up="zsc.rd.qd",Bp=function(){function t(t,i,e){this.In=t,this.Nn=i,this.Ro=e,this.ua=2e3,this.lastRecordDeviceTime=0}return t.prototype.getDetectionStreams=function(){var t=[];return this.Ro.previewStreamList.forEach((function(i){i.localStream&&t.push(i.localStream)})),t},t.prototype.aa=function(t){this.In.warn(Up+" DeviceError: ".concat(ye," ").concat(we)),this.Nn.actionListener("_deviceError",ye,t,"micro"),this.Nn.actionListener("deviceError",ye,t)},t.prototype.ca=function(t){if(this.In.info(Up+" get name of device id: ".concat(JSON.stringify(t))),!t.deviceID&&!this.ha&&""==t.trackLabel)return"unknown";if(!t.deviceID||"default"===t.deviceID)return t.trackLabel;for(var i in this.ha){var e=this.ha[i];if(e)for(var n=0,s=e;n<s.length;n++){var r=s[n];if(r.deviceID===t.deviceID)return r.deviceName}}return t.trackLabel},t.prototype.fa=function(t){this.In.warn(Up+" DeviceError: ".concat(Se," ").concat(Ee)),this.Nn.actionListener("_deviceError",Se,t,"camera"),this.Nn.actionListener("deviceError",Se,t)},t.prototype.la=function(t){this.ha=t},t.prototype.da=function(t){return{trackID:t.id,trackLabel:t.label,readyState:t.readyState,deviceID:t.getSettings().deviceId}},t.prototype.va=function(t,i){return-1!==t.findIndex((function(t){return t.deviceName==i.deviceName&&t.preview==t.preview}))},t.prototype.ma=function(t,i){if(t.audioTrack){var e=this.da(t.audioTrack),n=performance.now()-t.lastTrackEndTime.audio;if("ended"==e.readyState&&n<this.ua){this.In.warn(Up+" mic device may loose.");var s={deviceName:this.ca(e),preview:t};this.va(i,s)||i.push(s)}}},t.prototype.pa=function(t,i){if(t.videoTrack){var e=this.da(t.videoTrack),n=performance.now()-t.lastTrackEndTime.video;if("ended"==e.readyState&&n<this.ua){this.In.warn(Up+" camera device may loose.");var s={deviceName:this.ca(e),preview:t};this.va(i,s)||i.push(s)}}},t.prototype.ga=function(t,i,e){var n=this.Ro.getPreviewer(t);n&&(this.ma(n,i),this.pa(n,e))},t.prototype.isRecordQuickly=function(){return performance.now()-this.lastRecordDeviceTime<this.ua},t.prototype.onDeviceNoChangeQuickly=function(t){var i=this;if(this.isRecordQuickly())this.In.info(Up+" device no change because record device quickly");else{this.In.info(Up+" device no change quickly"),this.la(t);var e=[],n=[];this.getDetectionStreams().forEach((function(t){i.ga(t,e,n)})),e.forEach((function(t){i.aa(t.deviceName),t.preview.updatePublisherStreamMicStatus(!1,2)})),n.forEach((function(t){i.fa(t.deviceName),t.preview.updatePublisherStreamCameraStatus(!1,2)}))}},t}(),Jp=function(){return Jp=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Jp.apply(this,arguments)},Vp=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Hp=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Gp=function(){function t(t,i,e){this.In=t,this.Ro=i,this.Nn=e}return Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),t.prototype.ba=function(t,i,e,n,s){return Vp(this,void 0,void 0,(function(){var r,o,u,a,c,h,f,l,d,v,m,p,g=this;return Hp(this,(function(b){switch(b.label){case 0:return r=this.Ro.checkPreview(i),o="audio"===t,r?!!r.zegoCaptureStream&&"video"===t&&"camera"!==r.previewType?(this.In.error("zsc.sd.0 stream type cannot set device"),n&&n({errorCode:Yi.code,extendedData:Yi.message}),[2]):"video"===t&&0==r.mediaStreamConfig.video?(this.In.error("zsc.sd.0 camera can not be changed when video is false"),n&&n({errorCode:Be.code,extendedData:Be.message}),[2]):o&&0==r.mediaStreamConfig.audio?(this.In.error("zsc.sd.0 microphone can not be changed when audio is false"),n&&n({errorCode:Je.code,extendedData:Je.message}),[2]):("recapture"===e&&(r.mediaStreamConfig.facingMode?((s=s||{}).facingMode=(null==s?void 0:s.facingMode)||r.mediaStreamConfig.facingMode,e=""):e=(o?r.mediaStreamConfig.audioInput:r.mediaStreamConfig.videoInput)||""),e&&delete r.mediaStreamConfig.facingMode,u={},"video"===t?((null==s?void 0:s.facingMode)?u.facingMode=s.facingMode:e&&(u.videoInput=e),a=r.videoTrack):(u.audio=!0,u.audioInput=e,a=r.audioTrack),c=eh(),h=nh()&&th().indexOf("HuaweiBrowser")>-1,this.Nn.engineConfig.stopTrackWhenSwitchDevice||(null==s?void 0:s.stopTrack)||uh()||hh()&&c&&th().indexOf("Oriole 64-bit")>-1||h?(this.In.info("zsc.sd.0 stop "),this.Ro.trackUtils.stopTrack(a),c&&uh()?[4,new Promise((function(t){setTimeout((function(){t(void 0)}),100)}))]:[3,2]):[3,2]):(this.In.error("zsc.sd.0 preview no found"),n&&n({errorCode:Xi.code,extendedData:Xi.message}),[2]);case 1:b.sent(),b.label=2;case 2:return f=Jp(Jp({},r.mediaStreamConfig),u),o&&"default"===e&&(this.In.warn("zsc.sd.0 stop preview audio track"),r.audioTrack&&r.audioTrack.stop()),l=r.getMediaStreamConstraints(f).mediaStreamConstraints,d=function(e,n){n.getTracks().forEach((function(e){if(e.kind===t){var n="video"===t,s=n?"videoTrack":"audioTrack",o=r[s];n&&r.streamFromCanvas&&r.stopCanvasStreamTrack(),o&&(e.enabled=o.enabled),n&&r.lowStream&&r.lowStream.getTracks().forEach((function(t){g.Ro.trackUtils.stopTrack(t)}));var u=g.Ro.getPublishList(i);u.length>0&&(!r.muteImage||e.enabled||!n)?u.map((function(t){return t.publisher})).forEach((function(t){t.replacePublishedTrack(e,!1,{isCamera:!0})})):r&&r.muteImage&&!e.enabled&&n?r[s]=e:r&&r.replacePreviewTrack(e,!1,{isCamera:!0}),g.Ro.trackUtils.stopTrack(o),r.updateZegoStreamCaptureTrack(e)}})),r.restartSoundLevel()},o?l.video=!1:l.audio=!1,this.In.info("zsc.sd.0 mediaStreamConstraints "+JSON.stringify(l)),v=Be,"audio"===t&&(v=Je),m=function(t){for(var i=0,e=t.getTracks();i<e.length;i++){if("ended"==e[i].readyState)return!0}return!1},p=function(i){g.Ro.trackUtils.stopTrack("video"==t?r.videoTrack:r.audioTrack),g.In.warn("zsc.sd.0 switch "+t+" device failed, stop last device and retry. "+i.toString());navigator.mediaDevices.getUserMedia(l).then((function(i){Object.assign(r.mediaStreamConfig,u),d(0,i),g.In.info("zsc.sd.0 swtich "+t+" device success"),n&&n({errorCode:0,extendedData:""})}),(function(i){g.In.warn("zsc.sd.0 swtich "+t+" device failed and recover last device. "+i.toString());var e=r.getMediaStreamConstraints(r.mediaStreamConfig).mediaStreamConstraints;o?e.video=!1:e.audio=!1;navigator.mediaDevices.getUserMedia(e).then((function(e){d(0,e),g.In.info("zsc.sd.0 recover last "+t+" device success"),n&&n({errorCode:v.code,extendedData:v.message+" "+JSON.stringify(i)})}),(function(i){g.In.error("zsc.sd.0 swtich "+t+" device and recover failed, please recreate stream. "+i.toString()),n&&n({errorCode:v.code,extendedData:v.message+" "+JSON.stringify(i)})}))}))},navigator.mediaDevices.getUserMedia(l).then((function(i){m(i)&&g.In.error("zsc.sd.0 switch"+t+" device fail, has track ended."),Object.assign(r.mediaStreamConfig,u),d(0,i),g.In.info("zsc.sd.0 switch "+t+" device success"),n&&n({errorCode:0,extendedData:""})}),p),[2]}}))}))},t.prototype.setPublishStreamVideoConstraints=function(t,i,e,n){var s,r,o,u,a,c,h,f,l,d,v,m,p;return Vp(this,void 0,void 0,(function(){var g,b,_,y,w,S,E,O,T,k,R,I,N,C,z,D,P,A,M,x,j,L,q,U,B=this;return Hp(this,(function(J){switch(J.label){case 0:if(this.In.info((g="zsc.spsc.0 video")+" constraints "+JSON.stringify(i)),!(b=this.Ro.checkPreview(t)))return this.In.error(g+" preview no found"),n&&n({errorCode:Xi.code,extendedData:Xi.message}),[2];if(!(_=b.videoTrack))return this.In.error(g+" video track not found"),n&&n({errorCode:je,extendedData:Le}),[2];if(y=b.videoPreviewType||b.previewType,i.video=b.mediaStreamConfig.video,i.videoQuality||(i.videoQuality=4,i.quality=4),i=Dl(i),w=null==_?void 0:_.getSettings(),S=JSON.parse(JSON.stringify(b.mediaStreamConfig)),E={},[1,2,3].includes(S.videoQuality)&&("screen"===y?((null==(O=this.Ro.getScreenConstrains(S))?void 0:O.video)&&(E.frameRate=null===(s=O.video)||void 0===s?void 0:s.frameRate),(null==O?void 0:O.bitRate)&&(E.bitRate=null==O?void 0:O.bitRate)):(null==(O=b.getMediaStreamConstraints(S,!0).mediaStreamConstraints)?void 0:O.video)&&(E={width:(T=null==O?void 0:O.video).width,height:T.height,frameRate:T.frameRate,bitRate:T.bitRate})),k=Object.assign(b.mediaStreamConfig,E,i),i.maxBitrate&&(k.bitRate=i.maxBitrate),I=!1,"screen"==y?(R=this.Ro.getScreenConstrains(k)).bitRate!==S.bitRate&&(i.maxBitrate=R.bitRate):(N=b.getMediaStreamConstraints(k,!0).mediaStreamConstraints,b.videoInfo.width===(null===(r=(R=N).video)||void 0===r?void 0:r.width)&&b.videoInfo.height===(null===(o=R.video)||void 0===o?void 0:o.height)||(this.In.info(g+" resolution change "),I=!0),w.width===(null===(u=R.video)||void 0===u?void 0:u.width)&&w.height===(null===(a=R.video)||void 0===a?void 0:a.height)||(this.In.info(g+" resolution diff with track settings"),I=!0)),this.In.info(g+" applyConstraints "+JSON.stringify(R.video)),C={},Object.keys(R.video).forEach((function(t){C[t]=JSON.stringify(R.video[t])})),e.setAttributes({video_conf:Cr.video_conf(C)}),z=this.Ro.getPublishList(t),D=b.videoInfo.frameRate!==(null===(c=R.video)||void 0===c?void 0:c.frameRate)||w.frameRate!==(null===(h=R.video)||void 0===h?void 0:h.frameRate),P=I||D,!(y&&["camera","screen"].includes(y)&&P))return[3,5];J.label=1;case 1:return J.trys.push([1,3,,4]),this.In.info(g+" track change "),[4,_.applyConstraints(Jp(Jp({},R.video),{deviceId:void 0}))];case 2:return J.sent(),[3,4];case 3:return A=J.sent(),n&&n({errorCode:Ue,extendedData:"".concat(A.name," ").concat(A.constraint?"constraint:"+A.constraint:"")}),[2];case 4:(M=this.Ro.getPreviewer(t))&&R.video instanceof Object&&M.setVideoInfo({width:(x=R.video).width,height:x.height,frameRate:x.frameRate}),I&&"safari"===this.Nn.browser&&(null===(f=b.videoNodeQueue)||void 0===f||f.replaceNewSourceByTrack(_,void 0,{handleTrackType:ut.changeResolution})),z.forEach((function(t){var i,e,n=null===(e=null===(i=t.localStream)||void 0===i?void 0:i.getVideoTracks()[0])||void 0===e?void 0:e.getSettings();(null==w?void 0:w.width)===(null==n?void 0:n.width)&&(null==w?void 0:w.height)===(null==n?void 0:n.height)||B.enVideoSpan(t.streamID,Dr,{w:Pr(null==n?void 0:n.width),h:Ar(null==n?void 0:n.height)}),(null==w?void 0:w.frameRate)!==(null==n?void 0:n.frameRate)&&B.enVideoSpan(t.streamID,jr,{fps:Lr(null==n?void 0:n.frameRate)})})),J.label=5;case 5:if(j=[1,2,3].includes(i.videoQuality)?(null===(l=R.video)||void 0===l?void 0:l.maxBitrate)||(null===(d=R.video)||void 0===d?void 0:d.bitRate):i.maxBitrate||(null===(v=R.video)||void 0===v?void 0:v.maxBitrate)||(null===(m=R.video)||void 0===m?void 0:m.bitRate),!1,!(Lt(j)&&j>0))return[3,9];if(L=b.videoInfo.bitRate!==j,b.setVideoInfo({bitRate:j}),!L)return[3,9];q=0,J.label=6;case 6:return q<z.length?(U=null===(p=z[q])||void 0===p?void 0:p.publisher)?[4,U.setBitrate(j)]:[3,8]:[3,9];case 7:J.sent(),this.enVideoSpan(U.streamId,Mr,{bitrate:xr(1e3*j)}),J.label=8;case 8:return q++,[3,6];case 9:return this.In.info(g+" set constraints success "),n&&n({errorCode:0,extendedData:""}),[2]}}))}))},t.prototype.setPublishStreamAudioConstraints=function(t,i,e,n){return Vp(this,void 0,void 0,(function(){var s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S=this;return Hp(this,(function(E){switch(E.label){case 0:if(this.In.info((s="zsc.spsc.0 audio")+" constraints "+JSON.stringify(i)),!(r=this.Ro.checkPreview(t)))return this.In.error(s+" preview no found"),n&&n({errorCode:Xi.code,extendedData:Xi.message}),[2];if(!(o=r.audioTrack)||r.hasEmptyAudioTrack)return this.In.error(s+" audio track not found"),n&&n({errorCode:je,extendedData:Le}),[2];i.audio=r.mediaStreamConfig.audio,i=Dl(i),u=r.audioPreviewType||r.previewType,a=JSON.parse(JSON.stringify(r.mediaStreamConfig)),c=Object.assign(r.mediaStreamConfig,i),"screen"==u?h=this.Ro.getScreenConstrains(c):(f=r.getMediaStreamConstraints(c,!0).mediaStreamConstraints,h=f),this.In.info(s+" applyConstraints "+JSON.stringify(h)),l=!0,l=(null==o?void 0:o.enabled)||!1,e.setAttributes({audio_conf:zr.audio_conf(h.audio)}),this.Ro.trackUtils.stopTrack(o),E.label=1;case 1:return E.trys.push([1,3,,5]),[4,navigator.mediaDevices.getUserMedia({video:!1,audio:h.audio})];case 2:return d=E.sent(),y=d.getVideoTracks()[0],this.Ro.trackUtils.stopTrack(y),(v=d.getAudioTracks()[0]).enabled=l,m=JSON.stringify(v.getSettings()),r.replacePreviewTrack(v),r.updateZegoStreamCaptureTrack(v),p=v,r.insertableaudio&&r.localStream&&(p=r.localStream.getAudioTracks()[0]),r.destNode||r.onAudioTrackChange(p),this.In.info(s+" set constraints success "+m),n&&n({errorCode:0,extendedData:""}),[3,5];case 3:return g=E.sent(),b=r.getMediaStreamConstraints(a).mediaStreamConstraints,this.In.info(s+" oldMediaStreamConstraints "+JSON.stringify(b)),[4,navigator.mediaDevices.getUserMedia({video:!1,audio:b.audio}).catch((function(t){S.In.error(s+".1 setbackup fail "+t.name)}))];case 4:return(_=E.sent())&&(_.getTracks().forEach((function(t){jo(t,S.In,s+".1")})),y=t.getVideoTracks()[0],this.Ro.trackUtils.stopTrack(y),w=_.getAudioTracks()[0],r.replacePreviewTrack(w),r.updateZegoStreamCaptureTrack(w),r.destNode||r.onAudioTrackChange(w)),this.In.info(s+".1 setbackup suc "),n&&n({errorCode:Ue,extendedData:"".concat(g.name," ").concat(g.constraint?"constraint:"+g.constraint:"")}),[3,5];case 5:return[2]}}))}))},t.prototype.handleTrack=function(t,i,e,n,s){var r,o,u,a;return Vp(this,void 0,void 0,(function(){var c,h,f,l,d,v,m,p,g,b,_,y,w,S,E,O,T,k,R,I,N,C,z,D,P=this;return Hp(this,(function(A){switch(A.label){case 0:if(ti(this.In,nm,". ms id: ".concat(null==i?void 0:i.id,", kind: ").concat(null==e?void 0:e.kind,", track id: ").concat(null==e?void 0:e.id)),c="ADD"===t,h={errorCode:0,extendedData:""},!Yt(i))return this.In.error(nm+" stream wrong"),s({errorCode:Ii.code,extendedData:Ii.message}),[2];if(!(e instanceof MediaStreamTrack))return this.In.error(nm+" parameter 2 type error"),s({errorCode:Ii.code,extendedData:Ii.message}),[2];if(!(f=this.Ro.checkPreview(i)))return this.In.error(nm+" stream no found"),s&&s({errorCode:Xi.code,extendedData:Xi.message}),[2];if("video"===e.kind){if(null===(r=f.videoEffect)||void 0===r?void 0:r.enabled)return this.In.error(nm+" need to disable video beauty effect first"),s&&s({errorCode:Qe,extendedData:"need to disable video beauty effect before add or remove track"}),[2];if(f.enableDualStream)return this.In.error(nm+" "+(l=" can not add/remove track while dual stream enabled.")),s&&s({errorCode:Qe,extendedData:l}),[2];if(f.isBackgroundBlur)return this.In.error(nm+" need to disable background process first"),s&&s({errorCode:Xe,extendedData:"need to disable video background process before add or remove track"}),[2]}return f.streamFromCanvas&&"video"===e.kind?(this.In.error(nm+" browser not support"),s&&s({errorCode:Ye,extendedData:Ze}),[2]):(d="audio"===e.kind&&this.Nn.engineConfig.keepAudioTrack&&f.hasEmptyAudioTrack,v=i.getTracks().length>=2||i.getTracks().find((function(t){return t.kind==e.kind})),c&&v&&!d?(this.In.error(nm+" only stream which have one track and kind no exist can add track"),s&&s({errorCode:Ve,extendedData:He}),[2]):"REMOVE"==t&&(i.getTracks().length<=1||"video"===e.kind&&f.hasEmptyAudioTrack||!i.getTracks().find((function(t){return t.kind===e.kind})))?(this.In.error(nm+" can not remove track"),s({errorCode:Ye,extendedData:Ze}),[2]):!(m=this.Ro.checkPublish(i))||m.publisher.supportTransceiver||5===m.publisher.stateNego&&1!=m.publisher.isUpdateSDP?(p=function(t){var i=P.Ro.previewStreamList.find((function(i){return i.originVideoTrack===t||i.originAudioTrack===t}));if(i=i||P.Ro.previewStreamList.find((function(i){return i.localStream.getTracks().find((function(i){return i==t}))})),i)return P.In.info(nm+" video info: ".concat(JSON.stringify(i.videoInfo))),i;P.In.warn(nm+" ".concat(t.kind," track is not created by sdk"))},this.Nn.engineConfig.keepAudioTrack&&"audio"===e.kind?(c?((D=null===(o=p(e))||void 0===o?void 0:o.videoInfo)&&f.updateAudioInfo(D),this._replaceTrack(i,e,!1,!0),f.hasEmptyAudioTrack=!1):((g=f.getEmptyAudioTrack())&&this._replaceTrack(i,g,!1,!0),f.hasEmptyAudioTrack=!0),this.In.info(nm+" end"),n(h),[2]):(b=f.rtcViewer,_=f,y="video"==e.kind?"videoTrack":"audioTrack",c&&(w=p(e))&&("video"===e.kind?(_.updateMediaStreamConstraints(w.mediaStreamConfig,"video"),f.mediaStreamConfig.video=!0):(_.updateMediaStreamConstraints(w.mediaStreamConfig,"audio"),f.mediaStreamConfig.audio=!0)),m?(S=m.publisher,(E=m.publisher.peerConnection)?(S.supportTransceiver?this.In.info(nm+" support transceiver"):S.isUpdateSDP=!0,S.sideMediaConfig.isSEIStart&&"video"===e.kind?(this.In.info(nm+" replace sei blank track."),O=void 0,c?[4,S.replacePublishedTrack(e,!1,{handleTrack:t})]:[3,2]):[3,5]):(this.In.error(nm+" pc has not created."),[2])):[3,15])):(this.In.error(nm+" publish state wrong. "+"".concat(m.publisher.stateNego)),s&&s({errorCode:Ge,extendedData:Fe}),[2]));case 1:return O=A.sent(),S.handleSEIVideoTrack("add"),[3,4];case 2:return S.handleSEIVideoTrack("remove"),[4,S.replacePublishedTrack(S.sideMediaConfig.track,!1,{handleTrack:t})];case 3:O=A.sent(),A.label=4;case 4:return 0===(null==O?void 0:O.errorCode)||this.In.warn(nm+" enable sei but not found video sender. error: ".concat(JSON.stringify(O))),[3,11];case 5:return"audio"!==e.kind?[3,6]:(S.isUpdateSDP=!1,c?(_.replacePreviewTrack(e),T=_.audioNodeQueue?null===(a=null===(u=_.audioNodeQueue)||void 0===u?void 0:u.destinationNode)||void 0===a?void 0:a.stream.getAudioTracks()[0]:e,(k=S.audioSender)?k.replaceTrack(T):E.addTrack(T,i),this.In.info(nm+" add audio track. ")):(i.removeTrack(e),_[y]=null,b&&b.setTrack(!1,null),(k=S.audioSender)&&k.replaceTrack(null),this.In.info(nm+" remove audio track. ")),this.In.info(nm+" end"),n(h),[2]);case 6:return k=S.videoSender,R=e,_.zegoCaptureStream&&(I=_.getStreamThroughCanvas(new MediaStream([e])),R=I.getVideoTracks()[0]),c?k?[4,k.replaceTrack(e)]:[3,8]:[3,10];case 7:return A.sent(),this.In.info(nm+" sender replace track "+R.kind),[3,9];case 8:E.addTrack(R,i),this.In.info(nm+" pc add track "+R.kind),A.label=9;case 9:return[3,11];case 10:if(!k)return this.In.error(nm+" sender no found"),s&&s({errorCode:je,extendedData:Le}),[2];try{k.replaceTrack(null),this.In.info(nm+" sender replace null.")}catch(t){this.In.error(nm+" "+t),s&&s({errorCode:We,extendedData:Ke+" "+t})}A.label=11;case 11:return N=_.updateVideoInfo(D=c?null==w?void 0:w.videoInfo:{}),C=function(){"ADD"==t?(i.addTrack(e),_[y]=e,b&&b.setTrack("video"==e.kind,e,"safari"===P.Nn.browser),"video"==e.kind&&1==e.enabled?S.sendStreamStatus(0,S.mic_status,!0):1==e.enabled&&S.sendStreamStatus(S.camera_status,0,!0),P.In.info(nm+" add track completely")):("video"==e.kind?S.sendStreamStatus(2,S.mic_status,!0):S.sendStreamStatus(S.camera_status,2,!0),i.removeTrack(e),_[y]=null,b&&b.setTrack("video"==e.kind,null),P.In.info(nm+" remove track completely")),f.mediaStreamConfig.video="ADD"==t},z=function(){return Vp(P,void 0,void 0,(function(){var t,i,e,r=this;return Hp(this,(function(o){switch(o.label){case 0:t={},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,E.createOffer(t)];case 2:return i=o.sent(),S.onCreateOfferSuccess(i,!0,Jp(Jp({},N),{bitRate:c?N.bitRate:50}),(function(t){return Vp(r,void 0,void 0,(function(){return Hp(this,(function(i){return 0!==t?s&&s({errorCode:te.code,extendedData:te.message}):(C(),n(h),this.In.info(nm+" end")),[2]}))}))})),[3,4];case 3:return e=o.sent(),this.In.error(nm+" "+e),s&&s({errorCode:Qi.code,extendedData:Qi.message+" "+e}),[3,4];case 4:return[2]}}))}))},S.isUpdateSDP?(this.In.info(nm+" need to update sdp"),[4,z()]):[3,13];case 12:return A.sent(),[3,14];case 13:this.In.info(nm+" only update track"),C(),c&&"video"===e.kind&&N.bitRate&&S.setBitrate(N.bitRate),n(h),A.label=14;case 14:return[3,16];case 15:c?((D=null==w?void 0:w.videoInfo)&&("video"===e.kind?(_.updateVideoInfo(D),f.mediaStreamConfig.video=!0):_.updateAudioInfo(D)),i.addTrack(e),_[y]=e,b&&b.setTrack("video"==e.kind,e)):(i.removeTrack(e),_[y]=null,"video"===e.kind&&(f.mediaStreamConfig.video=!1),b&&b.setTrack("video"==e.kind,null)),this.In.info(nm+" end"),n(h),A.label=16;case 16:return[2]}}))}))},t.prototype.enVideoSpan=function(t,i,e){var n=this.Mn.createSpan(a.H,{key:bn.event,par:t},{key:""},i);n.setAttributes(e),n.end()},t.prototype._replaceTrack=function(t,i,e,n,s,r){void 0===n&&(n=!1),void 0===s&&(s=!1),void 0===r&&(r=!1);var o=this.Ro.checkPreview(t),u=this.Ro.getPublishList(t,!1);if(!o)return this.In.error("zc.rt.0 preview no found"),{errorCode:Xi.code,extendedData:Xi.message};if(o.streamFromCanvas&&"video"===i.kind&&!r)return this.In.error("zc.rt.0 browser not support"),{errorCode:Ye,extendedData:Ze};var a=t.getTracks().find((function(t){return t.kind===i.kind})),c="audio"===i.kind,h={errorCode:je,extendedData:Le};if(!n&&!a)return this.In.error("zc.rt.0 track no found"),h;if(!n&&c&&o.hasEmptyAudioTrack&&(this.In.warn("zc.rt.0 replace empty audio track"),!this.Nn.engineConfig.allowReplaceEmptyTrack))return h;if(n&&c&&!o.mediaStreamConfig.audio){var f=o.mediaStreamConfig;o.mediaStreamConfig.audio=!0;var l=i.getSettings(),d=l||{},v=d.deviceId,m=d.echoCancellation,p=d.noiseSuppression,g=d.autoGainControl,b=d.channelCount;this.In.info("zc.rt.0 add audio: "+JSON.stringify(l)),v&&(f.audioInput=v),b&&(f.channelCount=b),m&&(f.AEC=m),p&&(f.ANS=p),g&&(f.AGC=g)}var _=this.Ro.soundLevelDelegate&&c,y=s?{handleTrackType:ut.replaceNew}:{};if(u.length){var w=null;return _&&o.stopSoundLevel(),u.forEach((function(t){var n;w=null===(n=t.publisher)||void 0===n?void 0:n.replacePublishedTrack(i,!1,Jp({isTrackProcessedFromOriginalStream:e},y))})),_&&o.startSoundLevel(),w}return _&&o.stopSoundLevel(),o.replacePreviewTrack(i,!1,Jp({isTrackProcessedFromOriginalStream:e},y)),_&&o.startSoundLevel(),{errorCode:0,extendedData:""}},t.prototype.enableCamera=function(t,i,e){var n=this.Ro.checkPreview(t);return n?(n.enableCamera(i,this.Ro,e),!0):(this.In.error("zsc.ec.0 "+di),!1)},t.prototype.enableMicrophone=function(t,i){var e=this.Ro.checkPreview(t);return e?e.enableMicrophone(i):(this.In.error("zsc.em.0 "+di),!1)},t.prototype.enableMicrophoneOnly=function(t){ti(this.In,Zv);for(var i=0;i<this.Ro.previewStreamList.length;i++){if(!this.Ro.previewStreamList[i].enableMicrophoneOnly(t))return this.In.error("".concat(Zv,".0 previewer ").concat(i," change mic mute state failed")),!1;0}return this.Ro.isMicEnabled=t,!0},t.prototype.enableCameraCapturing=function(t,i){var e;return Vp(this,void 0,void 0,(function(){var n,s,r,o,u,a,c,h,f=this;return Hp(this,(function(l){switch(l.label){case 0:return t.localStream?(n=this.Ro.getPublishList(t.localStream).map((function(t){return t.publisher})),i?"live"!==(null===(e=t.videoTrack)||void 0===e?void 0:e.readyState)?[3,1]:(this.In.warn("zp.ecc camera is already capturing"),[3,12]):[3,13]):[2,!1];case 1:s=t.getMediaStreamConstraints(Jp(Jp({},t.mediaStreamConfig),{audio:!1})).mediaStreamConstraints,l.label=2;case 2:return l.trys.push([2,11,,12]),[4,navigator.mediaDevices.getUserMedia(s)];case 3:return(r=l.sent()).getTracks().forEach((function(t){return jo(t,f.In,"zsc.ecc")})),(o=r.getVideoTracks()[0]).enabled=t.isVideoEnabled,!1===o.enabled&&this.In.warn("zp.ecc video is not enabled"),!t.muteImage||t.isVideoEnabled?[3,4]:(t.videoTrack=o,o.enabled=!t.isVideoEnabled,[3,10]);case 4:if(!n.length)return[3,9];u=0,l.label=5;case 5:return u<n.length?[4,n[u].replacePublishedTrack(o)]:[3,8];case 6:if(0!==(null==(a=l.sent())?void 0:a.errorCode))throw a;l.label=7;case 7:return u++,[3,5];case 8:return[3,10];case 9:t.replacePreviewTrack(o),l.label=10;case 10:return t.hasStopCaptureVideo=!1,t.updateZegoStreamCaptureTrack(o),[3,12];case 11:return c=l.sent(),this.In.error("zsc.ecc resume camera capturing failed. "+JSON.stringify(c)),[2,!1];case 12:return[3,15];case 13:return[4,t.stopCaptureVideo()];case 14:l.sent(),n.length&&(h=t.muteImage&&!t.isVideoEnabled?0:id(t.videoTrack),n.forEach((function(t){t.sendStreamStatus(h,t.mic_status)}))),l.label=15;case 15:return[2,!0]}}))}))},t.prototype.activateSEIInsert=function(t,i,e){void 0===e&&(e=0);var n=this.Ro.checkPreview(t);return n?0!==i&&1!==i?(this.In.error(Qv+" value of “action” should be 0 or 1"),!1):(n.activateSEIConfig={action:i,infoType:e},this.Ro.getPublishList(t).map((function(t){return t.publisher})).forEach((function(t){t.activateSEIInsert(i,e)})),!0):(this.In.error(Qv+" stream is not created"),!1)},t}(),Fp=function(){return Fp=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Fp.apply(this,arguments)},Yp=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Zp=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Qp=bn,Xp=bn.event,Wp=bn.error,Kp=_n,$p=Cn,tg=gn.error,ig=tg.te,eg=tg.ne,ng=tg.ee,sg=Ro();if(navigator.mediaDevices&&"setCaptureHandleConfig"in navigator.mediaDevices)try{navigator.mediaDevices.setCaptureHandleConfig({handle:sg,exposeOrigin:!0,permittedOrigins:["*"]})}catch(t){}function rg(t,i,e){var n={width:640,height:360},s={width:640,height:480},r={width:960,height:540},o=Fp(Fp({video:!0,videoQuality:4,frameRate:15,bitRate:500},n),{audioBitrate:48,channelCount:1});switch(t.scenario){case j.UNKNOWN:o={};break;case j.StandardVideoCall:break;case j.HighVideoCall:o.frameRate=25,o.bitRate=1500,o=Fp(Fp({},o),r);break;case j.StandardChatroom:o.video=!1,o.audioBitrate=24;break;case j.HighQualityChatroom:o.video=!1;break;case j.Karaoke:o.video=!1,o.audioBitrate=128,o.channelCount=2;break;case j.Broadcast:o.frameRate=20,o.bitRate=1200,(o=Fp(Fp({},o),r)).audioBitrate=64,o.channelCount=2;break;default:t.isFlutter?(o.bitRate=600,o=Fp(Fp({},o),n)):(o.bitRate=800,o=Fp(Fp({},o),s))}i.info("".concat(ud," scenario ").concat(t.scenario," ").concat(JSON.stringify(o)));var u=t.settingConfig.getCloudSettingScenario(t.scenario,!1,!0);return Object.assign(o,u||{},e||{})}var og,ug,ag,cg=function(){function t(t,i,e,n,s,r){var o=this;this.In=t,this.dataReport=i,this.Nn=e,this.Ro=n,this.rtm=s,this.zegoWebRtc=r,this._a=new Bp(this.In,this.Nn,this.Ro),this.ya=[],this.eventHandler={visibilitychange:function(){var t=!Wt.hidden;o.Nn.engineConfig.autoRecaptureOnShow&&t&&(o.In.info("".concat("zc.hvc.0"," call ").concat(t)),o.ya.forEach((function(t){var i,e=Dp(t,o.In);null===(i=o.zegoWebRtc.rtcModules.publishModule.Wu)||void 0===i||i.ba("video",e,"recapture",(function(){}))})))}},this.wa=0,this.Sa=0,this.Ea=0,this.Oa=_i((function(t){var i=o.Mn.createSpan(a.H,{key:fn},{key:""},ps.event);i.setAttributes({old_cap_volume:o.Sa,cap_volume:t,change_duration:o.Ea}),i.end(),o.wa=0}),3e3),this.Wu=new Gp(t,n,e),this.recordDevices(),this.Ro.checkDeviceChange=function(){o.Ta(500)},this.handleVisibilityChange()}return Object.defineProperty(t.prototype,"publishStreamHandler",{get:function(){return this.Wu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),t.prototype.handleVisibilityChange=function(){var t=th();t.indexOf("OpenHarmony")>-1&&t.indexOf("HuaweiBrowser")>-1&&Wt.addEventListener("visibilitychange",this.eventHandler.visibilitychange)},t.prototype.createStream=function(t,i){var e=this;void 0===i&&(i=!1),this.In.info(ud+" call. "+i);var n=void 0,s=void 0,r=void 0;if(t){var o=t.camera,u=t.screen,c=t.custom;o&&(n=Fp({},o)),u&&(s=Ut(u)?u:Fp({},u)),c&&(r=Fp({},c))}var h=0;if(n&&(h++,n.audioBitRate&&(n.audioBitrate=n.audioBitRate,delete n.audioBitRate),n.bitrate&&(n.bitRate=n.bitrate,delete n.bitrate),n=zl(n)),s&&(h++,Jt(s)&&s.bitrate&&(s.bitRate=s.bitrate),s=zl(s)),r&&(h++,r.bitrate&&(r.bitRate=r.bitrate)),r=r&&Dl(r),n=n&&Dl(n),s=s&&Dl(s),h>1){var f="cannot set more than one type of source";throw this.In.error(ud+" ".concat(f,". ").concat(JSON.stringify(t))),{code:Ii.code,msg:f}}return new Xt((function(t,o){var u=e.Mn.createSpan(a.H,{key:fn},{key:""},gn.event),c=function(i){var s=e.Ro.checkPreview(i),r=e.getStreamByCanvas(i);s&&e.setEmptyAudioTrack(r,s),e.initCopyMusic(i),u.setAttributes({media_stream_id:gn.media_stream_id(null==i?void 0:i.id)}),u.end(),!e.Nn.deviceInfos&&e.recordDevices(),(n||null==n)&&e.ya.push(r),t(r),e.Ro.activeSoundLevel()},h=function(t,i){void 0===i&&(i=""),e.Mn.setError(u,t,i),o({code:t.code,msg:t.message+i})};if("https:"!==window.location.protocol&&"file:"!==window.location.protocol&&-1==window.location.hostname.indexOf("127.0.0.1")&&-1==window.location.hostname.indexOf("localhost")){var f=" https or localhost required ";return e.In.error(ud+f),void h({code:tg.ie.code,message:tg.ie.message+f})}var l=function(t){Gt(t)?h(t[0],t[1]):h(t)};r?e.Cu(r,u).then(c).catch(l):s?e.ka(s,u,i).then(c).catch(l):(n||null==n)&&e.zu(n||{},u,i).then(c).catch(l)}))},t.prototype.zu=function(t,i,e){return Yp(this,void 0,void 0,(function(){var n,s,r=this;return Zp(this,(function(o){if(!Bt(t.videoQuality)&&!ai(t.videoQuality))throw this.In.error(ud+(n=" videoQuality must be integer number")),[ig,n];if(!Bt(t.keyFrameInterval)&&!ai(t.keyFrameInterval))throw this.In.error(ud+(n=" keyFrameInterval must be integer number")),[ig,n];if(!Bt(t.videoOptimizationMode)&&!["default","motion","detail"].includes(t.videoOptimizationMode))throw this.In.error(ud+(n=" video optimizationMode must be 'default', 'motion', 'detail'")),[ig,n];if(!Bt(t.videoInput)&&!Vt(t.videoInput)&&!qt(t.videoInput))throw this.In.error(ud+(n=" video input must be string'")),[ig,n];if(!Bt(t.audioInput)&&!Vt(t.audioInput)&&!qt(t.audioInput))throw this.In.error(ud+(n=" audio input must be string'")),[ig,n];if(!Bt(t.facingMode)&&!qt(t.facingMode))throw this.In.error(ud+(n=" facingMode must be string'")),[ig,n];if(t.audioBitrate){if(!ai(t.audioBitrate))throw this.In.error(ud+(n=" audioBitrate must be integer number")),[ig,n];if(t.audioBitrate<6||t.audioBitrate>510)throw n=" audio bitrate cannot exceed the range [6,510]. current value: ".concat(t.audioBitrate,"."),this.In.error(ud+n),[ig,n];this.Nn.audioBitRate=1e3*t.audioBitrate}if(t.bitRate){if(!Lt(t.bitRate))throw this.In.error(ud+(n=" bitrate must be integer number")),[ig,n];if(t.bitRate>10240)throw this.In.error(ud+(n=" bitrate cannot more than 10 Mbps")),[ig,n]}if(!Bt(t.minBitrate)&&!Lt(t.minBitrate))throw this.In.error(ud+(n=" minBitrate must be integer number")),[ig,n];if(!Bt(t.startBitrate)&&!["default","target"].includes(t.startBitrate))throw this.In.error(ud+(n=" startBitrate must be integer 'default' or 'target'")),[ig,n];if(void 0!==t.channelCount&&!ai(t.channelCount))throw this.In.error(ud+(n=" channelCount must be integer number")),[ig,n];if(!Bt(t.AEC)&&!Ut(t.AEC))throw this.In.error(ud+(n=" AEC must be boolean'")),[ig,n];if(!Bt(t.ANS)&&!Ut(t.ANS))throw this.In.error(ud+(n=" ANS must be boolean'")),[ig,n];if(!Bt(t.AGC)&&!Ut(t.AGC))throw this.In.error(ud+(n=" AGC must be boolean'")),[ig,n];var u,a;return e&&4===t.videoQuality&&(!td(["frameRate","width","height"],u=t,a=function(t,i){throw[t,i]})||Wl(u.bitRate,a)),s={},this.In.info(ud+" camera "+JSON.stringify(t)),s=t,i.setAttributes({stream_type:gn.stream_type("camera"),camera:gn.camera(t)}),Ut(s.video)||(s.video=!0),Ut(s.audio)||(s.audio=!0),[2,new Xt((function(t,e){r.Ra(s,"camera",t,e,i)}))]}))}))},t.prototype.ka=function(t,i,e){return Yp(this,void 0,void 0,(function(){var n,s,r,o=this;return Zp(this,(function(u){return function(t,i,e){var n=Jt(t),s=gn.error.te;if(n&&!Bt(t.videoQuality)&&!ai(t.videoQuality))return e(s," videoQuality must be integer number"),!1;if(n&&!Bt(t.sourceID)&&!qt(t.sourceID))return e(s," sourceID must be string"),!1;if(n&&!Bt(t.videoOptimizationMode)&&!["default","motion","detail"].includes(t.videoOptimizationMode))return e(s," video optimizationMode must be 'default', 'motion', 'detail'"),!1;if(n&&!Bt(t.keyFrameInterval)&&!ai(t.keyFrameInterval))return e(s," keyFrameInterval must be integer number"),!1;if(n&&i&&4===t.videoQuality){if(!Wl(t.bitRate,e))return!1;if(!td(["frameRate"],t,e))return!1}}(t,e,(function(t,i){throw[t,i]})),n=this.Nn.browser,s=this.Ro.getScreenConstrains(t),i.setAttributes({stream_type:gn.stream_type("screen"),screen:gn.screen(s)}),r=t&&t.captureElement,[2,new Xt((function(i,e){var u=function(t){e([t])},a=function(e){o.Ro.createScreenPreviewer(e,s,t)&&i(e),o.addShareScreenEnd(e)};uh()||Jt(t)&&"firefox"==t.type?o.startScreenShotFirFox("screen",s,(function(t,i,e){t?i&&a(i):e&&u(e)})):!r&&oh()&&uy.screenShotReady||Jt(t)&&"shot"==t.type?o.startScreenShotChrome((function(i,e,n){i?(o.In.info(ud+" using extension"),e&&a(e)):(n&&o.In.error(ud+" extension "+n),"SS_DIALOG_CANCEL"===n||Jt(t)&&"shot"==t.type?n&&u(tg.ee):o.startScreenSharing(s,(function(t,i,e){t?i&&a(i):(o.In.error(ud+" "+e),e&&u(e))})))})):"Electron"==n||Jt(t)&&"Electron"==t.type?o.startScreenShotElectron(s,(function(t,i,e){t?i&&a(i):e&&u(e)})):o.startScreenSharing(s,(function(t,i,e){t?i&&a(i):e&&u(e)}))}))]}))}))},t.prototype.Cu=function(t,i){return Yp(this,void 0,void 0,(function(){var e,n,s=this;return Zp(this,(function(r){if(!t.source||!Qt(t.source)&&!Yt(t.source))throw this.In.error(ud+" source must be HTMLMediaElement or MediaStream"),[ig," source must be HTMLMediaElement or MediaStream"];if(t.bitRate){if(!ai(t.bitRate))throw this.In.error(ud+" bitrate must be integer number"),[ig," bitrate must be integer number"];if(t.bitRate>10240)throw this.In.error(ud+" bitrate cannot greater than 10 Mbps"),[ig," bitrate cannot greater than 10 Mbps"]}if(t.audioBitrate){if(!ai(t.audioBitrate))throw this.In.error("ze.cs.0 audioBitrate must be integer number"),[ig," audioBitrate must be integer number"];if(t.audioBitrate<6)throw this.In.error("ze.cs.0 audioBitrate cannot less 6 kbps"),[ig," audioBitrate cannot less 6 kbps"];if(t.audioBitrate>510)throw this.In.error("ze.cs.0 audioBitrate cannot greater than 510 kbps"),[ig," audioBitrate cannot greater than 510 kbps"]}if(!Bt(t.keyFrameInterval)&&!ai(t.keyFrameInterval))throw this.In.error(ud+(e=" keyFrameInterval must be integer number")),[ig,e];if(!Bt(t.videoOptimizationMode)&&!["default","motion","detail"].includes(t.videoOptimizationMode))throw this.In.error(ud+(e=" video optimizationMode must be 'default', 'motion', 'detail'")),[ig,e];if(void 0!==t.channelCount&&1!==t.channelCount&&2!==t.channelCount)throw this.In.error("ze.cs.0 channelCount must number 1 or 2"),[ig," channelCount must number 1 or 2"];return n=Yt(t.source)?"MediaStream":"HTMLElement",i.setAttributes({stream_type:gn.stream_type("custom"),custom:gn.custom(Fp(Fp({},t),{source_type:n}))}),[2,new Xt((function(e,n){s.Ra(t,"custom",e,n,i)}))]}))}))},t.prototype.getStreamByCanvas=function(t){var i=this.Ro.checkPreview(t);if(i){var e=fh();if(e&&e.includes("15_1")&&!this.Nn.engineConfig.disableCanvasIOS15_1){var n=i.getStreamThroughCanvas(t);return i.localStream=n,i.streamFromCanvas=!0,i.streamFromCanvasTrack=n.getVideoTracks()[0],n}}return t},t.prototype.createZegoStream=function(t){var i=this;return void 0===t&&(t={}),new Xt((function(e,n){return Yp(i,void 0,void 0,(function(){var i,s,r,o,u,a,c;return Zp(this,(function(h){switch(h.label){case 0:if(this.In.info("ze.czs.0 call"),i=!1,t&&!Jt(t))return[2,n(Ii)];if((r=[s=t.camera,t.screen,t.custom].reduce((function(t,i){return t+(i?1:0)}),0))>1)return this.In.error(ud+" ".concat(o="cannot set more than one type of source",". ").concat(JSON.stringify(t))),[2,n({code:Ii.code,msg:o})];if(i=!!s||0===r,u=new qp(t,this.In,this.Ro,this.Nn,this),a=new Ap(u),!t.autoCapture&&null!=t.autoCapture)return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,a.zegoStream.autoCapture()];case 2:return h.sent(),[3,4];case 3:return c=h.sent(),[2,n(c)];case 4:return this.In.info("ze.czs.0 success"),i&&this.ya.push(a),e(a),[2]}}))}))}))},t.prototype.destroyStream=function(t){this.In.info(ad+" call");var i=this.Mn.createSpan(a.H,{key:fn},{key:""},es.event);if(i.setAttributes({stop_reason:es.stop_reason("destroyStream")}),!(Yt(t)||Jt(t)&&t.getTracks))return this.In.error(ad+" localStream is not mediaStream or tracks is null"),void this.Mn.setError(i,es.error._n);Yt(t)?(Yt(t)&&0==t.getTracks().length&&this.In.info(ad+" tracks is null"),this.ya=this.ya.filter((function(i){return i!==t})),this.stopPreview(t)):t.zegoStream&&t.zegoStream.destroy(),i.end()},t.prototype.startPublishingStream=function(t,i,e,n){var s,r,o,u=this,c=Dp(i,this.In),h=mm(this.In,t);h.info(cd+" call publishOption: "+JSON.stringify(e)+" isDataChannel: "+JSON.stringify(!!n)+" ms_id: "+(null==c?void 0:c.id));var f,l=!0,d="",v=Wp,m=v.he;l&&void 0===t&&(h.error(cd+(d="stream id required")),l=!1,f=Ei),!l||t&&qt(t)||(h.error(cd+" "+(d="stream id type wrong")),l=!1,f=Ei),l&&0===t.length&&(this.In.error(cd+" "+(d=Ei.message)),l=!1,f=Ei),l&&t.length>256&&(h.error(cd+" "+(d="stream id length limit")),l=!1,f=Si),l&&!ui(t)&&(this.In.warn(cd+" #invald streamID:".concat(t)),this.Nn.isFlutter&&(l=!1,f=Oi)),l&&!oi(t)&&(h.error(cd+" "+(d="stream ID contains illegal characters")),l=!1,f=Oi),l&&(!c||Yt(c)&&0==c.getTracks().length)?(h.error(cd+" "+(d="localStream wrong")),l=!1,f=m):c&&c.getTracks().forEach((function(t){jo(t,u.In,cd)}));var p=this.Ro.checkPreview(c);l&&!p&&(h.error(cd+" "+(d=fi)),l=!1,f=v.me);var g=null==p?void 0:p.zegoCaptureStream;if(g&&(g.originAudioStream||g.originVideoStream||(h.error(cd+" "+(d="stream is not capturing")),l=!1,f=v.pe)),(null==p?void 0:p.isVideoEffectStarting)&&(h.error(cd+" "+(d=(f=v.ge).message)),l=!1),l&&e&&!Jt(e)&&(l=!1,f=m,d="publishOption must be object"),l&&e&&!Bt(e.streamParams)&&!qt(e.streamParams)&&(h.error(cd+" publishOption streamParams must be string"),l=!1,f=m,d=" publishOption streamParams must be string"),l&&e&&!Bt(e.extraInfo)&&!qt(e.extraInfo)&&(h.error(cd+" publishOption extraInfo must be string"),l=!1,f=m,d=" publishOption extraInfo must be string"),l&&e&&!Bt(e.videoCodec)&&!qt(e.videoCodec)&&(h.error(cd+" publishOption videoCodec must be string"),l=!1,f=m,d=" publishOption videoCodec must be string"),l&&e&&!Bt(e.inspectFlag)&&(Lt(e.inspectFlag)?[0,1].includes(e.inspectFlag)||(h.error(cd+" publishOption inspectFlag is not in range"),l=!1,f=m,d=" publishOption inspectFlag is not in range"):(h.error(cd+" publishOption inspectFlag must be number"),l=!1,f=m,d=" publishOption inspectFlag must be number")),!l||!this.Nn.isMultiRoom||e&&qt(e.roomID)&&""!=e.roomID||(l=!1,f=m,d=" roomID is need if set multi room"),e&&e.videoCodec&&(e.videoCodec=e.videoCodec.toUpperCase()),l&&e&&!Bt(e.trafficControlFocusOnMode)&&(Lt(e.trafficControlFocusOnMode)&&[0,1].includes(e.trafficControlFocusOnMode)||(this.In.error(cd+" publishOption trafficControlFocusOnMode: ".concat(e.trafficControlFocusOnMode," is invalid")),delete e.trafficControlFocusOnMode)),l&&e&&!Bt(e.trafficControlMinVideoBitrate)&&(Lt(e.trafficControlMinVideoBitrate)||(this.In.error(cd+" publishOption trafficControlMinVideoBitrate: ".concat(e.trafficControlMinVideoBitrate," is invalid")),e.trafficControlMinVideoBitrate=0)),l&&e&&!Bt(e.enableTrafficControl)&&(Ut(e.enableTrafficControl)||(this.In.error(cd+" publishOption enableTrafficControl: ".concat(e.enableTrafficControl," is invalid")),e.enableTrafficControl=!0)),this.Nn.useNetAgent&&this.Nn.roomList.length>0?h.info(cd+" publish accelerate"):this.rtm.isDisConnect()&&(h.error(cd+" not login"),l=!1,f=v.be),!l){h.error(cd+" "+d);var b=this.Mn.getAPIErrorReport(Xp);throw b&&f&&this.Mn.takeAPIErrorReport(Xp,f,b),{errorCode:null==f?void 0:f.code,extendedData:d}}var _=this.Mn.createSpan(a.I,{key:fn},{key:Xp,par:t},Xp,!0);e||(e={});var y=(null==p?void 0:p.videoPreviewType)||(null==p?void 0:p.previewType);!e.videoCodec&&ah()&&"custom"==y&&(null===(r=null==p?void 0:p.mediaStreamConfig)||void 0===r?void 0:r.source)&&Qt(null===(o=p.mediaStreamConfig)||void 0===o?void 0:o.source)&&(h.info(cd+" Redmi note 8 uesed custom stream. change to VP8"),e.videoCodec="VP8");var w=qo(this.Nn.appid,this.Nn.idName,t),S=((s={})["_publish_"+t]={stream_sid:w},s);this.Mn.setPublicPros(S),_.setAttributes({stream_id:Qp.stream_id(t),stream_sid:Qp.stream_sid(w),publish_option:Qp.publish_option(e),enable_camera:Qp.enable_camera(!!(null==p?void 0:p.videoTrack)),enable_mic:Qp.enable_mic(!!(null==p?void 0:p.audioTrack)),use_na:Qp.use_na(1)}),e.audioBitRate=this.Nn.audioBitRate;var E=e.roomID?e.roomID:this.Nn.roomList[0]?this.Nn.roomList[0].roomID:"",O=this.Nn.getRoomByRoomID(E);return O?(_.setAttributes({room_id:Qp.room_id(E)}),this.Ro.setPublishStateStart(O,t,c,e,w,n)?(this.Nn.publishStreamList[t]={state:T.tryPublish,extra_info:e.extraInfo,roomID:O.roomID},h.info("zc.p.sps.1 start publish"),O.streamHandler.onPublishStateUpdate(Q,t,{code:0,message:""}),this.Mn.createSpan(a.H,{key:bn.event,par:t},{key:Kp.event,par:t},Kp.event,!0).setAttributes({reason:Kp.reason("StartPublish")}),this.Mn.createSpan(a.I,{key:bn.event,par:t},{key:Cn.event,par:t},Cn.event,!0).setAttributes({room_id:$p.room_id(null==O?void 0:O.roomID),room_sid_string:$p.room_sid_string(null==O?void 0:O.roomSessionID)}),this.Nn.appConfig?(null==p?void 0:p.containBackgroundProcess)&&!1===this.Nn.supportBg?(h.info("zc.p.sps.1 check not support background porcess"),O.streamHandler.onPublishStateUpdate(Z,t,v.qe),!1):(this.Ro.startPublishingStream(t),!0):(this.Ro.waitPublishList.push(t),!0)):(h.error("zc.p.sps.1 cannot start publish"),!1)):(h.error("zc.p.sps.1 room no found"),!1)},t.prototype.updatePublishingStream=function(t,i){var e=this;return new Xt((function(n){var s=function(t,i){var s=Lt(t)?{errorCode:t,extendedData:JSON.stringify({fail_reason:i})}:t;e.In.error(Bv+" "+s.extendedData),n(s)};e.In.info(Bv+" call");var r=e.Ro.checkPreview(t);if(r)if(r.zegoCaptureStream){var o=r.zegoCaptureStream;i!=gp.audio&&i!=gp.videoAndAudio||o.getAudioTracks().length?i!=gp.video&&i!=gp.videoAndAudio||o.getVideoTracks().length?i==gp.audio?o.updateStreamAudioTrack(n,s,1):i==gp.video?o.updateStreamVideoTrack(n,s,1):o.updateStreamVideoAndAudio(n,s,1):s(Ae,Me):s(De,Pe)}else s(Ii.code,Ii.message+", stream type wrong");else s(Ce,ze)}))},t.prototype.activateSEIInsert=function(t){var i=t.stream,e=t.action,n=t.infoType,s=this._getSpan(t.stream,ro);s.setAttributes({action:oo(t.action),info_type:uo(t.infoType)});var r=this.Wu.activateSEIInsert(i,e,n);return s.end(),r},t.prototype.sendSEI=function(t,i){if(!Po())return this.In.warn(dd+" browser not support "),!1;if(!Ft(i))return this.In.error(dd+" inData required Uint8Array"),!1;if(i.byteLength>4096)return this.In.error(dd+" inData length limit"),!1;var e=this.Ro.publisherList[t];return e&&e.publisher?e.publisher.sendSEI(i):(this.In.warn(dd+" publish not exist"),!1)},t.prototype.stopPublishingStream=function(t,i,e){var n,s,r,o;this.In.info(fd+" call "+(i?i.toString():""),{streamid:t});var u=i||{code:0,message:""},c=this.Mn.createSpan(a.I,{key:fn},{key:""},zn.event);if(!qt(t)||""==t)return this.In.error(fd+" streamID must be string and not empty"),this.Mn.setError(c,zn.error.te,"stream id type error"),!1;var h=this.Ro.publisherList[t];e&&!(null===(n=null==h?void 0:h.publisher)||void 0===n?void 0:n.Ia)&&(u=Wp.Ue),c.setAttributes({stream_id:zn.stream_id(t),stream_sid:zn.stream_sid(null==h?void 0:h.streamSid),room_id:zn.room_id(null===(r=null===(s=this.Ro.publisherList[t])||void 0===s?void 0:s.room)||void 0===r?void 0:r.roomID),error:u.code,message:u.message});var f=this.Ro.getRoomByStreamID(t),l=h&&h.publisher&&7!==h.publisher.state||(null===(o=null==h?void 0:h.retryStreamHandler)||void 0===o?void 0:o.isRetrying());if(this.Ro.stopPublishingStream(t,u),this.Nn.publishStreamList[t]){if(this.Nn.publishStreamList[t].state>=T.update_info&&f){if(!i||1102018!==i.code)f.streamHandler.updateStreamInfo(t,R);for(var d=0;d<f.streamList.length;d++)if(f.streamList[d].stream_id==t){f.streamList.splice(d--,1);break}}delete this.Nn.publishStreamList[t]}return c.end(),f&&l&&f.streamHandler.onPublishStateUpdate(Z,t,u),!0},t.prototype.stopPublishingStreamInRoom=function(t){for(var i in this.In.info("zc.spsr.0.0 call "+t),this.Nn.publishStreamList)this.Nn.publishStreamList[i].roomID===t&&this.stopPublishingStream(i)},t.prototype.setCaptureVolume=function(t,i){var e=this;return new Xt((function(n){e.In.info(Av+" call");var s=Dp(t,e.In),r=ps.error.te,o=function(t){e.In.error(Av+" "+t),n({errorCode:r.code,extendedData:JSON.stringify({fail_reason:r.message+" "+t})})},u=e.Ro.checkPreview(s);Yt(s)&&u?0!=s.getAudioTracks().length?!Lt(i)||i<0||i>200?o(" volume must be number between 0 to 200"):(e.wa?e.Ea=Math.round(performance.now()-e.wa):(e.wa=performance.now(),e.Sa=u.volume),e.Oa(i),u.setVolume(i),n({errorCode:0,extendedData:""}),e.In.info(Av+" call success")):o(" stream audioTrack no found"):o(" stream must be created by zego")}))},t.prototype.getElectronScreenSources=function(){var t=this;return new Xt((function(i,e){var n=window.require("electron");n||(t.In.error("zc.gess.0 Electron is not exist"),e({message:"Electron is not exist"})),n.desktopCapturer.getSources({types:["window","screen"]}).then((function(t){var e=t.map((function(t){return{id:t.id,name:t.name,thumbnail:t.thumbnail}}));i(e)})).catch((function(i){t.In.error("zc.gess.0 "+i),e(i)}))}))},t.prototype.startScreenShotChrome=function(t){if(uy.screenShotReady)window.postMessage({type:"SS_UI_REQUEST",text:"start"},"*"),bo("screenShare",{success:t},this.Nn.callbackList);else{var i='zc.b.ss Please install the extension:1. Go to chrome://extensions  2. Check: "Enable Developer mode   3. Click: "Load the unpacked extension... 4. Choose "extension" folder from the repository 5. Reload this page';this.In.error(i),t(!1,null,{code:eg.code,message:eg.message+" "+i})}},t.prototype.startScreenSharing=function(t,i){var e=this;if("getDisplayMedia"in navigator.mediaDevices){var n=navigator.mediaDevices,s=t.audio||!1,r=t.video,o="zc.b.sss";if(rh()&&Jt(r)){var u=r.width,a=r.height;Jt(u)?r.width={max:u.max||u.ideal}:u&&(r.width={max:u}),Jt(a)?r.height={max:a.max||a.ideal}:a&&(r.height={max:a})}var c={audio:s,video:r,preferCurrentTab:!!t.captureElement,systemAudio:"include",selfBrowserSurface:"include",surfaceSwitching:"include"};t.video=r,this.In.info("zc.b.sss config: "+JSON.stringify(c)),n.getDisplayMedia(c).then((function(n){return Yp(e,void 0,void 0,(function(){var e,s,r,u,a;return Zp(this,(function(c){switch(c.label){case 0:if(!(e=t.captureElement))return[3,5];if(s=n.getVideoTracks()[0],!("CropTarget"in window&&"fromElement"in CropTarget&&s.cropTo))return[3,5];c.label=1;case 1:return c.trys.push([1,4,,5]),(r=null==s?void 0:s.getCaptureHandle())&&r.handle===sg?[4,CropTarget.fromElement(e)]:(this.In.info("".concat(o," no current tap")),n.getVideoTracks().forEach((function(t){return t.stop()})),i(!1,null,{code:eg.code,message:eg.message+" captureElement must on current tab."}),[2]);case 2:return u=c.sent(),[4,s.cropTo(u)];case 3:return c.sent(),[3,5];case 4:return a=c.sent(),this.In.error("".concat(o," crop error:").concat(a)),n.getVideoTracks().forEach((function(t){return t.stop()})),i(!1,null,{code:eg.code,message:eg.message+" "+a}),[3,5];case 5:return this.In.info("zc.b.sss capture suc"),i(!0,n),[2]}}))}))})).catch((function(t){e.In.error(o+" "+t),t.message&&"permission denied"==t.message.toLowerCase()?i(!1,null,ng):i(!1,null,{code:eg.code,message:eg.message+" "+t})}))}else this.In.error("zc.b.sss brower does not support getDisplayMedia"),i(!1,null,tg.ie)},t.prototype.startScreenShotFirFox=function(t,i,e){var n=this,s={video:Fp(Fp({},i.video),{mediaSource:t}),audio:i.audio};navigator.mediaDevices.getUserMedia(s).then((function(t){t.getTracks().forEach((function(t){return jo(t,n.In,"ze.ssf.1")})),e(!0,t)})).catch((function(t){n.In.error("ze.ssf.1 "+t),e(!1,null,{code:eg.code,message:eg.message+" "+t})}))},t.prototype.startScreenShotElectron=function(t,i){var e=this;if(!window.require("electron"))return this.In.error("ze.sse.1 Electron is not exist"),void i(!1,null,{code:eg.code,message:eg.message+" Electron is not exist"});var n={video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t.sourceID,maxWidth:window.screen.width,maxHeight:window.screen.height}},audio:!1};navigator.mediaDevices.getUserMedia(n).then((function(t){t.getTracks().forEach((function(t){return jo(t,e.In,"ze.sse.1")})),i(!0,t)})).catch((function(t){e.In.error("ze.sse.1 "+t),i(!1,null,{code:eg.code,message:eg.message+" "+t})}))},t.prototype.Ra=function(t,i,e,n,s){var r=this,o=null;return o=new zp(this.In,this.Nn,this.Ro,i),this.Ro.previewStreamList.push(o),o.startPreview(t,(function(n){r.Ro.soundLevelDelegate&&(null==o||o.startSoundLevel()),"camera"===i&&(!1===(null==t?void 0:t.audio)&&o&&(o.hasMicTrack=!1),(null==o?void 0:o.micTrack)&&(o.micTrack.enabled=r.Ro.isMicEnabled)),(null==t?void 0:t.videoOptimizationMode)&&r.Ro.setVideoTrackContentHint(n,null==t?void 0:t.videoOptimizationMode),r.In.debug("zsc.sp.0 call success"),!r.Nn.deviceInfos&&r.recordDevices(),e&&e(n)}),(function(t){r.Ro.previewStreamList=r.Ro.previewStreamList.filter((function(t){return t!==o})),n&&n(t)}),s),!0},t.prototype.stopPreview=function(t){if(!t)return this.In.warn("zsc.sp.0 localStream null"),!1;for(var i in this.Ro.publisherList)this.Ro.publisherList[i].localStream===t&&(this.Ro.publisherList[i].localStream=null);var e=this.Ro.checkPreview(t);return e?(e.previewSuc&&(e.stopPreview(),this.Ro.removePreview(e)),!0):(this.In.info("zsc.sp.0 "+di),!1)},t.prototype.recordDevices=function(t,i){var e,n=this;this.In.info("zsc.rd.0 call"),this.Ta(0).then((function(i){n._a.lastRecordDeviceTime=performance.now(),t&&t(i)})).catch((function(t){n.In.warn("zsc.rd.0 getDevices err:"+t),i&&i(t)})),void 0!==(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.ondevicechange)&&(navigator.mediaDevices.ondevicechange=null,navigator.mediaDevices.ondevicechange=function(t){return Yp(n,void 0,void 0,(function(){return Zp(this,(function(t){return this.In.info("zsc.rd.0 devicechange"),this.Ta(500),[2]}))}))})},t.prototype.Ta=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=""),Yp(this,void 0,void 0,(function(){var i,e,n,s=this;return Zp(this,(function(r){switch(r.label){case 0:return this.In.info("zsc.rd.0 get and compare devices: "+t),i=!0,(e=this.Nn.deviceChangeTimer)?(clearTimeout(e),this.Nn.deviceChangeTimer=null):0===t&&(i=!1),n=function(){return Yp(s,void 0,void 0,(function(){var t=this;return Zp(this,(function(e){return this.In.info("zsc.rd.0 start get and compare devices"),[2,new Promise((function(e,n){Xl((function(n){var s,r,o,u,c,h;if(t.In.info("zsc.rd.0 get devices success. ".concat(JSON.stringify(n),"; need compare: ").concat(i)),!t.Nn.deviceInfos||!i)return t.Nn.deviceInfos={microphones:n.microphones,speakers:n.speakers,cameras:n.cameras},void e(JSON.parse(JSON.stringify(t.Nn.deviceInfos)));var f=!0,l=[],d=[];if(rh()&&1===(null===(r=null===(s=t.Nn.deviceInfos)||void 0===s?void 0:s.cameras)||void 0===r?void 0:r.length)&&""===(null===(o=t.Nn.deviceInfos)||void 0===o?void 0:o.cameras[0].deviceID))t.In.info("zsc.rd.0 cameras not accurate");else{for(var v=function(i){var e=t.Nn.deviceInfos.cameras[i];n.cameras.find((function(t){return t.deviceID===e.deviceID}))||l.push(e)},m=0;m<t.Nn.deviceInfos.cameras.length;m++)v(m);t.Nn.deviceStateOut=!1;var p=!1;l.length>0&&(p=!0),l.forEach((function(i){for(var e in t.Ro.publisherList){var n=t.Ro.publisherList[e],s=n.publisher;if(n.localStream&&""!==n.cameraLabel&&n.cameraLabel===i.deviceName)p=!1,!s.isVideoTrackAlive()&&s.sendStreamStatus(-6,s.mic_status),f=!1,t.Nn.actionListener("_deviceError",_e,i.deviceName,"camera"),t.Nn.actionListener("deviceError",_e,i.deviceName);n.localStream&&0===n.localStream.getAudioTracks().length&&(p=!1)}p&&(t.Nn.deviceStateOut=!0),t.deviceInterruptReport(0,i,"camera"),f=!1,t.Nn.actionListener("videoDeviceStateChanged","DELETE",i)})),n.cameras.filter((function(i){return!t.Nn.deviceInfos.cameras.find((function(t){return t.deviceID===i.deviceID}))})).forEach((function(i){t.deviceInterruptReport(1,i,"camera"),f=!1,t.Nn.actionListener("videoDeviceStateChanged","ADD",i)}))}rh()&&1===(null===(c=null===(u=t.Nn.deviceInfos)||void 0===u?void 0:u.microphones)||void 0===c?void 0:c.length)&&""===(null===(h=t.Nn.deviceInfos)||void 0===h?void 0:h.microphones[0].deviceID)?t.In.info("zsc.rd.0 microphones not accurate"):((d=t.Nn.deviceInfos.microphones.filter((function(t){return!n.microphones.find((function(i){return i.deviceID===t.deviceID}))}))).forEach((function(i){for(var e in t.Ro.publisherList){var n=t.Ro.publisherList[e],s=n.publisher;if(n.localStream&&""!==n.microLabel&&(n.microLabel===i.deviceName||""!==n.microLabel&&n.microLabel.includes(i.deviceName)))!s.isAudioTrackAlive()&&s.sendStreamStatus(s.camera_status,-6),f=!1,t.Nn.actionListener("_deviceError",_e,t.Ro.publisherList[e].microLabel,"micro"),t.Nn.actionListener("deviceError",_e,t.Ro.publisherList[e].microLabel)}t.deviceInterruptReport(0,i,"micro"),f=!1,t.Nn.actionListener("audioDeviceStateChanged","DELETE","Input",i)})),n.microphones.filter((function(i){return!t.Nn.deviceInfos.microphones.find((function(t){return t.deviceID===i.deviceID}))})).forEach((function(i){t.deviceInterruptReport(1,i,"micro"),f=!1,t.Nn.actionListener("audioDeviceStateChanged","ADD","Input",i)})));var g=t.Nn.deviceInfos.speakers.filter((function(t){return!n.speakers.find((function(i){return i.deviceID===t.deviceID}))})),b=n.speakers.filter((function(i){return!t.Nn.deviceInfos.speakers.find((function(t){return t.deviceID===i.deviceID}))}));g.forEach((function(i){var e=t.Mn.createSpan(a.H,{key:fn},{key:""},ns);e.setAttributes({reason_type:rs("delete"),device:ss(i.deviceID),device_name:ss(i.deviceName)}),e.end(),f=!1,t.Nn.actionListener("audioDeviceStateChanged","DELETE","Output",i)})),b.forEach((function(i){var e=t.Mn.createSpan(a.H,{key:fn},{key:""},ns);e.setAttributes({reason_type:rs("add"),device:ss(i.deviceID),device_name:ss(i.deviceName)}),e.end(),f=!1,t.Nn.actionListener("audioDeviceStateChanged","ADD","Output",i)})),f&&t._a.onDeviceNoChangeQuickly(n);var _=Fp({},t.Nn.deviceInfos);if(t.Nn.deviceInfos={microphones:n.microphones,speakers:n.speakers,cameras:n.cameras},t.Nn.autoSwitchDeviceSetting.microphone){var y=t.Nn.deviceInfos.microphones;if(d&&0!==d.length&&0!=y.length)t.Ro.previewStreamList.forEach((function(i){return Yp(t,void 0,void 0,(function(){var t,e,n,s,r,o,u;return Zp(this,(function(a){switch(a.label){case 0:return t=i.localStream,e=y[0].deviceID,s=null==(n=i.audioTrack)?void 0:n.getSettings().deviceId,r=!1,s&&"default"===s?(o=_.microphones.find((function(t){return"default"===t.deviceID})).deviceName,u=y.find((function(t){return"default"===t.deviceID})).deviceName,r=u!==o):""!==s&&(r=d.some((function(t){return t.deviceID===s}))),t&&r&&""!==e?(this.In.info("zsc.rd.0 auto switch audio device. "+e),[4,this.zegoWebRtc.useAudioDevice(t,e)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[2]}}))}))}))}if(t.Nn.autoSwitchDeviceSetting.camera){var w=t.Nn.deviceInfos.cameras;if(l&&0!==l.length&&0!=w.length)t.Ro.previewStreamList.forEach((function(i){return Yp(t,void 0,void 0,(function(){var t,e,n,s,r,o,u;return Zp(this,(function(a){switch(a.label){case 0:return t=i.localStream,e=w[0].deviceID,s=null==(n=i.videoTrack)?void 0:n.getSettings().deviceId,r=!1,s&&"default"===s?(o=_.cameras.find((function(t){return"default"===t.deviceID})).deviceName,u=w.find((function(t){return"default"===t.deviceID})).deviceName,r=u!==o):""!==s&&(r=l.some((function(t){return t.deviceID===s}))),t&&r&&""!==e?(this.In.info("zsc.rd.0 auto switch video device. "+e),[4,this.zegoWebRtc.useVideoDevice(t,e)]):[3,2];case 1:a.sent(),a.label=2;case 2:return[2]}}))}))}))}e(JSON.parse(JSON.stringify(t.Nn.deviceInfos)))}),(function(t){n(t)}))}))]}))}))},0!==t?[3,2]:[4,n()];case 1:case 3:return[2,r.sent()];case 2:return[4,new Promise((function(i,e){s.Nn.deviceChangeTimer=setTimeout((function(){return Yp(s,void 0,void 0,(function(){var t,s;return Zp(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,n()];case 1:return t=r.sent(),i(t),[3,3];case 2:return s=r.sent(),e(s),[3,3];case 3:return[2]}}))}))}),t)}))]}}))}))},t.prototype.setVideoConfig=function(t,i){var e=this;return ti(this.In,Gv),new Xt((function(n,s){var r=Dp(t,e.In),o=Cr.error,u=o._n,a=o.te,c=e._getSpan(r,Cr.event),h=Fp({},i);for(var f in h)h[f]instanceof Object&&(h[f]=JSON.stringify(h[f]));c.setAttributes({video_params:h});var l=function(t){e.Mn.setError(c,u,t)};if(!Yt(r))return e.In.error(Gv+" localStream not found"),l("localStream not found"),void s({errorCode:a.code,extendedData:a.message+" localStream no found"});if(!i||!Jt(i)||0==Object.keys(i).length)return e.In.error(Gv+" constraints wrong"),l("constraints wrong"),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"});var d,v,m=i.width,p=i.height,g=i.maxBitrate,b=i.frameRate;if(m&&Lt(m)&&!e.Nn.checkValidNumber(m,0,7680))return e.In.error(Gv+" constraints width integer number, range[0, 7680]"),l("constraints width integer number, range[1, 7680]"),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"});if(m&&Jt(m)){if(!(v=Kl(m,"width",0,7680)).result)return e.In.error(Gv+" constraints width: "+v.message),l("constraints width: "+v.message),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"})}else if(m&&!Lt(m)&&!Jt(m))return e.In.error(Gv+" constraints width must be a number or an object. "),l("constraints width must be a number or an object."),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"});if(p&&Lt(p)&&!e.Nn.checkValidNumber(p,0,4320))return e.In.error(Gv+" constraints height integer number, range[0, 4320]"),l(" constraints height integer number, range[0, 4320]"),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"});if(p&&Jt(p)){if(!(v=Kl(i.height,"height",0,4320)).result)return e.In.error(Gv+" constraints height: "+v.message),l("constraints height: "+v.message),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"})}else if(p&&!Lt(p)&&!Jt(p))return e.In.error(Gv+" constraints height must be a number or an object. "),l(" constraints height must be a number or an object."),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"});if(g&&!Lt(g))return e.In.error(Gv+(d=" constraints maxBitrate is not a number")),l(d),void s({errorCode:a.code,extendedData:a.message+d});if(!Bt(b)&&!Lt(b)&&!Jt(b))return e.In.error(Gv+(d=" constraints frameRate is not a number or an object")),l(d),void s({errorCode:a.code,extendedData:a.message+d});if(Lt(b)&&!(b>0&&b%1==0))return e.In.error(Gv+" constraints frameRate must be positive integer number"),l("constraints frameRate must be positive integer number"),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"});if(b&&Jt(b)&&!(v=Kl(b,"frameRate")).result)return e.In.error(Gv+" constraints frameRate: "+v.message),l("constraints frameRate: "+v.message),void s({errorCode:a.code,extendedData:a.message+" constraints wrong"});e.Wu.setPublishStreamVideoConstraints(r,i,c,(function(t){c.setAttributes({error:t.errorCode,message:t.extendedData}),c.end(),n(t)}))}))},t.prototype.setAudioConfig=function(t,i){var e=this;return ti(this.In,Fv),new Xt((function(n){var s=Dp(t,e.In),r=e._getSpan(s,zr.event);if(r.setAttributes({audio_params:zr.audio_params(i)}),!Yt(s))return e.In.error(Fv+" localStream not found"),e.Mn.setError(r,zr.error._n),void n({errorCode:zr.error.te.code,extendedData:zr.error.te.message+" localStream no found"});if(!i||!Jt(i)||0==Object.keys(i).length||!Bt(i.AEC)&&!Ut(i.AEC)||!Bt(i.AGC)&&!Ut(i.AGC)||!Bt(i.ANS)&&!Ut(i.ANS))return e.In.error(Fv+" constraints wrong"),e.Mn.setError(r,zr.error.te," constraints wrong"),void n({errorCode:zr.error.te.code,extendedData:zr.error.te.message+" constraints wrong"});e.Wu.setPublishStreamAudioConstraints(s,i,r,(function(t){r.end(),n(t)}))}))},t.prototype.mutePublishStreamVideo=function(t,i,e){var n=Dp(t,this.In);ti(this.In,Xv,". "+(null==n?void 0:n.id)+" mute: ".concat(i,", retain: ").concat(e));var s=this._getSpan(n,Vr),r=this.Ro.checkPreview(n);if(!r)return this.In.error(Xv+" localStream error"),!1;if(!Ut(i)||!Bt(e)&&!Ut(e))return this.In.error(Xv+" option error"),!1;var o=this.Wu.enableCamera(n,!i,e);return r.syncVideoEnabled=o&&i,s.setAttributes({mute_type:Hr(i?1:0),retain:Gr(e||!1)}),s.end(),ii(this.In,Xv),o},t.prototype.mutePublishStreamAudio=function(t,i){var e=Dp(t,this.In);ti(this.In,Wv,(null==e?void 0:e.id)+" mute: ".concat(i));var n=this.Ro.checkPreview(e);if(!n)return this.In.error(Wv+" localStream error"),!1;var s=this._getSpan(e,Fr);if(!Ut(i))return this.In.error(Wv+" option error"),!1;var r=this.Wu.enableMicrophone(e,!i);return n.syncAudioEnabled=r&&i,s.setAttributes({mute_type:Yr(i?1:0)}),s.end(),ii(this.In,Wv),r},t.prototype.muteMicrophone=function(t){this.In.info(Kv+" call");var i=this.Mn.createSpan(a.H,{key:pn},{key:""},Zr);if(!Ut(t))return this.In.error(Kv+" option error"),this.Mn.setError(i,Ii),!1;var e=this.Wu.enableMicrophoneOnly(!t),n=Object.keys(this.Ro.publisherList).map((function(t){return{stream_id:t}}));return i.setAttributes({enable:Qr(!t),stream_list:Xr(n)}),i.end(),this.In.info(Kv+" end"),e},t.prototype.handleTrack=function(t,i,e,n,s){this.Wu.handleTrack(t,i,e,n,s)},t.prototype._getSpan=function(t,i){var e=this.Ro.checkPublish(t);return this.Mn.createSpan(a.H,e?{key:bn.event,par:e.streamID}:{key:fn},{key:""},i)},t.prototype.enVideoSpan=function(t,i,e){this.Wu.enVideoSpan(t,i,e)},t.prototype.replaceTrack=function(t,i,e,n){return Yp(this,void 0,void 0,(function(){var s,r,o,u,a,c;return Zp(this,(function(h){return s=this._getSpan(t,qr.event),r=qr.error.te,Yt(t)?i&&i instanceof MediaStreamTrack?(o={id:i.id,muted:i.muted,enabled:i.enabled,kind:i.kind,readyState:i.readyState,label:i.label},ti(this.In,Yv,". ".concat(t.id," track: ")+JSON.stringify(o)),u=!0,"safari"===this.Nn.browser&&void 0!==(null==n?void 0:n.isReplaceNew)&&(u=n.isReplaceNew),a=Bt(null==n?void 0:n.isCaptureStream)||null==n?void 0:n.isCaptureStream,c=this.Wu._replaceTrack(t,i,e,void 0,u,a),s.setAttributes({track_kind:qr.track_kind(i.kind)}),s.end(),[2,c]):(this.In.error(Yv+" mediastream track no found"),this.Mn.setError(s,r,"mediastream track no found"),[2,{errorCode:r.code,extendedData:r.message+" mediastream track no found"}]):(this.In.error(Yv+" localStream not found"),this.Mn.setError(s,r,"localStream not found"),[2,{errorCode:r.code,extendedData:r.message+" localStream no found"}])}))}))},t.prototype.useVideoDevice=function(t,i){var e=this,n="zc.uvd.0";return ti(this.In,n),new Xt((function(s){var r=Dp(t,e.In),o=e._getSpan(r,Ur.event);if(o.setAttributes({device:Ur.device(i)}),!Yt(r))return e.In.error(n+" localStream not found"),e.Mn.setError(o,Ur.error._n),void s({errorCode:Ur.error.te.code,extendedData:Ur.error.te.message});if(!qt(i))return e.In.error(n+" deviceID must be string"),e.Mn.setError(o,Ur.error.te," deviceID must be string"),void s({errorCode:Ur.error.te.code,extendedData:Ur.error.te.message});var u=function(t){o.setAttributes({error:t.errorCode,message:t.extendedData}),o.end(),e.Ro.getPublishList(r).forEach((function(t){var i,e;t.cameraLabel=(null===(e=null===(i=t.publisher.previewer)||void 0===i?void 0:i.videoTrack)||void 0===e?void 0:e.label)||t.cameraLabel})),s(t)};Xl((function(t){var s=t.cameras.find((function(t){return t.deviceID==i}));if(!s)return e.In.error(n+" "+hi),void u({errorCode:Ur.error.wn.code,extendedData:Ur.error.wn.message});o.setAttributes({device_name:Ur.device_name(null==s?void 0:s.deviceName)}),e.Wu.ba("video",r,i,u)}),(function(t){e.In.warn(n+" getDevices err:"+t),e.Wu.ba("video",r,i,u)}))}))},t.prototype.useFrontCamera=function(t,i){var e=this,n="zc.ufc.0";return ti(this.In,n,""+i),new Xt((function(s,r){var o=Dp(t,e.In),u=e._getSpan(o,Ur.event);if(!Yt(o))return e.In.error(n+" localStream not found"),e.Mn.setError(u,Ur.error._n),void r({errorCode:Ur.error.te.code,extendedData:Ur.error.te.message});if(!Ut(i))return e.In.error(n+" enable must be boolean"),e.Mn.setError(u,Ur.error.te," enable must be boolean"),void r({errorCode:Ur.error.te.code,extendedData:Ur.error.te.message});var a=eh(),c=ih(),h=nh();if(!(a||c||h))return e.In.error(n+" must use in mobile"),e.Mn.setError(u,Ur.error.Sn," must use in mobile"),void r({errorCode:Ur.error.Sn.code,extendedData:Ur.error.Sn.message});var f=i?"user":"environment";u.setAttributes({facing_mode:Ur.facing_mode(f)}),e.Wu.ba("video",o,"",(function(t){u.setAttributes({error:t.errorCode,message:t.extendedData}),u.end(),e.Ro.getPublishList(o).forEach((function(t){var i,e;t.cameraLabel=(null===(e=null===(i=t.publisher.previewer)||void 0===i?void 0:i.videoTrack)||void 0===e?void 0:e.label)||t.cameraLabel})),0===(null==t?void 0:t.errorCode)?s(t):r(t)}),{facingMode:f})}))},t.prototype.useAudioDevice=function(t,i){var e=this,n="zc.uad.1";return ti(this.In,n),new Xt((function(s){var r=Dp(t,e.In),o=e._getSpan(r,Br.event);o.setAttributes({device:Br.device(i)});var u=function(t,i){e.In.error(n+" "+i);var r=t;r.message=r.message+(i?" "+i:""),e.Mn.setError(o,t,i),s({errorCode:r.code,extendedData:r.message})},a=function(t){o.setAttributes({error:t.errorCode,message:t.extendedData}),o.end(),e.Ro.getPublishList(r).forEach((function(t){var i;t.microLabel=(null===(i=r.getAudioTracks()[0])||void 0===i?void 0:i.label)||t.microLabel}));var i=e.Ro.checkPreview(r);0===t.errorCode&&i&&(i.hasMicTrack=!0),s(t)};Yt(r)?qt(i)?Xl((function(t){var s=t.microphones.find((function(t){return t.deviceID==i}));if(!s)return e.In.error(n+" "+hi),void a({errorCode:Br.error.wn.code,extendedData:Br.error.wn.message});o.setAttributes({device_name:Br.device_name(null==s?void 0:s.deviceName)}),e.Wu.ba("audio",r,i,a)}),(function(t){e.In.warn(n+" getDevices err:"+t),e.Wu.ba("audio",r,i,a)})):u(Br.error.te,"deviceID must be string"):u(Br.error._n,"localStream not found")}))},t.prototype.enableDualStream=function(t){var i="zsc.eds";ti(this.In,i);var e=Dp(t,this.In),n=this.Ro.checkPreview(e);if(n)if(null==n?void 0:n.lowStream)this.In.error(i+" low stream already exists");else{var s=n.videoPreviewType||n.previewType;if(uh()&&"custom"==s)this.In.error(i+" can not support firefox");else this.Ro.checkPublish(e)?this.In.error(i+" is publishing"):(n.enableDualStream=!0,n.createLowStream())}else this.In.error(i+" preview no found")},t.prototype.setLowStreamParameter=function(t,i){var e=Dp(t,this.In),n=this.Ro.checkPreview(e);if(n){var s=n.videoInfo,r=[];for(var o in i)isNaN(+i[o])&&r.push(o);if(r.length)throw new Error('param "'.concat(r.join(","),' type error"'));i.width&&s.width&&ed(s.width)&&i.width>ed(s.width)?this.In.error("zsc.slsp.0 low stream width can not larger than high stream"):i.height&&s.height&&ed(s.height)&&i.height>ed(s.height)?this.In.error("zsc.slsp.0 low stream height can not larger than high stream"):i.frameRate&&s.frameRate&&ed(s.frameRate)&&i.frameRate>ed(s.frameRate)||i.height&&s.bitRate&&i.bitRate>s.bitRate||(n.lowStreamConfig=Object.assign(n.lowStreamConfig,i))}else this.In.error("zsc.slsp.0 preview no found")},t.prototype.setDummyCaptureImagePath=function(t,i){var e=this;return new Xt((function(n,s){var r=Dp(i,e.In),o=e.Ro.checkPreview(r);if(!o)return e.In.error("zc.sdcp.0 preview no found"),void n(!1);if(!qt(t))return e.In.error("zc.sdcp.0 filePath type error"),void n(!1);var u=new Image;u.src=t,u.crossOrigin="anonymous",u.onload=function(){o.loadImgTimer&&clearTimeout(o.loadImgTimer),o.loadImgTimer=void 0,e.In.info("zc.sdcp.0 load file path success"),o.setMuteImage(u),n(!0)},o.loadImgTimer=setTimeout((function(){e.In.error("zc.sdcp.0 load img timeout"),n(!1)}),5e3)}))},t.prototype.enableAutoSwitchDevice=function(t){this.In.info("zc.easw call. "+JSON.stringify(t)),this.Nn.autoSwitchDeviceSetting=Fp({},t)},t.prototype.enableCameraCapturing=function(t,i){return void 0===i&&(i=!0),Yp(this,void 0,void 0,(function(){var e,n,s,r,o,u;return Zp(this,(function(c){return this.In.info("zsc.ecc call by user "+i),e=this.Mn.createSpan(a.H,{key:pn},{key:""},Wr),n=Dp(t,this.In),(s=this.Ro.checkPreview(n))?(r=s.videoPreviewType||s.previewType,s.localStream&&s.videoTrack&&"camera"===r?(o=this.Ro.getPublishList(n),u=o.map((function(t){return{stream_id:t.streamID}})),e.setAttributes({enable:Kr(i),stream_list:$r(u)}),e.end(),[2,this.Wu.enableCameraCapturing(s,i)]):(this.In.error("zsc.ecc not camera stream"),[2,!1])):(this.In.error("zsc.ecc "+di),this.Mn.setError(e,Xi),[2,!1])}))}))},t.prototype.getStreamStats=function(t){var i,e,n;return this.In.info("zc.p.0.gqs call"),Yt(t)&&t.getTracks().length>0?n=null===(i=this.Ro.checkPublish(t))||void 0===i?void 0:i.publisher:qt(t)&&(n=null===(e=this.Ro.publisherList[t])||void 0===e?void 0:e.publisher),n?(null==n?void 0:n.qualityHandler.Na)||null:(this.In.error("zsc.sp.0 stream is not publishing"),null)},t.prototype.startWaitPublish=function(){var t=this;this.Ro.waitPublishList.forEach((function(i){t.Ro.startPublishingStream(i)})),this.Ro.waitPublishList=[]},t.prototype.deviceInterruptReport=function(t,i,e){var n="camera"===e?Gn:Hn,s=this.Mn.createSpan(a.H,{key:fn},{key:""},n.event);s.setAttributes({changed_type:n.interrupt(t),device:n.device(i.deviceID),device_name:n.device_name(i.deviceName)}),s.end()},t.prototype.initCopyMusic=function(t){if(this.Ro.useCopyMusic&&!isNaN(this.Nn.engineConfig.choirRole)){var i=this.Ro.checkPreview(t),e=this.Nn.roomList[0];if(e){var n=Array.from(new Set(e.streamList.map((function(t){return t.id_name})))),s=n.length+(n.includes(this.Ro.userid)?0:1);i&&!i.onlyPreview&&i.setVolumeFactorByUserCount(s)}}},t.prototype.setEmptyAudioTrack=function(t,i){if(this.Nn.engineConfig.keepAudioTrack&&0==t.getAudioTracks().length){var e=i.getEmptyAudioTrack();e&&(e.enabled=!1,t.addTrack(e),i&&(i.hasEmptyAudioTrack=!0))}},t.prototype.addShareScreenEnd=function(t){var i=this,e=t.getVideoTracks()[0];e&&(e.onended=function(){var e=i.Mn.createSpan(a.H,{key:fn},{key:""},es.event);e.setAttributes({stop_reason:es.stop_reason("screenSharingEnded")}),t&&i.stopPreview(t),e.end(),i.Nn.actionListener("screenSharingEnded",t)})},t.prototype.destroy=function(){Wt.removeEventListener("visibilitychange",this.eventHandler.visibilitychange)},t}(),hg=function(){return hg=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},hg.apply(this,arguments)},fg=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},lg=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},dg=Pn.event,vg=Pn,mg=function(){function t(t,i,e,n,s){this.In=t,this.dataReport=i,this.Nn=e,this.Ro=n,this.rtm=s}return Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),t.prototype.startPlayingStream=function(t,i,e){var n=this;return this.In.info(hd+" playOption: "+JSON.stringify(function(t,i){var e={};if(t)for(var n=0,s=Object.keys(t);n<s.length;n++){var r=s[n];i.includes(r)||(e[r]=t[r])}return e}(i||{},["CDNVideo","CDNPlayer"]))+" isDataChannel: "+JSON.stringify(!!e),{streamid:t}),new Xt((function(s,r){return n._handlePlayStream(t,i,s,r,e)}))},t.prototype._handlePlayStream=function(t,i,e,n,s){var r,o=this,u=vg,a=function(t,i){o.In.error(hd+" "+(i||t.message));var e=o.Mn.getAPIErrorReport(dg);e&&o.Mn.takeAPIErrorReport(dg,t,e),n&&n(hg(hg({},t),{errorCode:t.code,extendedData:t.message+(i?" "+i:"")}))};if(!t)return a(u.error.He),!1;if(!qt(t))return a(u.error.He,"stream id type error"),!1;if(t.length>256)return a(u.error.Fe,"stream id length limit 256"),!1;if(!ui(t)&&(this.In.warn(hd+" #invald streamID:".concat(t)),this.Nn.isFlutter))return a(u.error.Ye),!1;if(!oi(t))return a(u.error.Ye),!1;if(!Bt(i)&&!Jt(i))return a(u.error.Ge,"playOption must be object"),!1;if(!Bt(null==i?void 0:i.codecTemplateID)&&!Number.isInteger(null==i?void 0:i.codecTemplateID))return a(u.error.Ge,"codecTemplateID must be integer "),!1;if(Ut(null==i?void 0:i.adaptiveSwitch)&&(null==i?void 0:i.adaptiveSwitch)){if((null==i?void 0:i.resourceMode)!==U.L3)return a(u.error.Ge,"adaptiveSwitch only support resourceMode as L3"),!1;if(!Gt(null==i?void 0:i.adaptiveTemplateIDList)||0===(null==i?void 0:i.adaptiveTemplateIDList.length))return a(u.error.Ge,"adaptiveTemplateIDList must be array and length > 0"),!1}var c=this.Ro.maxChannels;if(Lt(c)&&Object.keys(this.Ro.playerList).length>=c){var h=Object.values(this.Ro.playerList).filter((function(t){return!1===(null==t?void 0:t.isProbe)})).length;if(h>=c)return this.In.error("zsc.pss.1 play streams is out limit "+h+" "+c),a(u.error.mn),!1}var f=qo(this.Nn.appid,this.Nn.idName,t),l=((r={})["_play_"+t]={stream_sid:f},r);if(this.Mn.setPublicPros(l),this.Nn.playAccelerate&&this.Nn.roomList.length>0)this.In.info(hd+" play accelerate");else if(this.rtm.isDisConnect())return a(u.error.Ze),!1;this.Nn.pullLimited||(t=NaN+t),i&&i.videoCodec&&(i.videoCodec=i.videoCodec.toUpperCase());var d=this.Nn.settingConfig.getSetting("resource_mode",!0);void 0!==d&&(this.In.info(hd+" setting resource_mode "+d),!i&&(i={}),i.resourceMode=d);var v=this.Ro.setPlayStateStart(t,i,f,s);return!0!==v?(a(JSON.parse(JSON.stringify(v)),"cannot start play"),!1):(this.Ro.onPlayStateUpdate(K,t,{code:0,message:""}),this.Ro.playSuccessCallBackList[t]=function(t){e&&e(t)},n&&(this.Ro.playErrorCallBackList[t]=n),this.Nn.appConfig?(this.Ro.startPlayingStream(t),!0):(this.Ro.waitPlayList.push(t),!0))},t.prototype.setPlayStreamVideoType=function(t,i){var e=this;return new Promise((function(n,s){return fg(e,void 0,void 0,(function(){var e,r;return lg(this,(function(o){switch(o.label){case 0:if(e=mm(this.In,t),!qt(t)||""===t)return e.error(ld+" streamid must be string and not empty"),s(!1),[2];if(!(r=this.Ro.playerList[t]))return e.error(ld+" player not exist"),s(!1),[2];if(![0,1,2].includes(i))return e.error(ld+" streamType must be number 0 or 1 or 2"),s(!1),[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.setPlayStreamVideoType(i)];case 2:return 0===o.sent().result?n(!0):s(!1),[3,4];case 3:return o.sent(),s(!1),[3,4];case 4:return[2]}}))}))}))},t.prototype.stopPlayingStream=function(t,i,e){var n,s,r=mm(this.In,t);r.info(ld+" call");var o=this.Mn.createSpan(a.I,{key:fn},{key:""},Ln.event);if(!qt(t)||""===t)return r.error(ld+" streamid must be string and not empty"),this.Mn.setError(o,Ln.error.te,"stream id type error"),void delete this.Nn.reportSeqList.stopPlay[t];var u=this.Ro.playerList[t];o.setAttributes({stream_id:Ln.stream_id(t),room_id:Ln.room_id(null===(n=this.Ro.playerList[t])||void 0===n?void 0:n.room.roomID),webrtc_sid:Ln.webrtc_sid(null==u?void 0:u.sessionId),stream_sid:Ln.stream_sid(null==u?void 0:u.streamSid),biz_product:u&&(null===(s=u.playOption)||void 0===s?void 0:s.resourceMode)==U.DG?1:0});var c=u&&"NO_PLAY"!==(null==u?void 0:u.curCBState.state);e&&!i&&6!==(null==u?void 0:u.state)&&(i=vg.error.vn);var h=[1,3].includes(null==u?void 0:u.resourceMode)&&(null==u?void 0:u.playMode)===q.CDN;for(var f in this.Ro.stopPlayingStream(t,i),this.Nn.streamUrlMap)if(this.Nn.streamUrlMap[f]===t){delete this.Nn.streamUrlMap[f];break}i?this.Mn.setError(o,i):o.end(),c&&this.Ro.onPlayStateUpdate(W,t,i||{code:0,message:""},{isCDN:h}),r.debug(ld+" call success")},t.prototype.stopPlayingStreamInRoom=function(t){for(var i in this.In.info("zc.spsr.1.0 call "+t),this.Ro.playerList)this.Ro.playerList[i].room.roomID===t&&this.stopPlayingStream(i)},t.prototype.setStreamAudioOutput=function(t,i){var e=this;return!(null==i||0==i.length||!t)&&(this.In.debug("zsc.ssao.0 device "+i),t?"undefined"!==t.sinkId?(t.setSinkId(i).then((function(){e.In.info("zsc.ssao.0 success device: "+i)})).catch((function(t){e.In.info("zsc.ssao.0 "+t.name)})),!0):(this.In.error("zsc.ssao.0 browser does not suppport"),!1):(this.In.error("zsc.ssao.0 no localVideo"),!1))},t.prototype.startWaitPlay=function(){var t=this;this.Ro.waitPlayList.forEach((function(i){t.Ro.startPlayingStream(i)})),this.Ro.waitPlayList=[]},t.prototype.setPlayerListForbid=function(t){var i=this;t.forEach((function(t){var e=t.stream_attr_opts,n=i.Ro.playerList[t.streamID];e&&(null==n||n.setMuteStreamByPlayMode(e))}))},t.prototype.getStreamStats=function(t){var i,e;return this.In.info("zc.p.1.gqs call"),qt(t)&&(e=this.Ro.playerList[t]),e&&(null===(i=null==e?void 0:e.qualityHandler)||void 0===i?void 0:i.Na)?e.qualityHandler.Na||null:(this.In.error("zsc.sp.0 stream is not playing"),null)},t.prototype.mutePlayStreamVideo=function(t,i){ti(this.In,$v,t+" "+i);var e=this.Mn.createSpan(a.H,{key:Pn.event,par:t},{key:""},to);e.setAttributes({mute_type:io(i?1:0)});var n=this.mutePlayStream(t,"video",i);return e.end(),this.In.info($v+" end"),n},t.prototype.mutePlayStreamAudio=function(t,i){ti(this.In,tm,t+" "+i);var e=this.Mn.createSpan(a.H,{key:Pn.event,par:t},{key:""},eo);e.setAttributes({mute_type:no(i?1:0)});var n=this.mutePlayStream(t,"audio",i);return e.end(),this.In.info(tm+" end"),n},t.prototype.muteAllPlayAudioStreams=function(t){var i=this;return ti(this.In,im," "+t),new Promise((function(e,n){if("boolean"!=typeof t)return i.In.error(im+" mute should be a boolean type"),void n(!1);var s=Object.keys(i.Ro.playerList),r=[];if(!i.Ro.playModule)return i.In.info(im+" cannot find play module."),void n(!1);i.Ro.defaultAudioMuted=t,i.In.info(im+" "+"mute ".concat(t," streamid ").concat(JSON.stringify(s)));for(var o=0,u=s;o<u.length;o++){r.push(i.mutePlayStreamAudio(u[o],t))}Promise.all(r).then((function(n){i.In.info(im+" "+"mute ".concat(t," all audio success")),e(!0)})).catch((function(e){i.In.error(im+" mute: "+t+" error catch: "+e),n(!1)}))}))},t.prototype.muteAllPlayVideoStreams=function(t){var i=this;return ti(this.In,em," "+t),new Promise((function(e,n){if("boolean"!=typeof t)return i.In.error(em+" mute should be a boolean type"),void n(!1);var s=Object.keys(i.Ro.playerList),r=[];if(!i.Ro.playModule)return i.In.info(em+" cannot find play module."),void n(!1);i.Ro.defaultVideoMuted=t,i.In.info(em+" "+"mute ".concat(t," streamid ").concat(JSON.stringify(s)));for(var o=0,u=s;o<u.length;o++){r.push(i.mutePlayStreamVideo(u[o],t))}Promise.all(r).then((function(n){i.In.info(em+" "+"mute ".concat(t," all audio success")),e(!0)})).catch((function(e){i.In.error(em+" mute: "+t+" error catch: "+e),n(!1)}))}))},t.prototype.mutePlayStream=function(t,i,e,n){var s=this;return void 0===n&&(n=!0),this.In.info("zsc.mps.0 call "+i+" "+e),new Xt((function(r,o){if(!qt(t)||""==t)return s.In.error("zsc.mps.0 streamID must be string and not empty"),void o(!1);if(!Ut(e))return s.In.error("zsc.mps.0 mute must be boolean"),void o(!1);var u=s.Ro.playerList[t];if(!u)return s.In.error("zsc.mps.0 player not found"),void o(!1);if("video"===i){if(u.playOption&&!1===u.playOption.video)return s.In.error("zsc.mps.0 stream no contain video"),void o(!1);if(n&&(null==u?void 0:u.isServerMuteVideo))return s.In.error("zsc.mps.0 stream ".concat(t," has forbid video")),void o(!1);if(u.playMode===q.CDN)return s.In.info("zsc.mps.0 stream ".concat(t," cdn mute video ").concat(e)),void(u.playMediaStatus.video=!e);u.ActivatePlayVideoStream(e,(function(){var i,n;s.In.info("zsc.mps.0 suc"),u.playMediaStatus.video=!e;var o=Jr,c=s.Mn.createSpan(a.H,{key:Pn.event,par:t},{key:""},o.event);c.setAttributes({webrtc_sid:o.webrtc_sid(u.sessionId),video_activate:o.video_activate(!!u.playMediaStatus.video),audio_activate:o.audio_activate(!!u.playMediaStatus.audio),video_layer:o.video_layer(2===(null===(i=null==u?void 0:u.playOption)||void 0===i?void 0:i.streamType)?-1:null===(n=null==u?void 0:u.playOption)||void 0===n?void 0:n.streamType)}),c.end(),u.handleVideoTrackForPlaying(),r(!0)}),(function(){s.In.error("zsc.mps.0 fail"),o(!1)}))}else if("audio"===i){if(u.playOption&&!1===u.playOption.audio)return s.In.error("zsc.mps.0 stream no contain audio"),void o(!1);if(n&&(null==u?void 0:u.isServerMuteAudio))return s.In.error("zsc.mps.0 stream ".concat(t," has forbid audio")),void o(!1);if(u.playMode===q.CDN)return s.In.info("zsc.mps.0 stream ".concat(t," cdn mute audio ").concat(e)),void(u.playMediaStatus.audio=!e);u.ActivatePlayAudioStream(e,(function(){s.In.info("zsc.mps.0 suc"),u.playMediaStatus.audio=!e;var i=Jr,n=s.Mn.createSpan(a.H,{key:Pn.event,par:t},{key:""},i.event);n.setAttributes({webrtc_sid:i.webrtc_sid(u.sessionId),video_activate:i.video_activate(!!u.playMediaStatus.video),audio_activate:i.audio_activate(!!u.playMediaStatus.audio)}),n.end(),r(!0)}),(function(){s.In.error("zsc.mps.0 fail"),o(!1)}))}else o(!1)}))},t}(),pg=function(){function t(t,i,e,n){this.Ro=t,this.Nn=i,this.In=e,this.rtm=n}return Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),t.prototype.setStreamExtraInfo=function(t,i){var e=this;return new Xt((function(n,s){var r=e.Ro.getRoomByStreamID(t),o=so,u=e.Mn.createSpan(a.H,r?{key:ln,par:null==r?void 0:r.roomID}:{key:pn},{key:""},o.event);u.setAttributes({stream_id:o.stream_id(t),stream_extra_info:o.stream_extra_info(i)});var c=function(t,i){void 0===i&&(i=""),e.In.error("zb.ssei "+i),e.Mn.setError(u,t,i),s({errorCode:t.code,extendedData:t.message+" "+i})};qt(t)&&""!=t?qt(i)?0!==i.length?i.length>1024?c(o.error._zpg_kExtraInfoTooLong):e.rtm.isDisConnect()?c(o.error.Tn):e.Nn.publishStreamList[t]?r?r.streamHandler.setStreamExtraInfo(t,i,(function(t,i){var r,a,c,h;if(0===(null===(r=null==t?void 0:t.body)||void 0===r?void 0:r.err_code)||0===(null==t?void 0:t.errorCode))u.setAttributes({send_seq:o.send_seq(i)}),u.end(),n({errorCode:0===(null===(a=null==t?void 0:t.body)||void 0===a?void 0:a.err_code)?null===(c=null==t?void 0:t.body)||void 0===c?void 0:c.err_code:null==t?void 0:t.errorCode,extendedData:""});else{var f={errorCode:(null===(h=null==t?void 0:t.body)||void 0===h?void 0:h.err_code)||(null==t?void 0:t.code)};e.Mn.setError(u,f),s(f)}}),c):c(o.error.Tn):c(o.error.kn):c(o.error._zpg_kExtraInfoNull):c(o.error.te," extraInfo must be string"):c(o.error.te," streamID must be string and not empty")}))},t}(),gg=function(){return gg=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},gg.apply(this,arguments)},bg=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},_g=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},yg=An,wg=Pn.event,Sg=Pn.error,Eg=bn.error,Og=function(){function t(t,i,e,n,s,r,o){var u=this;this.In=t,this.dataReport=i,this.Nn=e,this.Ro=n,this.rtm=s,this.ac=r,this.zegoWebRtc=o,this.beforeunloadListener=function(){for(var t=0;t<u.Ro.previewStreamList.length;t++)u.Ro.previewStreamList[t].stopPreview();u.Ro.previewStreamList=[]},this.pagehideListener=function(){for(var t in window.event&&(window.event.cancelBubble=!0),u.Ro.publisherList)u.publishModule.stopPublishingStream(t);for(var t in u.Ro.playerList)u.playModule.stopPlayingStream(t)},this.messageListener=function(t){var i=t.data,e=i.type;"SS_DIALOG_SUCCESS"===e&&u.screenStreamFrom(i.streamId,i.canRequestAudioTrack,_o("screenShare",u.Nn.callbackList)),"SS_DIALOG_CANCEL"===e&&_o("screenShare",u.Nn.callbackList)(!1,null,e)},this.offlineListener=function(){for(var t in u.In.info("zc.off.0 "+vi),u.Nn.networkState=B.offline,u.Ro.publisherList){u.Ro.stopNetProbe(u.Ro.publisherList[t].publisher)}for(var t in u.Ro.playerList){var i=u.Ro.playerList[t];i.playMode==q.CDN&&i.zegoCdnPlayer&&(i.zegoCdnPlayer.canRetry=!1),u.Ro.stopNetProbe(i)}},this.onlineListener=function(t){for(var i in u.In.info("zc.on.0 network is online"),u.Nn.networkState=B.online,u.Ro.publisherList){var e=u.Ro.publisherList[i].publisher,n=u.Ro.publisherList[i].retryStreamHandler;7==e.state||e.stateNego==vt.stop||e.iceStateDisConnect?!n.isOverTime&&n.publishStateHandle(Z,i,Eg.ve):6==e.state&&n.stopMaxTime()}for(var i in u.Ro.playerList){var s=u.Ro.playerList[i],r=s.playMode,o=(n=s.retryStreamHandler,s.zegoCdnPlayer);r==q.CDN&&o&&(o.canRetry=!1),7==s.state||r!==q.CDN&&(0==s.stateNego||s.iceStateDisConnect)?!n.isOverTime&&n.playStateHandle(W,i,Sg.en):6==s.state&&n.stopMaxTime()}},this.visibilitychangeListener=function(t){var i="";i="visible"===Wt.visibilityState?"foreground":"background";var e=u.Mn.createSpan(a.H,{key:fn},{key:""},vs);e.setAttribute("state",ms(i)),e.end()},this.safariPagehideListener=function(t){var i=u.Mn.createSpan(a.H,{key:fn},{key:""},vs);i.setAttribute("state",ms("background")),i.end()},this.safariPageshowListener=function(t){var i=u.Mn.createSpan(a.H,{key:fn},{key:""},vs);i.setAttribute("state",ms("foreground")),i.end()},this.publishModule=new cg(this.In,this.dataReport,this.Nn,this.Ro,this.rtm,this.zegoWebRtc),this.playModule=new mg(this.In,this.dataReport,this.Nn,this.Ro,this.rtm),this.Ro.playModule=this.playModule,this.initAdvance(),this.streamCommon=new pg(n,e,t,s),this.initStreamCDN(),this.initAudioMix(),this.Nn.appConfig=this.rtm.getAppConfig(),this.init()}return Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"logger",{get:function(){return this.In},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateCenter",{get:function(){return this.Nn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamCenter",{get:function(){return this.Ro},enumerable:!1,configurable:!0}),t.prototype.init=function(){var t=this;this.bindWindowListener(),this.bindRTMListener(),this.bindStreamCenterHandler(),this.bindEngineDestroyListener(),this.bindListener("_engineConfigUpdate",(function(i){isNaN(i.choirRole)||t.updatePreviewerVolumeFactor()}))},t.prototype.initAudioMix=function(){},t.prototype.initAdvance=function(){},t.prototype.initStreamCDN=function(){},t.prototype.bindWindowListener=function(){var t=th(),i=t.match(/iPad/i)||t.match(/iPhone/i)?"pagehide":"firefox"===this.Nn.browser?"beforeunload":"unload";window.addEventListener("beforeunload",this.beforeunloadListener),window.addEventListener(i,this.pagehideListener),window.addEventListener("message",this.messageListener),window.addEventListener("offline",this.offlineListener),window.addEventListener("online",this.onlineListener),Wt.addEventListener("visibilitychange",this.visibilitychangeListener),rh()&&(window.addEventListener("pagehide",this.safariPagehideListener),window.addEventListener("pageshow",this.safariPageshowListener))},t.prototype.offWindowListner=function(){var t=th(),i=t.match(/iPad/i)||t.match(/iPhone/i)?"pagehide":"firefox"===this.Nn.browser?"beforeunload":"unload";window.removeEventListener("beforeunload",this.beforeunloadListener),window.removeEventListener(i,this.pagehideListener),window.removeEventListener("message",this.messageListener),window.removeEventListener("offline",this.offlineListener),window.removeEventListener("online",this.onlineListener),Wt.removeEventListener("visibilitychange",this.visibilitychangeListener),rh()&&(window.removeEventListener("pagehide",this.safariPagehideListener),window.removeEventListener("pageshow",this.safariPageshowListener))},t.prototype.bindEngineDestroyListener=function(){var t=this;this.Nn.listenerList._engineDestroy.push((function(){t.offWindowListner()}))},t.prototype.bindRTMListener=function(){var t=this;this.rtm._on("_settingCanFetch",(function(i){return bg(t,void 0,void 0,(function(){var t,e,n;return _g(this,(function(s){return this.In.info("zc.scf stream config "+JSON.stringify(i).length),i&&(this.Nn.settingConfig.setSetting(i.setting),(null===(e=i.setting)||void 0===e?void 0:e.open_mini_sdp)&&(t=this.Nn.settingConfig.getSetting("open_mini_sdp"),null===(n=this.Ro)||void 0===n||n.initMiniSdpWorker(t))),[2]}))}))})),this.rtm._on("_appConfigRsp",(function(){t.In.info("zc.acr call ");var i=!t.Nn.appConfig;t.Nn.appConfig=t.rtm.getAppConfig(),t.In.info("zc.acr appConfig ".concat(JSON.stringify(t.Nn.appConfig))),i&&(t.Ro.reConnectSignals(),t.publishModule.startWaitPublish(),t.playModule.startWaitPlay())})),this.rtm._on("_netAppConfigRsp",(function(i){t.Nn.netAppConfig=i,t.Nn.supportBg=t.checkBackgroundCapacity()})),this.rtm._on("_roomLogin",(function(i,e){t.Nn.appid=t.rtm.getAppID(),t.Nn.idName=t.rtm.getUserID(),t.Nn.nickName=t.rtm.getUserName(),t.Nn.testEnvironment=t.rtm.isTestEnvironment(),t.Nn.isMultiRoom=t.rtm.getMultiRoom(),t.Ro.setSessionInfo(t.Nn.appid,t.Nn.idName,t.Nn.testEnvironment);var n=t.Nn.getRoomByRoomID(i);if(!n){var s=new am(t.In,t.Nn,t.rtm,t.Ro,i);t.bindStreamHandler(s),t.Nn.roomList.push(n={roomID:i,streamHandler:s,sessionID:"",roomSessionID:"",token:e,isResetRoom:!1,streamList:[],streamInfoList:[],dataChannelManager:null}),t.Nn.engineConfig.connectMediaServerInAdvance&&t.Ro.connectWebRTCCenterServer(!0,!0,i,e)}})),this.rtm._on("roomLoginResponse",(function(i){return bg(t,void 0,void 0,(function(){var t,e,n,s,r,o;return _g(this,(function(u){return this.In.info("zc.rlr call "+JSON.stringify(i)),t=i.header.room_id||i.body.room_id,this.Nn.appConfig=this.rtm.getAppConfig(),e=this.rtm.getToken(t),n=this.rtm.getSessionId(t),s=this.rtm.getRoomSessionID(t),(r=this.Nn.getRoomByRoomID(t))||(o=new am(this.In,this.Nn,this.rtm,this.Ro,t),this.bindStreamHandler(o),this.Nn.roomList.push(r={roomID:t,streamHandler:o,sessionID:n,roomSessionID:s,token:e,isResetRoom:!1,streamList:[],streamInfoList:[],dataChannelManager:null})),r.sessionID=n,r.roomSessionID=s,1===i.body.stream_fetch_flag?(this.In.info("zc.rlr stream fetch "+t),r.streamHandler.room=r,r.streamHandler.fetchStreamList(),[2]):(r.streamHandler.handleStreamStart(i,r),this.Ro.checkStreamReport(),this.In.info("zc.rlr end "+t),[2])}))}))})),this.rtm._on("HBResponse",(function(i,e){var n,s=null===(n=null==i?void 0:i.header)||void 0===n?void 0:n.room_id,r=t.Nn.getRoomByRoomID(s||e);null==r||r.streamHandler.patchStreamList(i)})),this.rtm._on("_roomStateUpdate",(function(i,e,n,s,r,o){if("CONNECTED"===e&&t.Ro.billingTimer.startChargeInfosUpload(),"DISCONNECTED"==e){t.In.info("zc.rsu "+i+" disconnected "+(n?n+" ":"")+(s||"")),t.Ro.billingTimer.stopChargeInfosUpload();var u=t.Nn.getRoomByRoomID(i);if(u){var a=t.Nn.roomList.findIndex((function(t){return t.roomID==i}));u.isResetRoom=!0,u.streamHandler.reset(),u.dataChannelManager&&t.zegoWebRtc.destroyRealTimeSequentialDataManager(u.dataChannelManager),o||t.Ro.reset(i,n),t.Nn.roomList.splice(a,1)}if(o&&Object.keys(t.streamCenter.playerList).length>0)return;t.Ro.disconnectAllSignal()}else t.In.info("zc.rsu "+i+" state: "+e)})),this.rtm._on("_tokenRenewed",(function(i,e){t.In.info("zc.tr roomID:"+e),t.In.remoteReport("zc.tr token:"+i);var n=t.Nn.getRoomByRoomID(e);n&&(n.token=i)})),this.rtm._on("_stopStream",(function(i,e){i.forEach((function(i){t.publishModule.stopPublishingStream(i,e)}))})),this.rtm._on("_userTransUpdate",(function(i,e,n){var s=t.Nn.getRoomByRoomID(i);s?"pushstatus"===e||"mixpushstatus"===e&&s.streamHandler.getMixStreamStatus(n):t.In.error("zc.opur room no found")})),this.rtm._on("_uaHeartBeatTimeout",(function(){var i;t.In.info("zc.ohbto rtc in use: "+t.streamCenter.useingUdp),t.streamCenter.useingUdp||null===(i=t.rtm.netAgent)||void 0===i||i.reconnectUA()})),this.rtm.liveRoomHandler&&(this.rtm.liveRoomHandler.handlePushStreamMsg=function(i){i.body.stream_cmd=i.header.sub_cmd,i.body.stream_info=i.body.stream_info_list,delete i.body.stream_info_list,t.handlePushStreamMsg(i)})},t.prototype.handlePushStreamMsg=function(t){var i,e=(null===(i=null==t?void 0:t.header)||void 0===i?void 0:i.room_id)||"",n=this.Nn.getRoomByRoomID(e),s=this.rtm.getMsgSpan(os.event,e);if(!n)return this.Mn.setError(s,os.error.yn),void this.In.error("zc.opsu room no found");var r="";switch(t.body.stream_cmd){case H:r="add";break;case G:r="delete";break;case F:r="update"}var o=t.body.stream_info.map((function(t){return{stream_id:t.stream_id,stream_extra_info:t.extra_info,id_name:t.id_name||t.anchor_id_name}}));s.setAttributes({stream_update_type:os.stream_update_type(r),stream_seq:t.body.stream_seq,stream_list:os.stream_list(o)}),s.end(),n.streamHandler.handlePushStreamUpdateMsg(t)},t.prototype.bindStreamCenterHandler=function(){var t=this;this.Ro.onPlayStateUpdate=function(i,e,n){var s,r=mm(t.In,e);r.info("zc.opsu.1 ".concat(i));var o=t.Ro.playerList[e];o&&(0!=i&&1!=i||(o.retryStreamHandler.streamRetryStartTime=0,o.uploadPlayEvent(n)),[0,Sg.vn.code].includes(null==n?void 0:n.code)||(o.latestPlayErrCode=n.code),!o.isProbe&&o.Ca&&(1==i&&n&&o.Ca.setAttributes({error:n.code,message:n.message}),(0===i||2===i&&0!==n.code)&&o.reportMiniSdpInfos(),0!==i&&(pi(o.Ca,{url:yg.url(null===(s=o.signal)||void 0===s?void 0:s.server),ip:yg.ip(o.ip),peer_id:yg.peer_id(o.peerID),source_type:yg.source_type(o.playMode),net_protocol:yg.net_protocol(o.netProtocol),signal_consume:yg.signal_consume(o.signalTime),tryidx:yg.tryidx(o.tryidx)}),o.Ca=void 0)));var u=Date.now();if(0==i?(o.pulledTimeStamp=u,o.updateCDNValidTime()):1==i&&o&&(o.endPlayingSpan({stop_reason:o.stopReason}),o.stopReason=""),1===i&&t.Ro.playErrorCallBackList[e]){r.info("zc.opsu.1 connect changed");var a=n&&(n.code==Sg.vn.code?0:n.code);t.Ro.playErrorCallBackList[e]({errorCode:a||0,extendedData:a?n.message:""}),delete t.Ro.playErrorCallBackList[e],r.info("zc.opsu.1 stop play called by sdk"),t.playModule.stopPlayingStream(e,n)}else{0===i?0==o.firstPulledTimeStamp&&(o.firstPulledTimeStamp=u):o&&o.pulledTimeStamp&&o.updateValidTime(n);var c=function(t){return 0==t||1==t?0==t?"PLAYING":"NO_PLAY":"PLAY_REQUESTING"}(i),h=1===i||(null==o?void 0:o.updateCBState({state:c,code:n.code}));n.code===Sg.vn.code&&(n={code:0,message:""}),h&&t.Nn.actionListener("playerStateUpdate",{state:c,streamID:e,errorCode:n&&n.code,extendedData:n&&n.message})}},this.Ro.onPublishStateUpdate=function(i,e,n){t.onPublishStateUpdateHandle(i,e,n)},this.Ro.onPublishQualityUpdate=function(i,e){t.Nn.actionListener("publishQualityUpdate",i,e)},this.Ro.onPlayQualityUpdate=function(i,e){t.Nn.actionListener("playQualityUpdate",i,e)},this.Ro.onRemoteCameraStatusUpdate=function(i,e,n){var s=t.Mn.createSpan(a.H,{key:wg,par:i},{key:""},Zn);s.setAttributes({stream_id:Qn(i),camera_status:Xn(e),status_code:Wn(n)}),s.end(),t.Nn.actionListener("remoteCameraStatusUpdate",i,e),t.Nn.actionListener("_remoteCameraStatusUpdate",i,n)},this.Ro.onRemoteMicStatusUpdate=function(i,e,n){var s=t.Mn.createSpan(a.H,{key:wg,par:i},{key:""},Kn);s.setAttributes({stream_id:$n(i),mic_status:ts(e),status_code:is(n)}),s.end(),t.Nn.actionListener("remoteMicStatusUpdate",i,e),t.Nn.actionListener("_remoteMicStatusUpdate",i,n)},this.Ro.onSoundLevelUpdate=function(i){t.Nn.actionListener("soundLevelUpdate",i)},this.Ro.onMicSoundLevelUpdate=function(i){t.Nn.actionListener("capturedSoundLevelUpdate",i)}},t.prototype.bindStreamHandler=function(t){var i=this;t.onStreamUpdated=function(t,e,n){var s=n.map((function(t){return{streamID:t.streamID,user:t.user,extraInfo:t.extraInfo,urlsFLV:t.urlFlv,urlsRTMP:t.urlRtmp,urlsHLS:t.urlHls,urlsHttpsFLV:t.urlHttpsFlv,urlsHttpsHLS:t.urlHttpsHls}})),r={};if(0===e){var o=n.map((function(t){return{stream_id:t.streamID,code:ct[t.closeType]&&ct[t.closeType].code||0,description:ct[t.closeType]&&ct[t.closeType].description||"unknown"}}));r.stream_delete_reason=o}if(0===e?s=s.filter((function(t){var e,n=!i.Nn.publishStreamList[t.streamID];return n&&(null===(e=i.streamCenter.playerList[t.streamID])||void 0===e||e.setStreamUpdate(0)),n})):1===e&&s.forEach((function(t){var e;null===(e=i.streamCenter.playerList[t.streamID])||void 0===e||e.setStreamUpdate(1)})),i.updatePreviewerVolumeFactor(t),s.length>0&&i.Nn.actionListener("roomStreamUpdate",t,function(t){return 0==t?"DELETE":"ADD"}(e),s,Object.keys(r).length>0?JSON.stringify(r):""),n.length>0&&i.Nn.actionListener("_streamUpdated",e,n),1===e){var u=[];s.forEach((function(t){t.extraInfo&&u.push({streamID:t.streamID,user:t.user,extraInfo:t.extraInfo})})),u.length>0&&i.Nn.actionListener("streamExtraInfoUpdate",t,u)}},t.onPublishStateUpdate=function(t,e,n,s){var r,o,u,a,c,h,f,l,d;i.In.info("zb.opsu ".concat(t," ").concat(JSON.stringify(n)," ").concat(JSON.stringify(s),"}"),{streamid:e});var v=i.Ro.publisherList[e],m=v&&v.publisher;if(m){var p=v.publisher.isRePublish?yn:_n,g=_n;0!=t&&1!=t||(v.retryStreamHandler.streamRetryStartTime=0,m.uploadPublishEvent(n)),[0,Eg.Ue.code].includes(null==n?void 0:n.code)||(m.latestPublishErrCode=n.code),2===t&&0!==n.code&&m.reportMiniSdpInfos(),0!==t&&i.Mn.spanEnd({key:p.event,par:e},{error:n.code,message:n.message,url:g.url(null===(o=null===(r=null==v?void 0:v.publisher)||void 0===r?void 0:r.signal)||void 0===o?void 0:o.server),ip:g.ip(null===(u=null==v?void 0:v.publisher)||void 0===u?void 0:u.ip),peer_id:g.peer_id(null===(a=null==v?void 0:v.publisher)||void 0===a?void 0:a.peerID),source_type:g.source_type("rtc"),net_protocol:g.net_protocol(null===(c=null==v?void 0:v.publisher)||void 0===c?void 0:c.netProtocol)})}var b=Cn,_=Date.now();if(m){var y=m.publishedTimeStamp;0!=t&&y&&(n&&n.code&&n.code!==Eg.Ue.code&&m.errorTimes++,m.validPublishedTime=_-y,m.publishedTimeStamp=0),0==t?(0==m.firstPublishedTimeStamp&&(m.firstPublishedTimeStamp=_),m.publishedTimeStamp=_):1==t&&(1012===n.code?(i.Ro.stopPublishingStream(e,n),n=gg(gg({},n),{code:qi.code})):2002===n.code&&(i.Ro.stopPublishingStream(e,n),n.code=Pi),m.uploadRTCPublishStats(),i.Mn.spanEnd({key:b.event,par:e},{tryidx:b.tryidx(m.rtcPublishCount),url:b.url(null===(h=null==m?void 0:m.signal)||void 0===h?void 0:h.server),ip:b.ip(null==m?void 0:m.ip),dispatch_external_ip:b.dispatch_external_ip(i.Nn.clientIP),room_id:b.room_id(null===(f=null==v?void 0:v.room)||void 0===f?void 0:f.roomID),room_sid_string:b.room_sid_string(null===(l=null==v?void 0:v.room)||void 0===l?void 0:l.roomSessionID),resource_type:b.resource_type("rtc"),protocol:b.protocol("webrtc"),net_protocol:b.net_protocol(m.netProtocol),stop_reason:b.stop_reason(m.stopReason),error:n.code,message:n.message}),v&&(m.stopReason=""))}n.code===Eg.Ue.code&&(n={code:0,message:""});var w=function(t){return 0==t||1==t?0==t?"PUBLISHING":"NO_PUBLISH":"PUBLISH_REQUESTING"}(t);(1===t||(null===(d=null==v?void 0:v.publisher)||void 0===d?void 0:d.updateCBState({state:w,code:n.code})))&&i.Nn.actionListener("publisherStateUpdate",{state:w,streamID:e,errorCode:n.code,extendedData:s||n.message})},t.onStreamExtraInfoUpdated=function(t,e){var n=e.map((function(t){return{streamID:t.streamID,user:t.user,extraInfo:t.extraInfo}}));i.Nn.actionListener("streamExtraInfoUpdate",t,n)},t.onStreamAttrUpdated=function(t,e){i.playModule&&i.playModule.setPlayerListForbid(e)}},t.prototype.updatePreviewerVolumeFactor=function(t){var i=this;if(this.Ro.useCopyMusic&&!isNaN(this.Nn.engineConfig.choirRole)){this.In.info("zc.rtc.upvf "+t);var e=[];if(t){var n=this.Nn.getRoomByRoomID(t);n&&e.push(n)}else e.push.apply(e,this.Nn.roomList);e.forEach((function(t){var e=Array.from(new Set(t.streamList.map((function(t){return t.id_name}))));i.Ro.previewStreamList.forEach((function(t){t&&!t.onlyPreview&&t.setVolumeFactorByUserCount(e.length)}))}))}},t.prototype.screenStreamFrom=function(t,i,e){var n=this,s={};s.audio={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t}},s.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxWidth:window.screen.width,maxHeight:window.screen.height}},!i&&(s.audio=!1),navigator.mediaDevices.getUserMedia(s).then((function(t){t.getTracks().forEach((function(t){return jo(t,n.In,"zc.st.ssf")})),e(!0,t)})).catch((function(t){e(!1,null,t)}))},t.prototype.onPublishStateUpdateHandle=function(t,i,e){var n=this,s=mm(this.In,i);s.info("zc.opsuh.0 call");var r=this.Ro.publisherList[i],o=r.room;if(o)if(0==t){var u=this.Nn.publishStreamList[i];if(u){var a=!o.streamList.find((function(t){return t.stream_id==i&&(t.anchor_id_name==n.Nn.idName||t.id_name==n.Nn.idName||t.user_id===n.Nn.idName)}));if(s.info("zc.opsuh.0 room stream "+a),[T.tryPublish,T.retryPublish].includes(u.state)&&a)u.state=T.update_info,o.streamHandler.updateStreamInfo(i,k,u.extra_info,(function(t){}),void 0,r.publisher.getStreamAddOptions());else s.info("zc.opsuh.0 stream update"),u.state=T.publishing,this.WebrtcOnPublishStateUpdateHandle(t,i,e)}}else o.streamHandler.onPublishStateUpdate(t,i,e),1==t&&(s.info("zc.opsuh.0 stop publish called by sdk"),this.publishModule.stopPublishingStream(i,e));else s.error("zc.opsuh.0 "+ci)},t.prototype.WebrtcOnPublishStateUpdateHandle=function(t,i,e){if(this.Nn.publishStreamList[i].state==T.publishing){var n=this.Ro.getRoomByStreamID(i);n&&n.streamHandler.onPublishStateUpdate(t,i,e)}},t.prototype.bindListener=function(t,i){return this.Nn.addListener(t,i)},t.prototype.deleteListener=function(t,i){return this.Nn.deleteListener(t,i)},t.prototype.checkBackgroundCapacity=function(){if(this.Nn.netAppConfig){var t=this.Nn.netAppConfig.media_config.publish_config.object_segmentation_platform;return!!t&&!!Uo(t,0)}return!0},t}(),Tg=function(){function t(t){this.view=t,this.offset=0,this.current_start_code_size=0,this.current_nalu_start=0,this.current_nalu_size=0,this.start_code_size=0,this.nalu_start=0,this.left_size=0,this.nalu_size=0,this.left_size=t.byteLength}return t.prototype.FindStartCode=function(){var t=this.view.byteLength-this.offset;for(this.current_start_code_size=0,this.current_nalu_start=-1;t>=3;){if(0==this.view.getUint8(this.offset)&&0==this.view.getUint8(this.offset+1)&&1==this.view.getUint8(this.offset+2))return this.current_start_code_size=3,this.current_nalu_start=this.offset,this.offset-1>=0&&0==this.view.getUint8(this.offset-1)&&(++this.current_start_code_size,--this.current_nalu_start),this.offset+=3,!0;--t,++this.offset}return!1},t.prototype.FindNalu=function(){return this.start_code_size=0,this.nalu_start=0,this.nalu_size=0,!(this.offset>=this.view.byteLength)&&(!!this.FindStartCode()&&(this.start_code_size=this.current_start_code_size,this.nalu_start=this.current_nalu_start,!0))},t.prototype.NextNalu=function(t){if(this.start_code_size=0,this.nalu_start=0,this.nalu_size=0,this.offset>=this.view.byteLength)return!1;if(!this.FindStartCode())return!1;if((this.start_code_size=this.current_start_code_size,this.nalu_start=this.current_nalu_start,t)&&6!=(31&this.view.getUint8(this.nalu_start+this.start_code_size)))return!0;return this.FindStartCode()?(this.offset=this.current_nalu_start,this.nalu_size=this.current_nalu_start-this.nalu_start,!0):(this.nalu_size=this.view.byteLength-this.nalu_start,!0)},t}();function kg(t,i,e){if(0===t)return"";var n=1,s="  Here are some explanations about the error code: ".concat(n++,". reason=").concat(t,": ").concat(function(t){switch(t){case og.PEER_CLOSE_REASON_NORMAL:return"Client voluntarily exits.";case og.PEER_CLOSE_REASON_STATE_ERROR:return"Status error; Reason: Repeatedly received offer/answer, etc.";case og.PEER_CLOSE_REASON_VRS_PUBLISH_DENIED:return"Refuse to push the stream; Reason: The client retweeted the stream and was kicked or the agent's pubstart timed out, etc.";case og.PEER_CLOSE_REASON_VRS_PLAY_DENIED:return"Refuse to pull stream; Reason: may pull empty stream, etc., refer to 'err' error code for details.";case og.PEER_CLOSE_REASON_AUDIO_CODEC_NOT_MATCH:return"No matching audio codec; Reason: Client (Web) does not support OPUS, etc.";case og.PEER_CLOSE_REASON_VIDEO_CODEC_NOT_MATCH:return"No matching video codec; Reason: Client (Web) does not support h264 and vp8 etc.";case og.PEER_CLOSE_REASON_SDP_INVALID:return"SDP parsing error; Reason: SDP format error.";default:return"unknown"}}(t));return i&&(s+=" ".concat(n++,". action=").concat(i,": ").concat(function(t){switch(t){case ug.DENIED_ACTION_STOP:return"cancel pushing stream.";case ug.DENIED_ACTION_RETRY_NEXT_IP:return"Try the next ip, if there is no next ip, re-request the route.";case ug.DENIED_ACTION_REDIRECT:return"Redirect to the ip address specified by data.";case ug.DENIED_ACTION_REDISPATCH:return"re-request route.";case ug.DENIED_ACTION_RETRY:return"retry current gateway node.";default:return"unknown"}}(i))),e&&(s+=" ".concat(n++,". err=").concat(e,": ").concat(function(t){switch(t){case ag.DENIED_ERROR_DISPATCH_FAILED:return"media scheduling failed.";case ag.DENIED_ERROR_EMPTY_PUBLISH_IPS:return"empty publish ips error.";case ag.DENIED_ERROR_EMPTY_PLAY_IPS:return"empty play ips error.";case ag.DENIED_ERROR_STREAM_NOT_EXSIT:return"stream does not exist.";case ag.DENIED_ERROR_APP_NOT_ONLINE:return"APP has been removed.";case ag.DENIED_ERROR_INVALID_PARAMETERS:return"invalid parameter.";case ag.DENIED_ERROR_NO_CLIENTIP_SET:return"client ip is not set.";case ag.DENIED_ERROR_PERMISSION_DENIED:return"No permission, access denied.";case ag.DENIED_ERROR_SET_STREAM_INFO_FAILED:return"Failed to set stream information.";case ag.DENIED_ERROR_INTERNAL_ERROR:return"internal error / server busy.";case ag.DENIED_ERROR_PUBLISH_FORBIDDEN:return"Streaming is banned.";case ag.DENIED_ERROR_NEW_PUBLISH:return"new publish error.";case ag.DENIED_ERROR_INNER_ERROR:return"inner error.";case ag.DENIED_ERROR_MANAGER_STOP:return"manager stop error.";case ag.DENIED_ERROR_PUBLISH_AUTH_FAILED:return"Stream push authentication failed.";case ag.DENIED_ERROR_PLAY_AUTH_FAILED:return"Stream pull authentication failed.";case ag.DENIED_ERROR_SERVER_STOP:return"server stoped error.";case ag.DENIED_ERROR_SESSION_ID:return"session id error.";case ag.DENIED_ERROR_MANAGER_TIMEOUT:return"manager timeout.";case ag.DENIED_ERROR_NEW_PUBLISH_SRC:return"new publish src.";case ag.DENIED_ERROR_PLAY_SESSION_LIMIT:return"Pull session limit.";case ag.DENIED_ERROR_DISABLE_IP_PORT_FLEXIBLE:return"disable ip port flexible.";case ag.DENIED_ERROR_PACKET_ILLEGAL_TS:return"packet illegal ts.";case ag.DENIED_ERROR_PACKET_ILLEGAL_ADDR:return"packet illegal address.";case ag.DENIED_ERROR_PACKET_ILLEGAL_FORMAT:return"packet illegal format.";case ag.DENIED_ERROR_CHECK_ADDR_TIMEOUT:return"Check address timed out.";case ag.DENIED_ERROR_CHECK_ADDR_ILLEGAL_SIGNATURE:return"Check Address Illegal Signature.";case ag.DENIED_ERROR_CHECK_ADDR_INCONSTANT:return"Check for address changes.";case ag.DENIED_ERROR_WEBRTC_NEGOTIATE_TIMEOUT:return"SDP negotiation timed out, check whether the SDP is sent successfully.";case ag.DENIED_ERROR_WEBRTC_CANDIDATE_TIMEOUT:return"Address negotiation timed out, check whether the Candidate is sent successfully.";case ag.DENIED_ERROR_WEBRTC_CONNECTIVITY_CHECK_FAILED:return"The connectivity check failed, probably due to firewall restrictions (protocol or port) that caused the network between the browser and the gateway to fail.";case ag.DENIED_ERROR_WEBRTC_DTLS_HS_FAILED:return"The DTLS handshake fails, the verification of the certificate may fail, and the background checks whether the certificate has expired.";case ag.DENIED_ERROR_WEBRTC_DTLS_HS_TIMEOUT:return"The DTLS handshake timed out, this mainly due to network link packet loss and other situations that caused the timeout. Please check your network status and try again.";case ag.DENIED_ERROR_WEBRTC_SRTP_PROTECT_FAILED:return"Streaming encryption failed";case ag.DENIED_ERROR_WEBRTC_HB_TIMEOUT:return"The heartbeat timed out, this mainly due to network link packet loss and other conditions that caused the timeout. Please check your network status and try again.";case ag.DENIED_ERROR_WEBRTC_CONNECTION_LOST:return"The link is disconnected. In turn mode, if the turn link times out or has been released, the gateway will fail to send, and the gateway will think that the link has been lost.";case ag.DENIED_ERROR_WEBRTC_NEW_SRC:return"After the stream pushing end pushes the stream again, the stream pulling end will receive this message.";default:return"unknown"}}(e))),s}!function(t){t[t.PEER_CLOSE_REASON_NORMAL=0]="PEER_CLOSE_REASON_NORMAL",t[t.PEER_CLOSE_REASON_STATE_ERROR=5]="PEER_CLOSE_REASON_STATE_ERROR",t[t.PEER_CLOSE_REASON_VRS_PUBLISH_DENIED=15]="PEER_CLOSE_REASON_VRS_PUBLISH_DENIED",t[t.PEER_CLOSE_REASON_VRS_PLAY_DENIED=18]="PEER_CLOSE_REASON_VRS_PLAY_DENIED",t[t.PEER_CLOSE_REASON_AUDIO_CODEC_NOT_MATCH=21]="PEER_CLOSE_REASON_AUDIO_CODEC_NOT_MATCH",t[t.PEER_CLOSE_REASON_VIDEO_CODEC_NOT_MATCH=22]="PEER_CLOSE_REASON_VIDEO_CODEC_NOT_MATCH",t[t.PEER_CLOSE_REASON_SDP_INVALID=23]="PEER_CLOSE_REASON_SDP_INVALID"}(og||(og={})),function(t){t[t.DENIED_ACTION_STOP=1]="DENIED_ACTION_STOP",t[t.DENIED_ACTION_RETRY_NEXT_IP=2]="DENIED_ACTION_RETRY_NEXT_IP",t[t.DENIED_ACTION_REDIRECT=3]="DENIED_ACTION_REDIRECT",t[t.DENIED_ACTION_REDISPATCH=4]="DENIED_ACTION_REDISPATCH",t[t.DENIED_ACTION_RETRY=5]="DENIED_ACTION_RETRY"}(ug||(ug={})),function(t){t[t.DENIED_ERROR_DISPATCH_FAILED=1001]="DENIED_ERROR_DISPATCH_FAILED",t[t.DENIED_ERROR_EMPTY_PUBLISH_IPS=1002]="DENIED_ERROR_EMPTY_PUBLISH_IPS",t[t.DENIED_ERROR_EMPTY_PLAY_IPS=1003]="DENIED_ERROR_EMPTY_PLAY_IPS",t[t.DENIED_ERROR_STREAM_NOT_EXSIT=1004]="DENIED_ERROR_STREAM_NOT_EXSIT",t[t.DENIED_ERROR_APP_NOT_ONLINE=1005]="DENIED_ERROR_APP_NOT_ONLINE",t[t.DENIED_ERROR_INVALID_PARAMETERS=1006]="DENIED_ERROR_INVALID_PARAMETERS",t[t.DENIED_ERROR_NO_CLIENTIP_SET=1007]="DENIED_ERROR_NO_CLIENTIP_SET",t[t.DENIED_ERROR_PERMISSION_DENIED=1008]="DENIED_ERROR_PERMISSION_DENIED",t[t.DENIED_ERROR_SET_STREAM_INFO_FAILED=1009]="DENIED_ERROR_SET_STREAM_INFO_FAILED",t[t.DENIED_ERROR_INTERNAL_ERROR=1010]="DENIED_ERROR_INTERNAL_ERROR",t[t.DENIED_ERROR_PUBLISH_FORBIDDEN=1011]="DENIED_ERROR_PUBLISH_FORBIDDEN",t[t.DENIED_ERROR_NEW_PUBLISH=1012]="DENIED_ERROR_NEW_PUBLISH",t[t.DENIED_ERROR_INNER_ERROR=1013]="DENIED_ERROR_INNER_ERROR",t[t.DENIED_ERROR_MANAGER_STOP=1014]="DENIED_ERROR_MANAGER_STOP",t[t.DENIED_ERROR_PUBLISH_AUTH_FAILED=1015]="DENIED_ERROR_PUBLISH_AUTH_FAILED",t[t.DENIED_ERROR_PLAY_AUTH_FAILED=1016]="DENIED_ERROR_PLAY_AUTH_FAILED",t[t.DENIED_ERROR_SERVER_STOP=2001]="DENIED_ERROR_SERVER_STOP",t[t.DENIED_ERROR_SESSION_ID=2002]="DENIED_ERROR_SESSION_ID",t[t.DENIED_ERROR_MANAGER_TIMEOUT=2003]="DENIED_ERROR_MANAGER_TIMEOUT",t[t.DENIED_ERROR_NEW_PUBLISH_SRC=2004]="DENIED_ERROR_NEW_PUBLISH_SRC",t[t.DENIED_ERROR_PLAY_SESSION_LIMIT=2005]="DENIED_ERROR_PLAY_SESSION_LIMIT",t[t.DENIED_ERROR_DISABLE_IP_PORT_FLEXIBLE=2006]="DENIED_ERROR_DISABLE_IP_PORT_FLEXIBLE",t[t.DENIED_ERROR_PACKET_ILLEGAL_TS=2007]="DENIED_ERROR_PACKET_ILLEGAL_TS",t[t.DENIED_ERROR_PACKET_ILLEGAL_ADDR=2008]="DENIED_ERROR_PACKET_ILLEGAL_ADDR",t[t.DENIED_ERROR_PACKET_ILLEGAL_FORMAT=2009]="DENIED_ERROR_PACKET_ILLEGAL_FORMAT",t[t.DENIED_ERROR_CHECK_ADDR_TIMEOUT=2010]="DENIED_ERROR_CHECK_ADDR_TIMEOUT",t[t.DENIED_ERROR_CHECK_ADDR_ILLEGAL_SIGNATURE=2011]="DENIED_ERROR_CHECK_ADDR_ILLEGAL_SIGNATURE",t[t.DENIED_ERROR_CHECK_ADDR_INCONSTANT=2012]="DENIED_ERROR_CHECK_ADDR_INCONSTANT",t[t.DENIED_ERROR_WEBRTC_NEGOTIATE_TIMEOUT=3e3]="DENIED_ERROR_WEBRTC_NEGOTIATE_TIMEOUT",t[t.DENIED_ERROR_WEBRTC_CANDIDATE_TIMEOUT=3001]="DENIED_ERROR_WEBRTC_CANDIDATE_TIMEOUT",t[t.DENIED_ERROR_WEBRTC_CONNECTIVITY_CHECK_FAILED=3002]="DENIED_ERROR_WEBRTC_CONNECTIVITY_CHECK_FAILED",t[t.DENIED_ERROR_WEBRTC_DTLS_HS_FAILED=3003]="DENIED_ERROR_WEBRTC_DTLS_HS_FAILED",t[t.DENIED_ERROR_WEBRTC_DTLS_HS_TIMEOUT=3004]="DENIED_ERROR_WEBRTC_DTLS_HS_TIMEOUT",t[t.DENIED_ERROR_WEBRTC_SRTP_PROTECT_FAILED=3005]="DENIED_ERROR_WEBRTC_SRTP_PROTECT_FAILED",t[t.DENIED_ERROR_WEBRTC_HB_TIMEOUT=3006]="DENIED_ERROR_WEBRTC_HB_TIMEOUT",t[t.DENIED_ERROR_WEBRTC_CONNECTION_LOST=3007]="DENIED_ERROR_WEBRTC_CONNECTION_LOST",t[t.DENIED_ERROR_WEBRTC_NEW_SRC=3008]="DENIED_ERROR_WEBRTC_NEW_SRC"}(ag||(ag={}));var Rg,Ig={FPS:{code:dt.captureFpsToLow,message:"The video capture frame rate is too low."},VOLUME:{code:dt.captureVolumeToLow,message:"The capture volume is too low."}},Ng={V_BITRATE:{code:dt.sendVideoBitrateToLow,message:"The video bit rate sent is too low."},FPS:{code:dt.sendFpsToLow,message:"The video frame rate sent is too low."},A_BITRATE:{code:dt.sendAudioBitrateToLow,message:"The audio bit rate sent is too low."}},Cg={A_VOLUME:{code:dt.receiveVolumeToLow,message:"The volume of audio received is too low."},A_DECODE:{code:dt.receiveAudioDecodedFail,message:"The received audio failed to be decoded."},V_DECODE:{code:dt.receiveVideoDecodedFail,message:"The received video failed to be decoded."},V_DECODED_FPS:{code:dt.receiveVideoFpsDecodedToLow,message:"Received video decode frame rate is too low."},RENDER_VIDEO_FPS:{code:dt.renderVideoFpsToLow,message:"The rendered video frame rate is too low."}},zg={FPS:{code:dt.captureFpsNormal,message:"The video capture frame rate is normal."},VOLUME:{code:dt.captureVolumeNormal,message:"The capture volume is normal."}},Dg={V_BITRATE:{code:dt.sendVideoBitrateNormal,message:"The video bit rate sent is normal."},FPS:{code:dt.sendFpsNormal,message:"The video frame rate sent is normal."},A_BITRATE:{code:dt.sendAudioBitrateNormal,message:"The audio bit rate sent is normal."}},Pg={A_VOLUME:{code:dt.receiveVolumeNormal,message:"The volume of audio received is normal."},A_DECODE:{code:dt.receiveAudioDecodedNormal,message:"The received audio successed to be decoded."},V_DECODE:{code:dt.receiveVideoDecodedNormal,message:"The received video successed to be decoded."},V_DECODED_FPS:{code:dt.receiveVideoFpsDecodedNormal,message:"Received video decode frame rate is normal."},RENDER_VIDEO_FPS:{code:dt.renderVideoFpsNormal,message:"The rendered video frame rate is normal."}},Ag=function(){function t(t,i,e,n){this.Nn=t,this.parentEvent=n,this.results={},this.preTime=Date.now(),this.preTotalFps=0,this.preIsNormal={},this.In=i,this.streamId=e,this.initPreIsNormal(Ig),this.initPreIsNormal(Ng),this.initPreIsNormal(Cg)}return t.prototype.initPreIsNormal=function(t){for(var i in t){this.preIsNormal[t[i].code]=!0}},t.prototype.recordData=function(t,i,e){var n=t.code,s=this.results[n]||[];if(s.push(e),s.length>=5){var r=s.includes(!1);this.preIsNormal[n]&&!r&&(this.uploadEventData(t),this.Nn.actionListener("exceptionUpdate",this.streamId,t)),!this.preIsNormal[n]&&r&&(this.uploadEventData(i),this.Nn.actionListener("exceptionUpdate",this.streamId,i)),this.preIsNormal[n]=r,s=[]}this.results[n]=s},t.prototype.uploadEventData=function(t){var i=this.Nn.reporter.createSpan(a.I,{key:this.parentEvent,par:this.streamId},{key:""},Rr);i.setAttributes({code:Ir(t.code),message:Nr(t.message)}),i.end()},t.prototype.checkRemoteStats=function(t,i){this.recordData(Cg.A_VOLUME,Pg.A_VOLUME,this.recvAudioVolume(t)),this.recordData(Cg.A_DECODE,Pg.A_DECODE,this.recvAudioDecode(t)),this.recordData(Cg.V_DECODE,Pg.V_DECODE,this.recvVideoDecode(t)),this.recordData(Cg.V_DECODED_FPS,Pg.V_DECODED_FPS,this.recvVideoDecodedFrameRate(t)),this.recordData(Cg.RENDER_VIDEO_FPS,Pg.RENDER_VIDEO_FPS,this.renderVideoFrameRate(t,i))},t.prototype.checkLocalStats=function(t){this.recordData(Ig.FPS,zg.FPS,this.captureVideoFrameRate(t)),this.recordData(Ng.FPS,Dg.FPS,this.sendVideoFrameRate(t)),this.recordData(Ig.VOLUME,zg.VOLUME,this.sendAudioVolume(t)),this.recordData(Ng.V_BITRATE,Dg.V_BITRATE,this.sendVideoBitrate(t)),this.recordData(Ng.A_BITRATE,Dg.A_BITRATE,this.sendAudioBitrate(t))},t.prototype.sendVideoBitrate=function(t){return!("1"===t.videoMuteState||t.videoQuality>2)&&0===t.videoBitrate},t.prototype.sendVideoFrameRate=function(t){var i=t.videoTransferFPS,e=t.videoFPS;return"1"!==t.videoMuteState&&(e>=10&&i<5||e<10&&e>=5&&i<=1)},t.prototype.captureVideoFrameRate=function(t){var i=t.videoTargetFPS,e=t.videoFPS;return"1"!==t.videoMuteState&&(i>=10&&e<5||i<10&&i>=5&&e<=1)},t.prototype.sendAudioVolume=function(t){return"1"!==t.audioMuteState&&Math.floor(32767*t.audioLevel)<Math.floor(327.67)},t.prototype.sendAudioBitrate=function(t){var i=t.audioBitrate;return!("1"===t.audioMuteState||t.audioQuality>2)&&(0===i||t.audioTargetBitrate>=48&&i<22)},t.prototype.recvAudioVolume=function(t){return!("1"===t.audioMuteState||t.audioQuality>2)&&(t.audioBitrate>0&&Math.floor(32767*t.audioLevel)<Math.floor(327.67))},t.prototype.recvAudioDecode=function(t){return!("1"===t.audioMuteState||t.audioQuality>2)&&(t.audioBitrate>0&&0===t.audioFPS)},t.prototype.recvVideoDecode=function(t){return!("1"===t.videoMuteState||t.videoQuality>2)&&(t.videoBitrate>0&&0===t.videoTransferFPS)},t.prototype.recvVideoDecodedFrameRate=function(t){var i=t.videoFPS,e=t.videoTransferFPS;return"1"!==t.videoMuteState&&(i>=10&&e<5||i<10&&i>=5&&e<=1)},t.prototype.renderVideoFrameRate=function(t,i){var e=t.videoTransferFPS,n=t.videoRenderFPS;return"1"!==t.videoMuteState&&(-1!=n&&(e>10&&n<5||e<=10&&e>=5&&n<=1))},t}(),Mg=function(){return Mg=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Mg.apply(this,arguments)},xg=function(){function t(t,i,e,n,s,r,o){this.za=t,this.Da=i,this.Pa=e,this.Oo=s,this.Nn=r,this.Ro=o,this.Aa=null,this.Ma=1e3,this.xa=null,this.ja=null,this.La=0,this.Us=0,this.qa={},this.Ua=0,this.Ba=0,this.probeState=ot.probed,this.publishStat={},this.Na={video:{videoBitrate:0,videoFPS:0,videoTransferFPS:0,frameHeight:0,frameWidth:0,muteState:"1",videoQuality:-1,videoPacketsLost:0,videoPacketsLostRate:0,googCodecName:""},audio:{audioBitrate:0,audioCodec:"",muteState:"1",audioQuality:-1,audioFPS:0,audioPacketsLost:0,audioPacketsLostRate:0,googCodecName:""}},this.Ja=0,this.Va="udp",this.Ha={},this.Ga="",this.Fa="",this.Ya=0,this.Za=0,this.Qa=void 0,this.connectIPStack=-1,this.Xa=new Ag(this.Nn,n,this.streamId,bn.event)}return Object.defineProperty(t.prototype,"streamId",{get:function(){return this.Pa.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.Pa.sessionId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerID",{get:function(){return this.Pa.peerID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fo",{get:function(){return this.Pa.localStream},enumerable:!1,configurable:!0}),t.prototype.setPublishQualityTimer=function(){var t=this;null==this.Aa&&(this.Pa.info(Ad+" called ".concat(this.Ma," ").concat(this.za," ").concat(this.Da)),(this.Aa||this.xa||this.ja)&&this.clearPublishQualityTimer(),this.Aa=setInterval((function(){t.Wa()}),this.Ma),this.La=this.Us=Date.now(),1e3!==this.Ma&&(this.za!=this.Ma&&(this.xa=setInterval((function(){t.notifyPublishQuality()}),this.za)),this.Da!=this.Ma&&(this.ja=setInterval((function(){t.reportPublishQuality()}),this.Da))),this.qa={audioPacketsLost:0,videoPacketsLost:0,videoPacketsSent:0,audioPacketsSent:0,audioRetransmittedPacketsSent:0,audioRetransmittedBytesSent:0,videoTime:Date.now(),audioTime:Date.now(),time:Date.now(),audioBytesSent:0,videoBytesSent:0,framesEncoded:0,framesSent:0,videoRetransmittedPacketsSent:0,videoRetransmittedBytesSent:0,videoActualBytesSent:0,qpSum:0})},t.prototype.clearPublishQualityTimer=function(){this.Pa.info("zc.p.0.spqt.1 called ".concat(!!this.Aa," ").concat(!!this.xa," ").concat(!!this.ja)),null!=this.Aa&&(clearInterval(this.Aa),this.Aa=null),null!=this.xa&&(clearInterval(this.xa),this.xa=null),null!=this.ja&&(clearInterval(this.ja),this.ja=null),this.qa={},this.Ba=0,this.Ja=0},t.prototype.Ka=function(){var t=this,i=[],e=!1;if(!this.Pa.peerConnection)return{result:i,hasVideo:e};var n=[],s=this.Pa,r=s.videoSender,o=s.audioSender;return r&&n.push(r),o&&n.push(o),n.forEach((function(n){n.track&&("video"===n.track.kind&&(e=!0),t.Pa.peerConnection&&i.push(t.Pa.peerConnection.getStats(n.track)))})),{result:i,hasVideo:e}},t.prototype.Wa=function(){var t=this;if(this.Pa.peerConnection){var i=this.Ka(),e=i.hasVideo;Promise.all(i.result).then((function(i){0!==i.length&&t.Aa&&t.$a(i.filter((function(t){return t instanceof RTCStatsReport})),i[i.length-1]instanceof RTCStatsReport?null:i[i.length-1],e)})).catch((function(i){t.Pa.info(Ad+" getStats error "+i.toString())}))}},t.prototype.$a=function(t,i,e){var n,s,r,o=this;if(t){var u,a,c=this.Ro.checkPreview(this.fo),h=c&&c.rtcViewer;h&&(u=h.Bo,a=h.Jo),u&&u.currentTime||(u=Ql(this.fo,"video")||u),a&&a.currentTime||(a=Ql(this.fo,"audio")||a||u);var f=[],l="",d={scenario:this.Nn.scenario,sampleTimeWindow:this.Da,audioCodec:"",audioTargetBitrate:this.Pa.videoInfo.audioBitrate/1e3||0,audioBitrate:0,audioRtxBitrate:0,videoTargetBitrate:this.Pa.videoInfo.bitRate||0,videoTargetFPS:this.Pa.videoInfo.frameRate||0,videoBitrate:0,audioFPS:0,audioLevel:0,audioPacketsLost:0,totalAudioEnergy:0,totalSamplesDuration:0,echoReturnLossEnhancement:void 0,audioPacketsLostRate:0,videoFPS:0,nackCount:0,pliCount:0,audioQuality:0,videoQuality:0,frameHeight:0,frameWidth:0,videoTransferFPS:0,videoPacketsLost:0,videoPacketsLostRate:0,totalRoundTripTime:0,currentRoundTripTime:0,availableOutgoingBitrate:void 0,inputWidth:void 0,inputHeight:void 0,inputFPS:void 0,qualityLimitationReason:"",targetBitrate:void 0,retransmitBitrate:void 0,actualEncBitrate:void 0,frameQp:void 0,videoCodecName:void 0,videoMuteState:(null===(n=null==c?void 0:c.videoTrack)||void 0===n?void 0:n.enabled)?"0":"1",audioMuteState:this.fo.getAudioTracks().length>0&&this.fo.getAudioTracks()[0].enabled?"0":"1",soundLevel:null==c?void 0:c.soundLevel,muted:a?a.muted:void 0,audioPaused:a?a.paused:void 0,videoPaused:u?u.paused:void 0,volume:a?a.volume:void 0,sinkId:a?a.sinkId:void 0};this.Pa.ip&&(Sl(this.Pa.ip)?d.ipv6=this.Pa.ip:d.ipv4=wl(this.Pa.ip));var v=this.qa.time,m=0,p=0,g=0,b=0,_=0,y=0;if(t.forEach((function(t){var i=!1;t.forEach((function(t){"track"==t.type&&(i=!0)})),t.forEach((function(e){var n=e.kind||e.mediaType;if(("outbound-rtp"==e.type||"ssrc"==e.type&&null!=e.bytesSent)&&"audio"==n){var s="";if((r=t.get(e.codecId))&&r.mimeType&&(s=r.mimeType.split("/")[1]),o.Fa!==s&&(o.Fa=s),d.audioCodec=o.Fa,0!=v&&(d.audioBitrate=8*(e.bytesSent-o.qa.audioBytesSent)/(e.timestamp-v),e.retransmittedPacketsSent=e.retransmittedPacketsSent||0,e.packetsSent=e.packetsSent||0,d.audioFPS=(e.packetsSent-(e.retransmittedPacketsSent-o.qa.audioRetransmittedPacketsSent)-o.qa.audioPacketsSent)/(e.timestamp-v)*1e3||0,g=(e.retransmittedPacketsSent-o.qa.audioRetransmittedPacketsSent)/(e.packetsSent-o.qa.audioPacketsSent)),d.audioBitrate<0&&(d.audioBitrate=0),void 0!==e.retransmittedBytesSent){if(0!=v)d.audioRtxBitrate=8*(e.retransmittedBytesSent-o.qa.audioRetransmittedBytesSent)/(a=e.timestamp-v);o.qa.audioRetransmittedBytesSent=e.retransmittedBytesSent}o.qa.audioBytesSent=e.bytesSent,o.qa.time=e.timestamp,o.qa.audioPacketsSentTimeStamp=e.packetsSent-o.qa.audioPacketsSent,o.qa.audioPacketsSent=e.packetsSent,o.qa.audioRetransmittedPacketsSent=e.retransmittedPacketsSent}else if(("outbound-rtp"==e.type||"ssrc"==e.type&&null!=e.bytesSent)&&"video"==n){var r,u="";(r=t.get(e.codecId))&&r.mimeType&&(u=r.mimeType.split("/")[1]),o.Ga!==u&&(o.Ga=u),d.videoCodecName=o.Ga;d.isHardwareEncode=function(t){if(t){var i=null==t?void 0:t.toLocaleLowerCase();if("unknown"!==i)return"openh264"!==i&&"libvpx"!==i}}(e.encoderImplementation),d.codecImplementationName=e.encoderImplementation;var a,c=0;if(void 0!==e.retransmittedBytesSent&&(c=e.bytesSent-e.retransmittedBytesSent),0!=v)d.videoBitrate=8*(e.bytesSent-o.qa.videoBytesSent)/(a=e.timestamp-v),d.videoFPS=1e3*(e.framesEncoded-o.qa.framesEncoded)/a,b=(e.retransmittedPacketsSent-o.qa.videoRetransmittedPacketsSent)/(e.packetsSent-o.qa.videoPacketsSent),void 0!==e.retransmittedBytesSent&&(d.retransmitBitrate=8*(e.retransmittedBytesSent-o.qa.videoRetransmittedBytesSent)/a,d.actualEncBitrate=8*(c-o.qa.videoActualBytesSent)/a),void 0!==e.qpSum&&(d.frameQp=(e.qpSum-o.qa.qpSum)/(e.framesEncoded-o.qa.framesEncoded));d.videoBitrate<0&&(d.videoBitrate=0),d.videoFPS<0&&(d.videoFPS=0),d.nackCount=e.nackCount,d.pliCount=e.pliCount,d.qualityLimitationReason=e.qualityLimitationReason,d.targetBitrate=e.targetBitrate,o.qa.videoBytesSent=e.bytesSent,o.qa.framesEncoded=e.framesEncoded,o.qa.time=e.timestamp,o.qa.videoPacketsSentTimeStamp=e.packetsSent-o.qa.videoPacketsSent,o.qa.videoPacketsSent=e.packetsSent,o.qa.videoRetransmittedPacketsSent=e.retransmittedPacketsSent,o.qa.videoRetransmittedBytesSent=e.retransmittedBytesSent,o.qa.videoActualBytesSent=c,o.qa.qpSum=e.qpSum,i||o._c(v,d,e)}else if("remote-inbound-rtp"==e.type&&"video"==n){e.packetsLost>0&&(d.videoPacketsLost=e.packetsLost);var h=e.packetsLost-o.qa.videoPacketsLost;d.videoPacketsLostRate=h>0?h/o.qa.videoPacketsSentTimeStamp:0,e.packetsLost>0&&(o.qa.videoPacketsLost=e.packetsLost),o.qa.videoTime=e.timestamp,p=1e3*e.roundTripTime,y=e.jitter}else if("remote-inbound-rtp"==e.type&&"audio"==n){e.packetsLost>0&&(d.audioPacketsLost=e.packetsLost);var w=e.packetsLost-o.qa.audioPacketsLost;d.audioPacketsLostRate=w>0?w/o.qa.audioPacketsSentTimeStamp:0,e.packetsLost>0&&(o.qa.audioPacketsLost=e.packetsLost),o.qa.audioTime=e.timestamp,m=1e3*e.roundTripTime,_=e.jitter}else if("media-source"==e.type&&("audio"==n||e.id.toLowerCase().indexOf("audio")>=0))d.audioLevel=e.audioLevel||0,d.totalAudioEnergy=e.totalAudioEnergy,d.totalSamplesDuration=e.totalSamplesDuration,d.echoReturnLossEnhancement=e.echoReturnLossEnhancement;else if("media-source"==e.type&&("video"==n||e.id.toLowerCase().indexOf("video")>=0))d.inputWidth=e.width,d.inputHeight=e.height,d.inputFPS=e.framesPerSecond;else if("track"==e.type&&("video"==n||e.id.indexOf("video")>=0||e.frameWidth))o._c(v,d,e);else if("candidate-pair"!=e.type||!e.nominated||uh()&&!e.selected)"local-candidate"===e.type&&f.push(e);else{null!=e.totalRoundTripTime&&(d.totalRoundTripTime=e.totalRoundTripTime),null!=e.currentRoundTripTime&&(d.currentRoundTripTime=e.currentRoundTripTime),void 0!==e.availableOutgoingBitrate&&(d.availableOutgoingBitrate=e.availableOutgoingBitrate),"succeeded"===e.state&&(l=e.localCandidateId);var S=o.Ro.lastChangeIpTime;if(S&&o.Za<S&&Date.now()-S<=15e3){var E=e.bytesReceived,O=o.qa.condidateBytesReceived;O&&(E>O?o.Ya=0:o.Ya++),o.Ya>=5&&(o.Ya=0,o.Za=S,o.onPublishingError(Ki)),o.qa.condidateBytesReceived=E}else o.Ya>0&&(o.Ya=0)}}))})),l){var w=f.find((function(t){return t.id==l}));if(w){var S=void 0;if(void 0!==w.relayProtocol)S=w.relayProtocol;else if(w.protocol)S=w.protocol;else if(w.priority){var E=w.priority>>24;void 0!==E&&(S=Zl(E,this.Nn.browser))}void 0!==S&&this.Va!==S&&(this.Pa.info(Ad+" protocol "+S),this.Va=S);var O=!1,T=w.candidateType,k=w.networkType,R=w.relayProtocol,I=w.relatedAddress,N=w.url,C=w.ip;if(C){var z=El(C);z>=0&&z!==this.connectIPStack&&(this.Pa.info(Md+" "+this.streamId+" ipStack "+kt[z]),this.connectIPStack=z,this.onConnectIPUpdate(C))}O=this.Sc([{key:"candidateType",value:T},{key:"networkType",value:k}]),"relay"===T&&(O=this.Sc([{key:"relayProtocol",value:R},{key:"relatedAddress",value:I},{key:"url",value:N}])),O&&this.Pa.info(Md+" upload candidate change "+JSON.stringify(this.Ha))}}if("chrome"===this.Nn.browser){var D=null===(s=th())||void 0===s?void 0:s.match(/Chrome\/(\d+)/);parseInt(D&&D[1]||"100")<=91&&d.isHardwareEncode&&this.Pa.handleEncBitrate(Number.parseInt(d.targetBitrate),Number.parseInt(d.actualEncBitrate),Number.parseInt(d.retransmitBitrate))}p=isNaN(p)||p<0?0:p,b=isNaN(b)||b<0?0:b,y=isNaN(y)||y<0?0:y,m=isNaN(m)||m<0?0:m,g=isNaN(g)||g<0?0:g,_=isNaN(_)||_<0?0:_;var P=zo(p,b,y),A=zo(m,g,_);if(d.videoQuality=v>0?Do(P):0,d.audioQuality=v>0?Do(A):0,this.Nn.networkState!==B.offline&&"disconnected"!==(null===(r=this.Pa.peerConnection)||void 0===r?void 0:r.connectionState)||(d.videoQuality=V.Die,d.audioQuality=V.Die),e&&(!d.frameHeight||!d.frameWidth)){var M=this.fo.getVideoTracks()[0];M&&(d.frameHeight=M.getSettings().height||0,d.frameWidth=M.getSettings().width||0)}var x=Math.min(P,A);this.Ua=x,this.Tc(d),this.publishStat=d,this.Pa.onStatsUpdated(this.publishStat);var j=Date.now();this.Ma===this.za?this.notifyPublishQuality():this.xa||j-this.La+50>=this.za&&this.notifyPublishQuality(),this.Da===this.Ma?this.reportPublishQuality():this.ja||j-this.Us+50>=this.Da&&this.reportPublishQuality()}},t.prototype.onConnectIPUpdate=function(t){},t.prototype.notifyPublishQuality=function(){this.La=Date.now(),this.Pa.onPublishQualityUpdate(this.streamId,this.Na)},t.prototype.reportPublishQuality=function(){var t=Date.now();this.Us=t,this.checkProbe(),this.Uc(this.publishStat),this.Xa.checkLocalStats(this.publishStat),this.Ro.changeTxQuality(Do(this.Ua)),this.Pa.sendNetQualityGrade(this.Ro.rxQuality,this.Ro.txQuality)},t.prototype.checkProbe=function(){var t=this.Ua,i=this.qa.time;this.Pa.debug(Ad+" netQuality "+t+" "+i),t<=this.Ro.targetQuality?this.Ba++:this.Ba=0,i>0&&this.Ba>=this.Ro.probeStartedNum&&Date.now()>this.Pa.probeTime+this.Ro.probeInterval&&(this.Pa.info(Ad+" netQuality "+t+" start net probe"),this.probeState=ot.tryProbe,this.Pa.poorQualityRetryCnt++,this.Ro.startNetProbe(!0,this.Pa))},t.prototype._c=function(t,i,e){var n=e.frameHeight,s=e.frameWidth,r=e.framesSent,o=e.timestamp;if(i.frameHeight=n,i.frameWidth=s,0===t||this.qa.frameHeight===n&&this.qa.frameWidth===s)0===t&&(this.qa.frameHeight=n,this.qa.frameWidth=s);else{var u=this.Nn.reporter.createSpan(a.H,{key:bn.event,par:this.streamId},{key:""},Sn);u.setAttributes({webrtc_sid:En(this.sessionId),w:On(s),h:Tn(n)}),u.end(),this.qa.frameHeight=n,this.qa.frameWidth=s}0!=t&&(i.videoTransferFPS=1e3*(r-this.qa.framesSent)/(o-t)),i.videoTransferFPS<0&&(i.videoTransferFPS=0),this.qa.framesSent=r},t.prototype.Tc=function(t){var i=t.videoBitrate,e=t.videoFPS,n=t.videoTransferFPS,s=t.frameHeight,r=t.frameWidth,o=t.videoMuteState,u=t.videoQuality,a=t.isHardwareEncode,c=t.audioBitrate,h=t.audioCodec,f=t.audioMuteState,l=t.audioQuality,d=t.audioFPS,v={video:Mg(Mg({},this.Na.video),{videoBitrate:i,videoFPS:e,videoTransferFPS:n,frameHeight:s,frameWidth:r,muteState:o,videoQuality:u,isHardwareEncode:a}),audio:Mg(Mg({},this.Na.audio),{audioBitrate:c,audioCodec:h,muteState:f,audioQuality:l,audioFPS:d}),nackCount:t.nackCount,pliCount:t.pliCount,totalRoundTripTime:t.totalRoundTripTime,currentRoundTripTime:t.currentRoundTripTime};if(void 0!==t.qualityLimitationReason&&(v.qualityLimitationReason=t.qualityLimitationReason),void 0!==t.videoPacketsLost){var m=t.videoPacketsLostRate;v.video.videoPacketsLost=t.videoPacketsLost,v.video.videoPacketsLostRate=m}if(void 0!==t.audioPacketsLost){var p=t.audioPacketsLostRate;v.audio.audioPacketsLost=t.audioPacketsLost,v.audio.audioPacketsLostRate=p}void 0!==t.codecImplementationName&&(v.codecImplementationName=t.codecImplementationName),void 0!==t.videoCodecName&&(v.video.googCodecName=t.videoCodecName),""!==t.audioCodec&&(v.audio.googCodecName=t.audioCodec),this.Na=v},t.prototype.simplifyPublishDataKey=function(t){var i={};return i.scenario=t.scenario,i.aRtxRate=t.audioRtxBitrate,i.aTargetRate=t.audioTargetBitrate,i.aBitrate=Math.trunc(t.audioBitrate),i.vUsrTargetRate=t.videoTargetBitrate,i.vBitrate=Math.trunc(t.videoBitrate),i.aFps=Math.trunc(t.audioFPS),i.aLevel=Math.trunc(1e5*t.audioLevel)/1e5,i.aPktLost=t.audioPacketsLost,i.aTotalEnergy=Math.trunc(1e5*t.totalAudioEnergy)/1e5,i.echoRetLossEnh=Math.trunc(1e5*t.echoReturnLossEnhancement)/1e5,i.aPlr=t.audioPacketsLostRate,i.vFps=Math.trunc(t.videoFPS),i.nackCnt=t.nackCount,i.vPliCnt=t.pliCount,i.aQuality=t.audioQuality,i.vQuality=t.videoQuality,i.vHeight=t.frameHeight,i.vWidth=t.frameWidth,i.vTransFPS=Math.trunc(t.videoTransferFPS),i.vPktLost=t.videoPacketsLost,i.vPlr=t.videoPacketsLostRate,i.rtt=t.currentRoundTripTime,i.bw=t.availableOutgoingBitrate,i.vInputW=t.inputWidth,i.vInputH=t.inputHeight,i.inFps=t.inputFPS,i.qualityLimit=t.qualityLimitationReason,i.vTargetRate=t.targetBitrate,i.vRtxRate=t.retransmitBitrate,i.VEncBitrate=t.actualEncBitrate,i.sinkId=t.sinkId,i.vQP=t.frameQp,i.vCodec=t.videoCodecName,i.vMuteStat=t.videoMuteState,i.aMuteStat=t.audioMuteState,i.aPaused=t.audioPaused,i.vPaused=t.videoPaused,i.muted=t.muted,i.volume=t.volume,i.aSoundLv=t.soundLevel,i.vIsHW=t.isHardwareEncode,i.vCodecImpl=t.codecImplementationName,i},t.prototype.Uc=function(t){var i=Date.now();if(0==this.Ja||i-this.Ja>=2e3){t.stream_type="publish",t.stream_id=this.streamId,t.timeStamp=i;var e=this.simplifyPublishDataKey(t);void 0!==this.Qa&&(e.gw_vRecvKbps=this.Qa.videoRecvBitrate,e.gw_TCStat=this.Qa.trafficControlStat,e.gw_vPlr=this.Qa.videoLostRate,e.gw_aRecvKbps=this.Qa.audioRecvBitrate,e.gw_aPlr=this.Qa.audioLostRate),this.Pa.info(Md+" upload"+JSON.stringify(e)),this.fo&&this.Pa.info(Md+" "+xo(this.fo)),this.Ro.updateQuality(ht.publish_quality,t),this.Ja=i}},t.prototype.Sc=function(t){for(var i=!1,e=0;e<t.length;e++){var n=t[e],s=n.key,r=n.value;this.Ha[s]!==r&&(this.Ha[s]=r,i=!0)}return i},t.prototype.onPublishingError=function(t){},t.prototype.updateGwPublishNetState=function(t){this.Qa=t},t}(),jg=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Lg=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},qg=zh.webrtc_cmd,Ug=67109120,Bg=function(){function t(t,i,e){this.Vc=0,this.Yc=0,this.Zc=0,this.Xc=null,this.Wc=!1,this.$c=0,this.th=0,this.ih=0,this.eh=0,this.nh=0,this.sh=0,this.rh=null,this.oh=0,this.uh=0,this.ah=0,this.hh={},this.fh=new st,this.dh=3e3,this.ar=1e3,this.Pr=null,this.mh={},this.ph={first:!0,seq:0},this.gh={first:!0,seq:0},this.bh={first:!0,seq:0},this.useCmd=!0,this.LOG_TAG=i?"zc.p.prs.0":"zc.p.prs",this.In=t,this.Uo=e,this.In.info("".concat(this.LOG_TAG,".c ").concat(e))}return Object.defineProperty(t.prototype,"dataChannel",{set:function(t){this.Xc=t,t&&this.Zc>=Ug&&(this.Wc=!0,this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," enable dc")))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isCenterServerConnected",{get:function(){var t;return(null===(t=this.rh)||void 0===t?void 0:t.mediaState)===zt.LOGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"webrtcCenterServerSignal",{set:function(t){this.rh=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamId",{get:function(){return this.Uo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerId",{get:function(){return this.Vc},set:function(t){this.Vc!==t&&this.In.warn("".concat(this.LOG_TAG," ").concat(this.streamId," setPeerId: ").concat(this.Vc," ").concat(t,", sid: ").concat(this.sessionId)),this.Vc=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.Yc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gwVersion",{get:function(){return this.Zc},set:function(t){this.Zc=t,t>=Ug&&this.Xc&&(this.Wc=!0,this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," enable dc, sid: ").concat(this.sessionId)))},enumerable:!1,configurable:!0}),t.prototype.reset=function(){var t,i=this,e=this.Xc?1:0;this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId," reset, rtt:(").concat(this.sh,",").concat(this.nh,",").concat(this.eh,"), dc: ").concat(e,", rtt(").concat(this.ih,",").concat(this.th,",").concat(this.$c,"), (tx: ").concat(this.oh," ").concat(this.uh,", rx:").concat(this.ah,"), sid: ").concat(this.sessionId)),this.Pr&&clearTimeout(this.Pr),this.fh.each((function(t){t._data&&delete i.hh[t._data.seq]})),this.fh.removeAll(),null===(t=this.rh)||void 0===t||t.unregisterPeerCallback(this.Yc),this.Zc=0,this.Yc=0,this.Vc=0,this.Xc=null,this.Wc=!1,this.ih=0,this.th=0,this.$c=0,this.sh=0,this.nh=0,this.eh=0,this.oh=0,this.uh=0,this.ah=0,this.ph.first=!0,this.gh.first=!0,this.bh.first=!0},t.prototype.isDCReady=function(){return!(!this.Xc||"open"!=this.Xc.readyState)},Object.defineProperty(t.prototype,"DCState",{get:function(){return this.Xc?this.Xc.readyState:"invalid"},enumerable:!1,configurable:!0}),t.prototype.isUseDC=function(){return!!this.Wc&&(!(this.Zc<Ug)&&"open"===this.DCState)},t.prototype.addReqTask=function(t,i,e,n,s){var r={seq:t,deleted:!1,cmd:i,sendTime:(new Date).getTime(),success:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];n&&n.apply(void 0,t)},error:s,timeout:this.dh,isOverDC:e},o=this.fh.push(r);this.hh[r.seq]=o,this.checkTimer()},t.prototype.removeReqTask=function(t){t._data&&delete this.hh[t._data.seq],this.fh.remove(t)},t.prototype.checkTimer=function(){var t=this;this.fh.size()>0?this.Pr||(this.Pr=setTimeout((function(){t.Pr=null,t.onTimeout()}),this.ar)):this.Pr&&(clearTimeout(this.Pr),this.Pr=null)},t.prototype.onTimeout=function(){for(var t,i=this.fh.getFirst(),e=(new Date).getTime();null!=i&&i._data&&!(i._data.sendTime+this.dh>e);)i._data.isOverDC&&(this.Wc&&(this.In.error("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", rollback DC, sid: ").concat(this.sessionId)),this.Wc=!1),this.uh++),this.removeReqTask(i),this.In.warn("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", timeout, cmd: ").concat(i._data.cmd,", seq: ").concat(null===(t=i._data)||void 0===t?void 0:t.seq,", dc: ").concat(i._data.isOverDC)),i._data.error&&i._data.error(1,i._data.seq),i=this.fh.getFirst();this.checkTimer()},t.prototype.onDataChannelMessage=function(t){var i=new Uint8Array(t),e=i[0];if(11!=e||i.length<4)this.In.error("".concat(this.LOG_TAG,".dc ").concat(this.streamId," pid: ").concat(this.peerId,", header type(").concat(e," != 0xb)"));else{var n=15&i[1],s=i[2]<<8|i[3],r=i.slice(4);s>i.length-4?this.In.error("".concat(this.LOG_TAG,".dc ").concat(this.streamId," pid: ").concat(this.peerId,", invalid data, len: ").concat(i.length," ").concat(s)):2==n?this.handleCmdPush(r,!0):1==n?this.handleCmdRsp(r,0,!0):this.In.error("".concat(this.LOG_TAG,".dc ").concat(this.streamId," pid: ").concat(this.peerId,", unknown cmd type: ").concat(n,", sid: ").concat(this.sessionId))}},t.prototype.emitCallback=function(t,i){var e=this.mh[t];e&&e.callback(i.seq,this.Yc,i)},t.prototype.updateRtt=function(t){if(this.sh=t,0===this.eh)return this.eh=t,void(this.nh=t);t>this.eh&&(this.eh=t),t<this.nh&&(this.nh=t)},t.prototype.updateDcRtt=function(t){if(this.ih=t,0===this.$c)return this.$c=t,void(this.th=t);t>this.$c&&(this.$c=t),t<this.th&&(this.th=t)},t.prototype.handleCmdHeartbeatMsg=function(t,i){var e=this,n=[{key:"p2p_net_stat_rsp",type:"rsp",field:"p2p_net_stat_rsp"},{key:"play_net_stat",type:"req",field:"play_net_stat_notify"},{key:"net_quality_push",type:"req",field:"net_quality_grade_push"},{key:"pub_net_stat",type:"req",field:"PublishNetStatNotify"},{key:"pub_quality_grade_rsp",type:"rsp",field:"pub_quality_grade_rsp"},{key:"stream_status_push",type:"req",field:"StreamStatusNotifyPush"},{key:"code_err_push",type:"req",field:"codec_error_notify"},{key:"play_event_push",type:"req",field:"PlayEventPush"},{key:"pub_event_push",type:"req",field:"PublishEventPush"}];t.payloads.forEach((function(t){var s,r="cmd_hb_msg",o=n.find((function(i){return t.hasOwnProperty(i.key)}));o&&(r=o.field,s=t[o.key],"rsp"===o.type?e.internalCheckCmdRsp(s,0,i,r):e.emitCallback(r,s))}))},t.prototype.handleCmdPush=function(t,i,e){i&&this.ah++;var n=qg.WebrtcCmdReqMsg.decode(t);if(n){var s,r=Object.keys(n)[0];this.In.debug("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", handleCmdPush fromDC: ").concat(i,", cmd: ").concat(r)),ri(n[r]);var o,u,a=0;switch(r){case"net_quality_grade_push":o=n.net_quality_grade_push,s="net_quality_grade_ack",a=7,(this.gh.first||o.seq>this.gh.seq)&&(this.gh.first=!1,this.gh.seq=o.seq,u="net_quality_grade_push");break;case"codec_error_notify":o=n.codec_error_notify,s="codec_error_notify_ack",a=9,u="codec_error_notify";break;case"candidate_push":o=n.candidate_push,s="candidate_push_ack",a=12,u="CandidateInfoPush";break;case"close_peer_push":o=n.close_peer_push,s="close_peer_ack",a=13,u="CloseSessionPush";break;case"stream_status":o=n.stream_status,s="stream_status_ack",a=14,(this.ph.first||o.seq>this.ph.seq)&&(this.ph.first=!1,this.ph.seq=o.seq,u="StreamStatusNotifyPush");break;case"client_info":o=n.client_info,s="client_info_ack",a=18,u="ClientInfoPush",n.client_info.peer_id&&(this.Vc=n.client_info.peer_id);break;case"net_quality_push":s="net_quality_ack",a=20,void 0===(o=n.net_quality_push).peer_id&&(o.peer_id=this.peerId),(this.bh.first||o.seq>this.bh.seq)&&(this.bh.first=!1,this.bh.seq=o.seq,u="NetQualityInfoPush");break;case"publish_event":o=n.publish_event,s="publish_event_ack",a=23,u="PublishEventPush";break;case"play_event":o=n.play_event,s="play_event_ack",a=26,u="PlayEventPush";break;case"heartbeat_msg_push":s="heartbeat_msg_ack",a=27,this.handleCmdHeartbeatMsg(o=n.heartbeat_msg_push,i);break;default:return void this.In.error("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", handleCmdPush fromDC:").concat(i,", unknown cmd: ").concat(r,", sid: ").concat(this.sessionId))}if(o)s&&this.sendCmdAck(s,a,0,(null==o?void 0:o.seq)?o.seq:0,i,e),u&&this.emitCallback(u,o)}else this.In.error("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", handleCmdPush, decode failed"))},t.prototype.internalCheckCmdRsp=function(t,i,e,n){t.seq=(null==t?void 0:t.seq)?t.seq:i;var s=this.hh[t.seq];if(s){if(this.removeReqTask(s),s._data){var r=(new Date).getTime()-s._data.sendTime;e?this.updateDcRtt(r):this.updateRtt(r),s._data.success&&s._data.success(t.seq,t)}}else this.In.warn("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId," handleCmdRsp, unknown seq: ").concat(t.seq,", cmd: ").concat(n,", sid: ").concat(this.sessionId))},t.prototype.handleCmdRsp=function(t,i,e){var n=qg.WebrtcCmdRspMsg.decode(t);if(n){var s,r=Object.keys(n)[0];switch(ri(n[r]),r){case"p2p_net_stats_get":s=n.p2p_net_stats_get;break;case"net_quality_grade":s=n.net_quality_grade;break;case"stream_status_ack":s=n.stream_status_ack;break;case"stream_property_update_ack":s=n.stream_property_update_ack;break;case"usr_sei_filter":s=n.usr_sei_filter;break;case"video_stream_sub":s=n.video_stream_sub;break;case"broadcaster_status_ack":s=n.broadcaster_status_ack;break;case"active_audio_play":s=n.active_audio_play;break;case"active_video_play":s=n.active_video_play;break;case"net_quality_probe":s=n.net_quality_probe;break;case"active_sei_insert":s=n.active_sei_insert;break;case"close_peer":s=n.close_peer;break;case"play_stats":return;case"restart_ice":s=n.restart_ice;break;default:return void this.In.error("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", handleCmdRsp, unknown cmd: ").concat(r,", sid: ").concat(this.sessionId))}s&&this.internalCheckCmdRsp(s,i,e,r),this.checkTimer()}else this.In.error("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", handleCmdRsp, decode failed"))},t.prototype.sendCmdAck=function(t,i,e,n,s,r){var o,u=qg.WebrtcCmdRspMsg.encode((o={},o[t]={result:e,seq:n},o)).finish();s&&this.isDCReady()?this.sendAckByDC(u):this.rh&&this.rh.sendGWCmdAck(this.Yc,{peer_id:this.Vc,cmd_id:i},u,r)},t.prototype.sendReqByDC=function(t){this.sendByDC(t,0),this.oh++},t.prototype.sendAckByDC=function(t){this.sendByDC(t,3)},t.prototype.sendByDC=function(t,i){var e,n=new Uint8Array(4+t.length),s=0;n[s]=11,n[++s]=i,n[++s]=t.length>>8,n[s+1]=t.length-(n[s]<<8),n.set(t,s+=2),s+=t.length,null===(e=this.Xc)||void 0===e||e.send(n)},t.prototype.registerPeerCallback=function(){var t=this;this.rh&&this.rh.registerPeerCallback(this.Yc,(function(i,e){t.handleMsgWithSession(i,e)}))},t.prototype.handleMsgWithSession=function(t,i){var e,n,s;if(t){var r=t.header,o=r.seq,u=r.cmd,a=r.session_id;if(i===Dt.RSP){if("CmdRsp"===u)return void this.handleCmdRsp(null===(e=t.body)||void 0===e?void 0:e.body,o,!1);var c=this.hh[o];if(!c)return void this.In.warn("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId," handleMsgWithSession, unknown seq: ").concat(o,", cmd: ").concat(u,", sid: ").concat(a));if(this.removeReqTask(c),c._data){var h=(new Date).getTime();this.updateRtt(h-c._data.sendTime),c._data.success&&c._data.success(o,t.body)}this.checkTimer()}else if("CmdPush"===u)this.handleCmdPush(null===(n=t.body)||void 0===n?void 0:n.body,!1,{seq:o,sessionId:a});else{var f=this.mh[u];f&&f.callback(null===(s=null==t?void 0:t.header)||void 0===s?void 0:s.seq,this.Yc,null==t?void 0:t.body)}}},t.prototype.registerPushCallback=function(t,i){this.mh[t]={callback:i},this.rh&&["SessionResetPush"].includes(t)&&this.rh.registerPushCallback(t,this.Yc,i)},t.prototype.unregisterPushCallback=function(t){delete this.mh[t],this.rh&&this.rh.unregisterPushCallback(t,this.Yc)},t.prototype.dispatchGwNodes=function(t,i,e){if(this.rh){var n=N();this.rh.dispatchGwNodes(n,t,i,e)}},t.prototype.getGwVersString=function(t){var i=t>>8&65535,e=255&t;return"".concat(t>>24,".").concat(i,".").concat(e)},t.prototype.createSession=function(t,i,e,n){var s=this;if(this.rh){var r=i.serverHost,o=performance.now();this.rh.createSession(t,i,(function(t,i,n){return jg(s,void 0,void 0,(function(){var s,u;return Lg(this,(function(a){return o&&(s=(performance.now()-o).toFixed(0)),u=r.length>0?r:null==n?void 0:n.gw_nodes[0],this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," CreateSessionRsp, node: ").concat(u,", gw ver: ").concat(this.getGwVersString(n.gw_version),", rtt: ").concat(s,", sid: ").concat(i)),this.Yc=n.session_id,this.gwVersion=n.gw_version,this.registerPeerCallback(),e&&e(t,n.session_id,n),[2]}))}))}),(function(t,i){n&&n(t,i)}))}},t.prototype.createSessionWithSdp=function(t,i,e){var n=this;if(this.rh){var s=performance.now();this.rh.createSessionWithSdp(t,(function(e,r,o){return jg(n,void 0,void 0,(function(){var n,u;return Lg(this,(function(a){return s&&(n=(performance.now()-s).toFixed(0)),u=t.serverHost.length>0?t.serverHost:null==o?void 0:o.gw_nodes[0],this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," CreateSessionWithSdpRsp, node: ").concat(u,", gw ver: ").concat(this.getGwVersString(o.gw_version),", rtt: ").concat(n,", sid: ").concat(r)),this.Yc=r,this.gwVersion=o.gw_version,o.params_ext&&o.params_ext.peer_id&&(this.peerId=o.params_ext.peer_id),this.registerPeerCallback(),i&&i(e,r,o),[2]}))}))}),(function(t,i){e&&e(t,i)}))}},t.prototype.sendMediaDesc=function(t,i,e,n,s,r){var o=this;this.addReqTask(t,"MediaDesc",!1,(function(t,i){s&&s(t,o.Yc,i)}),(function(t){r&&r(t)})),this.rh&&this.rh.sendMediaDesc(t,i,e,n)},t.prototype.sendMediaDescUpdateReq=function(t,i,e,n,s){var r=this;this.addReqTask(t,"MediaDescUpdate",!1,(function(t,i){n&&n(t,r.Yc,i)}),(function(t){s&&s(t)})),this.rh&&this.rh.sendMediaDescUpdateReq(t,i,e)},t.prototype.sendCandidateInfo=function(t,i,e){var n=this,s=N();this.addReqTask(s,"CandidateInfo",!1,(function(t,e){i&&i(t,n.Yc,e)}),(function(t){e&&e(t)})),this.rh&&this.rh.sendCandidateInfo(s,this.Yc,t)},t.prototype.sendCloseSession=function(t,i,e){var n=this;if(this.Yc>0){var s=N();this.addReqTask(s,"CloseSession",!1,(function(t,e){i&&i(t,n.Yc,e)}),(function(t){e&&e(t)})),this.rh&&this.rh.sendCloseSession(s,this.Yc,t)}},t.prototype.sendStreamStatus=function(t,i,e,n){var s,r=N(),o=this.isUseDC();if(this.addReqTask(r,"StreamStatus",o,(function(t,i){e(t,i)}),(function(t){n&&n()})),this.useCmd&&this.Zc>=Ug&&this.peerId>0){this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", seq: ").concat(r,", sendStreamStatus(").concat(t,", ").concat(i,"), dc:").concat(o));var u=qg.WebrtcCmdReqMsg.encode({stream_status:{mic_status:i,camera_status:t,seq:r}}).finish();o&&this.isDCReady()?this.sendReqByDC(u):this.isCenterServerConnected&&(null===(s=this.rh)||void 0===s||s.sendGWCmdReq(this.Yc,r,{peer_id:this.peerId,cmd_id:16,body:u}))}else this.rh&&this.isCenterServerConnected&&this.rh.sendStreamStatus(r,this.Yc,t,i,this.streamId);return r},t.prototype.sendStreamAlignmentProperty=function(t){var i=this;return new Xt((function(e){var n=N(),s=qg.WebrtcCmdReqMsg.encode({stream_property_update:{enable_stream_alignment_when_mix:t,seq:n}}).finish(),r=i.isUseDC();i.addReqTask(n,"StreamPropertyUpdate",r,(function(t){e(!0)}),(function(t){i.In.error("".concat(i.LOG_TAG," ").concat(i.streamId," pid: ").concat(i.peerId,", seq: ").concat(n,", sendStreamPropertyUpdate error: ").concat(t)),e(!1)})),i.In.info("".concat(i.LOG_TAG," ").concat(i.streamId," pid: ").concat(i.peerId,", seq: ").concat(n,", sendStreamAlignmentProperty(").concat(t,"), dc: ").concat(r)),r?i.sendReqByDC(s):i.rh?i.rh.sendGWCmdReq(i.Yc,n,{peer_id:i.peerId,cmd_id:9,body:s}):e(!1)}))},t.prototype.sendSEIUUID=function(t){return jg(this,void 0,void 0,(function(){var i=this;return Lg(this,(function(e){return[2,new Xt((function(e,n){var s=N(),r=qg.WebrtcCmdReqMsg.encode({usr_sei_filter:{sei_filter:t,seq:s}}).finish(),o=i.isUseDC();i.addReqTask(s,"usr_sei_filter",o,(function(t){e(t)}),(function(t){n(t)})),i.In.info("".concat(i.LOG_TAG," ").concat(i.streamId," pid: ").concat(i.peerId,", seq: ").concat(s,", sendSEIUUID:").concat(t,", dc: ").concat(o)),o?i.sendReqByDC(r):i.rh?i.rh.sendGWCmdReq(i.Yc,s,{peer_id:i.Vc,cmd_id:5,body:r}):n(3)}))]}))}))},t.prototype.subscribeVideoStream=function(t){return jg(this,void 0,void 0,(function(){var i=this;return Lg(this,(function(e){return[2,new Xt((function(e,n){var s=N(),r=qg.WebrtcCmdReqMsg.encode({video_stream_sub:{type:t,seq:s}}).finish(),o=i.isUseDC();i.addReqTask(s,"video_stream_sub",o,(function(t){e(t)}),(function(t){n(t)})),i.In.info("".concat(i.LOG_TAG,".dc ").concat(i.streamId," pid: ").concat(i.peerId,", seq: ").concat(s,", subscribeVideoStream:").concat(t,", dc: ").concat(o)),o?i.sendReqByDC(r):i.rh?i.rh.sendGWCmdReq(i.Yc,s,{peer_id:i.Vc,cmd_id:2,body:r}):n(3)}))]}))}))},t.prototype.sendRestartIce=function(t,i){return jg(this,void 0,void 0,(function(){var e=this;return Lg(this,(function(n){return[2,new Xt((function(n,s){var r=N(),o=qg.WebrtcCmdReqMsg.encode({restart_ice:{ice_ufrag:t,ice_pwd:i,seq:r}}).finish(),u=e.isUseDC();e.addReqTask(r,"restart_ice",u,(function(t){ri(t[Object.keys(t)[0]]),n(t)}),(function(t){s(t)})),e.In.info("".concat(e.LOG_TAG,".dc ").concat(e.streamId," pid: ").concat(e.peerId,", seq: ").concat(r,", iceUfrag:").concat(t,", icePwd:").concat(i,", dc: ").concat(u)),u?e.sendReqByDC(o):e.rh?e.rh.sendGWCmdReq(e.Yc,r,{peer_id:e.Vc,cmd_id:28,body:o}):s(3)}))]}))}))},t.prototype.sendNetQualityGrade=function(t,i){var e=N(),n=qg.WebrtcCmdReqMsg.encode({net_quality_grade:{rx_quality:t,tx_quality:i,seq:e}}).finish(),s=this.isUseDC();this.addReqTask(e,"net_quality_grade",s,(function(t){}),(function(t){})),s?this.sendReqByDC(n):this.rh&&this.rh.sendGWCmdReq(this.Yc,e,{peer_id:this.peerId,cmd_id:6,body:n})},t.prototype.sendBroadcasterStatus=function(t){var i,e=this,n=N(),s=this.isUseDC();if(this.addReqTask(n,"broadcaster_status",s,(function(t,i){e.In.debug("".concat(e.LOG_TAG," ").concat(e.streamId," pid: ").concat(e.peerId,", seq: ").concat(t,", BroadcasterStatusRsp: ").concat(JSON.stringify(i)))}),(function(t){e.In.error("".concat(e.LOG_TAG," ").concat(e.streamId," pid: ").concat(e.peerId,", seq: ").concat(n,", sendBroadcasterStatus error: ").concat(t))})),this.useCmd&&this.Zc>=Ug&&this.peerId>0){this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", seq: ").concat(n,", sendBroadcasterStatus(").concat(t,"), dc:").concat(s));var r=qg.WebrtcCmdReqMsg.encode({broadcaster_status:{status:t,seq:n}}).finish();s?this.sendReqByDC(r):null===(i=this.rh)||void 0===i||i.sendGWCmdReq(this.Yc,n,{peer_id:this.peerId,cmd_id:17,body:r})}else this.rh&&this.rh.sendBroadcasterStatus(n,this.Yc,t)},t.prototype.sendNetProbeReq=function(t,i){var e,n=this,s=N(),r=this.isUseDC();if(this.addReqTask(s,"net_quality_probe",r,(function(i,e){n.In.debug("".concat(n.LOG_TAG," ").concat(n.streamId," pid: ").concat(n.peerId,", seq: ").concat(i,", NetProbeRsp: ").concat(JSON.stringify(e))),t&&t(i,e)}),(function(t){n.In.error("".concat(n.LOG_TAG," ").concat(n.streamId," pid: ").concat(n.peerId,", seq: ").concat(s,", sendNetProbeReq error: ").concat(t)),i&&i(t)})),this.useCmd&&this.Zc>=Ug&&this.peerId>0){this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", seq: ").concat(s,", sendNetProbeReq, dc: ").concat(r));var o=qg.WebrtcCmdReqMsg.encode({net_quality_probe:{seq:s,action:1}}).finish();r?this.sendReqByDC(o):null===(e=this.rh)||void 0===e||e.sendGWCmdReq(this.Yc,s,{peer_id:this.peerId,cmd_id:23,body:o})}else this.rh&&this.rh.sendNetProbe(s,this.Yc,this.peerId)},t.prototype.getP2PNetStats=function(t,i){var e,n=this;if(this.peerId){var s=N(),r=this.isUseDC();if(this.addReqTask(s,"p2p_net_stats_get",r,(function(i,e){n.In.debug("".concat(n.LOG_TAG," ").concat(n.streamId," pid: ").concat(n.peerId,", seq: ").concat(i,", getP2PNetStatsRsp: ").concat(JSON.stringify(e))),t&&t(i,e)}),(function(t){n.In.error("".concat(n.LOG_TAG," ").concat(n.streamId," pid: ").concat(n.peerId,", seq: ").concat(s,", getP2PNetStats error: ").concat(t)),i&&i(t)})),this.useCmd&&this.Zc>=Ug&&this.peerId>0){var o=qg.WebrtcCmdReqMsg.encode({p2p_net_stats_get:{seq:s}}).finish();r?this.sendReqByDC(o):null===(e=this.rh)||void 0===e||e.sendGWCmdReq(this.Yc,s,{peer_id:this.peerId,cmd_id:26,body:o})}else this.rh&&this.rh.getP2PNetStats(s,this.Yc,this.peerId)}else this.In.warn("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId," invalid, getP2PNetStats)"))},t.prototype.ActivatePlayAudioStream=function(t,i,e){var n,s=this,r=N(),o=this.isUseDC();if(this.addReqTask(r,"active_audio_play",o,(function(t,e){s.In.info("".concat(s.LOG_TAG," ").concat(s.streamId," pid: ").concat(s.peerId,", seq: ").concat(t,", ActivatePlayAudioStreamRsp: ").concat(JSON.stringify(e))),i&&i(t,e)}),(function(t){s.In.error("".concat(s.LOG_TAG,".dc ").concat(s.streamId," pid: ").concat(s.peerId,", seq: ").concat(r,", ActivatePlayAudioStream error: ").concat(t)),e&&e(t)})),this.useCmd&&this.Zc>=Ug&&this.peerId>0){this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", seq: ").concat(r,", ActivatePlayAudioStream(").concat(t,"), dc: ").concat(o));var u=qg.WebrtcCmdReqMsg.encode({active_audio_play:{active:t?0:1,seq:r}}).finish();o?this.sendReqByDC(u):null===(n=this.rh)||void 0===n||n.sendGWCmdReq(this.Yc,r,{peer_id:this.peerId,cmd_id:20,body:u})}else this.rh&&this.rh.ActivatePlayAudioStream(r,this.Yc,t)},t.prototype.ActivatePlayVideoStream=function(t,i,e){var n,s=this,r=N(),o=this.isUseDC();if(this.addReqTask(r,"active_video_play",o,(function(t,e){s.In.debug("".concat(s.LOG_TAG," ").concat(s.streamId," pid: ").concat(s.peerId,", seq: ").concat(t,", ActivatePlayVideoStreamRsp: ").concat(JSON.stringify(e))),i&&i(t,e)}),(function(t){s.In.error("".concat(s.LOG_TAG," ").concat(s.streamId," pid: ").concat(s.peerId,", seq: ").concat(r,", ActivatePlayVideoStream error: ").concat(t)),e&&e(t)})),this.useCmd&&this.Zc>=Ug&&this.peerId>0){this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", seq: ").concat(r,", ActivatePlayVideoStream(").concat(t,"), dc: ").concat(o));var u=qg.WebrtcCmdReqMsg.encode({active_video_play:{active:t?0:1,layer:0,seq:r}}).finish();o?this.sendReqByDC(u):null===(n=this.rh)||void 0===n||n.sendGWCmdReq(this.Yc,r,{peer_id:this.peerId,cmd_id:21,body:u})}else this.rh&&this.rh.ActivatePlayVideoStream(r,this.Yc,t)},t.prototype.activateSEIInsert=function(t,i,e,n){var s,r=this,o=N(),u=this.isUseDC();if(this.addReqTask(o,"active_sei_insert",u,(function(t,i){r.In.debug("".concat(r.LOG_TAG," ").concat(r.streamId," pid: ").concat(r.peerId,", seq: ").concat(t,", activateSEIInsertRsp: ").concat(JSON.stringify(i))),e&&e(t,i)}),(function(t){r.In.error("".concat(r.LOG_TAG," ").concat(r.streamId," pid: ").concat(r.peerId,", seq: ").concat(o,", activateSEIInsert error: ").concat(t)),n&&n(t)})),this.useCmd&&this.Zc>=Ug&&this.peerId>0){this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", seq: ").concat(o,", activateSEIInsert(").concat(t,", ").concat(i,"), dc: ").concat(u));var a=qg.WebrtcCmdReqMsg.encode({active_sei_insert:{seq:o,action:t,info_type:i}}).finish();u?this.sendReqByDC(a):null===(s=this.rh)||void 0===s||s.sendGWCmdReq(this.Yc,o,{peer_id:this.peerId,cmd_id:25,body:a})}else this.rh&&this.rh.activateSEIInsert(o,this.Yc,this.peerId,t,i)},t.prototype.sendPlayStats=function(t){var i,e=N(),n=this.isUseDC();if(this.Zc>=83886081&&this.peerId>0){this.In.info("".concat(this.LOG_TAG," ").concat(this.streamId," pid: ").concat(this.peerId,", seq: ").concat(e,", sendPlayStats(").concat(t,"}), dc: ").concat(n));var s=qg.WebrtcCmdReqMsg.encode({play_stats:{seq:e,audio_jitter_ms:t}}).finish();return n?this.sendReqByDC(s):null===(i=this.rh)||void 0===i||i.sendGWCmdReq(this.Yc,e,{peer_id:this.peerId,cmd_id:27,body:s}),!0}return!1},t}();!function(t){t[t.UserData=1]="UserData",t[t.Cmd=2]="Cmd",t[t.Signal=11]="Signal",t[t.TcPadding=12]="TcPadding",t[t.TcFeedback=13]="TcFeedback"}(Rg||(Rg={}));var Jg,Vg,Hg,Gg=function(){function t(){this._h=0,this.yh=0,this.wh=0}return t.prototype.reset=function(){this._h=0,this.yh=0,this.wh=0},t.prototype.setGenDataInKbps=function(t){t>5e3&&(t=5e3),this._h=Math.floor(t/8)},Object.defineProperty(t.prototype,"sendBytesOnems",{get:function(){return this._h},enumerable:!1,configurable:!0}),t.prototype.generatePadding=function(){if(this._h<1)return 0;var t=Math.floor(performance.now());if(0===this.wh)return this.wh=t,this.yh=0,0;var i=t-this.wh;if(i<3)return 0;if(this.wh=t,i>500)return this.yh=0,0;var e=i*this._h+this.yh;return e<600?(this.yh=e,0):(this.yh=0,e)},t}();!function(t){t[t.Normal=0]="Normal",t[t.Control=1]="Control"}(Jg||(Jg={})),function(t){t[t.UNDERUSE=-1]="UNDERUSE",t[t.NORMAL=0]="NORMAL",t[t.OVERUSE=1]="OVERUSE",t[t.OVERUSE_DUE_PKT_LOST=2]="OVERUSE_DUE_PKT_LOST"}(Vg||(Vg={})),function(t){t[t.Default=-1]="Default",t[t.NoVideo=0]="NoVideo"}(Hg||(Hg={}));var Fg=function(){function t(t,i){this.In=t,this.enable=!0,this.isStart=!1,this.maxAudioBitrate=48,this.maxVideoBitrate=0,this.startVideoBitrate=0,this.minVideoBitrate=0,this.targetVideoBitrate=0,this.referenceVideoBitrate=-1,this.firstStatsUpdateTs=0,this.lastStatsUpdateTs=0,this.lastAvailableOutgoingBitrate=0,this.lastVideoActualEncBitrate=0,this.videoActualEncBitrateList=[],this.nackCountList=[],this.lastNackCount=0,this.tcState=Jg.Normal,this.continueUpCount=0,this.lastUpdateTargetVideoBitrateTime=0,this.updateTargetVideoBitrateCount=0,this.enable_debug_log=!1,this.Sh=!0,this.Eh=Hg.Default,this.Oh=new Gg,this.Xc=null,this.Th=0,this.kh=0,this.Rh={first:!0,seq:0,status:Vg.UNDERUSE,bandwide:0,targetBitrate:0,rtt:0},this.Ih=0,this.Nh=0,this.Ch=0,this.zh=0,this.Dh=0,this.Ph=!1,this.Ah=!1,this.Mh=null,this.test_padding=0,this.Nn=i}return t.prototype.updateVideoTargetBitrate=function(t){},t.prototype.pauseVideo=function(){},t.prototype.resumeVideo=function(){},t.prototype.reset=function(){this.test_padding=0,this.enable=!0,this.maxAudioBitrate=48,this.maxVideoBitrate=0,this.startVideoBitrate=0,this.minVideoBitrate=0,this.targetVideoBitrate=0,this.referenceVideoBitrate=-1,this.firstStatsUpdateTs=0,this.lastStatsUpdateTs=0,this.lastAvailableOutgoingBitrate=0,this.lastVideoActualEncBitrate=0,this.videoActualEncBitrateList.length=0,this.nackCountList.length=0,this.lastNackCount=0,this.tcState=Jg.Normal,this.continueUpCount=0,this.lastUpdateTargetVideoBitrateTime=0,this.updateTargetVideoBitrateCount=0,this.Sh=!0,this.Eh=Hg.Default,this.Oh.reset(),this.Xc=null,this.Th=0,this.kh=0,this.Rh.first=!0,this.Rh.seq=0,this.Rh.status=Vg.UNDERUSE,this.Rh.bandwide=0,this.Rh.targetBitrate=0,this.Ih=0,this.Nh=0,this.Ch=0,this.zh=0,this.Dh=0,this.Ph=!1,this.Ah=!1,this.clearProeTimer()},t.prototype.enableVideo=function(t){this.Sh=t},t.prototype.setDatachannel=function(t){this.Xc=t},t.prototype.setMinVideoBitrateMode=function(t){0===t&&(this.Eh=t)},t.prototype.getMinVideoBitrateMode=function(){return this.Eh},t.prototype.getBandwide=function(){return this.Rh.bandwide},t.prototype.getFeedback=function(){return this.Rh},t.prototype.start=function(){this.isStart||(this.targetVideoBitrate=this.maxVideoBitrate,this.enable&&this.referenceVideoBitrate>0&&(this.startVideoBitrate&&this.startVideoBitrate<this.maxVideoBitrate?this.targetVideoBitrate=this.startVideoBitrate:this.referenceVideoBitrate<=this.minVideoBitrate?this.targetVideoBitrate=this.minVideoBitrate:this.referenceVideoBitrate<this.maxVideoBitrate&&(this.targetVideoBitrate=Math.max(this.referenceVideoBitrate,50))),this.In.info("".concat(Zd," start ").concat(this.enable,", v[").concat(this.startVideoBitrate,"|").concat(this.maxVideoBitrate,"|").concat(this.minVideoBitrate,"], ref:").concat(this.referenceVideoBitrate,", tg:").concat(this.targetVideoBitrate,", vmode:").concat(this.Eh,", a[").concat(this.maxAudioBitrate,"]")),this.isStart=!0)},t.prototype.stop=function(){this.isStart&&this.In.info("".concat(Zd," stop")),this.isStart=!1,this.reset()},t.prototype.setEnable=function(t){this.enable=t},t.prototype.isEnable=function(){return this.enable},t.prototype.setMinVideoBitrate=function(t){t>0&&(this.minVideoBitrate=t)},t.prototype.getMinVideoBitrate=function(){return this.minVideoBitrate},t.prototype.setStartVideoBitrate=function(t){t>0&&(this.startVideoBitrate=t)},t.prototype.getStartVideoBitrate=function(){return this.startVideoBitrate},t.prototype.setVideoBitrate=function(t){t&&(this.maxVideoBitrate>0&&this.In.info("".concat(Zd," setVideoBitrate ").concat(this.maxVideoBitrate," => ").concat(t)),this.maxVideoBitrate=t,this.targetVideoBitrate=t)},t.prototype.setAudioBitrate=function(t){this.maxAudioBitrate=t},t.prototype.setReferenceVideoBitrate=function(t){this.referenceVideoBitrate=t},t.prototype.getTargetVideoBitrate=function(){return this.targetVideoBitrate},t.prototype.onStatsUpdated=function(t){if(this.enable){var i=1e3*t.audioRtxBitrate;this.Th=Math.floor(1e3*t.audioBitrate),this.kh=Math.floor(i);var e=t.availableOutgoingBitrate?t.availableOutgoingBitrate:0,n=t.actualEncBitrate?t.actualEncBitrate:0;if(0!=this.firstStatsUpdateTs||0!=t.videoBitrate){var s=Date.now();if(this.targetVideoBitrate<this.maxVideoBitrate){var r=0;e>this.lastAvailableOutgoingBitrate?this.continueUpCount++:e<this.lastAvailableOutgoingBitrate&&(this.tcState=Jg.Control,this.continueUpCount=0);var o=this.targetVideoBitrate;if(this.tcState==Jg.Normal)0==e||e<=3e5?(r=1,o*=this.updateTargetVideoBitrateCount<3?1.05:this.updateTargetVideoBitrateCount<6?1.1:1.15):(r=2,o*=e&&e>=this.lastAvailableOutgoingBitrate?1.3:1.15,(this.continueUpCount>5||this.lastUpdateTargetVideoBitrateTime>0&&s-this.lastUpdateTargetVideoBitrateTime>5e3)&&(o=this.maxVideoBitrate));else if(this.continueUpCount>0)(e&&e>1e3*this.targetVideoBitrate*.8||this.continueUpCount>=2)&&(r=3,o*=this.continueUpCount<3?1.05:this.continueUpCount<6?1.1:1.2);else{if(this.lastUpdateTargetVideoBitrateTime>0)s-this.lastUpdateTargetVideoBitrateTime+50>=2e3&&(r=4,o*=1.1);else this.firstStatsUpdateTs&&s-this.firstStatsUpdateTs+50>=4e3&&(r=5,o*=1.1)}if(o=Math.min(o,this.maxVideoBitrate),(o=Math.max(o,50))!=this.targetVideoBitrate){(!this.updateTargetVideoBitrateCount||o>=this.maxVideoBitrate)&&this.In.info("".concat(Zd," update video maxbitrate: ").concat(this.targetVideoBitrate," => ").concat(o,", ").concat(r)),this.targetVideoBitrate=o,this.updateTargetVideoBitrateCount++,this.lastUpdateTargetVideoBitrateTime=s,this.updateVideoTargetBitrate(o)}}this.lastAvailableOutgoingBitrate=e,this.lastVideoActualEncBitrate=n,this.lastStatsUpdateTs=s,this.firstStatsUpdateTs||(this.firstStatsUpdateTs=s),this.videoActualEncBitrateList.push(n),this.videoActualEncBitrateList.length>5&&this.videoActualEncBitrateList.shift();var u=t.nackCount-this.lastNackCount;this.lastNackCount=t.nackCount,this.nackCountList.push(u),this.nackCountList.length>5&&this.nackCountList.shift()}}},t.prototype.getLastVideoBitrate=function(){if(!this.firstStatsUpdateTs||this.lastStatsUpdateTs-this.firstStatsUpdateTs<1e4)return 0;if(Date.now()-this.lastStatsUpdateTs>1e4)return 0;var t=Math.max.apply(null,this.nackCountList),i=50;if(this.lastAvailableOutgoingBitrate>0){if(this.lastAvailableOutgoingBitrate>=1.2*this.maxVideoBitrate*1e3)return-1;if(0==t&&3e5==this.lastAvailableOutgoingBitrate)return-1;i=Math.max(this.lastAvailableOutgoingBitrate/1e3,this.lastVideoActualEncBitrate)}else{if(i=Math.max.apply(null,this.videoActualEncBitrateList),0==t&&i>.8*this.targetVideoBitrate)return-1;if(i>.8*this.maxVideoBitrate)return-1}return i=Math.max(i,50)},t.prototype.compare16BitsSeq=function(t,i){var e=t-i;return e<-32767?e=t+65535-i+1:e>32767&&(e=t-(i+65535)-1),e},t.prototype.handleFeedback=function(t){var i=t.byteLength-1;if(!(i<9)){var e=new Uint8Array(t,1,i),n=e[0]<<8|e[1],s=new DataView(t).getInt8(3),r=e[3]<<8|e[4],o=e[5]<<8|e[6],u=e[7]<<8|e[8];this.Rh.first||this.compare16BitsSeq(n,this.Rh.seq)>0?(this.Rh.first=!1,this.Rh.seq=n,this.Rh.status=s,this.Rh.bandwide=1e3*r,this.Rh.targetBitrate=1e3*o,this.Rh.rtt=u,this.processBandwide()):this.In.debug("".concat(Zd," handleFeedback, seq reorder: ").concat(this.Rh.seq,", ").concat(n))}},t.prototype.getRandomInt=function(t,i){return t=Math.ceil(t),i=Math.floor(i),Math.floor(Math.random()*(i-t+1))+t},t.prototype.sendPaddingData=function(){if(this.Xc&&"open"==this.Xc.readyState){var t=this.getRandomInt(500,1e3);if(t>this.Nh&&(t=this.Nh),this.Xc.bufferedAmount>32e3)return this.Nh-=t,void(this.Nh<0&&(this.Nh=0));var i=Math.floor(performance.now());if(t>0&&t<1144){var e=new Uint8Array(t+7);e[0]=Rg.TcPadding,e[1]=this.Ih>>8&255,e[2]=255&this.Ih,e[3]=i>>24&255,e[4]=i>>16&255,e[5]=i>>8&255,e[6]=255&i,this.Ih++,this.Ih>=65536&&(this.Ih=0),this.Xc.send(e),this.Nh-=e.byteLength,this.Nh<0&&(this.Nh=0)}}},t.prototype.processBandwide=function(){if(!(!this.enable||!this.Sh||!this.Xc||this.Rh.bandwide<=0||this.Rh.targetBitrate<=0||this.Th<=0||this.Eh!=Hg.NoVideo)){var t,i=this.Th,e=this.minVideoBitrate<=0?5e4:this.minVideoBitrate,n=this.Rh.status,s=this.Rh.targetBitrate,r=this.Rh.bandwide;t=this.Rh.rtt>=300?this.Rh.bandwide:s;var o=e+i+4e4;if(n>0?((r<=e+4e4||r<=1e5)&&(this.zh++,!1===this.Ph&&(this.pauseVideo(),this.Ph=!0)),this.Dh=0):n<=0&&(t>o||s>1.5*o)&&(this.zh=0,this.Dh++,(t>1.2*o&&t>15e4||this.Dh>25||s>1.8*o&&s>25e4)&&this.Ph&&(this.Ah=!1,this.Ph=!1,this.stopBandWideProbe(),this.resumeVideo())),this.Ph){var u=s-i;u>0&&n<=0?(this.Ch=u,this.Oh.setGenDataInKbps(u/1e3),this.Ah||(this.Ah=!0),this.Mh||this.startBandWideProbe()):this.stopBandWideProbe()}}},t.prototype.startBandWideProbe=function(){var t=this;this.clearProeTimer(),this.Ah&&(this.Mh=setTimeout((function(){var i=t.Oh.generatePadding();t.Nh+=i;if(t.Ch>0)for(var e=t.Ch/16e4+1,n=0;n<e;n++)t.Nh>0&&t.sendPaddingData();t.startBandWideProbe()}),40))},t.prototype.stopBandWideProbe=function(){this.Ch=0,this.Nh=0,this.Oh.reset(),this.clearProeTimer()},t.prototype.clearProeTimer=function(){this.Mh&&(clearTimeout(this.Mh),this.Mh=null)},t}(),Yg=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Zg=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Qg=function(){function t(t,i,e){this.Ro=t,this.xh=100,this.In=mm(i,e)}return t.prototype.getMiniSdp=function(t){var i=this,e="zc.s.gmsdp";return new Xt((function(n,s){return Yg(i,void 0,void 0,(function(){var i,r,o,u,a=this;return Zg(this,(function(c){return i=this.Ro.miniSdpWorker,r=function(t){a.In.error("".concat(e," error:").concat(JSON.stringify(t))),s(t)},u=function(){o&&(clearTimeout(o),o=null)},t?i?(i.parseToMiniSdp(t).then((function(t){if(a.In.info("".concat(e," parse sdp success buffer:").concat(null==t?void 0:t.byteLength)),u(),!t||!t.byteLength)return r(tn);n(t)})).catch((function(t){return u(),r(t)})),o=setTimeout((function(){a.In.info("".concat(e," get minisdp timeout")),r(sn)}),this.xh),[2]):[2,r(nn)]:[2,r({code:tn.code,message:"sdp error"})]}))}))}))},t.prototype.parseMiniSdp=function(t){var i=this,e="zc.s.prsdp";return this.In.info("".concat(e," rSDP:").concat(t.length," isMini")),new Xt((function(n,s){var r,o=t,u=i.Ro.miniSdpWorker,a=function(t){i.In.error("".concat(e," error:").concat(JSON.stringify(t))),s(t)},c=function(){r&&(clearTimeout(r),r=null)};if(!o||!o.byteLength)return a({code:en.code,message:"buffer error"});u?(u.loadMiniSdpToOriginSdp(o).then((function(t){i.In.info("".concat(e," parse minisdp success sdp:").concat(t.length)),c(),t?n(t):a(en)})).catch((function(t){c(),a(t)})),r=setTimeout((function(){i.In.info("".concat(e," parse minisdp timeout")),a(sn)}),i.xh)):a(nn)}))},t}(),Xg=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))};function Wg(t){var i,e=t,n=function(t){var i={m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"}]};function e(t,i,e){var n=function(t){return String(Number(t))===t?Number(t):t},s=t.name&&t.names;t.push&&!i[t.push]?i[t.push]=[]:s&&!i[t.name]&&(i[t.name]={});var r=t.push?{}:s?i[t.name]:i;(function(t,i,e,s){if(s&&!e)i[s]=n(t[1]);else for(var r=0;r<e.length;r+=1)null!=t[r+1]&&(i[e[r]]=n(t[r+1]))})(e.match(t.reg),r,t.names,t.name),t.push&&i[t.push].push(r)}var n=RegExp.prototype.test.bind(/^([a-z])=(.*)/),s=[],r={},o=r;return t.split(/(\r\n|\r|\n)/).filter(n).forEach((function(t){var n=t[0],r=t.slice(2);"m"===n&&(s.push({rtp:[],fmtp:[]}),o=s[s.length-1]);for(var u=0;u<(i[n]||[]).length;u+=1){var a=i[n][u];if(a.reg&&a.reg.test(r))return e(a,o,r)}})),r.media=s,r}(t),s=[];return n.media.forEach((function(t){"video"===t.type&&t.fmtp.forEach((function(t){i="a=fmtp:"+t.payload+" "+t.config,-1===t.config.indexOf("sps-pps-idr-in-keyframe")&&-1===s.indexOf(i)&&s.push(i)}))})),s.forEach((function(t){e=e.replace(new RegExp(t,"g"),t+";sps-pps-idr-in-keyframe=1")})),e}function Kg(t){for(var i=t.split("\r\n").filter((function(t){return!t.trim().startsWith("a=extmap-allow-mixed")})),e=[],n=0,s=i;n<s.length;n++){var r=s[n];e.push(r),r.trim().startsWith("a=group:BUNDLE")&&e.push("a=extmap-allow-mixed")}var o=e.map((function(t){return t.trim().startsWith("a=extmap")&&t.includes("/recvonly")?t.replace("/recvonly",""):t}));return o.join("\r\n")}var $g=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),tb=function(){return tb=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},tb.apply(this,arguments)},ib=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},eb=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};var nb,sb=new Uint8Array([0,0,0,1,101,184,0,4,0,0,9,255,254,222,35,192,166,30,73,128]),rb=new Uint8Array([0,0,0,1,103,77,64,51,140,141,78,64,60,34,17,168,0,0,0,1,104,238,60,128]),ob=bn,ub=wn,ab=_n,cb=ob.error,hb=Cn,fb=function(t){function i(i,e,n,s,r,o,u,a){var c,h=t.call(this,e,i)||this;return h.ipV6Prefer=-1,h.ipStackNode=kt.IPv4,h.jh=!1,h.Lh=[],h.qh=[],h.Uh=[],h.Bh="",h.Jh="",h.Vh=500,h.startTime=0,h.Hh=!0,h.Gh=null,h.Fh=null,h.Yh=3e3,h.Zh={state:"NO_PUBLISH",code:0},h.Qh=!1,h.supportTransceiver=!0,h.To=!1,h.Xh=0,h.Wh=0,h.Kh=0,h.$h=0,h.tf=0,h.publishedTimeStamp=0,h.firstPublishedTimeStamp=0,h.validPublishedTime=0,h.errorTimes=0,h.hasSucceed=!1,h.lastFailTimeLen=0,h._state=7,h.lastState=7,h.Yc=0,h.if=[],h.ef=null,h.nf=null,h.sf=null,h.rf=null,h.parentSpanKey="",h.uf=0,h.af=null,h.cf=!1,h.hf=[],h.ff=[],h.lf="H264",h.df=vt.stop,h.isExternal=!1,h.vf=25e3,h.mf=!1,h.pf="",h.gf=[],h.ipNode=null,h.ipV4NodeList=[],h.ipV6NodeList=[],h.bf=0,h.retryFailGwNodes=[],h.retryFailIpV4Nodes=[],h.retryFailIpV6Nodes=[],h._f=!1,h.yf=0,h.wf=!1,h.Sf=0,h.Ef=0,h.Of=[],h.Tf=[],h.kf=[],h.Rf=!1,h.If="",h.Nf=!1,h.Cf="",h.zf="",h.Df=!0,h.Pf=0,h.probeQuality=0,h.probeTime=0,h.probeNodeList=[],h.probedList=[],h.probeTimer=null,h.Af=0,h.Mf=0,h.poorQualityRetryCnt=0,h.xf=[],h.continuousFailCnt=0,h.isUpdateSDP=!1,h.toBeReplacedTracks={},h.send_seq=0,h.dataChannelState=0,h.jf=0,h.Lf=0,h.qf="",h.Uf=[],h.Bf=[],h.Jf={forceSynchronousNetworkTime:0,alignment:0},h.Vf={isSEIStart:!1,SEIType:et.ZegoDefined,unregisterSeiFilter:"",uuidSend:!1,track:null},h.Hf=0,h.reportPublishStateTime=0,h.isRePublish=!1,h.rtcPublishCount=0,h.stopReason="",h.signalTime=0,h.Gf=((c={}).PublishEventPush={seq:-1,time:0},c.ClientInfoPush={seq:-1,time:0},c),h.Ff=!0,h.Yf=!1,h.ip="",h.Zf={lanIP:"",wanIP:"",intranet:!1},h.encodeLowVideoFrame=function(t,i){h.encodeFrame(t,i,!0)},h.encodeVideoFrame=function(t,i){h.Vf.track?h.encodeFrameAudioOnly(t,i,!1):h.encodeFrame(t,i,!1)},h.recvLastKeyFrameTime=0,h.camera_status=2,h.mic_status=2,h.Qf=!1,h.Xf=0,h.Wf=void 0,h.Fo={onUaSocketConnected:function(){var t;h.info("zc.p.0.eh.0 ".concat(null===(t=h.Wf)||void 0===t?void 0:t.length," gwNode: ").concat(h.pf)),h.Wf&&(h.pf="",h.getDispatchIPNodeMode(),h.Kf.apply(h,h.Wf),h.Wf=void 0)}},h.id=Lo("".concat(o.appid,"_").concat(u.idName,"_").concat(i,"_").concat(Date.now(),"_").concat(N())),h.Uo=i,h.dataReport=n,h.qualityTimeInterval=s,h.Ro=o,h.Nn=u,h.lf=h.Ur("publish_video_codec"),h.Fu=a,h.fo=a.localStream,h.$f=a.zegoCaptureStream,h.To=h.Nn.isMiniSdp,h.To&&(h.tl=new Qg(o,e,i)),h.il=new Bg(e,!0,i),h.el=new Fg(h,u),h.$f&&h.$f.startPublish(),a.onAudioTrackChange=function(t){var i=h.audioSender;h.previewer.isAudioEnabled&&(i?(i.replaceTrack(t),h.info("zc.oatc remote audio track change success")):h.warn("zc.oatc stream has not sender"))},h.initStreamReport(),h.qualityHandler=new xg(h.qualityTimeInterval,r,h,e,h.dataReport,h.Nn,h.Ro),h.qualityHandler.onPublishingError=function(t){h.publishStateUpdateError(t)},h}return $g(i,t),Object.defineProperty(i.prototype,"nl",{get:function(){return this.Ro.agentIpStackDetection.IPv4===Nt.reachable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"signal",{get:function(){return this.sl},enumerable:!1,configurable:!0}),i.prototype.updateCBState=function(t){var i=this,e=Object.keys(t).some((function(e){return t[e]!==i.Zh[e]}));return e&&(this.Zh=t),e},Object.defineProperty(i.prototype,"state",{get:function(){return this._state},set:function(t){this.lastState=this._state,this._state=t},enumerable:!1,configurable:!0}),i.prototype.createSEIWorker=function(){return this.Ro.createSEIWorker()},Object.defineProperty(i.prototype,"seiWorker",{get:function(){return this.Ro.seiWorker},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sessionId",{get:function(){return this.Yc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"videoInfo",{get:function(){return this.Su},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Su",{get:function(){return this.previewer.videoInfo},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Iu",{get:function(){return this.previewer.mediaStreamConfig},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"streamId",{get:function(){return this.Uo},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"localStream",{get:function(){return this.fo},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"peerConnection",{get:function(){return this.af},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"stateNego",{get:function(){return this.df},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"publishOption",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNode",{get:function(){return this.pf},set:function(t){this.pf=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNodeList",{get:function(){return this.gf},set:function(t){this.gf=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNodesTTL",{get:function(){return this.bf},set:function(t){this.bf=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isNodesEmpty",{get:function(){return this.ipNodeType===It.ZV4Only?0===this.gf.length:this.ipNodeType===It.ZV4Priority?0===this.ipV4NodeList.length:(this.ipNodeType===It.ZV6Priority||0===this.ipV4NodeList.length)&&0===this.ipV6NodeList.length},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isPeer",{get:function(){return this.Df},set:function(t){this.Df=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"peerID",{get:function(){return this.Pf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dataChannel",{get:function(){return this.Xc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sideMediaConfig",{get:function(){return this.Vf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"publishStat",{get:function(){return this.qualityHandler.publishStat},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"previewer",{get:function(){return this.Fu},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"probeState",{get:function(){return this.qualityHandler.probeState},set:function(t){this.qualityHandler.probeState=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"netQuality",{get:function(){return this.qualityHandler.Ua},set:function(t){this.qualityHandler.Ua=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lastPublishStats",{get:function(){return this.qualityHandler.qa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"webrtcProtocol",{get:function(){return this.qualityHandler.Va},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lowStream",{get:function(){var t;return null===(t=this.Fu)||void 0===t?void 0:t.lowStream},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isStateRetry",{get:function(){return[vt.stop,vt.iceClosed,vt.iceFailed].includes(this.df)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"iceStateDisConnect",{get:function(){return[vt.iceClosed,vt.iceDisconnected,vt.iceFailed].includes(this.df)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isLastConnected",{get:function(){return 6===this.lastState},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"netProtocol",{get:function(){return this.Yf?"tcp":this.Ff?this.webrtcProtocol:"udp"},enumerable:!1,configurable:!0}),i.prototype.Ur=function(t,i){return void 0===i&&(i=!1),this.Nn.settingConfig.getSetting(t,i)},Object.defineProperty(i.prototype,"Ia",{get:function(){return 6===this.state},enumerable:!1,configurable:!0}),i.prototype.isTcVideoPasued=function(){return this.Rf},i.prototype.setSendMuteImage=function(t){this.Nf=t},i.prototype.setSignal=function(t){this.sl!==t&&(this.sl=t,this.il.webrtcCenterServerSignal=t)},i.prototype.initStreamReport=function(){this.ol=this.Mn.createSpan(a.I,{key:bn.event,par:this.Uo},{key:ub.event,par:this.Uo},ub.event,!0),this.Hf=(new Date).getTime()},i.prototype.checkAutoTcp=function(){var t=Ao();this.info("zc.p.0.cat  ".concat(t," ").concat(this.Df)),this.Ff=!(!t||!this.Df)},i.prototype.publishStateUpdateError=function(t,i,e,n){this.error(qd+"  call "+JSON.stringify(t));var s=this.Mn.createSpan(a.H,{key:bn.event,par:this.Uo},{key:""},Dn);s.setAttributes({error:null==t?void 0:t.code,message:null==t?void 0:t.message}),s.end(),this.Uo&&this.onPublishStateUpdate(Z,this.Uo,t,i,e,n),this.info(qd+"  ended")},i.prototype.netProbeToReDispatch=function(t,i){var e;void 0===t&&(t=function(){}),void 0===i&&(i=function(){}),this.Qh=!0;var n=null===(e=this.Ro.publisherList[this.Uo])||void 0===e?void 0:e.retryStreamHandler;n&&n.dispatchGwNodesBypass(this,t,i)},i.prototype.resetPublish=function(t){this.info("zc.p.0.rp call");var i=this.el.getLastVideoBitrate();if(i){var e=this.el.getBandwide();this.info("".concat(Zd," update ref bitrate: ").concat(i,", bw: ").concat(e)),this.Ro.updateReferenceBitrate(i)}this.closeSession(t),this.state=7,this.mf=!1,null==this.af&&null==this.af||(this.af.close(),this.af=null,this.videoSender=void 0,this.lowVideoSender=void 0,this.audioSender=void 0),this.ul&&(this.ul=null),this.al&&(this.al=null),this.resetIceInfos(),this.resetNat64Infos(),this.qf="",this.ip="",this.Fh&&(this.Fh=null),null!==this.cl&&(clearTimeout(this.cl),this.cl=null),null!=this.hl&&(clearTimeout(this.hl),this.hl=null),null!=this.fl&&(clearTimeout(this.fl),this.fl=null),this.ll&&(clearTimeout(this.ll),this.ll=null),this.dl&&(clearTimeout(this.dl),this.dl=null),this.qualityHandler.clearPublishQualityTimer(),this._clearCanvasTimer(),this.unregisterMsgCallback(),this.il.reset(),this.vl=0,this.uf=0,this.if=[],this.Wf=void 0,this.resetEncBitrate(),this.isUpdateSDP=!1,this.Rf=!1,this.If="",this.Nf=!1,this.Cf="",this.zf=""},i.prototype._clearCanvasTimer=function(){null!=this.ef&&(clearInterval(this.ef),this.Vf.track=null,this.ef=null,this.nf=null,this.sf=null,this.rf=null)},i.prototype.resetPushCmdSeqMap=function(){var t;this.Gf=((t={}).PublishEventPush={seq:-1,time:0},t.ClientInfoPush={seq:-1,time:0},t)},i.prototype.ml=function(){var t=this;this.il.registerPushCallback("CloseSessionPush",(function(i,e,n){32===n.reason&&(t.To=!1,t.Nn.To=!1,t.$h=performance.now()-t.tf),t.pl(i,e,n)})),this.il.registerPushCallback("SessionResetPush",(function(i,e,n){t.bl(i,e,n)})),this.il.registerPushCallback("PublishEventPush",(function(i,e,n){t._l(i,e,n)})),this.il.registerPushCallback("ClientInfoPush",(function(i,e,n){t.yl(i,n.peer_id,n.clientip||n.client_ip)})),this.il.registerPushCallback("PublishNetStatNotify",(function(i,e,n){t.qualityHandler.updateGwPublishNetState({videoRecvBitrate:n.video_recv_bitrate,trafficControlStat:n.traffic_control_stat,videoLostRate:n.video_lost_rate,audioRecvBitrate:n.audio_recv_bitrate,audioLostRate:n.audio_lost_rate})}))},i.prototype.unregisterMsgCallback=function(){this.il.unregisterPushCallback("CloseSessionPush"),this.il.unregisterPushCallback("SessionResetPush"),this.il.unregisterPushCallback("PublishEventPush"),this.il.unregisterPushCallback("ClientInfoPush")},i.prototype.startPublish=function(t,i,e,n){var s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S,E,O=this;if(this.info(Od+" called"),t){if(this.checkAutoTcp(),this.To&&!this.tf&&(this.tf=performance.now()),this.state=0,this.cf=!1,this.fo=i,this.rl=e||{},this.el.stop(),this.Rf=!1,this.If="",Ut(this.rl.enableDTX)){var T=this.Ur("dtx",!0);this.rl.enableDTX=void 0!==T?!!T:this.rl.enableDTX}else this.rl.enableDTX=!!this.Ur("dtx");var k;(null===(s=this.rl)||void 0===s?void 0:s.SEIType)&&(this.Vf.SEIType=this.rl.SEIType),this.qualityHandler.Na.video.muteState=(null===(o=null===(r=this.Fu)||void 0===r?void 0:r.videoTrack)||void 0===o?void 0:o.enabled)?"0":"1",this.qualityHandler.Na.audio.muteState=this.fo.getAudioTracks().length>0&&this.fo.getAudioTracks()[0].enabled?"0":"1",(null===(u=this.rl)||void 0===u?void 0:u.videoCodec)&&(this.lf=this.rl.videoCodec);var R=null===(a=this.Fu)||void 0===a?void 0:a.videoPreviewType;switch(R){case"camera":k=this.Ur("camera_video_bitrate",!0);break;case"screen":k=this.Ur("screen_video_bitrate",!0);break;case"custom":k=this.Ur("custom_video_bitrate",!0)}void 0!==k&&(this.info(Od+" setting "+R+" "+k),this.Su.bitRate=k);var I=this.Ur("bitrate_mode",!0);I&&(this.info(Od+" setting bitrate_mode "+I),this.Su.startBitrate=I);var N=this.Ur("publish_video_codec",!0);if(N&&(this.info(Od+" setting publish_video_codec "+N),this.lf=N),Ut(null===(c=this.rl)||void 0===c?void 0:c.isSEIStart)&&(this.Vf.isSEIStart=this.rl.isSEIStart),this.Vf.isSEIStart){var C=Po();"H264"===this.lf&&C||(this.warn(Od+" not use sei; support: ".concat(C,", codec: ").concat(this.lf," ")),this.Vf.isSEIStart=!1)}(null===(h=this.Nn.seiConfig)||void 0===h?void 0:h.unregisterSEIFilter)&&(this.Vf.unregisterSeiFilter=null===(f=this.Nn.seiConfig)||void 0===f?void 0:f.unregisterSEIFilter),9===this.Nn.scenario&&(this.Jf.forceSynchronousNetworkTime=1),[0,1].includes(null===(l=this.rl)||void 0===l?void 0:l.forceSynchronousNetworkTime)&&(this.Jf.forceSynchronousNetworkTime=null===(d=this.rl)||void 0===d?void 0:d.forceSynchronousNetworkTime);var z=0,D=0;(null===(v=this.rl)||void 0===v?void 0:v.trafficControlMinVideoBitrate)&&(z=this.rl.trafficControlMinVideoBitrate),Bt(this.rl.trafficControlFocusOnMode)||(D=this.rl.trafficControlFocusOnMode);Ut(this.rl.enableTrafficControl)&&this.el.setEnable(this.rl.enableTrafficControl);var P=0,A=0;if(this.Su.bitRate&&"target"===this.Su.startBitrate&&(P=this.Su.bitRate),z>0)A=z;else if(this.Su.minBitrate)A=this.Su.minBitrate;else if("screen"===this.Fu.previewType){var M=function(t){var i=0,e=t.frameRate,n=t.width*t.height*(e<=30?e:30);return Lt(n)?(i=n<=3888e3?200:n<=6912e3?400:n<=15552e3?700:n<=27648e3?1e3:2e3)>t.bitRate&&(i=t.bitRate):i=parseInt(.6*t.bitRate+""),{minBitrate:i,resolution:n}}(this.Su);A=M.minBitrate,this.info(Od+" resolution: ".concat(M.resolution,", min bitrate: ").concat(A))}if(this.el.setVideoBitrate(this.Su.bitRate),this.el.setMinVideoBitrate(A),this.el.setStartVideoBitrate(P),isNaN(this.Su.audioBitrate)||this.el.setAudioBitrate(this.Su.audioBitrate),this.el.enableVideo(!!(null===(m=this.Fu)||void 0===m?void 0:m.videoTrack)),Lt(this.rl.trafficControlMinVideoMode)&&this.el.setMinVideoBitrateMode(this.rl.trafficControlMinVideoMode),this.canSetBandWidthBySender()&&null!=n&&n>0){var x=this.Ur("ref_bitrate_on");(null!=x?x:this.Nn.engineConfig.enableReferenceBitrate)&&!this.Fu.enableDualStream&&this.el.setReferenceVideoBitrate(n)}this.el.updateVideoTargetBitrate=function(t){O.applyVideoBitrate(t)},this.el.pauseVideo=function(){O.onTcPauseVideo()},this.el.resumeVideo=function(){O.onTcResumeVideo()},this.el.start(),this.Mn.spanSetAttributes({key:ob.event,par:this.Uo},{video_en_codec_id:ob.video_en_codec_id("VP8"==this.lf?2:0),audio_c_channel_count:ob.audio_c_channel_count(2==this.Su.channelCount?2:1),audio_en_bps:ob.audio_en_bps(this.Su.audioBitrate),aec_level:ob.aec_level(1==this.Iu.AEC?2:0==this.Iu.AEC?0:2),ans_level:ob.ans_level(1==this.Iu.ANS?2:0==this.Iu.ANS?0:2),agc:ob.agc(1==this.Iu.AGC||0!=this.Iu.AGC),video_activate:ob.video_activate(!!(null===(g=null===(p=this.Fu)||void 0===p?void 0:p.videoTrack)||void 0===g?void 0:g.enabled)),audio_activate:ob.audio_activate(!!(null===(_=null===(b=this.Fu)||void 0===b?void 0:b.audioTrack)||void 0===_?void 0:_.enabled)),scenario:this.Nn.scenario,traffic_control_min_video_bitrate:{bitrate:ob.traffic_control_min_video_bitrate.bitrate(z),mode:ob.traffic_control_min_video_bitrate.mode(D)},cap_volume:this.previewer.volume,is_peer:ob.is_peer(this.Df)}),this.ol.setAttributes({room_id:ub.room_id(null===(w=null===(y=this.Ro.publisherList[this.Uo])||void 0===y?void 0:y.room)||void 0===w?void 0:w.roomID),room_sid_string:ub.room_sid_string(null===(E=null===(S=this.Ro.publisherList[this.Uo])||void 0===S?void 0:S.room)||void 0===E?void 0:E.roomSessionID),max_retry_interval:ub.max_retry_interval(this.Nn.streamRetryTime),scenario:this.Nn.scenario,use_resource_type:ub.use_resource_type(["rtc"])}),this.Df?this.wl({encodedInsertableStreams:this.Vf.isSEIStart}):this.Kf(),null!=this.hl&&(clearTimeout(this.hl),this.hl=null),this.hl=setTimeout((function(){O.error(Od+" waiting timeout"),O.publishStateUpdateError(cb.Ee)}),this.vf)}else this.error(Od+" "+t+" streamId is null")},i.prototype.Kf=function(t){var i,e,n,s,r,o=this;if(!(null===(i=this.sl)||void 0===i?void 0:i.isUaConnected))return this.info(Od+" wait to create session"),this.Wf=[t],void this.sl.on("uaConnected",this.Fo.onUaSocketConnected);this.vl=N();var u=this.Uo;1==this.Ro.testEnvironment&&(u="zegotest-"+this.Ro.appid+"-"+this.Uo),this.Ro.gwNode&&(this.pf=this.Ro.gwNode);var a=this.Ur("gw_nodes");a&&Gt(a)&&a.length>0&&(this.info(Od+" setting "+JSON.stringify(a)),this.gf=a,this.pf=this.gf[0]||this.pf),this.setTurnTcp();var c=this.Ur("udp_or_tcp",!0);c&&(this.info(Od+" setting udp_or_tcp "+c),this.Yf="tcp"===c),this.Yf&&(this.Df=!1,this.Ff=!1);var h=(null===(n=null===(e=this.Ro.publisherList[this.Uo])||void 0===e?void 0:e.room)||void 0===n?void 0:n.roomID)||(null===(s=this.Nn.roomList[0])||void 0===s?void 0:s.roomID);this.getIPStackNode(),this.info("".concat(Od," session req, seq: ").concat(this.vl," gwNode: ").concat(this.pf,", ipNodeType: ").concat(this.ipNodeType,", ").concat(this.Df?"peer":"turn",", ipv6_prefer: ").concat(this.ipV6Prefer));var f=this.Sl(h),l=f.params,d=f.paramsExt;this.El=d;var v=Us,m=function(){o.state=1,o.info(Od+" called success"),o.df=vt.start};if(this.Df){this.getLocalMiniSdp(t.sdp,(function(i){var e=(new Date).getTime(),n=o.getSpan(Us.event,o.parentSpanKey),s={};i?(o.info(Od+" isMini"),s.miniSdp=i):s.sdp=t.sdp,o.il.createSessionWithSdp(tb(tb({seq:o.vl,type:0,mode:0,streamId:u,videoInfo:o.Su,strAuthParam:o.rl&&o.rl.streamParams||""},s),{serverHost:o.pf,params:l,paramsExt:d,roomID:h,geo:{type:o.Ro.geo.type,areaList:o.Ro.geo.areaList},ipV6Prefer:o.ipV6Prefer}),(function(t,i,s){return ib(o,void 0,void 0,(function(){var r;return eb(this,(function(o){return r=(new Date).getTime(),this.info(Od+" create session time "+(r-e)),n.setAttributes({webrtc_sid:i,sdp:v.sdp(s.sdp),is_mini:v.is_mini(this.To),gw_nodes:v.gw_nodes(s.gw_nodes),gw_nodes_ttl:v.gw_nodes(s.gw_nodes_ttl),gw_version:v.gw_version(s.gw_version),ip_mode:this.ipV6Prefer}),n.end(),this.Mn.spanSetAttributes({key:ob.event,par:this.Uo},{gw_version:ob.gw_version(s.gw_version)}),this.df!==vt.iceConnected&&this.getSpan(Gs,this.parentSpanKey,"",!0),this.Ol(t,i,s,this.ipV6Prefer),[2]}))}))}),(function(t,i){if(o.vl==i){var e=1==t?cb.ke:cb.Re;o.info(Od+" create session fail. signal: ".concat(o.sl.state,"; ws: ").concat(o.sl.mediaState)),o.Mn.setError(n,e),o.publishStateUpdateError(e)}else o.warn(Od+" seq is not match.")})),m()}))}else{var p=this.getSpan(Us.event,this.parentSpanKey),g={type:0,mode:0,streamID:u,strAuthParam:(null===(r=this.rl)||void 0===r?void 0:r.streamParams)||"",serverHost:this.pf,params:l,roomID:h,geo:{type:this.Ro.geo.type,areaList:this.Ro.geo.areaList},ipV6Prefer:this.ipV6Prefer};this.il.createSession(this.vl,g,(function(t,i,e){return ib(o,void 0,void 0,(function(){return eb(this,(function(n){return p.setAttributes({webrtc_sid:v.webrtc_sid(i),gw_nodes:v.gw_nodes(e.gw_nodes),gw_nodes_ttl:v.gw_nodes(e.gw_nodes_ttl),gw_version:v.gw_version(e.gw_version),ip_mode:this.ipV6Prefer}),p.end(),this.Mn.spanSetAttributes({key:ob.event,par:this.Uo},{gw_version:ob.gw_version(e.gw_version)}),sd(e),this.Tl(t,i,e,this.ipV6Prefer),[2]}))}))}),(function(t,i){if(o.vl==i){var e=1==t?cb.ke:cb.Re;o.Mn.setError(p,e),o.publishStateUpdateError(e)}else o.warn(Od+" seq is not match.")})),m()}},i.prototype.Tl=function(t,i,e,n){var s,r,o,u=e.turn_server,a=u.split("?")[0]&&u.split("?")[0].slice(5),c=this.signal.kl,h="webrtc://".concat(a,"/").concat(c,"/").concat(this.Uo);if(this.Mn.spanSetAttributes({key:this.parentSpanKey,par:this.Uo},{webrtc_sid:e.session_id,url:h}),this.info(Od+" sessionId:"+e.session_id),this.vl==t){this.resetPushCmdSeqMap();var f=e.client_ip||e.clientip;f&&(this.Nn.clientIP=f),this.Pf=e.peer_id;var l=0,d=(new Date).getTime();if(this.Hf&&(this.info(Od+" create signal time "+(l=d-this.Hf)),this.signalTime=l),this.Lf=d,0!==e.result){if(this.error(Od+" create session failed "+e.result),1021===(null==e?void 0:e.result))return void this.publishStateUpdateError(Ri,!0);if(2012===(null==e?void 0:e.result))return void this.publishStateUpdateError(cb.Je,!0);2016===(null==e?void 0:e.result)&&n===_t.IPv6Prefer&&(this.Hh=!1),this.publishStateUpdateError(cb.Re)}else this.Yc=e.session_id,this.cf=!0,this.info(Od+" create session success "+this.Yc),this.setGwNodes(e,!1,n,t),n===_t.IPv6Prefer&&(null===(s=null==e?void 0:e.ipv6s)||void 0===s?void 0:s.length)>0&&(this.Hh=!0),(null===(r=null==e?void 0:e.ipv4s)||void 0===r?void 0:r.length)>0&&(null===(o=null==e?void 0:e.ipv6s)||void 0===o?void 0:o.length)>0&&this.checkIfToRestart(n),this.info(Od+" isRestartIce "+this.jh),this.Rl(e)}else this.error(Od+" seq is not match.")},i.prototype.Ol=function(t,i,e,n){var s,r,o,u=this;if(this.info(Od+" sessionId:"+i),this.vl==t){this.resetPushCmdSeqMap();var a=e.client_ip||e.clientip;a&&(this.Nn.clientIP=a),this.Pf=e.peer_id;var c=0,h=(new Date).getTime();if(this.Hf&&(this.info(Od+" create signal time "+(c=h-this.Hf)),this.signalTime=c),this.Lf=h,0!==e.result){if(110===e.result&&(this.To=!1,this.Nn.To=!1,this.$h=performance.now()-this.tf,this.Xh=2),this.error(Od+" create session failed "+e.result),1021===(null==e?void 0:e.result))return void this.publishStateUpdateError(Ri,!0);if(2012===(null==e?void 0:e.result))return void this.publishStateUpdateError(cb.Je,!0);2016===(null==e?void 0:e.result)&&n===_t.IPv6Prefer&&(this.Hh=!1),this.publishStateUpdateError({code:cb.Re.code,message:cb.Re.message+" result:"+e.result})}else this.Yc=i,this.cf=!0,this.setGwNodes(e,!1,n,t),this.info(Od+" get remote session success "),n===_t.IPv6Prefer&&(null===(s=null==e?void 0:e.ipv6s)||void 0===s?void 0:s.length)>0&&(this.Hh=!0),(null===(r=null==e?void 0:e.ipv4s)||void 0===r?void 0:r.length)>0&&(null===(o=null==e?void 0:e.ipv6s)||void 0===o?void 0:o.length)>0&&this.checkIfToRestart(n),this.info(Od+" isRestartIce "+this.jh),this.ml(),this.parseRemoteSdp(e,(function(t){if(u.Ff){if(u.info(Od+" fully auto tcp"),!u.setConfiguration(t,e.params_ext))return void u.publishStateUpdateError(ie,!1);u.setLocalSdp(u.al)}u.Il(t,void 0,e.params_ext)}),(function(t){u.publishStateUpdateError(t)}))}else this.error(Od+" seq is not match.")},i.prototype.Nl=function(t){var i,e=this;if(this.info(Fd+" set candidate ".concat(JSON.stringify(t))),t){var n=t.candidate,s=t.sdpMid,r=t.sdpMLineIndex;if(n)this.info(Fd+" addIceCandidate"),null===(i=this.af)||void 0===i||i.addIceCandidate(new RTCIceCandidate({sdpMid:s,sdpMLineIndex:r,candidate:n})).then((function(){e.info(Fd+" add can suc")})).catch((function(t){e.info(Fd+" add can fail, ".concat(t.message))}))}},i.prototype.Sl=function(t){var i="",e=[],n={},s=this.Nn.seiConfig.SEIPass;Ut(s)&&(n.sei_filter_pass=s?1:0),n.auto_switch_turn_type="firefox"===this.Nn.browser?2:1,this.Nn.idName&&e.push("zguid="+this.Nn.idName),t&&e.push("zgrid="+t),this.Ro.isProxy&&(n.zg_proxy=1),1===this.Jf.forceSynchronousNetworkTime&&(n.sync_ntp=1);var r=this.rl,o=r.setDeviceDelayByUser,u=r.trafficControlFocusOnMode,a=r.enableTrafficControl;isNaN(o)||(n.ktv_device_delay=o),Ut(a)&&(n.tc_type=a?0:2),isNaN(u)||(n.tc_focuson_mode=0==u?1:0);var c=fh(),h=this.Ur("vid_clock_rate_est");(c&&(c.includes("18_4")||c.includes("18_5"))||h)&&(n.enable_vid_clock_rate_est=1);var f=this.el.getMinVideoBitrate();f>0&&(n.tc_min_video_kbps=f<.7*this.Su.bitRate?f:.7*this.Su.bitRate);return n.proto_flags=2,this.Ur("peer_signal_over_dc")&&(n.proto_flags|=256),e.length>0&&(i=e.join("&")),{params:i,paramsExt:n}},i.prototype.getDispatchIPNodeMode=function(){if(!this.pf){this.info("zc.p.0.gdinm call");var t=this.Ro.getStreamIPNodesMode(),i=t.ipNodeType;this.ipV6Prefer=t.ipV6Prefer,this.ipNodeType=i,this.ipV6Prefer===_t.IPv6Prefer&&!this.Hh&&this.nl&&(this.ipV6Prefer=_t.IPv4Prefer,this.ipNodeType=It.ZV4Priority),this.info("zc.p.0.gdinm ".concat(this.ipV6Prefer," ").concat(this.ipNodeType))}},i.prototype.getRetryIPNodeMode=function(){if(this.info("zc.p.0.grinm call"),this.ipV6Prefer===Rt.kV4Only)this.ipNodeType=It.ZV4Only;else{var t=this.Ro.getRetryIPPreferNodeType().ipNodeType;this.ipNodeType=t}this.info("zc.p.0.grinm ".concat(this.ipV6Prefer," ").concat(this.ipNodeType))},i.prototype.getRetryIPv6Prefer=function(){this.ipV6Prefer=this.Ro.getIPv6PreferByGwNode(this.gwNode)},i.prototype.checkIfToRestart=function(t){this.jh=t!==Rt.kV4Only&&(this.ipNodeType===It.ZV6AndV4Priority||this.Nn.selectIPStackMode===_t.IPv4Prefer&&this.Ro.agentIpStackDetection.IPv4===Nt.reachable&&this.ipNodeType===It.ZV6Priority)},i.prototype.getIPStackNode=function(){if(this.gwNode){var t=ql(this.gwNode);this.ipStackNode=El(t)}else this.ipStackNode=[It.ZV4Only,It.ZV4Priority].includes(this.ipNodeType)?kt.IPv4:kt.IPv6},i.prototype.setGwNodes=function(t,i,e,n){var s,r,o;if(this.info("".concat(Hd," seq: ").concat(n,", gw_nodes: ").concat(JSON.stringify(null==t?void 0:t.gw_nodes),", ips: ").concat(JSON.stringify(t.ips),", ipv6s: ").concat(JSON.stringify(t.ipv6s),", ").concat(e)),this.info("".concat(Hd," seq: ").concat(n,", retry: ").concat(JSON.stringify(this.retryFailGwNodes),", ips: ").concat(JSON.stringify(this.retryFailIpV4Nodes),", ipv6s: ").concat(JSON.stringify(this.retryFailIpV6Nodes))),0===e){if((null===(s=t.gw_nodes)||void 0===s?void 0:s.length)>0){var u=Hl(t.gw_nodes,this.retryFailGwNodes,i);this.retryFailGwNodes=[],this.handleDispatchedGwNodes(u,t.gw_nodes_ttl,e)}}else{var a=void 0,c=void 0;(null===(r=t.ips)||void 0===r?void 0:r.length)>0&&(a=Gl(t.ips,this.retryFailIpV4Nodes,i),this.retryFailIpV4Nodes=[]),(null===(o=null==t?void 0:t.ipv6s)||void 0===o?void 0:o.length)>0&&(c=Gl(t.ipv6s,this.retryFailIpV6Nodes,i),this.retryFailIpV6Nodes=[]),this.handleDispatchedGwNodes(t.gw_nodes||[],t.gw_nodes_ttl,e,a,c)}},i.prototype.resetGwNodes=function(){this.info("zc.p.0.rgn call"),this.pf="",this.gf=[],this.ipV4NodeList=[],this.ipV6NodeList=[],this.bf=0},i.prototype.handleDispatchedGwNodes=function(t,i,e,n,s){var r=this;if(void 0===n&&(n=[]),void 0===s&&(s=[]),this.info(Gd+" "+JSON.stringify(t)+" "+JSON.stringify(n)+" "+JSON.stringify(s)+" ipv6Prefer "+e),Array.isArray(t)&&0!==t.length||0!==n.length||0!==s.length){var o=0===i?60:i,u=function(){r.bf=o?(new Date).getTime()+1e3*o:r.bf};this.gf=t.length>0?t:this.gf,this.ipV4NodeList=n.length>0?n:this.ipV4NodeList,this.ipV6NodeList=s.length>0?s:this.ipV6NodeList,e===Rt.kV4Only?(this.pf=t.length>0?this.gf[0]:this.pf,t.length>0&&u()):e==Rt.kV4AndV6&&n.length>0?(this.pf=Fl(n[0]),this.ipNode=n[0],u()):e===Rt.kV6AndV4&&s.length>0?(this.pf=Fl(s[0]),this.ipNode=s[0],u()):(this.gf.length>0&&(this.pf=this.gf[0]),this.info("".concat(Gd," no gwNode ").concat(e," ").concat(n.length," ").concat(s.length)),this.ipNodeType=It.ZV4Only,this.ipStackNode=kt.IPv4),this.Ro.updateCachedGwNodesList(this.streamId,!0,t||[],o,n,s)}},i.prototype.dispatchGwNodes=function(t,i,e){var n=this.Uo;1==this.Ro.testEnvironment&&(n="zegotest-"+this.Ro.appid+"-"+this.Uo);var s=t;s===_t.IPv6Prefer&&!this.Hh&&this.nl&&(s=_t.IPv4Prefer),this.il.dispatchGwNodes({type:0,streamID:n,geo:{type:this.Ro.geo.type,areaList:this.Ro.geo.areaList},ipV6Prefer:s},(function(t,e,n){sd(n),i&&i(n)}),(function(t,i){e&&e(t)}))},i.prototype.Rl=function(t){var i;return ib(this,void 0,void 0,(function(){var e,n,s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S,E,O,T,k,R,I,N,C,z=this;return eb(this,(function(D){switch(D.label){case 0:return this.info((e=kd)+" called"),n=[],this.Ro.autoSwitchProtocol=this.Ur("auto_to_tcp")||!1,s=this.Ur("udp_max_fail_num"),!isNaN(s)&&(this.Ro.maxUdpFailNum=s),u=(r=this.Ro).maxUdpFailNum,a=r.udpFailNum,this.info(e+"  autoToTcp: ".concat(o=r.autoSwitchProtocol,", udpFailNum: ").concat(a,", maxUdpFailNum: ").concat(u,".")),o&&!this.Yf&&a>=u&&(this.info(e+" switch to tcp. "),this.Yf=!0,this.Ff=!1),(c=this.Ur("udp_or_tcp",!0))&&(this.info(e+" setting udp_or_tcp "+c),this.Yf="tcp"===c),h=void 0,f=this.Zf.wanIP=(t.gw_nodes[0]||this.pf).split(":")[0],!this.Ro.isProxy||this.Ro.isLocalProxy?[3,2]:(l=null==Qf?void 0:Qf.proxyCtrl,[4,Promise.all([l.getTurnInfo(),l.intranetCheck(yl(f),void 0)])]);case 1:return d=D.sent(),m=d[1],(v=d[0]).code?this.warn(e+" use proxy failed."+JSON.stringify(v)):(g=(p=v.data).password,b=p.turn_ipv4,_=p.turn_port,y=p.username,(w=p.turn_internal_ipv4)&&(this.El.coturn_internal=w),S=_l(b),E="turn:".concat(S,":").concat(_,"?transport=").concat(this.Yf?"tcp":"udp"),this.info(e+" turn server: ".concat(E," ; intranet: ").concat(JSON.stringify(null===(i=null==m?void 0:m.data)||void 0===i?void 0:i.intranet),"; turn internal ip: ").concat(_l(w))),h=[{credential:g,urls:[E],username:y}]),m.code?this.warn(e+" use intranetCheck failed."+JSON.stringify(m)):this.Zf.intranet=m.data.intranet||!1,[3,3];case 2:this.Ro.isLocalProxy&&this.Ro.turnServers?(h=(T=this.Ro.turnServers).map((function(t){return{credential:t.credential,urls:[t.url],username:t.username}})),this.info(e+" use local proxy: "+JSON.stringify(T)),this.Zf.intranet=!1):t.turn_server&&(O=[],t.turn_server.split(";").forEach((function(t){var i=Ol(t).replace("[","").replace("]",""),e=El(i);if(z.ipStackNode===e?O.push(t):z.Lh.push(t),e==kt.IPv4){var n=nd(i),s=t.replace(i,"[".concat(n,"]"));z.Ro.isCandidateHasIPv6&&O.push(s)}})),(C=this.Lh).push.apply(C,O),this.setTurnTcp(),T=void 0,k=O.filter((function(t){return t.indexOf("udp")>-1})),R=O.filter((function(t){return t.indexOf("tcp")>-1})),T=this.Yf?R.length>0?R:k.map((function(t){return t.replace("udp","tcp")})):k,this.info(e+" over tcp "+JSON.stringify(T)),n.push.apply(n,T)),D.label=3;case 3:return t.stun_server&&n.push(t.stun_server),I={iceTransportPolicy:"all",iceServers:[{urls:n,username:t.turn_username,credential:t.turn_auth_key}],encodedInsertableStreams:this.Vf.isSEIStart},this.Bh=t.turn_username,this.Jh=t.turn_auth_key,h&&(I.iceServers=h,I.iceTransportPolicy="relay",I.rtcpMuxPolicy="require"),this.info(e+" turn username: "+(N=I.iceServers[0]).username+", credential: "+N.credential+", url: "+JSON.stringify(N.urls)),this.wl(I),this.ml(),this.info(e+" call success"),[2]}}))}))},i.prototype.Cl=function(t,i){var e=this.Gf[t],n=e.seq,s=e.time,r=performance.now();return-1!==n&&n>=i&&r-s<6e3?(this.warn("zc.p.cps.0"+" push ".concat(t,", seq ").concat(i," local ").concat(JSON.stringify(this.Gf[t]))),!1):(this.Gf[t]={seq:i,time:r},!0)},i.prototype.onReceivedDataChannel=function(t){var i=new Uint8Array(t.data,0,1);i[0]==Rg.Signal?this.il.onDataChannelMessage(t.data):i[0]==Rg.TcFeedback&&this.el.handleFeedback(t.data)},i.prototype.wl=function(t){var i,e,n,s,r,o,u=this,a=kd;this.af=new RTCPeerConnection(t),this.af.onicecandidate=function(t){u.onIceCandidate(t)},this.af.onsignalingstatechange=function(t){u.onSignalStateChange(t)},this.af.connectionState?this.af.onconnectionstatechange=function(t){u.zl(t)}:this.info("".concat(a," not support connectionState")),this.af.oniceconnectionstatechange=function(t){u.onIceConnectionStateChange(t)};var c=this.Ur("peer_signal_over_dc"),h=!(!this.el.isEnable()||0!=this.el.getMinVideoBitrateMode());if(this.Ro.isDataChannelEnabled||c||h){var f={ordered:!1};this.info("zc.p.dc.0.n  option:"+JSON.stringify(f)+" enable:"+c+" "+h),this.jf=0,this.Xc=this.af.createDataChannel(this.Uo,f),this.Xc.binaryType="arraybuffer",c&&(this.il.dataChannel=this.Xc),h&&this.el.setDatachannel(this.Xc),this.Xc.onopen=function(t){u.info("zc.p.dc.0.o data channel open"),u.dataChannelState=1},this.Xc.onclose=function(t){u.error("zc.p.dc.0.c onclose"),u.dataChannelState=0},this.Xc.onmessage=function(t){if(u.jf++<3&&u.info("zc.p.dc.0.m onmessage"),t.data instanceof Blob){var i=new FileReader,e={};i.readAsArrayBuffer(t.data),i.onload=function(){e.data=i.result,u.onReceivedDataChannel(e)}}else u.onReceivedDataChannel(t)}}var l=[],d=[],v=Po(),m=this.isRePublish?yn:_n,p=0;if(this.lowStream&&(p=1,this.lowStream.getVideoTracks().forEach((function(t){var i;if("video"===t.kind){u.info(Od+" lt-id: "+t.id);var e=null===(i=u.af)||void 0===i?void 0:i.addTrack(t,u.lowStream);u.lowVideoSender=e,u.Vf.isSEIStart&&e&&v&&u.Dl(e,!0)}}))),this.Mn.spanSetAttributes({key:m.event,par:this.Uo},{is_dual_stream:_n.is_dual_stream(p),is_mini:_n.is_mini(this.To)}),this.Mn.spanSetAttributes({key:ob.event,par:this.Uo},{is_dual_stream:ob.is_dual_stream(p)}),this.fo){if(this.fo.getTracks().forEach((function(t){var i,e,n=u.Vf.isSEIStart&&v;u.info("".concat(a," pc addTrack enable ").concat(t.kind," ").concat(t.enabled," ").concat(u.Fu.isVideoEnabled)),("audio"===t.kind&&u.previewer.isAudioEnabled||"video"===t.kind&&(t.enabled||n))&&(e=null===(i=u.af)||void 0===i?void 0:i.addTrack(t,u.fo))&&"video"===t.kind&&u.el.getStartVideoBitrate()>0&&(u.Fu.videoInfo.contentHint&&"detail"===u.Fu.videoInfo.contentHint||e.track&&"contentHint"in e.track&&(u.info("".concat(Zd," setContentHint: ").concat(e.track.contentHint," => detail, tid :").concat(e.track.id)),e.track.contentHint="detail",u.If="motion")),n&&e&&(u.info(Od+" sei transform: "+t.kind),"video"===t.kind?u.Dl(e):"audio"===t.kind&&u.Pl(e)),jo(t,u.In,a,{streamID:u.Uo})})),!(null===(i=this.Fu)||void 0===i?void 0:i.videoTrack)&&this.Vf.isSEIStart){this.Su.bitRate||(this.Su.bitRate=50);var g=this.Vf.track=this._addCanvasStreamVideoTrack(),b=this.af.addTrack(g,this.fo);b&&"video"==g.kind&&v&&this.Dl(b)}(null===(e=this.Fu)||void 0===e?void 0:e.videoTrack)&&!this.Fu.hasStopCaptureVideo&&this.Fu.isVideoEnabled&&(l=[null===(n=this.Fu)||void 0===n?void 0:n.videoTrack]),this.Fu.isAudioEnabled&&(d=this.fo.getAudioTracks());var _,y=!1,w=!1;if(l.length>0)this.info(a+" video device: "+(_=l[0]).label+" ; set: "+JSON.stringify(_.getSettings())),y=!0;if(d.length>0)this.info(a+" audio device: "+(_=d[0]).label+" ; set: "+JSON.stringify(_.getSettings())),w=!0;var S=null===(s=this.af)||void 0===s?void 0:s.getSenders().find((function(t){var i;return"video"===(null===(i=t.track)||void 0===i?void 0:i.kind)&&t!==u.lowVideoSender})),E=null===(r=this.af)||void 0===r?void 0:r.getSenders().find((function(t){var i;return"audio"===(null===(i=t.track)||void 0===i?void 0:i.kind)}));"function"==typeof RTCPeerConnection.prototype.addTransceiver?(this.supportTransceiver=!0,this.info(a+" ts sender ".concat(!!S," ").concat(!!E)),!y&&S&&this.warn(a+" vt diff ".concat(!!this.previewer.videoTrack," ").concat(this.localStream===(null===(o=this.previewer)||void 0===o?void 0:o.localStream))),y||this.Vf.isSEIStart||S||(this.info(a+" add vt"),S=this.af.addTransceiver("video",{direction:"sendrecv"}).sender),w||E||(this.info(a+" add at"),E=this.af.addTransceiver("audio",{direction:"sendrecv"}).sender)):this.supportTransceiver=!1,this.videoSender=S,this.audioSender=E}var O={offerToReceiveAudio:d.length>0?1:0,offerToReceiveVideo:l.length>0?1:0};!0===this.rl.enableDTX&&(O.voiceActivityDetection=!0),this.Fh=O,this.info(a+" createOffer: "+JSON.stringify(O));var T=this.getSpan(Ps,this.parentSpanKey);T.setAttributes({is_dual_stream:xs(this.lowStream?1:0)}),this.af.createOffer(O).then((function(t){T.setAttributes({sdp:As(t.sdp),is_mini:Ms(u.To)}),T.end(),u.onCreateOfferSuccess(t)}),(function(t){u.error(a+" create offer error "+t.toString()),u.Mn.setError(T,{code:cb.Oe.code,message:t.toString()}),u.publishStateUpdateError(cb.Oe,!0)}))},i.prototype.restartIce=function(){var t,i=this,e="zc.p.0.rsi";this.info("".concat(e," call")),null===(t=this.af)||void 0===t||t.createOffer(tb(tb({},this.Fh),{iceRestart:!0})).then((function(t){var n,s,r;if(i.info("".concat(e," createOffer suc")),t.sdp){i.Al(t);var o=jl(t.sdp),u=Ll(t.sdp);i.info("".concat(e," ice ").concat(o," ").concat(u));var a={iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:i.Lh,username:i.Bh,credential:i.Jh}],encodedInsertableStreams:i.Vf.isSEIStart};i.info("".concat(e," set config ").concat(JSON.stringify(a))),null===(n=i.af)||void 0===n||n.setConfiguration(a),i.sendRestartIce(o,u),i.info("".concat(e," localSdp1 ").concat(t.sdp.substr(0,t.sdp.length/2))),i.info("".concat(e," localSdp2 ").concat(t.sdp.substr(t.sdp.length/2))),null===(s=i.af)||void 0===s||s.setLocalDescription(t).then((function(t){i.info("".concat(e," set local sdp suc"))})).catch((function(t){i.info("".concat(e," set local sdp fail ").concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))})),null===(r=i.af)||void 0===r||r.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:i.ul})).then((function(t){i.info("".concat(e," set remote sdp suc"))})).catch((function(t){i.info("".concat(e," set remote sdp fail ").concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))})),i.qh.forEach((function(t){var n;null===(n=i.af)||void 0===n||n.addIceCandidate(new RTCIceCandidate(t)).then((function(){i.info("".concat(e," add can suc"))})).catch((function(t){i.info("".concat(e," add can fail, ").concat(t.message))}))}))}})).catch((function(t){i.warn("zc.p.0.rsi err ".concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))}))},i.prototype.resetIceInfos=function(){this.info("zc.p.0.rii.0 call"),this.Lh=[],this.Bh="",this.Jh="",this.qh=[]},i.prototype.resetNat64Infos=function(){this.info("zc.p.0.rni.0 call"),this.Uh=[]},i.prototype.switchVideoCodec=function(t,i){var e=this,n="zc.p.0.sc.0";return new Promise((function(s,r){var o;e.Fh?null===(o=e.af)||void 0===o||o.createOffer(e.Fh).then((function(o){if(!o.sdp)return e.warn("".concat(n," create offer sdp none")),void r(!1);var u=Kf.getSDPVideoCodec(o.sdp);if(u&&0===u[i].length)return e.warn("".concat(n," code not support")),void r(!1);e.lf=i,e.onCreateOfferSuccess(o,!0,void 0,(function(i){return ib(e,void 0,void 0,(function(){return eb(this,(function(e){return 0!==i?(this.lf=t,this.warn("".concat(n," result ").concat(i)),r(!1)):(this.info("".concat(n," suc")),s(!0)),[2]}))}))}))})).catch((function(t){e.warn("".concat(n," create offer fail ").concat(null==t?void 0:t.toString())),r(!1)})):r(!1)}))},i.prototype.checkCodecSupport=function(){var t,i=null===(t=this.previewer.videoTrack)||void 0===t?void 0:t.getSettings();return 0!==this.camera_status||"0"!==this.publishStat.videoMuteState||0!==this.lastPublishStats.videoBytesSent||0!==this.lastPublishStats.framesEncoded||0===(this.publishStat.inputWidth||(null==i?void 0:i.width))||0===(this.publishStat.inputHeight||(null==i?void 0:i.height))||0===(this.publishStat.inputFPS||(null==i?void 0:i.frameRate))},i.prototype.sendSEI=function(t){var i=this;if("H264"!==this.lf)return this.error(Vd+" code not support"),!1;if(!this.Vf.isSEIStart)return console.error("Send SEI Failed. The publishing stream has not enabled sei."),!1;if(this.Vf.SEIType==et.UserUnregister&&t.byteLength<=16)return this.error(Vd+" inData size should greater than 16"),!1;if(this.Uf.length>=10)return this.error(Vd+" side info count limit"),!1;this.Uf.push(t.buffer);var e=this.seiWorker;return e&&(this.Uf.forEach((function(t){e.postMessage({cmd:"pushSideInfo",buffer:t,hasLowStream:!!i.lowStream,streamID:i.Uo,maxLength:10},[t])})),this.Uf=[]),!0},i.prototype.Pl=function(t){var i={cmd:"encode",streamID:this.Uo,kind:"audio"},e=this.createSEIWorker();if(window.RTCRtpScriptTransform)t.transform=new RTCRtpScriptTransform(e,i);else{var n=t.createEncodedStreams(),s=n.readable,r=n.writable,o=!e;try{e&&e.postMessage(tb({readable:s,writable:r},i),[s,r])}catch(t){o=!0}if(o){this.warn("zc.p.cart The current browser version is too low.");var u=new TransformStream({transform:this.Ml});s.pipeThrough(u).pipeTo(r),this.Ro.handleSeiRollBack()}}},i.prototype.Dl=function(t,i){void 0===i&&(i=!1);var e=this.createSEIWorker(),n={cmd:"encode",streamID:this.Uo,type:this.Vf.SEIType,isLowStream:i,emulationPreventionByte:this.Nn.seiConfig.emulationPreventionByte,onlyAudio:!!this.Vf.track};if(window.RTCRtpScriptTransform)t.transform=new RTCRtpScriptTransform(e,n);else{var s=t.createEncodedStreams(),r=s.readable,o=s.writable,u=!e;try{e&&e.postMessage(tb({readable:r,writable:o},n),[r,o])}catch(t){u=!0}if(u){this.warn("zc.p.cvrt The current browser version is too low.");var a=new TransformStream({transform:this.encodeVideoFrame});r.pipeThrough(a).pipeTo(o),this.Ro.handleSeiRollBack()}}},i.prototype.Ml=function(t,i){i.enqueue(t)},i.prototype.encodeSEINalu=function(t){var i=t.byteLength,e=parseInt(i/255),n=i%255,s=new ArrayBuffer(1+(e+1)+i+1),r=new DataView(s),o=0;r.setUint8(o++,this.Vf.SEIType===et.UserUnregister?5:243);for(var u=0;u<e;u++)r.setUint8(o++,255);r.setUint8(o++,n);var a=new DataView(t);for(u=0;u<(null==t?void 0:t.byteLength);u++)r.setInt8(o++,a.getInt8(u));r.setInt8(o++,128);var c=new Uint8Array(s),h=c;if(this.Nn.seiConfig.emulationPreventionByte){var f=function(t){for(var i=[],e=t.length,n=0,s=0;s<e;++s){var r=t[s];r<=3&&n>=2&&(i.push(3),n=0),i.push(t[s]),0==r?++n:n=0}var o=new Uint8Array(i);return{output:o,outLength:o.length}}(c).output;h=f}return{rbspView:h,ebspLength:h.length}},i.prototype.encodeFrame=function(t,i,e){var n=e?this.Bf:this.Uf;if(n.length>0){for(var s=new DataView(t.data),r=[],o=0,u=0;u<n.length;u++){var a=this.encodeSEINalu(n[u]);o+=5+(E=a.ebspLength),r.push(a)}e?this.Bf=[]:this.Uf=[];for(var c=new ArrayBuffer(o+t.data.byteLength),h=new DataView(c),f=0,l=new Tg(s),d=0,v=!1,m=!1,p=0;l.NextNalu();){p++;var g=31&s.getUint8(l.nalu_start+l.start_code_size);if(7==g)v=!0,d+=l.nalu_size;else if(8==g)m=!0,d+=l.nalu_size;else if(9==g)continue;if(v&&m)break}for(var b=0;b<d;b++)h.setInt8(f++,s.getInt8(b));var _=10-p,y=r.length>=(_=_>0?_:0)?_:r.length;for(u=0;u<y;u++){var w=r[u],S=w.rbspView,E=w.ebspLength;h.setUint8(f++,0),h.setUint8(f++,0),h.setUint8(f++,0),h.setUint8(f++,1),h.setUint8(f++,6);for(var O=0;O<E;O++)h.setInt8(f++,S[O-0])}for(b=d;b<t.data.byteLength;b++)h.setInt8(f++,s.getInt8(b));new Uint8Array(c);t.data=c}i.enqueue(t)},i.prototype.encodeFrameAudioOnly=function(t,i,e){var n=e?this.Bf:this.Uf,s=0,r="key"===t.type,o=performance.now(),u=0,a=[];if(n.length>0){for(var c=n.length>=9?9:n.length,h=0;h<c;h++){var f=this.encodeSEINalu(n[h]);u+=5+(_=f.ebspLength),a.push(f)}e?this.Bf=[]:this.Uf=[],o-this.recvLastKeyFrameTime>2e3&&(r=!0)}r&&(s=rb.length+sb.length);var l=new ArrayBuffer(u+s),d=new DataView(l),v=0;if(r)for(var m=new DataView(rb.buffer),p=0;p<rb.length;p++)d.setInt8(v++,m.getInt8(p));for(h=0;h<a.length;h++){var g=a[h],b=g.rbspView,_=g.ebspLength;d.setUint8(v++,0),d.setUint8(v++,0),d.setUint8(v++,0),d.setUint8(v++,1),d.setUint8(v++,6);for(var y=0;y<_;y++)d.setInt8(v++,b[y-0])}if(r){var w=new DataView(sb.buffer);for(p=0;p<sb.length;p++)d.setInt8(v++,w.getInt8(p))}t.data=l,r&&(this.recvLastKeyFrameTime=o),i.enqueue(t)},i.prototype.onCreateOfferSuccess=function(t,i,e,n){var s=this;if(i&&(this.isUpdateSDP=!0,n&&(this.xl=n)),this.fo&&this.fo.getTracks().forEach((function(t){jo(t,s.In,Rd)})),this.info(Rd+" local sdp revert "+this.hf.join("")),this.Al(t),this.info(Rd+" localSdp1 "+t.sdp.substr(0,t.sdp.length/2)),this.info(Rd+" localSdp2 "+t.sdp.substr(t.sdp.length/2)),this.Ff&&!i)return this.al=t,void this.Kf(t);this.setLocalSdp(t,e)},i.prototype.Al=function(t){var i;this.Su.bitRate>0&&(t.sdp=this.jl(t.sdp,this.Su.bitRate)),t.sdp=t.sdp.replace(/sendrecv/g,"sendonly");var e=t.sdp.match(/m=application[\s\S]+datachannel[\s\S]+/)?null===(i=t.sdp.match(/m=application[\s\S]+datachannel[\s\S]+/))||void 0===i?void 0:i[0]:null;if(e){var n=e.replace(/sendonly/,"sendrecv");t.sdp=t.sdp.replace(e,n)}var s=[];isNaN(this.Su.audioBitrate)||s.push("maxaveragebitrate="+this.Su.audioBitrate);var r=/stereo=\d+/,o=t.sdp.match(r),u="stereo="+(2===this.Su.channelCount?1:0);if(o&&o[0]?t.sdp=t.sdp.replace(r,u):s.push(u),!0===this.rl.enableDTX){var a=/usedtx=\d+/,c=t.sdp.match(a),h="usedtx="+(this.rl.enableDTX?1:0);c&&c[0]?t.sdp=t.sdp.replace(a,h):s.push(h)}var f=/useinbandfec=\d+/,l=t.sdp.match(f);l&&l[0]&&s.push(l[0]),t.sdp=t.sdp.replace(f,s.join(";")),this.hf=t.sdp.match(/m=(.\w*)\s/g)||[],this.info(Rd+" local sdp revert "+this.hf.join(""));var d=Kf.getSDPVideoCodec(t.sdp);if((null==t?void 0:t.sdp.includes("m=video"))&&0===d[this.lf].length){if(!this.publishOption.enableAutoSwitchVideoCodec)return void this.publishStateUpdateError(cb.Ve,!0,"not support ".concat(this.lf," codec"));var v=this.lf;if(this.lf="H264"===this.lf?"VP8":"H264",this.info("".concat(Rd," switch video codec to ").concat(this.lf)),this.Nn.actionListener("publisherVideoEncoderChanged","H264"===v?0:2,"H264"===this.lf?0:2,this.streamId),0===d[this.lf].length)return void this.publishStateUpdateError(cb.Ve,!0,"not support H264 and VP8 codec")}t.sdp=Kf.getSDPByVideDecodeType(t.sdp,this.lf),this.setSdpHardCode(t),"firefox"===this.Nn.browser&&Jl(this.Nn.browserInfo,"firefox",139,2)&&(t.sdp=Kg(t.sdp))},i.prototype.setLocalSdp=function(t,i){var e,n=this;this.info(Rd+" set local sdp");var s=this.getSpan(js,this.parentSpanKey);s.setAttributes({sdp:Ls(t.sdp),is_mini:qs(this.To),is_dual_stream:xs(this.lowStream?1:0)}),null===(e=this.af)||void 0===e||e.setLocalDescription(t).then((function(){return ib(n,void 0,void 0,(function(){return eb(this,(function(e){switch(e.label){case 0:return s.end(),[4,this.onSetLocalDescriptionSuccess(t,i)];case 1:return e.sent(),[2]}}))}))}),(function(t){n.error(Rd+" error "+t.toString()),n.Mn.setError(s,{code:cb.Te.code,message:t.toString()}),n.publishStateUpdateError(cb.Te,!0)}))},i.prototype.jl=function(t,i){var e="AS";return"firefox"===this.Nn.browser&&(i=1e3*(i>>>0),e="TIAS"),t=-1===t.indexOf("b="+e+":")?t.replace(/(m=video.*\r\nc=IN.*\r\n)/g,"$1b="+e+":"+i+"\r\n"):(t=t.replace(new RegExp("b="+e+":.*\r\n","g"),"b="+e+":"+i+"\r\n")).replace("b="+e+":"+i+"\r\n","")},i.prototype.setSdpHardCode=function(t){var i,e,n=!1,s=null===(i=this.Fu)||void 0===i?void 0:i.previewType,r=this.Nn.settingConfig;"camera"===s?n=r.getSetting("camera_hard_encode"):"screen"===s?n=r.getSetting("hardware_encode"):"custom"===s&&(n=r.getSetting("custom_hard_encode"));var o=!n;this.info(Id+" ".concat(null===(e=this.Fu)||void 0===e?void 0:e.previewType," software encode: ").concat(o,", "));var u=Kf.getSDPByVideDecodeType(t.sdp,this.lf,o,this.Nn.engineConfig.encodecSelectionMode);t.sdp=u},i.prototype.onSetLocalDescriptionSuccess=function(t,i){return ib(this,void 0,void 0,(function(){var e,n=this;return eb(this,(function(s){return this.info(Id+" success"),this.fo&&this.fo.getTracks().forEach((function(t){jo(t,n.In,Id)})),!this.isUpdateSDP&&(this.state=2),i&&(this.previewer.videoInfo=tb(tb({},this.Su),i)),this.setSdpHardCode(t),this.Df&&!this.isUpdateSDP?this.Ff?(this.info(Id+" fully auto tcp"),[2]):(this.Kf(t),[2]):(e=function(i){var e,s={};i?s.miniSdp=i:s.sdp=t.sdp;var r=tb(tb({},s),{keyframe_intv:Math.floor((null===(e=n.Su)||void 0===e?void 0:e.keyFrameInterval)||2),paramsExt:n.El});if(n.uf=N(),n.isUpdateSDP){n.info(Id+" update sdp");var o=tb(tb({},r),{type:0});n.il.sendMediaDescUpdateReq(n.uf,n.Yc,o,(function(t,i,e){0==(null==e?void 0:e.result)&&n.parseRemoteSdp(e,(function(t){n.Ll(t)||n.Il(t)}),(function(t){n.publishStateUpdateError(t)}))}),(function(t,i){n.error(Id+" update sdp failed"),n.xl&&n.xl(-1),n.publishStateUpdateError(1==t?cb.xe:cb.je)}))}else{var u=n.getSpan(ir,n.parentSpanKey);n.il.sendMediaDesc(n.uf,n.Yc,0,r,(function(t,i,e){u.setAttributes({webrtc_sid:er(i),mediaDescription:{keyframe_intv:r.keyframe_intv},sdp:r.sdp}),u.end(),n.uf==t&&n.Yc==i?(n.info(Id+" send success stateNego:waiterAnswer"),n.df=vt.waiterAnswer,n.state=3,n.parseRemoteSdp(e,(function(t){n.Ll(null==e?void 0:e.sdp)||n.Il(t,!0)}),(function(t){n.publishStateUpdateError(t)}))):n.error(Id+" seq or sessionId is not equal")}),(function(t,i){n.error(Id+" mediaDesc error "+JSON.stringify(t)),n.Mn.setError(u,{code:cb.ze.code,message:cb.ze.message}),n.publishStateUpdateError(cb.ze)})),n.info(Id+" call success")}},this.getLocalMiniSdp(t.sdp,e),[2])}))}))},i.prototype.getVideoSenders=function(t){if(void 0===t&&(t=!1),t&&!this.previewer.isVideoEnabled)return[];var i=[];return this.videoSender&&(i.push(this.videoSender),this.lowVideoSender&&i.unshift(this.lowVideoSender)),i},i.prototype.canSetBandWidthBySender=function(){var t=this.Nn.browserInfo.name.toLowerCase(),i=Bl(this.Nn.browserInfo.version);return("chrome"===t||"safari"===t||"firefox"===t&&i>=64)&&"RTCRtpSender"in window&&"setParameters"in window.RTCRtpSender.prototype},i.prototype.applyVideoBitrate=function(t){return ib(this,void 0,void 0,(function(){var i=this;return eb(this,(function(e){return[2,new Xt((function(e){var n=i.videoSender;if(n){var s=n.getParameters();s.encodings||(s.encodings=[{}]);var r=1e3*t,o=s.encodings[0].maxBitrate,u=JSON.stringify(s.encodings[0]);s.encodings[0].maxBitrate=r,n.setParameters(s).then((function(){i.info("zc.p.sbw set maxBitrate success. ".concat(o,"=>").concat(r,", ").concat(u,",").concat(n.getParameters().encodings[0]," ")),e(!0)})).catch((function(t){i.warn("zc.p.sbw set maxBitrate fail"+t),e(!1)}))}else e(!0)}))]}))}))},i.prototype.Ll=function(t){return 0===xl(t).length&&(this.publishStateUpdateError(ie,!1),!0)},i.prototype.setBandWidthBySdp=function(t,i){this.info("zc.p.sbwbs bandwidth: ".concat(i));var e="AS";return"firefox"===this.Nn.browser&&(i=1e3*(i>>>0),e="TIAS"),t=/b=AS.*(\r\n|\n)/.test(t)?t.replace(/AS:(\d+)/,e+":"+i):t.replace(/m=video.*(\r\n|\n)c=.*(\r\n|\n)/,"$&b=".concat(e,":").concat(i,"\n"))},i.prototype.Il=function(t,i,e){var n,s;return void 0===i&&(i=!1),ib(this,void 0,void 0,(function(){var r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S,E,O,T,k,R,I,N,C,z,D,P,A,M,x,j,L=this;return eb(this,(function(q){switch(q.label){case 0:if(this.info(Nd+" call"),this.Su.audioBitrate&&48e3!==this.Su.audioBitrate&&(t=t.replace(/maxaveragebitrate=(\d+)/,"maxaveragebitrate="+this.Su.audioBitrate)),this.ff=t.match(/m=(.\w*)\s/g)||[],this.info(Nd+" sdp revert "+this.ff.join("")),this.setTurnTcp(),this.Ro.autoSwitchProtocol=this.Ur("auto_to_tcp")||!1,r=this.Ur("udp_max_fail_num"),!isNaN(r)&&(this.Ro.maxUdpFailNum=r),a=(o=this.Ro).maxUdpFailNum,c=o.udpFailNum,this.info("zp.oro.0  autoToTcp: ".concat(u=o.autoSwitchProtocol,", udpFailNum: ").concat(c,", maxUdpFailNum: ").concat(a,".")),u&&!this.Yf&&c>=a&&(this.info("zp.oro.0 switch to tcp."),this.Yf=!0,this.Ff=!1),(h=this.Ur("udp_or_tcp",!0))&&(this.info("zp.oro.0 setting udp_or_tcp "+h),this.Yf="tcp"===h),this.Yf&&!this.Ro.isProxy&&"firefox"!==this.Nn.browser&&(null===(n=t.match(/candidate.*/g))||void 0===n||n.forEach((function(i){var e=i.replace(/udp/,"tcp");e.includes(" tcptype ")||(e=e.replace(" typ host "," typ host tcptype passive ")),t=t.replace(i,e)}))),this.Ro.isProxy)if(f=Ml(t),l=f[0],d=f[1],v=t.match(/a=mid:[^(\n|\r)]+/g),d&&v)if(this.Zf.intranet)setTimeout((function(){d.forEach((function(t,i){var e,n={sdpMLineIndex:i,candidate:t.replace(l[i].ip,L.Zf.wanIP).replace("a=",""),sdpMid:v[i].replace("a=mid:","")};L.info("zp.oro.0  add wan candidate:"+JSON.stringify(n)),null===(e=L.af)||void 0===e||e.addIceCandidate(new RTCIceCandidate(n))}))}),1e3);else for(this.info("zp.oro.0  change candidate ip from lan to wan: "+(m=this.Zf.wanIP)),p=0;p<d.length;p++)b=(g=d[p]).replace(l[p].ip,m),t=t.replace(g,b);else this.warn("zp.oro.0  candidate not found");else t=this.extractCandidate(t);if(this.info("zp.oro.0 sdp revert "+this.hf.join("")+" "+this.ff.join("")),this.hf.join()!==this.ff.join()&&this.hf.length==this.ff.length&&(_=new RegExp("[\\s\\S]*"+this.ff[0]).exec(t)[0].replace(this.ff[0],""),y=[],w="",this.hf.forEach((function(i){var e=L.ff.findIndex((function(t){return t==i})),n=new RegExp(i+"[\\s\\S]*"+(L.ff[e+1]||"")).exec(t)[0].replace(L.ff[e+1],""),s=/a=mid:(\w)/.exec(n)[1];y.push(s),w+=n||""})),t=_.replace(/a=group:BUNDLE.*/,"a=group:BUNDLE "+y.join(" "))+w,this.hf=[],this.ff=[]),(S=Al(t).filter((function(t){return t.startsWith("m=video")}))).length>0&&(O=(E=this.lowStream?S[1]:S[0]).match(/m=video(.|\r|\n)*a=rtpmap(.|\r|\n)*(a=fmtp:(\d+).*)/),oh()&&(T=this.el.getStartVideoBitrate(),k=this.el.getMinVideoBitrate(),R=[],k&&R.push("x-google-min-bitrate=".concat(k)),T&&R.push("x-google-start-bitrate=".concat(T)),null!==O&&R.length&&(I=O[3],N="".concat(I,";").concat(R.join(";")),C=E.replace(I,N),t=t.replace(E,C)))),!(this.Su.bitRate>0))return[3,5];if(z=this.Su.bitRate,D=this.Su.bitRate,P=!1,!this.canSetBandWidthBySender())return[3,4];q.label=1;case 1:return q.trys.push([1,3,,4]),D=this.el.getTargetVideoBitrate(),[4,this.applyVideoBitrate(D)];case 2:return P=q.sent(),[3,4];case 3:return A=q.sent(),this.error(Nd+JSON.stringify(A)),[3,4];case 4:P||(t=this.setBandWidthBySdp(t,z)),null==(M=this.getVideoSenders())||M.forEach((function(t){var i;if(t&&t.getParameters&&t.setParameters){var e=t===L.lowVideoSender,n=t.getParameters();if(n.encodings&&0!=n.encodings.length||(n.encodings=[{}]),e){var s=null===(i=L.Fu)||void 0===i?void 0:i.lowStreamConfig.bitRate;s&&(n.encodings[0].maxBitrate=1e3*s)}else{var r=L.getScaleResolutionDownBy();1!=r&&(n.encodings[0].scaleResolutionDownBy=r)}L.videoInfo.frameRate>0&&(n.encodings[0].maxFramerate=L.videoInfo.frameRate),t.setParameters(n)}})),q.label=5;case 5:return this.info(Nd+" remoteSdp:"+t),x={type:"answer",sdp:t},(j=this.getSpan(Bs,this.parentSpanKey)).setAttributes({sdp:Js(x.sdp),is_mini:Vs(this.To),is_dual_stream:xs(this.lowStream?1:0),webrtc_sid:Hs(this.Yc)}),this.ul=x.sdp,null===(s=this.af)||void 0===s||s.setRemoteDescription(new RTCSessionDescription(x)).then((function(){L.info(Nd+" set success"),L.fo&&L.fo.getTracks().forEach((function(t){jo(t,L.In,Nd)})),j.end(),L.df==vt.iceConnected&&L.xl&&(L.info(Nd+" update sdp success"),L.xl(0),L.xl=void 0,L.isUpdateSDP=!1)}),(function(t){L.error(Nd+" failed: "+t.toString()),j.setAttributes({error:cb.Ie.code,message:t.toString()}),j.end();var i=!0;L.To&&(i=!1,L.To=!1,L.$h=performance.now()-L.tf,L.Xh=4),L.publishStateUpdateError(cb.Ie,i)})),this.state=4,i&&t.indexOf("candidate")>-1&&(this.ql(this.if),this.if=[],this.state=5),this.Ff&&this.Nl(e),this.startTime=Date.now(),this.checkRetryOtherIPCandidate(),this.info(Nd+" call success"),[2]}}))}))},i.prototype.checkRetryOtherIPCandidate=function(){var t=this;this.ll=setTimeout((function(){t.info("".concat("zc.p.0.croic"," check ").concat(t.state," ").concat(t.ipNodeType," ").concat(t.qh.length)),6!==t.state&&t.jh&&t.qh.length>0&&(t.ipStackNode=t.ipStackNode===kt.IPv4?kt.IPv6:kt.IPv4,t.restartIce())}),this.Vh)},i.prototype.extractCandidate=function(t){var i=this,e=Ml(t),n=e[0];return e[1].forEach((function(e,s){var r=n[s].ip,o=El(r);if(i.ipStackNode!==o){var u={sdpMLineIndex:parseInt(n[s].mid),candidate:e.replace("a=",""),sdpMid:n[s].mid};i.qh.push(u),t=t.replace(e+"\n","")}if(o===kt.IPv4){var a=nd(r),c=e.replace(new RegExp(r,"g"),a).replace("a=",""),h={sdpMLineIndex:parseInt(n[s].mid),candidate:c,sdpMid:n[s].mid};i.Uh.find((function(t){return t.candidate===h.candidate&&t.sdpMLineIndex===h.sdpMLineIndex&&t.sdpMid===h.sdpMid}))||i.Uh.push(h)}})),t},i.prototype.getScaleResolutionDownBy=function(){var t,i,e,n=this.lastPublishStats.frameWidth,s=(null===(i=null===(t=this.Fu)||void 0===t?void 0:t.cameraMaxResolution)||void 0===i?void 0:i.maxWidth)||0,r=null===(e=this.Fu.videoTrack)||void 0===e?void 0:e.getSettings().width,o=n?Math.min(s,n):s;return s&&r?Math.max(o/r,1):1},i.prototype.setBitrate=function(t){return ib(this,void 0,void 0,(function(){var i;return eb(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.applyVideoBitrate(t)];case 1:return e.sent(),this.el.setVideoBitrate(t),this.Su.bitRate=t,[3,3];case 2:return i=e.sent(),this.error("zc.p.0.sb.0"+JSON.stringify(i)),[3,3];case 3:return[2]}}))}))},i.prototype.setVideoBitrateForTC=function(t){this.el.setVideoBitrate(t)},i.prototype.setConfiguration=function(t,i){var e,n,s=this;if(this.info(Yd+" ".concat(JSON.stringify(i))),i){var r=i.turn_username,o=i.turn_auth_key,u=i.turn_urls;this.Bh=r,this.Jh=o;var a=void 0;if(u){var c=u.split(";"),h=[];c.forEach((function(t){var i=Ol(t).replace("[","").replace("]",""),e=El(i);if(s.ipStackNode===e?h.push(t):s.Lh.push(t),e==kt.IPv4){var n=nd(i),r=t.replace(i,"[".concat(n,"]"));s.Ro.isCandidateHasIPv6&&h.push(r)}})),(e=this.Lh).push.apply(e,h),a=h}else{var f=xl(t);if(0===f.length)return this.info(Yd+" no candidate"),!1;a=f}null===(n=this.af)||void 0===n||n.setConfiguration({iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:a,username:r,credential:o}],encodedInsertableStreams:this.Vf.isSEIStart})}return!0},i.prototype.onIceConnectionStateChange=function(t){var i,e=this;if(7!=this.state&&null!=this.af){this.info(Pd+" ice state: "+this.af.iceConnectionState);var n=this.getSpan($s,this.parentSpanKey,Cn.event);if(n.setAttributes({ice_state:tr(this.af.iceConnectionState)}),"connected"===this.af.iceConnectionState){if(this.info(Pd+" connected state "+this.state+" ?"+(null===(i=this.af)||void 0===i?void 0:i.connectionState)),this.Hf){var s=(new Date).getTime()-this.Hf;this.ol.setAttributes({publish_begin_time:ub.publish_begin_time(s)}),this.Hf=0}if(this.Mn.spanEnd({key:Gs,par:this.Uo},{webrtc_sid:this.Yc}),this.df=vt.iceConnected,this.Lf){var r=(new Date).getTime()-this.Lf;this.info(Pd+" ice time "+r)}this.Qh=!1,this.info(Pd+" stateNego:iceConnected"),this.hl&&(clearTimeout(this.hl),this.hl=null),null!=this.fl&&(clearTimeout(this.fl),this.fl=null),this.af.connectionState||(this.mf?this.publishSuccess():(this.Ul&&clearTimeout(this.Ul),this.Ul=null,this.Ul=setTimeout((function(){var t;e.info(Pd+" get first stats state "+e.state),6!==e.state&&(null===(t=e.af)||void 0===t||t.getStats().then((function(t){e.info(Pd+" get first stats suc"),t.size>0&&e.publishSuccess()})))}),1e3)))}else if("closed"===this.af.iceConnectionState)n.end(),this.df=vt.iceClosed,this.Bl(this.af.iceConnectionState);else if("failed"===this.af.iceConnectionState)n.end(),this.df=vt.iceFailed,this.Bl(this.af.iceConnectionState);else if("disconnected"===this.af.iceConnectionState){n.end(),this.warn(Pd+" ice disconnected "),this.df=vt.iceDisconnected;var o=this.Ro.lastChangeIpTime;o&&Date.now()-o<15e3?this.publishStateUpdateError(cb.Ne):this.fl||(this.fl=setTimeout((function(){e.Bl("disconnected")}),15e3))}}},i.prototype.onIceCandidate=function(t){var i,e,n=this;if(this.info(zd+" candidate "+JSON.stringify(t.candidate)),t.candidate){if(t.candidate.candidate)El(null===(i=t.candidate.candidate.split(" "))||void 0===i?void 0:i[4])===kt.IPv6&&(this.Ff&&(this.info("".concat(zd," can len ").concat(this.Uh.length)),this.Uh.forEach((function(t){var i;null===(i=n.af)||void 0===i||i.addIceCandidate(new RTCIceCandidate(t)).then((function(){n.info("".concat(zd," add can suc"))})).catch((function(t){n.info("".concat(zd," add can fail, ").concat(t.message))}))}))),this.Ro.isCandidateHasIPv6=!0);if(-1!=(null===(e=t.candidate.candidate)||void 0===e?void 0:e.indexOf("relay"))){this.info(zd+" candidate "+t.candidate.candidate+" state "+this.state+" autotcp "+this.Ff);var s=function(t){n.ql([{candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex}])};this.Ff?s(t):this.state<5||7==this.state?this.if.push({candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex}):s(t)}else this.info(zd+" candidate not relay")}},i.prototype.ql=function(t){var i=this;if(this.info(Ld+" called"),!(t=t.filter((function(t){return t.candidate.indexOf("relay")>0})))||t.length<1)this.info(Ld+" cancelled");else{var e=this.getSpan(nr,this.parentSpanKey);e.setAttributes({candidate_info:sr(t)}),this.df!==vt.iceConnected&&(this.df=vt.sendCandidate),this.info(Ld+" stateNego:sendCandidate"),this.il.sendCandidateInfo(t,(function(t,n,s){i.info(Ld+" send success"),e.end()}),(function(t,n){i.error(Ld+" failed to send: "+t.toString()),i.Mn.setError(e,{code:cb.De.code,message:t.toString()}),i.publishStateUpdateError(cb.De)}))}},i.prototype.zl=function(t){var i,e,n=null===(i=this.af)||void 0===i?void 0:i.connectionState;this.info(Dd+" conn state: "+n);Date.now();if("connected"===n){if("motion"===this.If){var s=this.videoSender;s&&"video"===(null===(e=s.track)||void 0===e?void 0:e.kind)&&"contentHint"in s.track&&(this.info("".concat(Zd," recover contentHint: ").concat(s.track.contentHint," => ").concat(this.If,", tid :").concat(s.track.id)),s.track.contentHint=this.If),this.If=""}6!==this.state&&this.publishSuccess()}},i.prototype.onSignalStateChange=function(t){this.info(Dd+" signal state: "+t.target.signalingState),7!=this.state&&null!=this.af&&"closed"===t.target.signalingState&&(this.df=vt.iceClosed,this.Bl(this.af.iceConnectionState))},i.prototype.pl=function(t,i,e){this.info(jd+" "+JSON.stringify(e));var n=this.getSpan(Xs,Cn.event);n.setAttributes({err_info:Ws(e.err_info||""),reason_info:null==e?void 0:e.reason}),n.end(),this.Mn.spanSetAttributes({key:Cn.event,par:this.Uo},{denied_info:Cn.denied_info(e.err_info),stop_reason:Cn.stop_reason("DenyStop")});var s=e.err_info?JSON.parse(e.err_info.toLowerCase()):{},r=s.action?s.action:null,o=1*e.reason,u=JSON.parse(JSON.stringify(cb.Se));u.message+=" reason:".concat(o," ").concat(r?" action:"+r:""," ").concat((null==s?void 0:s.err)?" err:"+(null==s?void 0:s.err):""),u.message+=";".concat(kg(o,r,null==s?void 0:s.err)),1011===s.err&&(u=cb.ye),1014===s.err&&(u=cb.we),1012===s.err&&(u=qi),this.hl&&clearTimeout(this.hl);var a=!([4,8,10,11,12,14,18,24,26,27,28,32].includes(o)||[2,3,4,5,6].includes(r)),c=!1;if(!this.Yf){if([8,10].includes(o)||[18,15].includes(o)&&2===r&&[3001,3002].includes(s.err)){this.Ro.udpFailNum++;var h=this.Ro;h.autoSwitchProtocol&&h.udpFailNum>=h.maxUdpFailNum&&(this.Df=!1,this.Ro.setIsPeer(!1),c=!0)}else this.Yf||(this.Ro.udpFailNum=0);var f=this.Ro.isNodeLast(this).lastTryNext,l=[3001,3002,3003,3004,3005,3006,3007,3008].includes(s.err);f&&l&&(this.info(jd+" switch tcp by all fail"),this.Nn.turnToTcp=!0,this.Ff=!1,this.Df=!1,this.Ro.setIsPeer(!1))}this.publishStateUpdateError(u,a,s,c)},i.prototype.bl=function(t,i,e){if(this.info(xd+" received "),this.getSpan(Ks,Cn.event).end(),i==this.Yc){var n={code:cb.Se.code,message:"server session reset "+e.reason};this.hl&&clearTimeout(this.hl),this.publishStateUpdateError(n)}else this.error(xd+" cannot find session")},i.prototype._l=function(t,i,e){var n;if(this.info("".concat("zc.p.0.orpe"," received, ").concat(t)),this.Cl("PublishEventPush",t)){var s=this.getSpan(Fs,this.parentSpanKey,Cn.event);s.setAttributes({event_state:Ys(e.event),webrtc_sid:i}),s.end(),this.Ul&&(clearTimeout(this.Ul),this.Ul=null);var r=null===(n=this.af)||void 0===n?void 0:n.connectionState;this.mf=!0,(r?"connected"===r:this.df===vt.iceConnected)&&6!=this.state?0==e.event&&this.publishSuccess():this.resendStreamStatus(0)}},i.prototype.yl=function(t,i,e){if(this.Cl("ClientInfoPush",t)){this.Nn.clientIP!==e&&this.info(Cd+" client ip changed "+this.Nn.clientIP+" "+e),this.Nn.clientIP=e,this.Pf=i,this.il.peerId=this.Pf,this.qf=e,this.Nn.isMultiOuter=this.isMultiOuter(),6===this.state&&this.getConnectIP(),this.Vf.isSEIStart&&this.Vf.SEIType==et.UserUnregister&&this.Vf.unregisterSeiFilter&&this.sendSEIUUID();var n=this.Fu;if(n&&null!==n.activateSEIConfig){var s=null==n?void 0:n.activateSEIConfig;this.activateSEIInsert(s.action,s.infoType)}}},i.prototype.sendSEIUUID=function(){var t=this;this.info("zc.ssuid call: "+this.Vf.unregisterSeiFilter),this.il.sendSEIUUID(this.Vf.unregisterSeiFilter).then((function(i){t.info("zc.ssuid success"),0==(null==i?void 0:i.result)&&(t.Vf.uuidSend=!0)})).catch((function(i){t.error("zc.ssuid failed")}))},i.prototype.sendRestartIce=function(t,i){var e=this;this.info("zc.p.0.srsi call: "+t+" "+i),this.il.sendRestartIce(t,i).then((function(t){e.info("zc.p.0.srsi result "+JSON.stringify(t))})).catch((function(t){e.warn("zc.p.0.srsi fail: "+JSON.stringify(t))}))},i.prototype.Bl=function(t){this.info(Pd+" state "+this.state+" connectionState "+t),this.publishStateUpdateError(cb.Ne)},i.prototype.getStopReason=function(t){var i="StopPublish";if(t&&t.code)switch(t.code){case 1103051:i="ReachMaxAVRetryTime";break;case 1012:i="DuplicateStreamID";break;default:i="StopPublish"}return i},i.prototype.stopPublish=function(t){var i,e,n;this.info("zc.p.0.sp.1 called "+this.state+" "+JSON.stringify(t));var s=this.getStopReason(t);if(1==this.Ro.publishersLength){var r=this.Ro.playerList;for(var o in r){var u=r[o];6==u.state&&u.broadcasterStatus==A.start&&(u.sendBroadcasterStatus(0),u.broadcasterStatus=A.stop)}}this.closeSession(0),this.resetPushCmdSeqMap();var a=Date.now();this.ol.setAttributes({publish_state_time:ub.publish_state_time(a-this.reportPublishStateTime)}),this.uploadRTCPublishStats();var c=this.Ia?0:this.lastFailTimeLen;(this.Mn.spanEnd({key:Cn.event,par:this.Uo},{tryidx:hb.tryidx(this.rtcPublishCount),url:hb.url(null===(i=this.sl)||void 0===i?void 0:i.server),ip:hb.ip(this.ip),dispatch_external_ip:hb.dispatch_external_ip(this.Nn.clientIP),resource_type:hb.resource_type("rtc"),protocol:hb.protocol("webrtc"),net_protocol:ab.net_protocol(this.netProtocol),stop_reason:Cn.stop_reason(s),try_time:hb.try_time(c),error:(null==t?void 0:t.code)||0,message:(null==t?void 0:t.message)||""}),this.Ia)||this.Mn.spanEnd({key:(this.isRePublish?yn:_n).event,par:this.Uo},{error:(null==t?void 0:t.code)||0,message:(null==t?void 0:t.message)||"",url:ab.url(null===(e=this.sl)||void 0===e?void 0:e.server),ip:ab.ip(this.ip),peer_id:ab.peer_id(this.Pf),source_type:ab.source_type("rtc"),net_protocol:ab.net_protocol(this.netProtocol)});var h=0;t&&0!==t.code&&(h=t.code===ee.code?this.latestPublishErrCode:t.code);var f=this.publishedTimeStamp;this.ol.setAttributes({stream_id:ub.stream_id(this.Uo),webrtc_sid:ub.webrtc_sid(this.Yc),probe_ip_cnt:ub.probe_ip_cnt(this.Af),valid_probe_ip_cnt:ub.valid_probe_ip_cnt(this.Mf),poor_quality_retry_cnt:ub.poor_quality_retry_cnt(this.poorQualityRetryCnt),probe_not_trigger_retry_info:ub.probe_not_trigger_retry_info(this.xf.length>0?this.xf:void 0),bitrate:ub.bitrate(1e3*this.Su.bitRate),h:ub.h(this.Su.height),w:ub.w(this.Su.width),cap_w:ub.w(this.Su.width),cap_h:ub.h(this.Su.height),fps:ub.h(this.Su.frameRate),env:ub.env(this.Nn.testEnvironment?3:1),fail_cnt:ub.fail_cnt(Math.max(this.rtcPublishCount-1,0)),continuous_fail_cnt:ub.continuous_fail_cnt(Math.max(this.continuousFailCnt-1,0)),stop_reason:ub.stop_reason(s),error:(null==t?void 0:t.code)||0,message:(null==t?void 0:t.message)||"",last_error:h,try_time:hb.try_time(c),valid_d:this.validPublishedTime+(f?a-f:0),total_d:a-this.firstPublishedTimeStamp,tempbroken_cnt:this.errorTimes,is_mini:this.To}),(null==t?void 0:t.code)===cb.Ue.code&&this.uploadPublishEvent(t),this.ol.end(),this.Ro.stopToReport(0),this.Ro.stopNetProbe(this),this.retryFailGwNodes=[],this.resetPublish(0),this.hasSucceed=!1,this.isRePublish=!1,this.rtcPublishCount=0,this.Qh=!1,this.Af=0,this.Mf=0,this.poorQualityRetryCnt=0,this.xf=[],this.continuousFailCnt=0,null===(n=this.$f)||void 0===n||n.resetPublish(),this.el.stop(),this.Rf=!1,this.seiWorker&&this.seiWorker.postMessage({cmd:"clear",type:"push",streamID:this.Uo})},i.prototype.uploadRTCPublishStats=function(){var t,i,e,n,s,r,o,u,a,c,h,f,l,d;this.lastPublishStats.time&&this.Mn.spanSetAttributes({key:Cn.event,par:this.Uo},{lsttime:Cn.lsttime(parseInt(this.lastPublishStats.time)),total_stat:Cn.total_stat({afc:null===(t=this.lastPublishStats)||void 0===t?void 0:t.audioPacketsSent,vfc:null===(i=this.lastPublishStats)||void 0===i?void 0:i.framesSent,tfc:(null===(e=this.lastPublishStats)||void 0===e?void 0:e.audioPacketsSent)+(null===(n=this.lastPublishStats)||void 0===n?void 0:n.framesSent),vb:null===(s=this.lastPublishStats)||void 0===s?void 0:s.videoBytesSent,ab:null===(r=this.lastPublishStats)||void 0===r?void 0:r.audioBytesSent,tb:(null===(o=this.lastPublishStats)||void 0===o?void 0:o.videoBytesSent)+(null===(u=this.lastPublishStats)||void 0===u?void 0:u.audioBytesSent),rtp_rtt:Math.round(1e3*(null===(a=this.publishStat)||void 0===a?void 0:a.currentRoundTripTime))||0,w:null===(c=this.publishStat)||void 0===c?void 0:c.frameWidth,rtp_plr:null===(h=this.publishStat)||void 0===h?void 0:h.videoPacketsLostRate,h:null===(f=this.publishStat)||void 0===f?void 0:f.frameHeight,rtp_bw:(null===(l=this.publishStat)||void 0===l?void 0:l.googAvailableSendBandwidth)?null===(d=this.publishStat)||void 0===d?void 0:d.googAvailableSendBandwidth:void 0})})},i.prototype.onPublishStateUpdate=function(t,i,e,n,s,r){},i.prototype.onPublishQualityUpdate=function(t,i){},i.prototype.onDisconnect=function(t){this.info(Ud+" call"),this.info(Ud+" websocket disconnect"),this.publishStateUpdateError(t||Pn.error.Ce,!!t)},i.prototype.publishSuccess=function(){var t,i,e,n,s,r=this;if(this.info(Td+" call"),this.Yf||(this.Ro.udpFailNum=0),this.isUpdateSDP&&this.xl)return this.info(Td+" update sdp success"),this.xl(0),this.xl=void 0,void(this.isUpdateSDP=!1);var o=this.isRePublish?yn:_n,u=null===(t=this.Ro.publisherList[this.Uo])||void 0===t?void 0:t.retryStreamHandler;for(var a in null==u||u.getTryTime(this,!0),this.reportMiniSdpInfos(),this.Mn.spanEnd({key:o.event,par:this.Uo},{url:ab.url(null===(i=this.sl)||void 0===i?void 0:i.server),source_type:ab.source_type("rtc"),signal_consume:ab.signal_consume(this.signalTime),is_peer:ab.is_peer(this.Df)},!0,!1),6!=this.state&&this.onPublishStateUpdate(Y,this.Uo,{code:0,message:""},!0),this.state=6,this.hasSucceed=!0,this.continuousFailCnt=0,this.resetIceInfos(),this.resetNat64Infos(),this.getConnectIP(),this.dl=setTimeout((function(){r.reportPublishStartEvent()}),1e3),this.reportPublishStateTime=Date.now(),this.Ro.playerList){var c=this.Ro.playerList[a];6==c.state&&c.broadcasterStatus==A.stop&&(c.sendBroadcasterStatus(1),c.broadcasterStatus=A.start)}var h=this.Ur("probe_started_num");!isNaN(h)&&(this.Ro.probeStartedNum=h),this.qualityHandler.setPublishQualityTimer();var f=this.Ur("auto_switch_publish_video_codec",!0);this.publishOption.enableAutoSwitchVideoCodec&&f&&(null===(e=this.Fh)||void 0===e?void 0:e.offerToReceiveVideo)&&!this.sideMediaConfig.isSEIStart&&(this.cl=setTimeout((function(){return ib(r,void 0,void 0,(function(){var t,i;return eb(this,(function(e){switch(e.label){case 0:if(this.checkCodecSupport())return[3,4];t=this.lf,i="H264"===this.lf?"VP8":"H264",this.info("".concat(Td," switch video codec to ").concat(i)),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.switchVideoCodec(t,i)];case 2:return e.sent()&&this.Nn.actionListener("publisherVideoEncoderChanged","H264"===t?0:2,"H264"===this.lf?0:2,this.streamId),[3,4];case 3:return e.sent(),this.warn("".concat(Td," switch video codec fail")),[3,4];case 4:return[2]}}))}))}),this.Yh));var l=2,d=2,v=null===(n=this.Fu)||void 0===n?void 0:n.videoTrack,m=0!==this.fo.getAudioTracks().length&&this.fo.getAudioTracks()[0];this.fo&&this.fo.getTracks().forEach((function(t){jo(t,r.In,Td)})),v&&"live"===v.readyState&&v.enabled||(null===(s=this.Fu)||void 0===s?void 0:s.muteImage)?l=0:v&&!v.enabled&&(l=3),m&&"live"===m.readyState&&(d=m.enabled?0:3),this.sendStreamStatus(l,d,!0),this.Ro.soundLevelDelegate&&this.Fu&&this.Fu.startSoundLevel(),9===this.Nn.scenario&&this.setStreamAlignmentProperty(1).then((function(t){r.In.info("zc.ssap ktv. "+t)})),this.info(Td+" call success")},i.prototype.startSoundLevel=function(){var t;if(this.info(Bd+" call"),this.fo&&0!=this.fo.getAudioTracks().length)try{null===(t=this.Fu)||void 0===t||t.startSoundLevel()}catch(t){this.error(Bd+" get sound level failed "+t)}else this.info(Bd+" local stream no found")},i.prototype.stopSoundLevel=function(){var t;this.info("zc.p.0.ssl.1 call"),null===(t=this.Fu)||void 0===t||t.stopSoundLevel()},i.prototype.handleEncBitrate=function(t,i,e){var n=this,s=1e3*this.Su.bitRate,r=0;if(i>0){this._f||this.wf||(this.yf++,i>=.75*t?(this.yf>=10&&this.Sf>=.6*this.yf&&(this.wf=!0,this.Ef=s),this.Sf++):this.yf>=10&&this.Sf/this.yf<.3&&(this._f=!0));var o=Io(this.Of,i,10);if(this._f)if(o>=1.05*s){if(this.Ef>s){this.Ef-=o>t?o-t:o-s,this.Ef=Math.max(this.Ef,s),this.Ef=Math.min(this.Ef,2*s),r=this.Ef}}else o<.8*s&&(0===this.Ef&&(this.Ef=t),this.Ef=this.Ef>=s?this.Ef+.08*s:1.05*this.Ef,this.Ef=Math.min(this.Ef,2*s),r=this.Ef)}if(e>0&&e<s){var u=Io(this.kf,e,5);if(this._f){if(u+i>1.05*s)this.Ef-=u+i-s,this.Ef=Math.max(this.Ef,s-u),r=this.Ef}else r=this.Ef-u}else this.Ef<s&&(this.Ef=s,r=this.Ef);if(r>0){r=Io(this.Tf,r,5);var a=this.getVideoSenders();if(!a)return;var c=a.length>1?a[1]:a[0]?a[0]:null;if(!c)return;var h=c.getParameters();h.encodings||(h.encodings=[{}]),h.encodings[0].maxBitrate=r,c.setParameters(h).then((function(){n.info(Jd+" success "+r)})).catch((function(t){n.error(Jd+" "+t)}))}},i.prototype.resetEncBitrate=function(){this._f=!1,this.yf=0,this.wf=!1,this.Sf=0,this.Ef=0,this.Of=[],this.Tf=[],this.kf=[]},i.prototype.replacePublishedTrack=function(t,i,e){var n,s;return void 0===i&&(i=!1),void 0===e&&(e={}),ib(this,void 0,void 0,(function(){var r,o,u,a,c,h,f,l,d,v,m,p,g;return eb(this,(function(b){switch(b.label){case 0:return this.info("zc.rt.1 call ".concat(t.kind," ").concat(i," ").concat(JSON.stringify(e))),r=this.previewer,(a=(u="video"===(o=t.kind))?r.videoTrack:r.audioTrack)||e.handleTrack?(c=0,h=0,u?(c=id(i?a:t),h=this.mic_status):"audio"===o&&(h=id(t),c=this.camera_status),[4,r.replacePreviewTrack(t,i,e)]):[3,13];case 1:return b.sent(),f=t,"audio"==t.kind&&r.insertableaudio&&(null===(n=r.localStream)||void 0===n?void 0:n.getAudioTracks()[0])&&(f=null===(s=r.localStream)||void 0===s?void 0:s.getAudioTracks()[0]),l="audio"===o&&r.destNode,d=!1,(!u||!i&&r.isVideoNodeQueueEnabled)&&("audio"!==o||l)||(d=!0),m=u?this.lowVideoSender:void 0,(v=u?this.videoSender:this.audioSender)?d?(p=!this.isTcVideoPasued()&&r.isVideoEnabled,u&&p?m&&r.lowStream?[4,m.replaceTrack(r.lowStream.getVideoTracks()[0])]:[3,3]:[3,8]):[3,10]:[3,11];case 2:b.sent(),b.label=3;case 3:return r.streamFromCanvas?(r.streamFromCanvasTrack&&!r.zegoCaptureStream||(g=r.getStreamThroughCanvas(r.localStream),r.streamFromCanvasTrack=g.getVideoTracks()[0]),[4,v.replaceTrack(r.streamFromCanvas?r.streamFromCanvasTrack:f)]):[3,5];case 4:return b.sent(),[3,7];case 5:return[4,v.replaceTrack(f)];case 6:b.sent(),b.label=7;case 7:return[3,10];case 8:return u?[3,10]:r.isAudioEnabled?[4,v.replaceTrack(f)]:[3,10];case 9:b.sent(),b.label=10;case 10:return this.sendStreamStatus(c,h),[3,12];case 11:this.info("zc.rt.1 replace remote track will work after stream published"),b.label=12;case 12:return this.info("zc.rt.1 replace remote track success"),[2,{errorCode:0,extendedData:""}];case 13:return this.error("zc.rt.1 publisher track no found"),[2,{errorCode:je,extendedData:Le}]}}))}))},i.prototype.sendStreamStatus=function(t,i,e,n){var s=this;void 0===e&&(e=!1),void 0===n&&(n=0),(e||this.camera_status!==t||this.mic_status!==i)&&this.sl&&(this.camera_status=t,this.mic_status=i,this.Qf=!1,this.mf||this.Gh?(this.Gh&&(clearTimeout(this.Gh),this.Gh=null),n++,this.info(yd+" start send ".concat(n," camera:").concat(t," mic:").concat(i,".")),this.Xf=this.il.sendStreamStatus(t,i,(function(t){s.Xf===t&&(s.Qf=!0)}),(function(){s.camera_status===t&&s.mic_status===i&&(s.warn(yd+" time out. ".concat(n)),n<=1&&s.sendStreamStatus(t,i,!0,n))}))):this.Gh=setTimeout((function(){s.resendStreamStatus(1)}),3e3))},i.prototype.resendStreamStatus=function(t){var i,e,n;if(void 0===t&&(t=0),!this.Qf)if(this.info(yd+" resend ".concat(t)),0==t){var s=2,r=2,o=null===(i=this.Fu)||void 0===i?void 0:i.videoTrack,u=0!==this.fo.getAudioTracks().length&&this.fo.getAudioTracks()[0];o&&("live"===o.readyState||(null===(e=this.Fu)||void 0===e?void 0:e.muteImage))&&(s=(null===(n=this.Fu)||void 0===n?void 0:n.muteImage)||!0===o.enabled?0:3),u&&"live"===u.readyState&&(r=!0===u.enabled?0:3),this.sendStreamStatus(s,r,!0)}else this.sendStreamStatus(this.camera_status,this.mic_status,!0)},i.prototype.handleSEIVideoTrack=function(t){"add"==t&&this.Vf.track?this._clearCanvasTimer():"remove"!=t||this.Vf.track||(this.Vf.track=this._addCanvasStreamVideoTrack()),this.seiWorker&&this.seiWorker.postMessage({cmd:"publishStreamType",streamID:this.Uo,onlyAudio:!!this.Vf.track})},i.prototype._addCanvasStreamVideoTrack=function(){var t=this;this.nf=$t(16,16),this.sf=this.nf.getContext("2d"),this.rf=new Image,this.rf.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAFFJREFUOE9jZGBgaGBgYLBnYGBwYCANHGBgYDjIyMDAcIWBgUGbNL1w1VdBBvwnUzNY26gBo2EwjNLBfjJyIiz7HADlBVB2DiEjR15lYGBYAwAypRSY53SYoAAAAABJRU5ErkJggg==";var i=this.Nn.engineConfig.blankVideoTrackFrameInterval||100;return this.info("zc.acsvt frame interval: "+i),this.ef=setInterval((function(){var i;null===(i=t.sf)||void 0===i||i.drawImage(t.rf,0,0,16,16)}),i),this.nf.captureStream().getVideoTracks()[0]},i.prototype.getSpan=function(t,i,e,n){void 0===n&&(n=!1);var s=mi(this.Mn,a.H,this.Uo,t,i,e,n);return s.setAttribute("is_mini",this.To),s},i.prototype.isMultiOuter=function(){return!(!this.Nn.accessClientIp||!this.qf||this.Nn.accessClientIp===this.qf)},i.prototype.isCustomCdn=function(){var t,i;return void 0!==(null===(t=this.rl)||void 0===t?void 0:t.cdnUrl)&&""!==(null===(i=this.rl)||void 0===i?void 0:i.cdnUrl)},i.prototype.setTurnTcp=function(){this.Yf=this.Nn.turnToTcp,void 0!==this.Nn.turnOverTcpOnly&&(this.Yf=this.Nn.turnOverTcpOnly)},i.prototype.setStreamAlignmentProperty=function(t){return this.Jf.alignment=t,this.il.sendStreamAlignmentProperty(t)},i.prototype.uploadPublishEvent=function(t){var i=this.Uo,e=t.code,n={};this.$h&&(n.mini_retry_consume=+this.$h.toFixed(0),this.$h=0,this.tf=0),this.Mn.spanEnd({key:bn.event,par:i},tb(tb(tb({},n),{error:e}),t),!0)},i.prototype.getConnectIP=function(){if(this.qf&&!this.ip){var t=El(this.qf),i=this.getIPByGwNode(t);this.ip=i,this.info("zc.p.0.gci.0 ip: ".concat(i)),this.reportPublishStartEvent()}},i.prototype.reportPublishStartEvent=function(){var t=this.isRePublish?yn:_n;this.Mn.spanSetAttributes({key:t.event,par:this.Uo},{ip:ab.ip(this.ip)}),this.Mn.spanReport({key:t.event,par:this.Uo})},i.prototype.getIPByGwNode=function(t){var i;if(this.ipNode){var e=this.ipNode.vid.split("|"),n="";return e.forEach((function(i){var e=El(i);t===e&&(n=i)})),n}if(this.gwNode){var s=null===(i=this.gwNode)||void 0===i?void 0:i.split(":");return this.gwNode.replace(":"+s[s.length-1],"")}return""},i.prototype.sendNetQualityGrade=function(t,i){this.il.sendNetQualityGrade(t,i)},i.prototype.closeSession=function(t){var i,e;null===(i=this.sl)||void 0===i||i.off("uaConnected",this.Fo.onUaSocketConnected),this.cf&&(this.il.sendCloseSession(t,(function(){})),null===(e=this.sl)||void 0===e||e.removeSession(this.Yc),this.cf=!1)},i.prototype.activateSEIInsert=function(t,i){var e=this;return new Xt((function(n,s){return e.il?(e.il.activateSEIInsert(t,i,(function(t,i){var s=!1;0===i.result?(e.info(Qv+" called success"),s=!0):1===i.result?(e.error(Qv+" "+i.peer_id+" invalid param."),s=!1):2===i.result&&(e.error(Qv+" peer not exist"),s=!1),n(s)}),(function(t){1===t&&e.error(Qv+" request timeout")})),!1):n(!1)}))},i.prototype.getStreamAddOptions=function(){return{stream_resource:1,stream_codec:"VP8"===this.lf?2:this.lowStream?4:0}},i.prototype.onStatsUpdated=function(t){this.el.onStatsUpdated(t)},i.prototype.getLocalMiniSdp=function(t,i){var e,n=this;if(this.To){var s=performance.now();null===(e=this.tl)||void 0===e||e.getMiniSdp(t).then((function(t){n.Wh=performance.now()-s,i(t)})).catch((function(t){n.To=!1,n.Nn.To=!1,n.Wh=performance.now()-s,n.$h=performance.now()-n.tf,n.Xh=1,i()}))}else i()},i.prototype.parseRemoteSdp=function(t,i,e){var n,s=this;if(this.To&&Ft(t.mini_sdp)&&t.mini_sdp.byteLength>0){var r=performance.now();null===(n=this.tl)||void 0===n||n.parseMiniSdp(t.mini_sdp).then((function(t){s.Kh=performance.now()-r,i(t)})).catch((function(t){s.To=!1,s.Nn.To=!1,s.Kh=performance.now()-r,s.$h=performance.now()-s.tf,s.Xh=3,e(t)}))}else i(t.sdp)},i.prototype.reportMiniSdpInfos=function(){var t=this.isRePublish?yn:_n,i={};(this.To||this.Xh)&&(i.mini_error=this.Xh,i.code_sdp_consume=+this.Wh.toFixed(0),i.decode_sdp_consume=+this.Kh.toFixed(0),this.Xh=0,this.Wh=0,this.Kh=0),this.Mn.spanSetAttributes({key:t.event,par:this.Uo},tb({},i))},i.prototype.onTcPauseVideo=function(){var t=this;if(this.Rf=!0,this.peerConnection&&0===this.camera_status){var i="",e=this.getVideoSenders();null==e||e.forEach((function(e){return ib(t,void 0,void 0,(function(){var t,n,s;return eb(this,(function(r){return t=e===this.lowVideoSender,e.track&&(t?t&&(i+=" low:",i+=e.track.id,(n=null===(s=this.lowStream)||void 0===s?void 0:s.getVideoTracks()[0].clone())&&(n.stop(),e.replaceTrack(n),this.zf=n.id)):(i+=" big:",i+=e.track.id,(n=this.localStream.getVideoTracks()[0].clone()).stop(),e.replaceTrack(n),this.Cf=n.id)),[2]}))}))}));var n=this.el.getFeedback();this.info("".concat(Zd," pause video, tid: ").concat(i,", tc:{").concat(n.status,"|").concat(n.bandwide,"|").concat(n.targetBitrate,"|").concat(n.rtt,"}"))}else this.warn("".concat(Zd," pause video, camera: ").concat(this.camera_status,", bw: ").concat(this.el.getBandwide()))},i.prototype.onTcResumeVideo=function(){var t=this;if(this.Rf=!1,this.peerConnection&&0===this.camera_status){var i="",e=this.getVideoSenders();null==e||e.forEach((function(e){return ib(t,void 0,void 0,(function(){var t,n,s,r;return eb(this,(function(o){return t=e===this.lowVideoSender,n=this.Fu.isVideoEnabled&&!this.Fu.hasStopCaptureVideo,e.track&&n&&(t?t&&(s=void 0,(s=this.Nf?this.fo.getVideoTracks()[0].clone():this.Fu.streamFromCanvasTrack?this.Fu.streamFromCanvasTrack:null===(r=this.lowStream)||void 0===r?void 0:r.getVideoTracks()[0])&&(e.replaceTrack(s),i+=" low:",i+=null==s?void 0:s.id)):(s=void 0,this.Nf?s=this.fo.getVideoTracks()[0]:(s=this.Fu.getDestinationTrack())||(s=this.Fu.streamFromCanvasTrack?this.Fu.streamFromCanvasTrack:this.fo.getVideoTracks()[0]),s&&(e.replaceTrack(s),i+=" big:",i+=s.id))),[2]}))}))})),this.zf="",this.Cf="";var n=this.el.getFeedback();this.info("".concat(Zd," resume video, tid: ").concat(i,", tc:{").concat(n.status,"|").concat(n.bandwide,"|").concat(n.targetBitrate,"|").concat(n.rtt,"}"))}else this.warn("".concat(Zd," resume video, bw: ").concat(this.el.getBandwide()))},i.prototype.isVideoTrackAlive=function(){var t=this.Fu._videoTrack,i=!(!t||"live"!==t.readyState||!t.enabled);return this.info("zc.p.0.ivta ".concat(i)),i},i.prototype.isAudioTrackAlive=function(){var t=0!==this.fo.getAudioTracks().length&&this.fo.getAudioTracks()[0],i=!(!t||"live"!==t.readyState||!t.enabled);return this.info("zc.p.0.iata ".concat(i)),i},i}(vm),lb=function(){this.publisherList={},this.playerList={}},db=function(t,i,e,n,s){if(i.breakStartTime){var r=t-i.breakStartTime;r>=n&&(i.cumulativeBreakDuration+=r,s?i.cumulativeBreakDurationL3+=r:i.cumulativeBreakDurationRtc+=r,e.breakDuration+=r),i.breakStartTime=void 0}},vb=function(t,i,e,n,s,r,o,u,a,c){void 0===a&&(a=u);var h=1e3;if(s>h&&(s=h),n.breakStartTime)if(e){if(0===i)t-n.breakStartTime>=22e3&&db(t,n,o,s,c),r.breakDuration+=h;else if(u>=s)if(u<500)if(u+a<h)db(t-(h-a),n,o,s,c),n.breakStartTime=t-u,r.breakDuration+=a+u,r.decodeTime+=h-(a+u);else db(t-h+a,n,o,s,c),n.breakStartTime=t-h+a,r.breakDuration+=h;else u>=500&&(db(t-u,n,o,s,c),n.breakStartTime=t-u,r.breakDuration+=h);else a<=s?(db(t-h+a,n,o,s,c),n.breakStartTime=void 0,r.breakDuration+=a,r.decodeTime+=h-a,o.decodeDuration+=h-a):r.breakDuration+=h}else{n.resumeRecv=!1;var f=t-h-n.breakStartTime;f<=0&&(f=0),n.breakStartTime=void 0,n.noBreakNoDecodeDuration+=f,c?n.noBreakNoDecodeDurationL3+=f:n.noBreakNoDecodeDurationRtc+=f,r.breakCancelDuration+=f,o.blankDuration+=f}else e?0===i?n.resumeRecv?(n.breakStartTime=t-h,r.breakDuration+=h):(n.noBreakNoDecodeDuration+=h,c?n.noBreakNoDecodeDurationL3+=h:n.noBreakNoDecodeDurationRtc+=h,o.blankDuration+=h):a>s?n.resumeRecv?(n.breakStartTime=t-a,n.cumulativeBreakDuration+=a,c?n.cumulativeBreakDurationL3+=a:n.cumulativeBreakDurationRtc+=a,r.breakDuration+=a,r.decodeTime+=h-a,o.breakDuration+=a,o.decodeDuration+=h-a):(n.noBreakNoDecodeDuration+=h,c?n.noBreakNoDecodeDurationL3+=h:n.noBreakNoDecodeDurationRtc+=h,o.blankDuration+=h):(r.decodeTime+=h,o.decodeDuration+=h):n.decodeStartTime&&(0===i?(n.resumeRecv=!1,n.noBreakNoDecodeDuration+=h,c?n.noBreakNoDecodeDurationL3+=h:n.noBreakNoDecodeDurationRtc+=h,o.blankDuration+=h):(r.decodeTime+=h,o.decodeDuration+=h));e&&i&&(n.resumeRecv=!0)},mb=function(t,i,e,n,s,r,o){if(n=n>1e3?1e3:n,i.breakDuration=0,i.breakCancelDuration=0,i.decodeTime=0,e.decodeDuration=0,e.breakDuration=0,e.blankDuration=0,t.decodeStartTime){var u=r,a=u-t.decodeStartTime;if(t.decodeStartTime=void 0,t.totalDuration+=a,o?t.totalDurationL3+=a:t.totalDurationRtc+=a,t.breakStartTime){var c=u-t.breakStartTime;t.breakStartTime=void 0,s?c>n&&(t.cumulativeBreakDuration+=c,o?t.cumulativeBreakDurationL3+=c:t.cumulativeBreakDurationRtc+=c):(t.noBreakNoDecodeDuration+=c,o?t.noBreakNoDecodeDurationL3+=c:t.noBreakNoDecodeDurationRtc+=c)}var h=t.cumulativeBreakDuration,f=t.totalDurationL3,l=t.cumulativeBreakDurationL3,d=t.noBreakNoDecodeDurationL3,v=t.totalDurationRtc,m=t.cumulativeBreakDurationRtc,p=t.noBreakNoDecodeDurationRtc,g=t.totalDuration-t.cumulativeBreakDuration-t.noBreakNoDecodeDuration;return t.cumulativeDecodeDuration=g,t.cumulativeDecodeDurationL3=f-l-d,t.cumulativeDecodeDurationRtc=v-m-p,{cumulativeBreakDuration:h,cumulativeDecodeDuration:g}}return{cumulativeBreakDuration:0,cumulativeDecodeDuration:0}},pb=function(){return pb=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},pb.apply(this,arguments)},gb=function(){function t(t,i,e,n,s,r){this.za=t,this.Da=i,this.Jl=e,this.In=n,this.dataReport=s,this.Nn=r,this.playQualityList=[],this.Aa=null,this.xa=null,this.ja=null,this.Vl={audioPacketsLost:0,videoPacketsLost:0,time:0,audioTime:0,videoTime:0,audioBytesReceived:0,videoBytesReceived:0,audioPacketsReceived:0,videoPacketsReceived:0,framesDecoded:0,framesReceived:0,framesDropped:0,audioBitrate:0,totalRenderFrames:0,renderTime:0,paintedFrames:0,lastTimestamp:0,videoElem:null,audioJitterBufferDelay:0,audioJitterBufferEmittedCount:0,videoJitterBufferDelay:0,videoJitterBufferEmittedCount:0,jitterBufferDelayMs:0},this.Na={video:{videoBitrate:0,videoFPS:0,videoRenderFPS:-1,videoTransferFPS:0,frameHeight:0,frameWidth:0,muteState:"1",videoQuality:-1,googCodecName:"",videoPacketsLost:0,videoPacketsLostRate:0,videoFramesDecoded:0,videoFramesDropped:0,videoCumulativeDecodeTime:0,videoCumulativeBreakTime:0,videoCumulativeBreakRate:0},audio:{audioBitrate:0,audioCodec:"",muteState:"1",audioQuality:-1,audioFPS:0,audioJitter:0,audioLevel:0,audioPacketsLost:0,audioPacketsLostRate:0,audioSamplingRate:0,audioSendLevel:0,googCodecName:"",audioCumulativeDecodeTime:0,audioCumulativeBreakTime:0,audioCumulativeBreakRate:0},peerToPeerDelay:0,peerToPeerPacketLostRate:0},this.decodeStartTime=0,this.Ua=0,this.probeState=ot.probed,this.Mh=null,this.Hl=1e4,this.Ja=0,this.playStat={},this.Gl=200,this.Fl=500,this.Yl={breakStartTime:void 0,cumulativeBreakDuration:0,cumulativeDecodeDuration:0,decodeStartTime:void 0,decodeEndTime:void 0,totalDuration:0,noBreakNoDecodeDuration:0,resumeRecv:!0,cumulativeBreakDurationL3:0,cumulativeDecodeDurationL3:0,noBreakNoDecodeDurationL3:0,totalDurationL3:0,cumulativeBreakDurationRtc:0,cumulativeDecodeDurationRtc:0,noBreakNoDecodeDurationRtc:0,totalDurationRtc:0},this.Zl={breakStartTime:void 0,cumulativeBreakDuration:0,cumulativeDecodeDuration:0,decodeStartTime:void 0,decodeEndTime:void 0,totalDuration:0,noBreakNoDecodeDuration:0,resumeRecv:!0,cumulativeBreakDurationL3:0,cumulativeDecodeDurationL3:0,noBreakNoDecodeDurationL3:0,totalDurationL3:0,cumulativeBreakDurationRtc:0,cumulativeDecodeDurationRtc:0,noBreakNoDecodeDurationRtc:0,totalDurationRtc:0},this.Ql=0,this.Xl={breakDuration:0,breakCancelDuration:0,decodeTime:0},this.Wl={breakDuration:0,breakCancelDuration:0,decodeTime:0},this.Kl={decodeDuration:0,breakDuration:0,blankDuration:0},this.$l={decodeDuration:0,breakDuration:0,blankDuration:0},this.td={totalSquaredInterFrameDelay:0,totalInterFrameDelay:0,framesDecode:0,totalSamplesReceived:0,concealedSamples:0,audioBytesReceived:0},this.ed=void 0,this.nd="",this.Ba=0,this.sd=0,this.Ma=1e3,this.Va="udp",this.Ha={},this.Ga="",this.Fa="",this.rd=!1,this.od=!1,this.ud=!1,this.Ya=0,this.Za=0,this.connectIPStack=-1,this.ad=0,this.La=0,this.Us=0,this.hasRecvMediaData=!1,this.onRecvMediaData=function(){},this.p2pNetStats={p2pLostRate:0,p2pRTT:0},this.Na.video.muteState=this.Jl.videoMuteState,this.Na.audio.muteState=this.Jl.audioMuteState,this.Xa=new Ag(this.Nn,this.In,this.Uo,Pn.event)}return Object.defineProperty(t.prototype,"_playStream",{get:function(){return this.Jl.playStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Ro",{get:function(){return this.Nn.streamCenter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Uo",{get:function(){return this.Jl.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.Jl.sessionId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerID",{get:function(){return this.Jl.peerID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioMuted",{get:function(){if(!this.Jl.remoteStream||this.Jl.remoteStream.getAudioTracks().length<=0)return!0;var t=this.Jl.remoteStream.getAudioTracks()[0];return!(!t||!t.muted&&"ended"!==t.readyState&&t.enabled)||("1"==this.Jl.audioMuteState||!this.Jl.playMediaStatus.audio)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoMuted",{get:function(){if(!this.Jl.remoteStream||this.Jl.remoteStream.getVideoTracks().length<=0)return!0;var t=this.Jl.remoteStream.getVideoTracks()[0];return!(!t||!t.muted&&"ended"!==t.readyState&&t.enabled)||("1"==this.Jl.videoMuteState||!this.Jl.playMediaStatus.video)},enumerable:!1,configurable:!0}),t.prototype.getPlayStats=function(t,i){var e,n=this;if(null!=t){var s,r,o=(new Date).getTime();o-this.ad+50>=3e3&&this.getP2PNetStats();var u=this.Jl.rtcViewer;u&&(s=u.Bo,r=u.Jo),s&&s.currentTime||(s=Ql(this._playStream,"video")||s),r&&r.currentTime||(r=Ql(this._playStream,"audio")||r||s);var a={sampleTimeWindow:this.Da,audioPacketsLost:0,audioPacketsLostRate:0,audioBitrate:0,audioLevel:0,audioSendLevel:0,audioSamplingRate:0,audioCodec:"",audioQuality:0,audioFPS:0,videoQuality:0,videoPacketsLost:0,videoPacketsLostRate:0,videoBitrate:0,videoFPS:0,videoRenderFPS:-1,nackCount:0,pliCount:0,audioJitter:0,videoJitter:0,videoFramesDecoded:0,keyFramesDecoded:0,totalFreezesDuration:0,frameHeight:0,frameWidth:0,videoTransferFPS:0,videoFramesDropped:0,totalRoundTripTime:0,currentRoundTripTime:0,availableOutgoingBitrate:void 0,videoCodecName:void 0,audioCodecName:void 0,audioJitterBufferDelayMs:0,videoJitterBufferDelayMs:0,jitterBufferDelayMs:0,googBandwidthLimitedResolution:void 0,googCpuLimitedResolution:void 0,googAvailableSendBandwidth:void 0,codecImplementationName:void 0,qualityLimitationReason:void 0,audioMuteState:this.audioMuted?"1":"0",videoMuteState:this.videoMuted?"1":"0",soundLevel:this.Jl.soundLevel,muted:r?r.muted:void 0,videoPaused:s?s.paused:void 0,audioPaused:r?r.paused:void 0,videoReadyState:s?s.readyState:void 0,audioReadyState:r?r.readyState:void 0,videoEnded:s?s.ended:void 0,audioEnded:r?r.ended:void 0,volume:r?r.volume:void 0,sinkId:r?r.sinkId:void 0};this.Jl.ip&&(Sl(this.Jl.ip)?a.ipv6=this.Jl.ip:a.ipv4=wl(this.Jl.ip));var c=this.Vl.time,h=0,f=0,l=0,d=0,v=0,m=0,p=0,g=null,b=null;t.forEach((function(t){var i=t.kind||t.mediaType;["ssrc","inbound-rtp"].includes(t.type)&&("video"==i||t.id.indexOf("VideoStream")>=0)&&(g=t),("inbound-rtp"==t.type||"ssrc"==t.type&&null!=t.bytesReceived)&&("audio"==i||t.id.indexOf("AudioStream")>=0)&&(b=t)}));var _=function(t,i){return t>i?t-i:0};this.Ql||(this.Ql=o-1e3);var y=this.Jl.playMode===q.L3;if(g){var w=g.totalInterFrameDelay,S=g.framesDecoded,E=g.totalSquaredInterFrameDelay,O=_(S,this.td.framesDecode);this.td.framesDecode=S;var T=_(w,this.td.totalInterFrameDelay);this.td.totalInterFrameDelay=w;var k=_(E,this.td.totalSquaredInterFrameDelay);this.td.totalSquaredInterFrameDelay=E;var R=(k-Math.pow(T,2)/(O||1))/(O||1);R=R>0?R:-R;var I=parseInt((1e3/(O+1)).toString()),N=1e3*Math.sqrt(R),C=T/(O||1)*1e3||I,z=(C=parseInt((C>1e3?1e3:C).toString()))+N;if(z=parseInt((z>1e3?1e3:z).toString()),O>0&&0===this.Jl.cameraStatus&&!this.Yl.decodeStartTime&&(this.Yl.decodeStartTime=o-1e3),this.Yl.decodeStartTime&&!this.od)vb(o,O,0===this.Jl.cameraStatus&&this.Jl.playMediaStatus.video&&!this.rd&&!this.ud,this.Yl,this.Fl,this.Xl,this.Kl,C,z,y)}if(b){var D=b.totalSamplesReceived,P=b.concealedSamples,A=b.bytesReceived,M=_(D,this.td.totalSamplesReceived);this.td.totalSamplesReceived=D;var x=_(P,this.td.concealedSamples);this.td.concealedSamples=P;var j=_(A,this.td.audioBytesReceived);this.td.audioBytesReceived=A;var L=parseInt((1e3*(x/(M||1))).toString());if(j>0&&0===this.Jl.micStatus&&!this.Zl.decodeStartTime&&(this.Zl.decodeStartTime=o-1e3),this.Zl.decodeStartTime)vb(o,j,0===this.Jl.micStatus&&this.Jl.playMediaStatus.audio&&!this.rd&&!this.ud,this.Zl,this.Gl,this.Wl,this.$l,L,L,y)}var U=[],J="",H=!1;if(t.forEach((function(t){"track"==t.type&&(H=!0)})),t.forEach((function(i){var e=i.kind||i.mediaType;if(("inbound-rtp"==i.type||"ssrc"==i.type&&null!=i.bytesReceived)&&("audio"==e||i.id.indexOf("AudioStream")>=0)){var r="";if((_=t.get(i.codecId))&&_.mimeType&&(r=_.mimeType.split("/")[1]),n.Fa!==r&&(n.Fa=r),a.audioCodec=n.Fa,0!=c)a.audioBitrate=8*(i.bytesReceived-n.Vl.audioBytesReceived)/(i.timestamp-c),(b=i.packetsLost-n.Vl.audioPacketsLost)>0&&(f=b/(b+i.packetsReceived-n.Vl.audioPacketsReceived));if(a.audioBitrate<0&&(a.audioBitrate=0),i.jitterBufferDelay){var o=i.jitterBufferDelay,u=i.jitterBufferEmittedCount;m=Math.floor((o-n.Vl.audioJitterBufferDelay)/(u-n.Vl.audioJitterBufferEmittedCount)*1e3),(m=isNaN(m)||m<0?0:m)>1e4&&n.Jl.info("".concat(ov," audio jitterDelay ").concat(o," ").concat(n.Vl.audioJitterBufferDelay," ").concat(u," ").concat(n.Vl.audioJitterBufferEmittedCount)),n.Vl.audioJitterBufferDelay=o,n.Vl.audioJitterBufferEmittedCount=u,a.audioJitterBufferDelayMs=m}a.audioJitter=i.jitter,i.packetsLost>0&&(a.audioPacketsLost=i.packetsLost);var g=i.packetsLost-n.Vl.audioPacketsLost;a.audioFPS=(i.packetsReceived-n.Vl.audioPacketsReceived)/(i.timestamp-c)*1e3,a.audioPacketsLostRate=g>0?g/(i.packetsReceived-n.Vl.audioPacketsReceived+g):0,n.Vl.audioBytesReceived=i.bytesReceived,i.packetsLost>0&&(n.Vl.audioPacketsLost=i.packetsLost),n.Vl.audioPacketsReceived=i.packetsReceived,n.Vl.audioTime=i.timestamp,n.Vl.time=i.timestamp,n.Vl.audioBitrate=a.audioBitrate,d=i.jitter,H||n.aTrackStats(a,i)}else if(("inbound-rtp"==i.type||"ssrc"==i.type&&null!=i.bytesReceived)&&("video"==e||i.id.indexOf("VideoStream")>=0)){var b;if(0!=c)a.videoBitrate=8*(i.bytesReceived-n.Vl.videoBytesReceived)/(i.timestamp-c),a.videoFPS=1e3*(i.framesDecoded-n.Vl.framesDecoded)/(i.timestamp-c),(b=i.packetsLost-n.Vl.videoPacketsLost)>0&&(l=b/(b+i.packetsReceived-n.Vl.videoPacketsReceived));else Lt(i.framesPerSecond)&&(a.videoFPS=i.framesPerSecond);a.videoBitrate<0&&(a.videoBitrate=0),a.videoFPS<0&&(a.videoFPS=0);var _,y="";if((_=t.get(i.codecId))&&_.mimeType&&(y=_.mimeType.split("/")[1]),n.Ga!==y&&(n.Ga=y),a.videoCodecName=n.Ga,i.jitterBufferDelay){o=i.jitterBufferDelay,u=i.jitterBufferEmittedCount;p=Math.floor((o-n.Vl.videoJitterBufferDelay)/(u-n.Vl.videoJitterBufferEmittedCount)*1e3),(p=isNaN(p)||p<0?0:p)>1e4&&n.Jl.info("".concat(ov," video jitterDelay ").concat(o," ").concat(n.Vl.videoJitterBufferDelay," ").concat(u," ").concat(n.Vl.videoJitterBufferEmittedCount)),n.Vl.videoJitterBufferDelay=o,n.Vl.videoJitterBufferEmittedCount=u,a.videoJitterBufferDelayMs=p}a.videoRenderFPS=n.getVideoRenderFps(s),a.codecImplementationName=i.decoderImplementation,a.videoJitter=i.jitter,a.nackCount=i.nackCount,a.pliCount=i.pliCount,a.videoFramesDecoded=i.framesDecoded,a.keyFramesDecoded=i.keyFramesDecoded,a.totalFreezesDuration=i.totalFreezesDuration,i.packetsLost>0&&(a.videoPacketsLost=i.packetsLost),a.videoPacketsLostRate=(g=i.packetsLost-n.Vl.videoPacketsLost)>0?g/(i.packetsReceived-n.Vl.videoPacketsReceived+g):0,n.Vl.videoBytesReceived=i.bytesReceived,n.Vl.framesDecoded=i.framesDecoded,i.packetsLost>0&&(n.Vl.videoPacketsLost=i.packetsLost),n.Vl.videoPacketsReceived=i.packetsReceived,n.Vl.videoTime=i.timestamp,n.Vl.time=i.timestamp,v=i.jitter,H||n.vTrackStats(a,i,c)}else if("track"==i.type&&("video"==e||i.id.indexOf("video")>=0)||i.frameWidth)n.vTrackStats(a,i,c);else if("track"==i.type&&("audio"==e||i.id.indexOf("audio")>=0))n.aTrackStats(a,i);else if("candidate-pair"!=i.type||!i.nominated||uh()&&!i.selected)"local-candidate"===i.type&&U.push(i);else{null!=i.totalRoundTripTime&&(a.totalRoundTripTime=i.totalRoundTripTime),null!=i.currentRoundTripTime&&(a.currentRoundTripTime=i.currentRoundTripTime,h=1e3*a.currentRoundTripTime),void 0!==i.availableOutgoingBitrate&&(a.availableOutgoingBitrate=i.availableOutgoingBitrate),"succeeded"===i.state&&(J=i.localCandidateId);var w=n.Ro.lastChangeIpTime;if(w&&n.Za<w&&Date.now()-w<=15e3){var S=i.bytesReceived,E=n.Vl.condidateBytesReceived;E&&(S>E?n.Ya=0:n.Ya++),n.Ya>=5&&(n.Ya=0,n.Za=w,n.onPlayingError(ce)),n.Vl.condidateBytesReceived=S}else n.Ya>0&&(n.Ya=0)}})),J){var G=U.find((function(t){return t.id==J}));if(G){var F=void 0;if(void 0!==G.relayProtocol)F=G.relayProtocol;else if(G.protocol)F=G.protocol;else if(G.priority){var Y=G.priority>>24;void 0!==Y&&(F=Zl(Y,this.Nn.browser))}void 0!==F&&this.Va!==F&&(this.Jl.info(sv+" protocol "+F),this.Va=F);var Z=!1,Q=G.candidateType,X=G.networkType,W=G.relayProtocol,K=G.relatedAddress,$=G.url,tt=G.ip;if(tt){var it=El(tt);it>=0&&it!==this.connectIPStack&&(this.In.info(rv+" "+this.Uo+" ipStack "+kt[it]),this.connectIPStack=it)}Z=this.Sc([{key:"candidateType",value:Q},{key:"networkType",value:X}]),"relay"===Q&&(Z=this.Sc([{key:"relayProtocol",value:W},{key:"relatedAddress",value:K},{key:"url",value:$}])),Z&&this.Jl.info(rv+" upload candidate change "+JSON.stringify(this.Ha))}}var et=0;et=m>0&&p>0?Math.max(m,p):m>0?m:p>0?p:0,a.jitterBufferDelayMs=this.Vl.jitterBufferDelayMs=et,l=isNaN(l)||l<0?0:l,v=isNaN(v)||v<0?0:v,f=isNaN(f)||f<0?0:f,d=isNaN(d)||d<0?0:d;var nt=zo(h,l,v),st=zo(h,f,d);a.audioQuality=c>0?Do(st):0,a.videoQuality=c>0?Do(nt):0,this.Nn.networkState!==B.offline&&"disconnected"!==(null===(e=this.Jl.peerConnection)||void 0===e?void 0:e.connectionState)||(a.videoQuality=V.Die,a.audioQuality=V.Die);var rt=Math.min(nt,st);this.Ua=rt,a.peerToPeerDelay=isNaN(this.p2pNetStats.p2pRTT)?0:parseInt((this.p2pNetStats.p2pRTT/2+this.Vl.jitterBufferDelayMs).toString()),a.peerToPeerPacketLostRate=this.p2pNetStats.p2pLostRate,this.playStat=a,this.updateCurrentQualityStats(a),!this.hasRecvMediaData&&(a.videoBitrate>0||a.audioBitrate>0)&&(this.hasRecvMediaData=!0,this.onRecvMediaData&&this.onRecvMediaData()),this.Ma==this.za?this.notifyPlayQuality():this.xa||o-this.La+50>=this.za&&this.notifyPlayQuality(),this.Ma==this.Da?this.reportPlayQuality():this.ja||o-this.Us+50>=this.Da&&this.reportPlayQuality(),this.Jl.onStatsUpdated(this.playStat)}},t.prototype.notifyPlayQuality=function(){this.La=Date.now(),this.Jl.onPlayQualityUpdate(this.Uo,this.Na)},t.prototype.reportPlayQuality=function(){var t=Date.now();this.Us=t,this.checkProbe(t),this.uploadPlayQuality(this.playStat,t),this.Xa.checkRemoteStats(this.playStat,this._playStream),this.Ro.changeRxQuality(Do(this.Ua))},t.prototype.getVideoRenderFps=function(t){var i=-1;if(!t||!(t&&(!!t.getVideoPlaybackQuality||!!t.requestVideoFrameCallback||void 0!==t.mozPaintedFrames)))return-1;var e=this.Vl.videoElem,n=t.currentTime,s=t.getVideoPlaybackQuality();t.requestVideoFrameCallback&&!s.totalVideoFrames?e&&e==t||(this.Vl.videoElem=t,this.Vl.lastTimestamp=n,!e&&t.requestVideoFrameCallback(this.videoFramesRender.bind(this))):this.Vl.videoElem=null,e=this.Vl.videoElem;var r,o=Date.now(),u=this.Vl,a=u.renderTime;return r="firefox"!=this.Nn.browser||s.totalVideoFrames||e||void 0===t.mozPaintedFrames?e?u.paintedFrames:s.totalVideoFrames-s.droppedVideoFrames:t.mozPaintedFrames,i=0!=a?1e3*(r-u.totalRenderFrames)/(o-a):r/s.creationTime,this.Vl.renderTime=o,this.Vl.totalRenderFrames=r,i},t.prototype.videoFramesRender=function(t,i){var e=this.Vl,n=e.videoElem;if(n&&n.requestVideoFrameCallback){var s=n.currentTime;e.lastTimestamp!=s&&(this.Vl.paintedFrames++,this.Vl.lastTimestamp=s),n.requestVideoFrameCallback(this.videoFramesRender.bind(this))}},t.prototype.vTrackStats=function(t,i,e){var n=i.frameWidth,s=i.framesReceived,r=i.framesDropped,o=i.timestamp;if(t.frameHeight=i.frameHeight,t.frameWidth=n,!t.frameHeight||!t.frameWidth){var u=this.Vl.videoElem||Ql(this.Jl.playStream);u&&(t.frameHeight=u.videoHeight||0,t.frameWidth=u.videoWidth||0)}0!==this.Jl.cameraStatus&&0===t.videoBitrate&&0===t.videoFPS&&(t.frameHeight=0,t.frameWidth=0);var c=t.frameWidth,h=t.frameHeight;if(0===e||this.Vl.frameHeight===h&&this.Vl.frameWidth===c)0===e&&(this.Vl.frameHeight=h,this.Vl.frameWidth=c,this.Jl.isProbe||(this.Mn.spanAppendAttribute({key:this.Jl.playingEvent,par:this.Uo},"vinfo",{h:h,fft:Date.now(),w:c}),this.Mn.spanAppendAttribute({key:xn.event,par:this.Uo},"vinfo",{h:h,fft:Date.now(),w:c})));else{if(!this.Jl.isProbe){var f=this.Mn.createSpan(a.H,{key:Pn.event,par:this.Uo},{key:""},kn);f.setAttributes({webrtc_sid:Rn(this.sessionId),w:In(c),h:Nn(h)}),f.end(),this.Mn.spanAppendAttribute({key:this.Jl.playingEvent,par:this.Uo},"vinfo",{h:h,fft:Date.now(),w:c}),this.Mn.spanAppendAttribute({key:xn.event,par:this.Uo},"vinfo",{h:h,fft:Date.now(),w:c})}this.Vl.frameHeight=h,this.Vl.frameWidth=c}0!=e&&(isNaN(s)||isNaN(r)||(t.videoTransferFPS=1e3*(s-this.Vl.framesReceived)/(o-e),t.videoFramesDropped=r-this.Vl.framesDropped)),t.videoTransferFPS<0&&(t.videoTransferFPS=0),t.videoFramesDropped<0&&(t.videoFramesDropped=0),s&&(this.Vl.framesReceived=s),r&&(this.Vl.framesDropped=r)},t.prototype.aTrackStats=function(t,i){t.audioLevel=i.audioLevel||0,t.audioSendLevel=i.totalAudioEnergy,t.audioSamplingRate=i.totalSamplesDuration},t.prototype.updateCurrentQualityStats=function(t){var i=t.videoBitrate,e=t.videoFPS,n=t.videoTransferFPS,s=t.frameHeight,r=t.frameWidth,o=t.videoMuteState,u=t.videoQuality,a=t.videoFramesDecoded,c=t.videoFramesDropped,h=t.videoPacketsLost,f=t.videoPacketsLostRate,l=t.audioBitrate,d=t.audioCodec,v=t.audioMuteState,m=t.audioQuality,p=t.audioFPS,g=t.audioJitter,b=t.audioLevel,_=t.audioPacketsLost,y=t.audioPacketsLostRate,w=t.audioSamplingRate,S=t.audioSendLevel,E=t.nackCount,O=t.pliCount,T=t.totalRoundTripTime,k=t.currentRoundTripTime,R=t.peerToPeerDelay,I=t.peerToPeerPacketLostRate,N=t.sampleTimeWindow,C=t.videoRenderFPS,z={video:pb(pb({},this.Na.video),{videoBitrate:i,videoFPS:e,videoTransferFPS:n,frameHeight:s,frameWidth:r,videoQuality:u,videoFramesDecoded:a,videoFramesDropped:c,videoPacketsLost:h,videoPacketsLostRate:f,muteState:o,videoCumulativeDecodeTime:this.Kl.decodeDuration,videoCumulativeBreakTime:this.Kl.breakDuration,videoCumulativeBreakRate:this.Kl.breakDuration/(this.Kl.decodeDuration+this.Kl.breakDuration||1),videoRenderFPS:C}),audio:pb(pb({},this.Na.audio),{audioBitrate:l,audioCodec:d,audioQuality:m,audioFPS:p,audioJitter:g,audioLevel:b,audioPacketsLost:_,audioPacketsLostRate:y,audioSamplingRate:w,audioSendLevel:S,muteState:v,audioCumulativeDecodeTime:this.$l.decodeDuration,audioCumulativeBreakTime:this.$l.breakDuration,audioCumulativeBreakRate:this.$l.breakDuration/(this.$l.decodeDuration+this.$l.breakDuration||1)}),nackCount:E,pliCount:O,totalRoundTripTime:T,currentRoundTripTime:k,peerToPeerDelay:R,peerToPeerPacketLostRate:(I||0)/255,sampleTimeWindow:N};void 0!==t.codecImplementationName&&(z.codecImplementationName=t.codecImplementationName),void 0!==t.videoCodecName&&(z.video.googCodecName=t.videoCodecName),""!==t.audioCodec&&(z.audio.googCodecName=t.audioCodec),this.Na=z},t.prototype.simplifyPlayDataKey=function(t){var i={};i.aPktLost=t.audioPacketsLost,i.aPlr=t.audioPacketsLostRate,i.aBitrate=Math.trunc(t.audioBitrate),i.aLevel=Math.trunc(1e5*t.audioLevel)/1e5,i.aTotalEnergy=Math.trunc(1e5*t.audioSendLevel)/1e5,i.aSampleRate=Math.trunc(t.audioSamplingRate),i.aQuality=t.audioQuality,i.aFPS=Math.trunc(t.audioFPS),i.vQuality=t.videoQuality,i.vPktLost=t.videoPacketsLost,i.vPlr=t.videoPacketsLostRate,i.vBitrate=Math.trunc(t.videoBitrate),i.vFPS=Math.trunc(t.videoFPS),i.nackCnt=t.nackCount,i.vPliCnt=t.pliCount,i.vFramesDec=t.videoFramesDecoded,i.vHeight=t.frameHeight,i.vWidth=t.frameWidth,i.vRcvFPS=Math.trunc(t.videoTransferFPS),i.vFrameDrop=t.videoFramesDropped,i.keyFrameDec=t.keyFramesDecoded,i.vTotalFreezeDur=t.totalFreezesDuration,i.rtt=t.currentRoundTripTime,i.vCodec=t.videoCodecName,i.aMuteStat=t.audioMuteState,i.vMuteStat=t.videoMuteState,i.soundLV=t.soundLevel,i.muted=t.muted,i.aPaused=t.audioPaused,i.vPaused=t.videoPaused,i.vRdyState=t.videoReadyState,i.aRdyState=t.audioReadyState,i.volume=t.volume,i.sinkId=t.sinkId,i.p2pDelay=t.peerToPeerDelay,i.p2pPlr=t.peerToPeerPacketLostRate,i.vBrkDur=t.video_break_duration,i.vBrkCancelDur=t.video_break_cancel_duration,i.vDecTime=t.video_decode_time,i.aBrkDur=t.audio_break_duration,i.aBrkCancelDur=t.audio_break_cancel_duration,i.aDecTime=t.audio_decode_time,i.aJtrBufDlyMs=t.audioJitterBufferDelayMs,i.vJtrBufDlyMs=t.videoJitterBufferDelayMs,i.aEnd=t.audioEnded,i.vEnd=t.videoEnded,i.vRenderFps=t.videoRenderFPS;var e=this._playStream?xo(this._playStream):void 0;return void 0!==e&&this.nd!==e&&(this.nd=e,i.stmTracks=e),i},t.prototype.uploadPlayQuality=function(t,i){var e=i;if(0==this.Ja||e-this.Ja>=2e3){t.stream_type="play",t.stream_id=this.Uo,t.timeStamp=e,t.video_break_duration=this.Xl.breakDuration,t.video_break_cancel_duration=this.Xl.breakCancelDuration,t.video_decode_time=this.Xl.decodeTime,this.Xl.breakCancelDuration=0,this.Xl.breakDuration=0,this.Xl.decodeTime=0,t.audio_break_duration=this.Wl.breakDuration,t.audio_break_cancel_duration=this.Wl.breakCancelDuration,t.audio_decode_time=this.Wl.decodeTime,this.Wl.breakCancelDuration=0,this.Wl.breakDuration=0,this.Wl.decodeTime=0,t.real_sampling_interval=e-this.Ql;var n=this.simplifyPlayDataKey(t);void 0!==this.ed&&(n.gw_aTxKbps=this.ed.audioTXBitrate,n.gw_vTxkbps=this.ed.videoTXBitrate,n.gw_vRedRate=this.ed.videoRedRate,n.gw_TCStat=this.ed.trafficControlStat,n.gw_TCBW=this.ed.trafficControlStat),this.Ql=e,this.Jl.info(rv+" upload"+JSON.stringify(n)),this.Ro.updateQuality(ht.play_quality,t),this.Ja=e}},t.prototype.getP2PNetStats=function(){var t=this;this.ad=Date.now(),this.Jl.getP2PNetStats((function(i,e){var n=e.p2p_rtt;t.p2pNetStats.p2pLostRate=e.p2p_lost_rate||0,t.p2pNetStats.p2pRTT=n||0}),(function(t){}))},t.prototype.setPlayQualityTimer=function(){var t=this;null==this.Aa&&(this.Jl.info(sv+" called ".concat(this.Ma," ").concat(this.za," ").concat(this.Da)),(this.Aa||this.xa||this.ja)&&this.clearPlayQualityTimer(),this.getP2PNetStats(),this.Aa=setInterval((function(){t.sd++;var i=t.Jl.peerConnection;if(i){var e=[i.getStats(null)];Promise.all(e).then((function(i){if(t.Aa)t.getPlayStats(i[0],i[1])})).catch((function(i){t.Jl.error(sv+" getStats error "+i.toString())}))}}),this.Ma),this.La=this.Us=Date.now(),1e3!==this.Ma&&(this.Ma!=this.za&&(this.xa=setInterval((function(){t.notifyPlayQuality()}),this.za)),this.Ma!=this.Da&&(this.ja=setInterval((function(){t.reportPlayQuality()}),this.Da))),this.Vl={audioPacketsLost:0,videoPacketsLost:0,time:Date.now(),audioTime:0,videoTime:0,audioBytesReceived:0,videoBytesReceived:0,videoPacketsReceived:0,audioPacketsReceived:0,framesDecoded:0,framesReceived:0,framesDropped:0,audioBitrate:0,totalRenderFrames:0,renderTime:0,paintedFrames:this.Vl.paintedFrames,lastTimestamp:0,videoElem:this.Vl.videoElem,audioJitterBufferDelay:0,audioJitterBufferEmittedCount:0,videoJitterBufferDelay:0,videoJitterBufferEmittedCount:0,jitterBufferDelayMs:0})},t.prototype.clearPlayQualityTimer=function(){if(this.Jl.info("zc.p.spqt.1.1 called ".concat(!!this.Aa," ").concat(!!this.xa," ").concat(!!this.ja)),null!=this.xa&&(clearInterval(this.xa),this.xa=null),null!=this.ja&&(clearInterval(this.ja),this.ja=null),null!=this.Aa){clearInterval(this.Aa),this.Aa=null;var t=(new Date).getTime();this.Ql=0,this.sd=0,this.td={totalSquaredInterFrameDelay:0,totalInterFrameDelay:0,framesDecode:0,totalSamplesReceived:0,concealedSamples:0,audioBytesReceived:0};var i=this.Jl.playMode===q.L3;mb(this.Yl,this.Xl,this.Kl,this.Fl,!this.ud&&0===this.Jl.cameraStatus&&this.Jl.playMediaStatus.video,t,i),mb(this.Zl,this.Wl,this.$l,this.Gl,!this.ud&&0===this.Jl.micStatus&&this.Jl.playMediaStatus.audio,t,i)}this.Ba=0,this.Vl={audioPacketsLost:0,videoPacketsLost:0,time:0,audioTime:0,videoTime:0,audioBytesReceived:0,videoBytesReceived:0,videoPacketsReceived:0,audioPacketsReceived:0,framesDecoded:0,framesDropped:0,framesReceived:0,audioBitrate:0,totalRenderFrames:0,renderTime:0,paintedFrames:0,lastTimestamp:0,videoElem:null,audioJitterBufferDelay:0,audioJitterBufferEmittedCount:0,videoJitterBufferDelay:0,videoJitterBufferEmittedCount:0,jitterBufferDelayMs:0},this.od=!1,this.ud=!1},t.prototype.checkProbe=function(t){var i=this.Ua,e=this.Vl.time;this.Jl.debug(sv+" netQuality "+i+" "+e),i<=this.Ro.targetQuality?this.Ba++:this.Ba=0,e>0&&this.Ba>=this.Ro.probeStartedNum&&t>this.Jl.probeTime+this.Ro.probeInterval&&(this.In.info(sv+" netQuality "+i+" start net probe"),this.probeState=ot.tryProbe,this.Jl.poorQualityRetryCnt++,this.Ro.startNetProbe(!1,this.Jl))},t.prototype.startProbeTimeout=function(){var t=this;this.Mh=setTimeout((function(){t.Jl.error(Qd+" probe timeout"),t.Jl.playStateUpdateError(Pn.error.ln)}),this.Hl)},t.prototype.stopProbeTimeout=function(){this.Mh&&(clearTimeout(this.Mh),this.Mh=null)},t.prototype.setStreamUpdate=function(t){0===t?this.rd=!0:1===t&&(this.rd=!1)},t.prototype.setPlayStreamEnd=function(t){this.ud=t},t.prototype.setHasBFrames=function(t){this.od=t},t.prototype.updateGwPlayNetState=function(t){this.ed=t},t.prototype.Sc=function(t){for(var i=!1,e=0;e<t.length;e++){var n=t[e],s=n.key,r=n.value;this.Ha[s]!==r&&(this.Ha[s]=r,i=!0)}return i},t.prototype.onPlayingError=function(t){},t}(),bb=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),_b=Pn.event,yb=wn,wb=xn,Sb=Pn.error,Eb=bn.error,Ob=Cn,Tb=jn;!function(t){t[t.disconnected=0]="disconnected",t[t.connecting=1]="connecting",t[t.connected=2]="connected"}(nb||(nb={}));var kb=function(t){function i(i,e,n,s,r){var o=t.call(this)||this;return o.streamID=i,o.In=e,o.Nn=n,o.Ro=s,o.isPublish=r,o.streamRetryStartTime=0,o.Yo=mm(o.In,o.streamID),o}return bb(i,t),Object.defineProperty(i.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),i.prototype.startMaxTime=function(){var t=this;this.Yo.info("zc.tsh.smt call"),this.maxTimer?this.Yo.warn("zc.tsh.smt max timer"):(0===this.streamRetryStartTime&&(this.streamRetryStartTime=(new Date).getTime()),this.maxTimer=setTimeout((function(){if(t.Yo.warn("zc.tsh.smt over max time ".concat(t.RETRY_MAX_TIME,"s, stop retry")),t.isOverTime=!0,t.invalid(),t.isPublish){if(!t.Ro.publisherList[t.streamID])return void t.Yo.info("zc.tsh.smt publish no found");t.publishStateHandle(Z,t.streamID,Eb._e,!0)}else{var i=t.Ro.playerList[t.streamID];if(!i)return void t.Yo.info("zc.tsh.smt play no found");var e=Sb.un;t.Nn.isFlutter&&i.isStreamNotFound&&(e=i.hasSucceed?le:se),t.playStateHandle(W,t.streamID,e,!0)}}),1e3*this.RETRY_MAX_TIME),this.Yo.info("zc.tsh.smt maxTimer=".concat(this.maxTimer)))},i.prototype.active=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i]},i.prototype.stopMaxTime=function(){this.Yo.info("zc.tsh.stmt streamID maxTimer="+this.maxTimer),this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},i.prototype.onactive=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i]},i.prototype.retryNextSignal=function(){return this.Nn.networkState==B.offline?(this.Yo.info("zc.tsh.rns offline"),nb.disconnected):this.isPublish?(this.Yo.info("zc.tsh.rns  publish ws state "+(null==(t=this.Ro.publisherList[this.streamID].publisher.signal)?void 0:t.state)+" "+t.mediaState),(null==t?void 0:t.state)==w&&(null==t?void 0:t.mediaState)===zt.LOGIN?nb.connected:(null==t?void 0:t.state)===_&&(null==t?void 0:t.mediaState)===zt.LOGOUT?nb.disconnected:nb.connecting):(this.Yo.info("zc.tsh.rns  play ws state "+(null==(t=this.Ro.playerList[this.streamID].signal)?void 0:t.state)+" "+(null==t?void 0:t.mediaState)),(null==t?void 0:t.state)==w&&(null==t?void 0:t.mediaState)===zt.LOGIN?nb.connected:(null==t?void 0:t.state)===_&&(null==t?void 0:t.mediaState)===zt.LOGOUT?nb.disconnected:nb.connecting);var t},i.prototype.publishStateHandle=function(t,i,e,n,s,r){var o,u,a=this,c=n||this.RETRY_MAX_TIME<3;this.Yo.info(vd+" call "+(e?e.code+"":"")+" "+n+" "+JSON.stringify(s)+" "+r+" "+c);var h=this.Ro.publisherList[i],f=h.publisher;if(c)return this.stopMaxTime(),this.invalid(),1===t&&f.resetPublish(1),(null==e?void 0:e.code)&&this.Mn.spanSetAttributes({key:f.parentSpanKey,par:i},e),void this.Ro.onPublishStateUpdate(t,i,e);if(e&&0!==e.code){this.maxTimer||c||this.startMaxTime(),this.Nn.publishStreamList[i].state=T.retryPublish;var l=f.localStream,d=f.publishOption;f.resetPublish(1);var v=this.retryNextSignal();if(this.Yo.info(vd+" server connect state "+nb[v]),v===nb.connected){this.Yo.info(vd+" retry current signal "),this.rtcPublishSpan(i,e,f),(null===(o=h.publisher.signal)||void 0===o?void 0:o.state)===w&&(this.Yo.info(vd+" current node "+f.gwNode+" failed "+JSON.stringify(f.retryFailGwNodes)+" "+JSON.stringify(f.retryFailIpV4Nodes)+" "+JSON.stringify(f.retryFailIpV4Nodes)),this.setRetryFailNodes(f),f.getRetryIPNodeMode(),this.retryNewGwNode(f,e,s,r),f.gwNode?f.getRetryIPv6Prefer():f.getDispatchIPNodeMode()),this.startRetryTimer&&clearTimeout(this.startRetryTimer),this.startRetryTimer=null;var m=[Eb.ve.code,Eb.Ne.code,ie.code].includes(e.code)?0:1e3;return this.Yo.info(vd+" delay "+m),this.startRetryTimer=setTimeout((function(){a.Yo.info(vd+" retry publish "+f.state),7==f.state&&f.startPublish(i,l,d)}),m),e&&0!==e.code&&this.Ro.onPublishStateUpdate(2,i,e),void this.publishStartSpan(i,e,h)}if(v===nb.disconnected){var p=null===(u=h.room)||void 0===u?void 0:u.roomID;this.retryServer(!0,p,null==h?void 0:h.room.token),f&&(f.isExternal=!1),this.rtcPublishSpan(i,e,f),this.Ro.onPublishStateUpdate(2,i,e),this.publishStartSpan(i,e,h)}else this.Yo.info(vd+" server connecting")}this.Yo.info(vd+" end")},i.prototype.needReDispatchError=function(t){return[Eb.Le.code,Sb.dn.code].includes(t.code)},i.prototype.isSwitchIPStackError=function(t){return[ie.code,be].includes(t.code)},i.prototype.playStateHandle=function(t,i,e,n,s,r){var o,u,c,h,f,l,d=this,v=n||this.RETRY_MAX_TIME<3;this.Yo.info(md+" call "+(e?e.code+"":"")+" "+n+" "+JSON.stringify(s)+" "+r+" "+v);var m=this.Ro.playerList[i];if(v)return this.stopMaxTime(),this.invalid(),(null==e?void 0:e.code)&&(null===(o=m.Ca)||void 0===o||o.setAttributes({error:null==e?void 0:e.code})),void this.Ro.onPlayStateUpdate(t,i,e);if(e&&0!==e.code){!this.maxTimer&&this.startMaxTime(),m.resetPlay(!0,1);var p=this.endRtcPlaySpan(i,e,m),g=this.retryNextSignal();if(this.Yo.info(md+" server connect state "+nb[g]),g===nb.connected){this.Yo.info(md+" retry current signal "),m.isCenterNode&&(null===(u=m.signal)||void 0===u?void 0:u.state)===w&&(this.Yo.info(md+" current node "+m.gwNode+" "+JSON.stringify(m.retryFailGwNodes)+" "+JSON.stringify(m.retryFailIpV4Nodes)+" "+JSON.stringify(m.retryFailIpV6Nodes)),this.setRetryFailNodes(m.zegoPeer),null===(c=m.zegoPeer)||void 0===c||c.getRetryIPNodeMode(),this.retryNewGwNode(m,e,s,r),m.gwNode?null===(h=m.zegoPeer)||void 0===h||h.getRetryIPv6Prefer():null===(f=m.zegoPeer)||void 0===f||f.getDispatchIPNodeMode()),this.startRetryTimer&&clearTimeout(this.startRetryTimer),this.startRetryTimer=null;var b=Pn.error,_=[b.en.code,b.Ne.code,be.code].includes(e.code)?0:1e3;return this.Yo.info(md+" delay "+_),this.startRetryTimer=setTimeout((function(){d.Yo.info(md+" retry state "+m.state),7===m.state&&m.startPlay(i,m.getRemoteStreamSuc)}),_),e&&0!==e.code&&this.Ro.onPlayStateUpdate(2,i,e),p||m.hd||(m.hd=mi(this.Mn,a.I,i,m.playingEvent,Pn.event),this.endRtcPlaySpan(i,e,m)),void this.playStartSpan(i,m)}if(g===nb.disconnected){var y=null===(l=m.room)||void 0===l?void 0:l.roomID;this.retryServer(m.playMode===q.RTC,y,null==m?void 0:m.room.token),m&&(m.isExternal=!1),this.Ro.onPlayStateUpdate(2,i,e),p||m.hd||(m.hd=mi(this.Mn,a.I,i,m.playingEvent,Pn.event),this.endRtcPlaySpan(i,e,m)),this.endRtcPlaySpan(i,e,m),this.playStartSpan(i,m)}else this.Yo.info(md+" server connecting")}this.Yo.info(md+" end")},i.prototype.retryServer=function(t,i,e){var n=t?M_:x_;this.Ro.signalList[n]?this.Ro.openConnectServerTask(n):this.Ro.connectWebRTCCenterServer(!1,t,i,e)},i.prototype.setRetryFailNodes=function(t){if(t)if(t.ipNodeType===It.ZV4Only){var i=t.retryFailGwNodes.findIndex((function(i){return i===t.gwNode}));i>=0&&t.retryFailGwNodes.splice(i,1),t.retryFailGwNodes.push(t.gwNode)}else{var e=t.ipV4NodeList,n=t.ipV6NodeList,s=t.retryFailIpV4Nodes,r=t.retryFailIpV6Nodes,o=t.gwNode,u=Yl(e,o),a=Yl(n,o);if(u>-1)(c=Yl(s,o))>=0&&s.splice(c,1),s.push(e[u]);else if(a>-1){var c;(c=Yl(r,o))>=0&&r.splice(c,1),r.push(n[a])}}},i.prototype.retryNewGwNode=function(t,i,e,n){var s,r,o,u,a,c;if(this.Yo.info(pd+" call"),i&&i.code&&this.needReDispatchError(i))this.retryNextGwNode(t,!0,n);else if(i&&i.code&&this.isSwitchIPStackError(i))this.retryNextGwNode(t,!1,n);else if(null==e?void 0:e.action)switch(null==e?void 0:e.action){case 1:case 5:break;case 2:default:this.retryNextGwNode(t,!1,n);break;case 3:this.Yo.info(pd+" redirect");var h=null==e?void 0:e.ins;if(h&&h.length>0){var f=((null===(s=h[0])||void 0===s?void 0:s.IP)||(null===(r=h[0])||void 0===r?void 0:r.ip))+":"+((null===(o=h[0])||void 0===o?void 0:o.Port)||(null===(u=h[0])||void 0===u?void 0:u.port)),l=(null===(a=h[0])||void 0===a?void 0:a.ipv6)+":"+(null===(c=h[0])||void 0===c?void 0:c.port);t.gwNode=f&&l?[It.ZV4Only,It.ZV4Priority].includes(t.ipNodeType)?f:l:f||l}break;case 4:t.resetGwNodes(),this.Ro.clearCachedGwNodesList(t,this.isPublish)}else this.retryNextGwNode(t,!1,n);this.Yo.info(pd+" new node "+t.gwNode)},i.prototype.retryNextGwNode=function(t,i,e){if(this.Yo.info(gd+" call "+t.gwNode),t.gwNode||!t.isNodesEmpty){var n=(new Date).getTime(),s=t.gwNodesTTL<n,r=t.iceStateDisConnect&&this.Nn.isMultiOuter,o=this.Ro.isNodeLast(this.isPublish?t:t.zegoPeer),u=o.lastTryNext,a=o.currentIdx,c=t.hasSucceed;this.Yo.info(gd+" ttl: "+s+" ice: "+r+" last: "+u+" hasSucc: "+c),i||c&&s||t.isLastConnected&&r||u?(t.gwNode=this.Ro.getGwNode(t,t.ipNodeType,a),this.dispatchGwNodesBypass(t)):t.gwNode=this.Ro.getGwNode(t,t.ipNodeType,e?-1:a)}else this.Yo.info(gd+" call gwNodeList is empty")},i.prototype.dispatchGwNodesBypass=function(t,i,e){var n=this;void 0===i&&(i=function(){}),void 0===e&&(e=function(){});var s=this.Ro.getStreamIPNodesMode().ipV6Prefer;t.dispatchGwNodes(s,(function(e){n.Yo.info(bd+" suc "+JSON.stringify(e)),t.setGwNodes(e,!0,s),i()}),(function(t){n.Yo.info(bd+" fail "+JSON.stringify(t)),e()}))},i.prototype.rtcPublishSpan=function(t,i,e){var n;null==e||e.uploadRTCPublishStats();var s=(null==e?void 0:e.isLastConnected)?0:this.getTryTime(e);this.Mn.spanEnd({key:Cn.event,par:t},{tryidx:Ob.tryidx(null==e?void 0:e.rtcPublishCount),url:Ob.url(null===(n=null==e?void 0:e.signal)||void 0===n?void 0:n.server),ip:Ob.ip(null==e?void 0:e.ip),dispatch_external_ip:Ob.dispatch_external_ip(this.Nn.clientIP),resource_type:Ob.resource_type("rtc"),protocol:Ob.protocol("webrtc"),try_time:Ob.try_time(s),error:null==i?void 0:i.code,message:null==i?void 0:i.message})},i.prototype.publishStartSpan=function(t,i,e){var n,s,r=null==e?void 0:e.publisher,o=(null==r?void 0:r.hasSucceed)?yn:_n;this.Mn.createSpan(a.H,{key:bn.event,par:t},{key:o.event,par:t},o.event,!0),!1===(null==r?void 0:r.isRePublish)&&this.Mn.spanSetAttributes({key:yb.event,par:t},{retry_btime:yb.retry_btime((new Date).getTime())}),(null==r?void 0:r.hasSucceed)&&(r.isRePublish=!0,r.parentSpanKey=yn.event),this.Mn.createSpan(a.I,{key:bn.event,par:t},{key:Cn.event,par:t},Cn.event,!0).setAttributes({room_id:Ob.room_id(null===(n=null==e?void 0:e.room)||void 0===n?void 0:n.roomID),room_sid_string:Ob.room_sid_string(null===(s=null==e?void 0:e.room)||void 0===s?void 0:s.roomSessionID)}),r&&(r.rtcPublishCount++,r.continuousFailCnt++)},i.prototype.endRtcPlaySpan=function(t,i,e){var n=(null==e?void 0:e.isLastConnected)?0:this.getTryTime(e);return!!(null==e?void 0:e.endPlayingSpan({stop_reason:JSON.stringify(i),try_time:Tb.try_time(n),error:null==i?void 0:i.code,message:null==i?void 0:i.message}))},i.prototype.playStartSpan=function(t,i,e){void 0===e&&(e=!1),i.Ca||i.isProbe||(i.Ca=mi(this.Mn,a.H,t,i.playStartEvent,_b,void 0,!0)),!0===i.hasSucceed&&this.Mn.spanSetAttributes({key:wb.event,par:t},{retry_btime:wb.retry_btime(Date.now())}),e||i&&(i.tryidx++,i.continuousFailCnt++)},i.prototype.getTryTime=function(t,i){var e=void 0;return t&&this.streamRetryStartTime>0&&(e=(new Date).getTime()-this.streamRetryStartTime,t.lastFailTimeLen=e=e>0?e:void 0,i&&(this.streamRetryStartTime=0)),e},i}(Rc);var Rb=function(){return Rb=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Rb.apply(this,arguments)},Ib=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Nb=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Cb=Pn.event,zb=Pn.error,Db=xn;function Pb(t){var i=0,e=0;return i=t[e++]<<24,i|=t[e++]<<16,i|=t[e++]<<8,i|=t[e++]}function Ab(t,i){void 0===i&&(i=0);for(var e=t.length,n=[],s=0;s<e;)s>=i&&e-s>=3&&!t[s]&&!t[s+1]&&3==t[s+2]?(n.push(t[s++]),n.push(t[s++]),s++):n.push(t[s++]);var r=new Uint8Array(n);return{output:r,outLength:r.length}}var Mb,xb=function(){function t(t,i,e,n,s,r,o,u,a,c){var h,f=this;this.Jl=t,this.fd=i,this.ol=r,this.Ro=o,this.Nn=u,this.room=a,this.ld=c,this.Ff=!0,this._state=7,this.lastState=7,this.df=0,this.if=[],this.Hf=0,this.Yc=0,this.remoteStream=null,this.af=void 0,this.closeSessionSignal=!1,this.dd=!1,this.vd=!1,this.mic=null,this.firstFrameTime=0,this.ipV6Prefer=-1,this.ipNodeType=It.ZV4Priority,this.ipStackNode=kt.IPv4,this.Hh=!0,this.jh=!1,this.Lh=[],this.qh=[],this.Uh=[],this.Bh="",this.Jh="",this.Vh=500,this.startTime=0,this.pf="",this.gf=[],this.bf=0,this.ipNode=null,this.ipV4NodeList=[],this.ipV6NodeList=[],this.probeType="audio",this.Pf=0,this.md=!1,this.pd="",this.gd=0,this.Lf=0,this.qf="",this.retryFailGwNodes=[],this.retryFailIpV4Nodes=[],this.retryFailIpV6Nodes=[],this.signalTime=0,this.stopReason="",this.bd=0,this.Gf=((h={}).StreamStatusNotifyPush={seq:-1,time:0},h.PlayEventPush={seq:-1,time:0},h.ClientInfoPush={seq:-1,time:0},h.NetQualityInfoPush={seq:-1,time:0},h),this.jf=0,this._d={yd:!0,wd:[],Sd:[]},this.onDataChannelList=[],this.Vf={isSEIStart:!1,unregisterSeiFilter:"",filterSize:0},this.To=!1,this.Xh=0,this.Wh=0,this.Kh=0,this.$h=0,this.tf=0,this.Zf={lanIP:"",wanIP:"",intranet:!1},this.cf=!1,this.Ed={first:!0,seq:0},this.Yf=!1,this.decodeVideoFrame=function(t,i){var e,n,s="VP8"!==f.pd;if(s){var r=f.Od;if(r){if(r.buffer)if(t.timestamp-r.time<20){var o=function(t,i){if(t.byteLength!==i.byteLength)return!1;for(var e=0;e<t.byteLength;e++)if(t[e]!==i[e])return!1;return!0}(new Uint8Array(t.data),r.buffer);o&&(s=!1)}else r.buffer=void 0}else f.Od={buffer:new Uint8Array(t.data),time:t.timestamp}}if(s){for(var u=new DataView(t.data),a=0,c=new Tg(u),h=0,l=!1;c.NextNalu(l);)if(7!=(h=31&u.getUint8(c.nalu_start+c.start_code_size))&&8!=h&&9!=h){if(6!=h)break;var d=new Uint8Array(t.data).slice(c.nalu_start+c.start_code_size,c.nalu_start+c.start_code_size+c.nalu_size);if(f.Nn.seiConfig.emulationPreventionByte)d=Ab(d).output;a=1,l=!0;for(var v=0;255===d[a];)v+=255,a++;if(243===(v+=d[a++])||5===v||100===v){for(var m=0;255===d[a];)m+=255,a++;if(m+=d[a++],t.data.byteLength-a<m)break;var p=new Uint8Array(4+m);switch(p[0]=0,p[1]=0,v){case 100:p[2]=3,p[3]=235;break;case 5:p[2]=3,p[3]=236;break;case 243:p[2]=3,p[3]=237}for(var g=0;g<m;g++)p[4+g-0]=d[a++];var b=!1;if(243===v)b=!0;else if(5===v){var _=f.Vf.unregisterSeiFilter;if(_){var y=p.slice(4,4+f.Vf.filterSize),w=void 0,S=!0;if(0===(w="string"==typeof _?Pl(_):_).length)S=!1;else for(var E=0;E<w.length;E++)if(w[E]!==y[E]){S=!1;break}b=S}else b=!0}b&&f.Nn.actionListener("playerRecvSEI",f.Uo,p)}else if(244===v){for(m=0;255===d[a];)m+=255,a++;if(m+=d[a++],t.data.byteLength-a<m)break;var O=parseInt(m/5+""),T=d.slice(a,a+=m),k=[],R=function(t){var i=5*t,s=T.slice(i,i+4),r=T.slice(i+4,i+5),o=Pb(s),u=r[0],a=(null===(n=null===(e=f.room.streamList)||void 0===e?void 0:e.find((function(t){return t.stream_nid===o})))||void 0===n?void 0:n.stream_id)||"";k.push({soundLevelID:o,value:u,streamID:a})};for(E=0;E<O;E++)R(E);var I=new Map(k.map((function(t){return[t.soundLevelID,t.value]}))),N=k.filter((function(t){return t.streamID})).map((function(t){return[t.streamID,t.value]})),C=new Map(N);f.Nn.actionListener("mixerSoundLevelUpdate",I,f.Uo),C.size&&f.Nn.actionListener("autoMixerSoundLevelUpdate",C,f.Uo)}}i.enqueue(t)}else i.enqueue(t)},this.decodeAudioFrame=function(t,i){i.enqueue(t)},this.Fo={seiMessage:function(t){var i=t.data,e=i.streamID;if(e===f.Uo)switch(i.cmd){case"recvSEI":f.Nn.actionListener("playerRecvSEI",e,new Uint8Array(i.buffer));break;case"mixSoundLevel":f.onRecvMixSoundLevels&&f.onRecvMixSoundLevels(i.soundLevelList)}},onUaSocketConnected:function(){var t;f.In.info("zc.ply.ousc call. "+(null===(t=f.Wf)||void 0===t?void 0:t.length)+" gwNode: "+f.pf),f.Wf&&(f.pf="",f.getDispatchIPNodeMode(),f.Kf.apply(f,f.Wf))}},this.onCanStopNegaTimer=function(){},this.onPlayStateUpdateError=function(){},this.onPlayBFrameEvent=function(t){},this.onPlayStreamEnd=function(t){},this.onGwPlayNetState=function(t){},this.Wf=void 0,this.In=mm(n,this.Uo),this.il=new Bg(n,!1,t.streamId),e&&this.setSignal(e),this.dataReport=s,this.To=this.Nn.isMiniSdp,this.To&&(this.tl=new Qg(o,n,this.Uo)),this.checkAutoTcp(),this.Td(),this.Hf=t.playStartTime}return Object.defineProperty(t.prototype,"signal",{get:function(){return this.sl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoTcp",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},set:function(t){this.lastState=this._state,this._state=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"stateNego",{get:function(){return this.df},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"kd",{get:function(){return this.Jl.playStartEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProbeByDG",{get:function(){return this.Jl.isProbeByDG},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamId",{get:function(){return this.Uo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this.Yc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playStream",{get:function(){return this.Jl.playStream},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerConnection",{get:function(){return this.af},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resourceMode",{get:function(){return this.Rd},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nl",{get:function(){return this.Ro.agentIpStackDetection.IPv4===Nt.reachable},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gwNode",{get:function(){return this.pf},set:function(t){this.pf=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gwNodeList",{get:function(){return this.gf},set:function(t){this.gf=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gwNodesTTL",{get:function(){return this.bf},set:function(t){this.bf=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isNodesEmpty",{get:function(){return this.ipNodeType===It.ZV4Only?0===this.gf.length:this.ipNodeType===It.ZV4Priority?0===this.ipV4NodeList.length:(this.ipNodeType===It.ZV6Priority||0===this.ipV4NodeList.length)&&0===this.ipV6NodeList.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Df",{get:function(){return this.Jl.isPeer},set:function(t){this.Jl.isPeer=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isProbe",{get:function(){return this.Jl.isProbe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"peerID",{get:function(){return this.Pf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamConnectIP",{get:function(){return this.qf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playingEvent",{get:function(){return this.Jl.playingEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamNotFoundTime",{get:function(){return this.bd},set:function(t){this.bd=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataChannel",{get:function(){return this.Xc},enumerable:!1,configurable:!0}),t.prototype.createSEIWorker=function(){return this.Ro.createSEIWorker()},Object.defineProperty(t.prototype,"seiWorker",{get:function(){return this.Ro.seiWorker},enumerable:!1,configurable:!0}),t.prototype.Ur=function(t,i){return void 0===i&&(i=!1),this.Nn.settingConfig.getSetting(t,i)},Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Uo",{get:function(){return this.Jl.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Id",{get:function(){var t;return null===(t=this.ld)||void 0===t?void 0:t.streamParams},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playMode",{get:function(){return this.fd},enumerable:!1,configurable:!0}),t.prototype.Td=function(){var t,i,e,n,s=null===(t=this.ld)||void 0===t?void 0:t.isSEIStart;if(Ut(s)&&(this.Vf.isSEIStart=s),s){var r=Po(),o=null===(i=this.ld)||void 0===i?void 0:i.videoCodec;(o&&"H264"!==o||!r)&&(this.In.warn(Qd+" not use sei; support: ".concat(r,", codec: ").concat(o," ")),this.Vf.isSEIStart=!1)}if(null===(e=this.Nn.seiConfig)||void 0===e?void 0:e.unregisterSEIFilter){var u=this.Vf.unregisterSeiFilter=null===(n=this.Nn.seiConfig)||void 0===n?void 0:n.unregisterSEIFilter;this.Vf.filterSize=Pl(u).byteLength}},t.prototype.setSignal=function(t){this.sl!==t?(this.sl=t,this.il.webrtcCenterServerSignal=t,this.Wf&&(this.In.info("zc.prc.ss signal register"),this.sl.on("uaConnected",this.Fo.onUaSocketConnected))):this.In.info("zc.prc.ss signal no changed")},t.prototype.connectGW=function(){return Ib(this,void 0,void 0,(function(){var t,i=this;return Nb(this,(function(e){return this.state=0,this.dd=!1,this.setTurnTcp(),this.To&&!this.tf&&(this.tf=performance.now()),(t=this.Ur("udp_or_tcp",!0))&&(this.In.info(tv+" setting udp_or_tcp "+t),this.Yf="tcp"===t),this.Yf&&(this.Df=!1,this.Ff=!1),[2,new Xt((function(t,e){(i.Df?i.Nd():i.Cd()).catch((function(t){e(t)})),i.getRemoteStreamSuc=t}))]}))}))},t.prototype.Nd=function(){return Ib(this,void 0,void 0,(function(){var t,i,e,n,s,r;return Nb(this,(function(o){switch(o.label){case 0:return o.trys.push([0,5,,6]),[4,this.wl({encodedInsertableStreams:this.Vf.isSEIStart})];case 1:return(t=o.sent())?(t=this.Al(t),[4,this.zd(t)]):[2];case 2:return(i=o.sent())?(this.Ol(i.seq,i.sessionID,e=i.msg,i.ipv6Prefer),[4,this.parseRemoteMiniSdp(e)]):[2];case 3:if(n=o.sent(),this.Ff&&!this.Dd(n,e.params_ext))throw this.Pd(be,!1);return[4,Xt.all([this.Ad(t),this.Md(n,void 0)])];case 4:return o.sent(),this.Ff&&this.Nl(e.params_ext),[3,6];case 5:if(!(s=o.sent()).playError)throw s;return this.onPlayStateUpdateError((r=s).error,r.stopRetry,r.detail,r.startFromFirst),[3,6];case 6:return[2]}}))}))},t.prototype.Cd=function(){return Ib(this,void 0,void 0,(function(){var t,i,e,n,s,r,o;return Nb(this,(function(u){switch(u.label){case 0:return u.trys.push([0,7,,8]),[4,this.zd(void 0)];case 1:return(t=u.sent())?(this.Tl(t.seq,t.sessionID,i=t.msg,t.ipv6Prefer),[4,this.xd(i)]):[2];case 2:return e=u.sent(),[4,this.wl(e)];case 3:return(n=u.sent())?(n=this.Al(n),[4,this.Ad(n)]):[2];case 4:return u.sent(),[4,this.jd(n)];case 5:return(s=u.sent())?[4,this.Md(s,!0)]:[2];case 6:return u.sent(),[3,8];case 7:if(!(r=u.sent()).playError)throw r;return this.onPlayStateUpdateError((o=r).error,o.stopRetry,o.detail,o.startFromFirst),[3,8];case 8:return[2]}}))}))},t.prototype.xd=function(t){var i;return Ib(this,void 0,void 0,(function(){var e,n,s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S,E,O,T,k,R,I,N,C,z=this;return Nb(this,(function(D){switch(D.label){case 0:return this.In.info((e=Xd)+" success"),this.setTurnTcp(),this.Ro.autoSwitchProtocol=this.Ur("auto_to_tcp")||!1,n=this.Ur("udp_max_fail_num"),!isNaN(n)&&(this.Ro.maxUdpFailNum=n),o=(s=this.Ro).maxUdpFailNum,u=s.udpFailNum,this.In.info(e+"  autoToTcp: ".concat(r=s.autoSwitchProtocol,", udpFailNum: ").concat(u,", maxUdpFailNum: ").concat(o,".")),r&&!this.Yf&&u>=o&&(this.In.info(e+" switch to tcp."),this.Yf=!0,this.Ff=!1),(a=this.Ur("udp_or_tcp",!0))&&(this.In.info(e+" setting udp_or_tcp "+a),this.Yf="tcp"===a),c=[],h=void 0,f=this.Zf.wanIP=(t.gw_nodes[0]||this.pf).split(":")[0],!this.Ro.isProxy||this.Ro.isLocalProxy?[3,2]:(l=null==Qf?void 0:Qf.proxyCtrl,[4,Promise.all([l.getTurnInfo(),l.intranetCheck(yl(f),void 0)])]);case 1:return d=D.sent(),m=d[1],(v=d[0]).code?this.In.warn(e+" use proxy failed."+JSON.stringify(v)):(g=(p=v.data).password,b=p.turn_ipv4,_=p.turn_port,y=p.username,(w=p.turn_internal_ipv4)&&(this.El.coturn_internal=w),S=_l(b),E="turn:".concat(S,":").concat(_,"?transport=").concat(this.Yf?"tcp":"udp"),this.In.info(e+" turn server: ".concat(E," ; intranet: ").concat(JSON.stringify(null===(i=null==m?void 0:m.data)||void 0===i?void 0:i.intranet),"; turn internal ip: ").concat(_l(w))),h=[{credential:g,urls:[E],username:y}]),m.code?this.In.warn(e+" use intranetCheck failed."+JSON.stringify(m)):this.Zf.intranet=m.data.intranet||!1,[3,3];case 2:this.Ro.isLocalProxy&&this.Ro.turnServers?(h=(T=this.Ro.turnServers).map((function(t){return{credential:t.credential,urls:[t.url],username:t.username}})),this.In.info(e+" use local proxy: "+JSON.stringify(T)),this.Zf.intranet=!1):t.turn_server&&(O=[],t.turn_server.split(";").forEach((function(t){var i=Ol(t).replace("[","").replace("]",""),e=El(i);if(z.ipStackNode===e?O.push(t):z.Lh.push(t),e==kt.IPv4){var n=nd(i),s=t.replace(i,"[".concat(n,"]"));z.Ro.isCandidateHasIPv6&&O.push(s)}})),(C=this.Lh).push.apply(C,O),T=void 0,k=O.filter((function(t){return t.indexOf("udp")>-1})),R=O.filter((function(t){return t.indexOf("tcp")>-1})),T=this.Yf?R.length>0?R:k.map((function(t){return t.replace("udp","tcp")})):k,this.In.info(e+" over tcp "+JSON.stringify(T)),c.push.apply(c,T)),D.label=3;case 3:return t.stun_server&&c.push(t.stun_server),I={iceTransportPolicy:"all",iceServers:[{urls:c,username:t.turn_username,credential:t.turn_auth_key}],encodedInsertableStreams:this.Vf.isSEIStart},this.Bh=t.turn_username,this.Jh=t.turn_auth_key,h&&(I.iceServers=h,I.iceTransportPolicy="relay",I.rtcpMuxPolicy="require"),this.In.info(e+" username: "+(N=I.iceServers[0]).username+", credential: "+N.credential),this.ml(),this.In.info(e+" call success"),[2,I]}}))}))},t.prototype.Cl=function(t,i){var e=this.Gf[t],n=e.seq,s=e.time,r=performance.now();return-1!==n&&n>=i&&r-s<6e3?(this.In.warn("zc.p.cps.1"+" push ".concat(t,", seq ").concat(i," local ").concat(JSON.stringify(this.Gf[t]))),!1):(this.Gf[t]={seq:i,time:r},!0)},t.prototype.wl=function(t){return Ib(this,void 0,void 0,(function(){var i,e,n,s,r,o,u,a,c=this;return Nb(this,(function(h){switch(h.label){case 0:i=Xd,this.af=new RTCPeerConnection(t),this.af.onicecandidate=function(t){c.Ld(t)},this.af.onsignalingstatechange=function(t){c.qd(t)},this.af.oniceconnectionstatechange=function(t){c.Ud(t)},this.af.onconnectionstatechange=function(t){c.Bd(t)},this.af.ontrack=function(t){c.Jd(t.streams[0],t.receiver)},e=this.Ur("peer_signal_over_dc"),(this.Ro.isDataChannelEnabled||e)&&(n={ordered:!1},this.In.info("zc.p.dc.n  option:"+JSON.stringify(n)+" enable: "+e),this.jf=0,this.Xc=this.af.createDataChannel(this.Uo,n),this.Xc.binaryType="arraybuffer",e&&(this.il.dataChannel=this.Xc),this.Xc.onopen=function(t){c.In.info("zc.p.dc.o onopen")},this.Xc.onclose=function(t){c.In.warn("zc.p.dc.c onclose")},this.Xc.onmessage=function(t){if(c.jf++<3&&c.In.info("zc.p.dc.m onmessage"),t.data instanceof Blob){var i=new FileReader,e={};i.readAsArrayBuffer(t.data),i.onload=function(){e.data=i.result,c.onReceivedDataChannel(e)}}else c.onReceivedDataChannel(t)}),this.Nn.customUa&&(s=Ht(this.af.addTransceiver),this.In.info(i+" custom ua ios "+s),s&&(this.af.addTransceiver("video",{direction:"recvonly"}),this.af.addTransceiver("audio",{direction:"recvonly"}))),this.Fh=r={offerToReceiveAudio:!0,offerToReceiveVideo:!0},this.isProbe?"audio"===this.probeType&&(r.offerToReceiveVideo=!1):(this.ld&&!1===this.ld.video&&(r.offerToReceiveVideo=!1),this.ld&&!1===this.ld.audio&&(r.offerToReceiveAudio=!1)),this.In.info(i+" createOffer: "+JSON.stringify(r)),o=this.getSpan(rr,this.kd),h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this.af.createOffer(r)];case 2:return u=h.sent(),o&&(o.setAttributes({sdp:or(u.sdp),is_mini:ur(this.To)}),o.end()),this.Vd(u.sdp||"")?[2,u]:(this.onNeedReplay&&this.onNeedReplay(),[2,void 0]);case 3:throw a=h.sent(),this.In.error(i+" create offer error "+a.toString()),o&&this.Mn.setError(o,{code:zb.Oe.code,message:a.toString()}),this.Pd(zb.Oe,!0);case 4:return[2]}}))}))},t.prototype.Ll=function(t){return 0===xl(t).length&&(this.onPlayStateUpdateError(be,!1),!0)},t.prototype.restartIce=function(){var t,i=this,e="zc.p.1.rsi";this.In.info("".concat(e," call")),null===(t=this.af)||void 0===t||t.createOffer(Rb(Rb({},this.Fh),{iceRestart:!0})).then((function(t){var n,s,r;if(i.In.info("".concat(e," createOffer suc")),t.sdp){i.Al(t);var o=jl(t.sdp),u=Ll(t.sdp);i.In.info("".concat(e," ice ").concat(o," ").concat(u));var a={iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:i.Lh,username:i.Bh,credential:i.Jh}],encodedInsertableStreams:i.Vf.isSEIStart};i.In.info("".concat(e," set config ").concat(JSON.stringify(a))),null===(n=i.af)||void 0===n||n.setConfiguration(a),i.sendRestartIce(o,u),i.In.info("".concat(e," localSdp1 ").concat(t.sdp.substr(0,t.sdp.length/2))),i.In.info("".concat(e," localSdp2 ").concat(t.sdp.substr(t.sdp.length/2))),null===(s=i.af)||void 0===s||s.setLocalDescription(t).then((function(t){i.In.info("".concat(e," set local sdp suc"))})).catch((function(t){i.In.info("".concat(e," set local sdp fail ").concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))})),null===(r=i.af)||void 0===r||r.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:i.ul})).then((function(t){i.In.info("".concat(e," set remote sdp suc"))})).catch((function(t){i.In.info("".concat(e," set remote sdp fail ").concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))})),i.qh.forEach((function(t){var n;null===(n=i.af)||void 0===n||n.addIceCandidate(new RTCIceCandidate(t)).then((function(){i.In.info("".concat(e," ").concat(i.Uo,", add can suc"))})).catch((function(t){i.In.info("".concat(e," ").concat(i.Uo,", add can fail, ").concat(t.message))}))}))}})).catch((function(t){i.In.warn("zc.p.0.rsi err ".concat(t.message?JSON.stringify(t.message):JSON.stringify(t)))}))},t.prototype.resetIceInfos=function(){this.In.info("zc.p.1.rii.0 call"),this.Lh=[],this.Bh="",this.Jh="",this.qh=[]},t.prototype.resetNat64Infos=function(){this.In.info("zc.p.0.rni.0 call"),this.Uh=[]},t.prototype.Vd=function(t){return this.In.info(Xd+" is probe "+this.isProbe),!this.isProbe||(!("audio"===this.probeType&&!t.includes("m=audio"))||(this.In.warn(Xd+" no audio"),this.probeType="all",!1))},t.prototype.zd=function(t){var i=this;return new Xt((function(e,n){try{i.Kf(t,e,n)}catch(t){n(t)}}))},t.prototype.Kf=function(t,i,e){var n,s,r,o,u,a,c,h=this,f=!!t;if(!this.sl.isUaConnected)return this.In.info(Qd+" wait to create session"),this.Wf=[t,i,e],void this.sl.on("uaConnected",this.Fo.onUaSocketConnected);this.Wf&&(this.Wf=void 0),this.vl=N();var l=this.Uo;1==this.Ro.testEnvironment&&(l="zegotest-"+this.Ro.appid+"-"+this.Uo);var d,v,m=(this.Nn.appConfig||{}).media_config;1===(null===(n=null==m?void 0:m.play_config)||void 0===n?void 0:n.enable_codec_template)&&void 0!==(null===(s=this.ld)||void 0===s?void 0:s.codecTemplateID)&&(v=bi(this.ld.codecTemplateID,null===(r=m.play_config)||void 0===r?void 0:r.codec_template_postfix_pattern),d=this.ld.codecTemplateID,l+=v),this.Ro.gwNode&&(this.pf=this.Ro.gwNode);var p=this.Ur("gw_nodes");p&&Gt(p)&&p.length>0&&(this.In.info(Qd+" setting "+JSON.stringify(p)),this.gf=p,this.pf=this.gf[0]||this.pf);var g=(null===(u=null===(o=this.Ro.publisherList[this.Uo])||void 0===o?void 0:o.room)||void 0===u?void 0:u.roomID)||(null===(a=this.Nn.roomList[0])||void 0===a?void 0:a.roomID);this.getIPStackNode(),this.In.info("".concat(Qd," session req gwNode: ").concat(this.pf,", ipNodeType: ").concat(this.ipNodeType,", ").concat(this.Df?"peer":"turn",", ipv6_prefer: ").concat(this.ipV6Prefer));var b=this.Sl(g),_=b.params,y=b.paramsExt;this.El=y;var w=fr;if(f){var S=function(n){var s=h.getSpan(fr.event,h.kd),r=h.Ur("l3_play_buffer_ms"),o=(new Date).getTime();h.cf=!1;var u={};n?u.miniSdp=n:u.sdp=t.sdp,h.il.createSessionWithSdp(Rb(Rb({seq:h.vl,type:h.isProbe?2:1,mode:0,streamId:l,strAuthParam:h.Id||""},u),{serverHost:h.pf,playBufLevel:h.fd===q.L3?r:void 0,params:_,paramsExt:y,roomID:g,geo:{type:h.Ro.geo.type,areaList:h.Ro.geo.areaList},transCodecID:d,transCodecSuffix:v,ipV6Prefer:h.ipV6Prefer}),(function(t,e,n){return Ib(h,void 0,void 0,(function(){var r;return Nb(this,(function(u){return r=(new Date).getTime(),this.In.info(Qd+" create session time "+(r-o)),s&&(s.setAttributes({webrtc_sid:e,sdp:w.sdp(n.sdp),gw_nodes:w.gw_nodes(n.gw_nodes),gw_nodes_ttl:w.gw_nodes(n.gw_nodes_ttl),gw_version:w.gw_version(n.gw_version),ip_mode:this.ipV6Prefer}),s.end()),5!==this.df&&this.getSpan(pr,this.kd,"",!0),this.vl!=t?(this.In.error(Wd+" seq is not match."),i(void 0)):i({seq:t,sessionID:e,msg:n,ipv6Prefer:this.ipV6Prefer}),[2]}))}))}),(function(t,i){if(h.vl==i){t===pe&&(h.To=!1);var n=1==t?zb.ke:zb.Re;s&&h.Mn.setError(s,n),h.In.warn(Wd+" create session fail. ".concat(t.code)),e(h.Pd(n))}else h.In.warn(Wd+" seq is not match.")}))};if(this.To){var E=performance.now();null===(c=this.tl)||void 0===c||c.getMiniSdp(t.sdp).then((function(t){h.Wh=performance.now()-E,S(t)})).catch((function(t){h.To=!1,h.Nn.To=!1,h.Wh=performance.now()-E,h.$h=performance.now()-h.tf,h.Xh=1,S()}))}else S()}else{var O=this.getSpan(fr.event,this.kd);this.cf=!1,this.il.createSession(this.vl,{type:1,mode:0,streamID:l,strAuthParam:this.Id||"",serverHost:this.pf,params:_,roomID:g,geo:{type:this.Ro.geo.type,areaList:this.Ro.geo.areaList},transCodecID:d,transCodecSuffix:v,ipV6Prefer:this.ipV6Prefer},(function(t,e,n){return Ib(h,void 0,void 0,(function(){return Nb(this,(function(s){return O&&(O.setAttributes({webrtc_sid:fr.webrtc_sid(e),sdp:w.sdp(n.sdp),is_mini:w.is_mini(this.To),gw_nodes:w.gw_nodes(n.gw_nodes),gw_nodes_ttl:w.gw_nodes(n.gw_nodes_ttl),gw_version:w.gw_version(n.gw_version),ip_mode:this.ipV6Prefer}),O.end()),this.vl!=t?(this.In.error(Qd+" seq is not match."),i(void 0)):i({seq:t,sessionID:e,msg:n,ipv6Prefer:this.ipV6Prefer}),[2]}))}))}),(function(t,i){if(h.vl==i){var n=1==t?zb.ke:zb.Re;O&&h.Mn.setError(O,n),e&&e(h.Pd(n))}else h.In.warn(Qd+" seq is not match.")}))}this.state=1,this.In.info(Qd+" called success"),this.df=1},t.prototype.Sl=function(t){var i="",e=[],n={},s=this.Nn.seiConfig.SEIPass;Ut(s)&&(n.sei_filter_pass=s?1:0),n.auto_switch_turn_type="firefox"===this.Nn.browser?2:1,this.fd===q.L3&&(n.client_class_type=1,!0===this.ld.adaptiveSwitch&&this.ld.adaptiveTemplateIDList&&(n.adaptive_switch=1,n.adaptive_template_id_list=this.ld.adaptiveTemplateIDList.join(","))),Lt(this.ld.streamType)&&(n.video_stream_type=this.ld.streamType),Lt(this.ld.posterType)&&(n.req_poster_type=this.ld.posterType);var r=0,o=this.ld.jitterBufferTarget,u=this.ld.playoutDelayHint;return Lt(o)&&o>0&&o<=4e3?r=o:Lt(u)&&u>0&&u<=4&&(r=1e3*u),Ut(this.ld.enableLowLatency)&&this.ld.enableLowLatency&&(r=2147483647),r>0&&(n.play_jitter_level=r),this.Nn.idName&&e.push("zguid="+this.Nn.idName),t&&e.push("zgrid="+t),this.Ro.isProxy&&(n.zg_proxy=1),n.proto_flags=2,this.Ur("peer_signal_over_dc")&&(n.proto_flags|=256),e.length>0&&(i=e.join("&")),{params:i,paramsExt:n}},t.prototype.getDispatchIPNodeMode=function(){if(!this.pf){this.In.info("zc.p.1.gdinm call");var t=this.Ro.getStreamIPNodesMode(),i=t.ipNodeType;this.ipV6Prefer=t.ipV6Prefer,this.ipNodeType=i,this.ipV6Prefer===_t.IPv6Prefer&&!this.Hh&&this.nl&&(this.ipV6Prefer=_t.IPv4Prefer,this.ipNodeType=It.ZV4Priority),this.In.info("zc.p.1.gdinm ".concat(this.ipV6Prefer," ").concat(this.ipNodeType))}},t.prototype.getRetryIPNodeMode=function(){if(this.In.info("zc.p.1.grinm call"),this.ipV6Prefer===Rt.kV4Only)this.ipNodeType=It.ZV4Only;else{var t=this.Ro.getRetryIPPreferNodeType(),i=t.ipV6Prefer;this.ipNodeType=t.ipNodeType,this.ipV6Prefer=i}this.In.info("zc.p.1.grinm ".concat(this.ipV6Prefer," ").concat(this.ipNodeType))},t.prototype.getRetryIPv6Prefer=function(){this.ipV6Prefer=this.Ro.getIPv6PreferByGwNode(this.gwNode)},t.prototype.checkIfToRestart=function(t){this.jh=!this.isProbe&&(t!==Rt.kV4Only&&(this.ipNodeType===It.ZV6AndV4Priority||this.Nn.selectIPStackMode===_t.IPv4Prefer&&this.Ro.agentIpStackDetection.IPv4===Nt.reachable&&this.ipNodeType===It.ZV6Priority))},t.prototype.getIPStackNode=function(){if(this.gwNode){var t=ql(this.gwNode);this.ipStackNode=El(t)}else this.ipStackNode=[It.ZV4Only,It.ZV4Priority].includes(this.ipNodeType)?kt.IPv4:kt.IPv6},t.prototype.setGwNodes=function(t,i,e,n){var s,r,o;if(this.In.info("".concat(vv," seq: ").concat(n,", gw_nodes: ").concat(JSON.stringify(null==t?void 0:t.gw_nodes),", ips: ").concat(JSON.stringify(t.ips),", ipv6s: ").concat(JSON.stringify(t.ipv6s),", ").concat(e)),this.In.info("".concat(vv," seq: ").concat(n,", retry: ").concat(JSON.stringify(this.retryFailGwNodes),", ips: ").concat(JSON.stringify(this.retryFailIpV4Nodes),", ipv6s: ").concat(JSON.stringify(this.retryFailIpV6Nodes))),0===e){if((null===(s=t.gw_nodes)||void 0===s?void 0:s.length)>0){var u=Hl(t.gw_nodes,this.retryFailGwNodes,i);this.retryFailGwNodes=[],this.handleDispatchedGwNodes(u,t.gw_nodes_ttl,e)}}else{var a=void 0,c=void 0;(null===(r=t.ips)||void 0===r?void 0:r.length)>0&&(a=Gl(t.ips,this.retryFailIpV4Nodes,i),this.retryFailIpV4Nodes=[]),(null===(o=null==t?void 0:t.ipv6s)||void 0===o?void 0:o.length)>0&&(c=Gl(t.ipv6s,this.retryFailIpV6Nodes,i),this.retryFailIpV6Nodes=[]),this.handleDispatchedGwNodes(t.gw_nodes||[],t.gw_nodes_ttl,e,a,c)}},t.prototype.resetGwNodes=function(){this.In.info("zc.p.1.rgn call"),this.pf="",this.gf=[],this.ipV4NodeList=[],this.ipV6NodeList=[],this.bf=0},t.prototype.handleDispatchedGwNodes=function(t,i,e,n,s){var r=this;if(void 0===n&&(n=[]),void 0===s&&(s=[]),this.In.info(mv+" "+JSON.stringify(t)+" "+JSON.stringify(t)+" "+JSON.stringify(n)+" "+JSON.stringify(s)+" ipv6Prefer "+e),Array.isArray(t)&&0!==t.length||0!==n.length||0!==s.length){var o=0===i?60:i,u=function(){r.bf=o?(new Date).getTime()+1e3*o:r.bf};this.gf=t.length>0?t:this.gf,this.ipV4NodeList=n.length>0?n:this.ipV4NodeList,this.ipV6NodeList=s.length>0?s:this.ipV6NodeList,e===Rt.kV4Only?(this.pf=t.length>0?this.gf[0]:this.pf,t.length>0&&u()):e==Rt.kV4AndV6&&n.length>0?(this.pf=Fl(n[0]),this.ipNode=n[0],u()):e===Rt.kV6AndV4&&s.length>0?(this.pf=Fl(s[0]),this.ipNode=s[0],u()):(this.gf.length>0&&(this.pf=this.gf[0]),this.In.info("".concat(mv," ").concat(this.Uo," no gwNode ").concat(e," ").concat(n.length," ").concat(s.length)),this.ipNodeType=It.ZV4Only,this.ipStackNode=kt.IPv4),this.Ro.updateCachedGwNodesList(this.streamId,!1,t||[],o,n,s)}},t.prototype.Tl=function(t,i,e,n){var s,r,o,u=e.turn_server,a=u.split("?")[0]&&u.split("?")[0].slice(5),c=this.signal.kl,h="webrtc://".concat(a,"/").concat(c,"/").concat(this.Uo);this.Mn.spanSetAttributes({key:this.kd,par:this.Uo},{webrtc_sid:e.session_id,url:h}),this.In.info(Qd+" sessionId:"+e.session_id),this.resetPushCmdSeqMap();var f=e.client_ip||e.clientip;f&&(this.Nn.clientIP=f),this.Pf=e.peer_id;var l=0,d=(new Date).getTime();if(this.Hf&&(this.In.info(Wd+" create signal time "+(l=d-this.Hf)),this.signalTime=l),this.Lf=d,0!==e.result){this.In.error(Qd+" create error "+e.result);var v=this.Pd(zb.Re);throw 1021===(null==e?void 0:e.result)&&(v=this.Pd(Ri,!0)),2013===(null==e?void 0:e.result)&&(v=this.Pd(zb.pn,!0)),2016===(null==e?void 0:e.result)&&n===_t.IPv6Prefer&&(this.Hh=!1),1006===(null==e?void 0:e.result)&&(v=this.Pd(zb.gn,!0)),v}this.Yc=e.session_id,this.cf=!0,this.setGwNodes(e,!1,n,t),n===_t.IPv6Prefer&&(null===(s=null==e?void 0:e.ipv6s)||void 0===s?void 0:s.length)>0&&(this.Hh=!0),(null===(r=null==e?void 0:e.ipv4s)||void 0===r?void 0:r.length)>0&&(null===(o=null==e?void 0:e.ipv6s)||void 0===o?void 0:o.length)>0&&this.checkIfToRestart(n),this.In.info(Qd+" "+this.Uo+" isRestartIce "+this.jh)},t.prototype.Ol=function(t,i,e,n){var s,r,o;this.In.info(Wd+" sessionId:"+i),this.resetPushCmdSeqMap();var u=e.client_ip||e.clientip;u&&(this.Nn.clientIP=u),this.Pf=e.peer_id;var a=0,c=(new Date).getTime();if(this.Hf&&(this.In.info(Wd+" create signal time "+(a=c-this.Hf)),this.signalTime=a),this.Lf=c,0!==e.result){if(110===e.result&&(this.To=!1,this.Nn.To=!1,this.$h=performance.now()-this.tf,this.Xh=2),this.In.error(Wd+" create session failed "+e.result),1021===(null==e?void 0:e.result))throw this.Pd(Ri,!0);var h=zb.Re;if(1004===(null==e?void 0:e.result))if(h=Rb(Rb({},this.Nn.isFlutter?se:zb.rn),{message:"Stream not found."}),this.Hd())throw this.Pd(h,!0);if(2013===(null==e?void 0:e.result))throw this.Pd(h=zb.pn,!0);if(2016===(null==e?void 0:e.result)&&n===_t.IPv6Prefer&&(this.Hh=!1),1006===(null==e?void 0:e.result))throw this.Pd(zb.gn,!0);throw this.Pd(h)}this.Yc=i,this.cf=!0,this.In.info(Wd+" create session success "),this.setGwNodes(e,!1,n,t),n===_t.IPv6Prefer&&(null===(s=null==e?void 0:e.ipv6s)||void 0===s?void 0:s.length)>0&&(this.Hh=!0),(null===(r=null==e?void 0:e.ipv4s)||void 0===r?void 0:r.length)>0&&(null===(o=null==e?void 0:e.ipv6s)||void 0===o?void 0:o.length)>0&&this.checkIfToRestart(n),this.In.info(Wd+" "+this.Uo+" isRestartIce "+this.jh),this.ml()},t.prototype.Nl=function(t){var i,e=this;if(this.In.info(pv+" set candidate ".concat(JSON.stringify(t))),t){var n=t.candidate,s=t.sdpMid,r=t.sdpMLineIndex;if(n)this.In.info(pv+" addIceCandidate"),null===(i=this.af)||void 0===i||i.addIceCandidate(new RTCIceCandidate({sdpMid:s,sdpMLineIndex:r,candidate:n})).then((function(){e.In.info(pv+" add can suc")})).catch((function(t){e.In.info(pv+" add can fail, ".concat(t.message))}))}},t.prototype.Al=function(t){if(!(null==t?void 0:t.sdp))throw this.In.warn(Kd+" no content"),this.Pd(ae,!0);var i=t.sdp;this.In.info(Kd+" localSdp1 "+i.substr(0,i.length/2)),this.In.info(Kd+" localSdp2 "+i.substr(i.length/2));var e=(i=(i=i.replace(/sendrecv/g,"recvonly")).replace(/useinbandfec=/,"stereo=1;useinbandfec=")).match(/m=application[\s\S]+datachannel[\s\S]+/),n=e?e[0]:null;if(n){var s=n.replace(/recvonly/,"sendrecv");i=i.replace(n,s)}return i=function(t){var i=t.split("\r\n"),e=new Map;i.forEach((function(t,n){if(/^a=rtcp-fb:/.test(t)&&i[n+1]&&!/^a=rtcp-fb:/.test(i[n+1])){var s=t.match(/^a=rtcp-fb:\d+/);s&&e.set(n+1,s[0]+" rrtr")}}));for(var n=Array.from(e),s=0;s<n.length;s++){var r=Xg([],n[s],!0);i.splice(r[0]+s,0,r[1])}return i.join("\r\n")}(i=Wg(i)),this.ld.videoCodec&&(i=Kf.getSDPByVideDecodeType(i,this.ld.videoCodec)),"firefox"===this.Nn.browser&&Jl(this.Nn.browserInfo,"firefox",139,2)&&(i=Kg(i)),t.sdp=i,t},t.prototype.Ad=function(t){var i;return Ib(this,void 0,void 0,(function(){var e,n;return Nb(this,(function(s){switch(s.label){case 0:this.In.info(Kd+" set local sdp"),(e=this.getSpan(ar,this.kd))&&e.setAttributes({sdp:cr(t.sdp),is_mini:hr(this.To)}),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,null===(i=this.af)||void 0===i?void 0:i.setLocalDescription(t)];case 2:return s.sent(),e&&e.end(),[3,4];case 3:throw n=s.sent(),this.In.error(Kd+" set error "+n.toString()),e&&this.Mn.setError(e,{code:zb.Te.code,message:n.toString()}),this.Pd(zb.Te,!0);case 4:return[2]}}))}))},t.prototype.jd=function(t){return Ib(this,void 0,void 0,(function(){var i,e,n,s,r,o,u,a,c,h=this;return Nb(this,(function(f){switch(f.label){case 0:if(this.In.info($d+" success"),i={paramsExt:this.El},!this.To)return[3,5];e=performance.now(),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this.tl.getMiniSdp(t.sdp)];case 2:return n=f.sent(),this.Wh=performance.now()-e,i.miniSdp=n,[3,4];case 3:return f.sent(),this.To=!1,this.Nn.To=!1,this.Wh=performance.now()-e,this.$h=performance.now()-this.tf,this.Xh=1,i.sdp=t.sdp,[3,4];case 4:return[3,6];case 5:i.sdp=t.sdp,f.label=6;case 6:return this.fd===q.L3&&(i.min_play_buf_level_ms=500),this.Gd=N(),s=this.getSpan(gr,this.kd),this.state=2,[4,new Xt((function(t,e){h.il.sendMediaDesc(h.Gd,h.Yc,0,i,(function(i,e,n){t({seq:i,sessionId:e,data:n})}),(function(t,i){h.In.error($d+" failed to send "+t),s&&h.Mn.setError(s,{code:zb.ze.code,message:t.toString()}),h.Gd==i&&e(h.Pd(zb.ze))}))}))];case 7:return r=f.sent(),o=r.seq,u=r.sessionId,a=r.data,this.In.info($d+" sendMediaDesc resp"),s&&(s.setAttributes({webrtc_sid:br(u),sdp:i.sdp}),s.end()),this.Gd!=o?(this.In.error($d+" seq or sessionId is not equal "+this.Gd+" "+o),[2,!1]):(this.In.info($d+" send success stateNego:waiterAnswer"),this.df=2,this.state=3,[4,this.parseRemoteMiniSdp(a)]);case 8:if(c=f.sent()){if(this.Ll(c))throw this.Pd(be);return[2,c]}throw this.Pd(zb.ze)}}))}))},Object.defineProperty(t.prototype,"turnToTcp",{get:function(){return this.Yf},enumerable:!1,configurable:!0}),t.prototype.checkAutoTcp=function(){var t=Ao();this.In.info("zc.p.1.cat ".concat(t," ").concat(this.Df)),this.Ff=!(!t||!this.Df)},t.prototype.Md=function(t,i){var e,n;return void 0===i&&(i=!1),Ib(this,void 0,void 0,(function(){var s,r,o,u,a,c,h,f,l,d,v,m,p,g,b,_,y,w,S,E,O=this;return Nb(this,(function(T){switch(T.label){case 0:if(s={type:"answer",sdp:t,toJSON:function(){}},r=this.getSpan(lr,this.kd),this.setTurnTcp(),this.Ro.autoSwitchProtocol=this.Ur("auto_to_tcp")||!1,o=this.Ur("udp_max_fail_num"),!isNaN(o)&&(this.Ro.maxUdpFailNum=o),c=(u=this.Ro).maxUdpFailNum,h=u.udpFailNum,this.In.info(tv+"  autoToTcp: ".concat(a=u.autoSwitchProtocol,", udpFailNum: ").concat(h,", maxUdpFailNum: ").concat(c,".")),a&&!this.Yf&&h>=c&&(this.In.info(tv+" switch to tcp."),this.Yf=!0,this.Ff=!1),(f=this.Ur("udp_or_tcp",!0))&&(this.In.info(tv+" setting udp_or_tcp "+f),this.Yf="tcp"===f),this.Yf&&!this.Ro.isProxy&&"firefox"!==this.Nn.browser&&(null===(e=s.sdp.match(/candidate.*/g))||void 0===e||e.forEach((function(t){var i=t.replace(/udp/,"tcp");i.includes(" tcptype ")||(i=i.replace(" typ host "," typ host tcptype passive ")),s.sdp=s.sdp.replace(t,i)}))),this.Ro.isProxy)if(l=tv,v=Ml(d=s.sdp),m=v[0],p=v[1],g=d.match(/a=mid:[^(\n|\r)]+/g),p&&g)if(this.Zf.intranet)setTimeout((function(){p.forEach((function(t,i){var e,n={sdpMLineIndex:i,candidate:t.replace(m[i].ip,O.Zf.wanIP).replace("a=",""),sdpMid:g[i].replace("a=mid:","")};O.In.info(l+"  add wan candidate:"+JSON.stringify(n)),null===(e=O.af)||void 0===e||e.addIceCandidate(new RTCIceCandidate(n))}))}),1e3);else for(this.In.info(l+"  change candidate ip from lan to wan: "+(b=this.Zf.wanIP)),_=0;_<p.length;_++)w=(y=p[_]).replace(m[_].ip,b),s.sdp=d.replace(y,w);else this.In.warn(l+" candidate not found");else s.sdp=this.extractCandidate(s.sdp);this.In.info(tv+" remoteSdp "+s.sdp),r&&r.setAttributes({sdp:dr(s.sdp),webrtc_sid:mr(this.Yc),is_mini:vr(this.To)}),this.state=4,i&&t.indexOf("candidate")>-1&&(this.ql(this.if),this.if=[],this.state=5),this.startTime=Date.now(),this.checkRetryOtherIPCandidate(),this.In.info(tv+" call success"),this.ul=s.sdp,T.label=1;case 1:return T.trys.push([1,3,,4]),[4,null===(n=this.af)||void 0===n?void 0:n.setRemoteDescription(new RTCSessionDescription(s))];case 2:return T.sent(),r&&r.end(),this.In.info(tv+" set success"),[3,4];case 3:throw S=T.sent(),this.In.error(tv+" set remote error "+S.toString()),r&&(r.setAttributes({error:zb.Ie.code,message:S.toString()}),r.end()),E=!0,this.To&&(E=!1,this.To=!1,this.$h=performance.now()-this.tf,this.Xh=4),this.Pd(zb.Ie,E);case 4:return[2]}}))}))},t.prototype.checkRetryOtherIPCandidate=function(){var t=this;this.ll=setTimeout((function(){t.In.info("".concat("zc.p.1.croic"," ").concat(t.Uo," check ").concat(t.state," ").concat(t.ipNodeType," ").concat(t.qh.length)),6!==t.state&&t.jh&&t.qh.length>0&&(t.ipStackNode=t.ipStackNode===kt.IPv4?kt.IPv6:kt.IPv4,t.restartIce())}),this.Vh)},t.prototype.extractCandidate=function(t){var i=this,e=Ml(t),n=e[0];return e[1].forEach((function(e,s){var r=n[s].ip,o=El(r);if(i.ipStackNode!==o){var u={sdpMLineIndex:parseInt(n[s].mid),candidate:e.replace("a=",""),sdpMid:n[s].mid};i.qh.push(u),t=t.replace(e+"\n","")}if(o===kt.IPv4){var a=nd(r),c=e.replace(new RegExp(r,"g"),a).replace("a=",""),h={sdpMLineIndex:parseInt(n[s].mid),candidate:c,sdpMid:n[s].mid};i.Uh.find((function(t){return t.candidate===h.candidate&&t.sdpMLineIndex===h.sdpMLineIndex&&t.sdpMid===h.sdpMid}))||i.Uh.push(h)}})),t},t.prototype.Dd=function(t,i){var e,n,s=this;if(this.In.info(gv+" preset turn "+"".concat(JSON.stringify(i))),i){var r=i.turn_username,o=i.turn_auth_key,u=i.turn_urls;this.Bh=r,this.Jh=o;var a=void 0;if(u){var c=u.split(";"),h=[];c.forEach((function(t){var i=Ol(t).replace("[","").replace("]",""),e=El(i);if(s.ipStackNode===e?h.push(t):s.Lh.push(t),e==kt.IPv4){var n=nd(i),r=t.replace(i,"[".concat(n,"]"));s.Ro.isCandidateHasIPv6&&h.push(r)}})),(e=this.Lh).push.apply(e,h),a=h}else{var f=xl(t);if(0===f.length)return this.In.info(gv+" "+this.Uo+" no candidate"),!1;a=f}var l={iceTransportPolicy:"all",rtcpMuxPolicy:"require",iceServers:[{urls:a,username:r,credential:o}],encodedInsertableStreams:this.Vf.isSEIStart};try{null===(n=this.af)||void 0===n||n.setConfiguration(l)}catch(t){this.In.info(gv+" preset turn "+t)}}return!0},t.prototype.sendRestartIce=function(t,i){var e=this;this.In.info("zc.p.1.srsi call: "+t+" "+i),this.il.sendRestartIce(t,i).then((function(t){e.In.info("zc.p.1.srsi result "+JSON.stringify(t))})).catch((function(t){e.In.warn("zc.p.1.srsi fail: "+JSON.stringify(t))}))},t.prototype.Fd=function(t,i,e){if(this.In.info("zc.p.orpe.1 received "+e.event),!this.isProbe){var n=this.Mn.createSpan(a.H,{key:Cb,par:this.Uo},{key:""},Zs);n.setAttributes({event_state:Qs(e.event),webrtc_sid:i}),n.end()}(this.Ed.first||t>this.Ed.seq)&&this.onPlayBFrameEvent(!1),0===e.event?this.onPlayStreamEnd(!1):1===e.event&&this.onPlayStreamEnd(!0)},t.prototype.yl=function(t,i,e){var n=e.clientip||e.client_ip;this.Nn.clientIP!==n&&this.In.info("zc.p.orci.1.1 client ip changed "+this.Nn.clientIP+" "+n),this.Nn.clientIP=n,this.Pf=e.peer_id,this.il.peerId=e.peer_id,this.qf=n,this.Nn.isMultiOuter=this.isMultiOuter(),this.onGetIP(),this.isProbe&&5==this.df&&this.il.sendNetProbeReq((function(){}),(function(){})),this.md=!0},t.prototype.onGetIP=function(){},t.prototype.Yd=function(t,i,e){var n=0,s=e.lossrate,r=e.rtt;(this.Pf!==e.peer_id&&!this.isProbeByDG||Bt(s)||Bt(r))&&(this.In.info("zc.p.1.nqi local peerID:"+this.Pf+" remote peerID:"+e.peer_id+" lossrate:"+s+" rtt:"+r),n=1),this.onRecvNetQuality&&this.onRecvNetQuality(n,s,r)},t.prototype.Zd=function(t,i,e){this.In.info("zc.s.nqga call: "+i),this.onRecvNetQualityGrade&&this.onRecvNetQualityGrade(e)},t.prototype.Ld=function(t){var i,e=this;if(this.In.info(iv+" called"),null!=t.candidate){if(this.In.info(iv+" candidate "+t.candidate.candidate+" state "+this.state+" autotcp "+this.Ff),t.candidate.candidate)El(null===(i=t.candidate.candidate.split(" "))||void 0===i?void 0:i[4])===kt.IPv6&&(this.Ff&&(this.In.info("".concat(iv," can len ").concat(this.Uh.length)),this.Uh.forEach((function(t){var i;null===(i=e.af)||void 0===i||i.addIceCandidate(new RTCIceCandidate(t)).then((function(){e.In.info("".concat(iv," add can suc"))})).catch((function(t){e.In.info("".concat(iv," add can fail, ").concat(t.message))}))}))),this.Ro.isCandidateHasIPv6=!0);var n=function(t){e.ql([{candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex}])};this.Ff?n(t):this.state<5||7==this.state?(this.In.info(iv+" cached"),this.if.push({candidate:t.candidate.candidate,sdpMid:t.candidate.sdpMid,sdpMLineIndex:t.candidate.sdpMLineIndex})):(this.In.info(iv+" send"),n(t))}},t.prototype.qd=function(t){this.In.info("zc.p.ocsc.1 called "+t.target.signalingState),7!=this.state&&null!=this.af&&"closed"===t.target.signalingState&&(this.df=7,this.Qd(this.af.iceConnectionState))},t.prototype.Ud=function(t){var i=this;if(7!=this.state&&null!=this.af){this.In.info(ev+" stateChanged "+this.af.iceConnectionState);var e=this.getSpan($s,this.kd,this.playingEvent);if(e&&e.setAttributes({ice_state:tr(this.af.iceConnectionState)}),"connected"===this.af.iceConnectionState){if(this.df=5,this.isProbe&&this.Df&&(this.md||this.isProbeByDG))return this.il.sendNetProbeReq((function(){}),(function(){})),void this.onCanStopNegaTimer();if(this.onCanStopNegaTimer(),null!=this.fl&&(clearTimeout(this.fl),this.fl=null),!this.isProbe&&this.Hf){var n=(new Date).getTime()-this.Hf;this.ol.setAttributes({play_begin_time:Db.play_begin_time(n)}),this.Hf=0}if(this.Mn.spanEnd({key:pr,par:this.Uo},{webrtc_sid:this.Yc}),this.Lf){var s=(new Date).getTime()-this.Lf;this.In.info(ev+" ice time "+s)}this.isProbe||6==this.state||(this.onPlayStateUpdate&&this.onPlayStateUpdate(X,this.Uo,{code:0,message:""},!0),this.getRemoteStreamSuc&&(this.getRemoteStreamSuc(this.ld.resourceMode==U.DG?null:this.playStream),this.getRemoteStreamSuc=null)),this.state=6,this.resetIceInfos(),this.resetNat64Infos();var r=(new Date).getTime()-this.Lf;this.onIceConnected&&this.onIceConnected(this.sessionId,r),this.In.info(ev+" stateNego:iceConnected"),this.Yf||(this.Ro.udpFailNum=0)}else if("closed"===this.af.iceConnectionState)null==e||e.end(),this.df=7,this.Qd(this.af.iceConnectionState);else if("failed"===this.af.iceConnectionState)null==e||e.end(),this.df=8,this.Qd(this.af.iceConnectionState);else if("disconnected"===this.af.iceConnectionState){null==e||e.end(),this.df=6,this.In.warn(ev+" ice disconnected");var o=this.Ro.lastChangeIpTime;o&&Date.now()-o<15e3?this.onPlayStateUpdateError(zb.Ne):this.fl||(this.fl=setTimeout((function(){i.Qd("disconnected")}),15e3))}}},t.prototype.Bd=function(t){var i,e;this.In.info("zc.p.opcsc.1 connectionChanged "+(null===(i=this.af)||void 0===i?void 0:i.connectionState)),"connected"===(null===(e=this.af)||void 0===e?void 0:e.connectionState)&&this.onPeerConnected&&this.onPeerConnected(this.sessionId,(new Date).getTime()-this.Lf)},t.prototype.Qd=function(t){this.In.info(ev+"  state "+this.state+" connectionState "+t),this.onPlayStateUpdateError(zb.Ne)},t.prototype.close=function(t){this.In.info(nv+" close peer, reason: "+t),this.state=7,this.dd=!1,this.md=!1,this.closeSession(t),null!=this.af&&(this.af.close(),this.af=null),this.ul&&(this.ul=null),this.al&&(this.al=null),this.resetIceInfos(),this.resetNat64Infos(),this.qf="",this.Wf=void 0;var i=this.seiWorker;i&&i.removeEventListener("message",this.Fo.seiMessage),this.onCanStopNegaTimer(),null!=this.fl&&(clearTimeout(this.fl),this.fl=null),this.ll&&(clearTimeout(this.ll),this.ll=null),this.stopVideocTimer(),this.Xd(),this.il.reset(),this.vl=0,this.Gd=0,this.Ed.first=!0},t.prototype.stopPlay=function(){this.retryFailGwNodes=[],this.retryFailIpV4Nodes=[],this.retryFailIpV6Nodes=[]},t.prototype.bl=function(t,i,e){this.In.info(uv+" received ");var n=this.getSpan(Ks,this.playingEvent);if(n&&n.end(),i==this.Yc){var s={code:zb.an.code,message:"server session reset "+e.reason};this.onCanStopNegaTimer(),this.onPlayStateUpdateError(s)}else this.In.info(uv+" cannot find session")},t.prototype.pl=function(t,i,e){this.In.info(av+" "+JSON.stringify(e)),this.Mn.spanSetAttributes({key:this.playingEvent,par:this.Uo},{denied_info:jn.denied_info(e.err_info),stop_reason:jn.stop_reason("DenyStop")});var n=e.err_info?JSON.parse(e.err_info.toLowerCase()):{},s=n.action?n.action:null,r=1*e.reason,o=!([4,8,10,11,12,14,24,26,27,28,32].includes(r)||[2,3,4,5,6].includes(s));1004===(null==n?void 0:n.err)&&(this.Hd()&&(o=!0));var u=Rb({},o&&1004===(null==n?void 0:n.err)?this.Nn.isFlutter?le:zb.rn:o?fe:zb.an);1011===(null==n?void 0:n.err)&&(u=Rb({},ve)),u.message+=" reason:".concat(r," ").concat(s?" action:"+s:""," ").concat((null==n?void 0:n.err)?" err:"+(null==n?void 0:n.err):""),u.message+=";".concat(kg(r,s,null==n?void 0:n.err)),this.onCanStopNegaTimer();var a=!1;if(!this.Yf){if([8,10].includes(r)||[18,15].includes(r)&&2===s&&[3001,3002].includes(n.err)){this.Ro.udpFailNum++;var c=this.Ro;c.autoSwitchProtocol&&c.udpFailNum>=c.maxUdpFailNum&&(this.Df=!1,this.Ro.setIsPeer(!1),a=!0)}else this.Yf||(this.Ro.udpFailNum=0);var h=this.Ro.isNodeLast(this).lastTryNext,f=[3001,3002,3003,3004,3005,3006,3007,3008].includes(n.err);h&&f&&(this.In.info(av+" switch tcp by all fail"),this.Nn.turnToTcp=!0,this.Ff=!1,this.Df=!1,this.Ro.setIsPeer(!1))}this.onPlayStateUpdateError(u,o,n,a)},t.prototype.Hd=function(){var t=Date.now(),i=this.Nn.streamRetryTime,e=this.bd;if(e){if(t-e>1e3*i)return this.bd=0,this.In.info("zc.p.ctest.1 "+" stream not found. retry over time: ".concat(i,"s")),!0}else this.bd=t;return!1},t.prototype.Wd=function(t,i,e){void 0===e&&(e=!1),this.onRecvStreamStatus&&this.onRecvStreamStatus(i.camera_status,i.mic_status,e),this.In.info(cv+" call success")},t.prototype.Jd=function(t,i){this.In.info(hv+" called "+t),t?(this.Kd(i),this.Vf.isSEIStart&&Po()&&("video"===i.track.kind?this.$d(i):"audio"===i.track.kind&&this.tv(i)),this.onRecvRemoteStream&&this.onRecvRemoteStream(t),this.remoteStream=t,this.getVideoCodec(),this.vd&&this.Wd(this.ev,this.nv,!0)):this.In.warn(hv+" remote stream is empty")},t.prototype.Kd=function(t){var i,e=0,n=0,s=this.ld.jitterBufferTarget,r=this.ld.playoutDelayHint;if(Lt(s)&&s>0&&s<=4e3?(n=s,e=s/1e3):Lt(r)&&r>0&&r<=4&&(n=1e3*e,e=r),Ut(this.ld.enableLowLatency)&&this.ld.enableLowLatency&&(e=0,n=0),n>0&&t)try{var o=null===(i=null==t?void 0:t.track)||void 0===i?void 0:i.kind;this.In.info(hv+" ".concat(o," playoutDelayHint: ").concat(n,", origin delay: ").concat(t.playoutDelayHint," | ").concat(t.jitterBufferTarget)),t.playoutDelayHint=e,t.jitterBufferTarget=n,this.In.info(hv+" ".concat(o," playoutDelayHint result: ").concat(t.playoutDelayHint," | ").concat(t.jitterBufferTarget))}catch(t){this.In.warn(hv+" set playoutDelayHint failed. ".concat(t))}},t.prototype.$d=function(t){var i=this.createSEIWorker();i&&i.addEventListener("message",this.Fo.seiMessage);var e=this.Vf,n={cmd:"decode",streamID:this.Uo,emulationPreventionByte:this.Nn.seiConfig.emulationPreventionByte,codec:this.pd,unregisterSeiFilter:e.unregisterSeiFilter,filterSize:e.filterSize};if(window.RTCRtpScriptTransform)t.transform=new RTCRtpScriptTransform(i,n);else{var s=t.createEncodedStreams(),r=s.readable,o=s.writable,u=!i;try{i&&i.postMessage(Rb({readable:r,writable:o},n),[r,o])}catch(t){u=!0}if(u){this.In.warn("zc.cvrt The current browser version is too low.");var a=new TransformStream({transform:this.decodeVideoFrame});this.receiverStreams=s,r.pipeThrough(a).pipeTo(o),this.Ro.handleSeiRollBack()}}},t.prototype.tv=function(t){var i={cmd:"decode",streamID:this.Uo,kind:"audio"},e=this.createSEIWorker();if(window.RTCRtpScriptTransform)t.transform=new RTCRtpScriptTransform(e,i);else{var n=t.createEncodedStreams(),s=n.readable,r=n.writable,o=!e;try{e&&e.postMessage(Rb({readable:s,writable:r},i),[s,r])}catch(t){o=!0}if(o){this.In.warn("zc.cart The current browser version is too low.");var u=new TransformStream({transform:this.decodeAudioFrame});s.pipeThrough(u).pipeTo(r),this.Ro.handleSeiRollBack()}}},t.prototype.ql=function(t){var i=this;if(this.In.info(fv+" called"),!(t=t.filter((function(t){return!!(t&&t.candidate.indexOf("relay")>0)})))||t.length<1)this.In.info(fv+" cancelled");else{var e=this.getSpan(_r,this.kd);e&&e.setAttributes({candidate_info:yr(t)}),5!==this.df&&(this.df=4),this.In.info(fv+" stateNego:sendCandidate"),this.il.sendCandidateInfo(t,(function(t,n,s){i.In.debug(fv+" send success"),e&&e.end()}),(function(t,n){i.In.error(fv+" failed to send: "+t.toString()),e&&i.Mn.setError(e,{code:zb.De.code,message:t.toString()}),i.onPlayStateUpdateError(zb.De)}))}},t.prototype.resetPushCmdSeqMap=function(){var t;this.Gf=((t={}).StreamStatusNotifyPush={seq:-1,time:0},t.PlayEventPush={seq:-1,time:0},t.ClientInfoPush={seq:-1,time:0},t.NetQualityInfoPush={seq:-1,time:0},t)},t.prototype.Pd=function(t,i,e,n){return{playError:1,error:t,stopRetry:i,detail:e,startFromFirst:n}},t.prototype.onPlayQualityUpdate=function(t,i){},t.prototype.getCameraMicStatus=function(t){return 0==t?"OPEN":"MUTE"},t.prototype.onReceivedDataChannel=function(t){switch(new Uint8Array(t.data,0,1)[0]){case Rg.Signal:this.il.onDataChannelMessage(t.data);break;case Rg.UserData:this.onUserData(t.data)}},t.prototype.onUserData=function(t){var i,e,n=this,s=new Uint8Array(t,0,10),r=t.byteLength-10,o=new Uint8Array(t,10,r),u=s[1],a=s[2]<<8|s[3],c=s[4]<<8|s[5],h=(new Date).getTime();if(this._d.yd&&(this._d.wd[0]=a==c?a:c,this._d.yd=!1),this._d.Sd.push({sn:a,sn0:c,recv_ts:h,flags:u,payload_len:r,payloadArray:o}),this._d.Sd.sort(this.compareShort),a==this._d.wd[0]){var f=this._d.Sd.filter((function(t){return t.sn0==c}));if(f.sort(this.compareShort),null!=f.find((function(t){return 1&t.flags}))&&f.length==this.compareShort(a,c)+1){for(var l=0,d=new ArrayBuffer(65536),v=0;v<f.length;v++){new Uint8Array(d).set(f[v].payloadArray,l),l+=f[v].payload_len}null===(i=this.onDataChannelList)||void 0===i||i.forEach((function(t){t(d,l,n.Uo)})),this._d.Sd=[],this._d.yd=!0}this._d.wd[0]++}else for(var m=function(){var t=p._d.Sd.filter((function(t){return t.sn0==n._d.Sd[0].sn0}));if(t.sort(p.compareShort),null!=t.find((function(t){return 1&t.flags}))&&t.length==p.compareShort(t[t.length-1].sn,t[0].sn0)+1){for(var i=0,s=new ArrayBuffer(65536),r=0;r<t.length;r++){new Uint8Array(s).set(t[r].payloadArray,i),i+=t[r].payload_len}p._d.wd[0]=t[0].sn0+t.length,null===(e=p.onDataChannelList)||void 0===e||e.forEach((function(t){t(s,i,n.Uo)})),p._d.Sd=[],p._d.yd=!0}else if(h-t[0].ts<4e3){var o=t[0].sn0;for(r=0;r<t.length&&o==t[r].sn;r++)o++;return p._d.wd[0]=o,"break"}for(r=0;r<t.length;r++)p._d.Sd.shift()},p=this;this._d.Sd.length>0;){if("break"===m())break}},t.prototype.compareShort=function(t,i){var e=new Uint16Array(1);e[0]=t-i;var n=new Int16Array(1);return n[0]=e[0],n[0]},t.prototype.getVideoCodec=function(){var t=this;this.af&&(this.af.getStats().then((function(i){i.forEach((function(e){if("inbound-rtp"===e.type&&"video"===e.kind&&e.codecId){var n=i.get(e.codecId).mimeType.toLowerCase();if(n.indexOf("h264")>-1)t.pd="H264";else if(n.indexOf("vp8")>-1){t.pd="VP8",t.Vf.isSEIStart&&t.In.error("zc.p.gvc video code VP8 is not support SEI");var s=t.seiWorker;s&&s.postMessage({cmd:"updatePlayer",codec:t.pd,streamID:t.Uo})}}}))})),this.gd++,this.pd||this.gd>=5)?this.stopVideocTimer():this.sv=setTimeout((function(){t.getVideoCodec()}),100)},t.prototype.stopVideocTimer=function(){this.sv&&(clearTimeout(this.sv),this.sv=null)},t.prototype.isMultiOuter=function(){return!(!this.Nn.accessClientIp||!this.qf||this.Nn.accessClientIp===this.qf)},t.prototype.getSpan=function(t,i,e,n){if(void 0===n&&(n=!1),this.isProbe)return null;var s=mi(this.Mn,a.H,this.Uo,t,i,e,n);return s.setAttribute("is_mini",this.To),s},t.prototype.setTurnTcp=function(){this.Yf=this.Nn.turnToTcp,void 0!==this.Nn.turnOverTcpOnly&&(this.Yf=this.Nn.turnOverTcpOnly)},t.prototype.ml=function(){var t=this,i=performance.now();this.il.registerPushCallback("CloseSessionPush",(function(e,n,s){if(i){var r=(performance.now()-i).toFixed(0);i=void 0,t.In.info(av+" ".concat(t.Uo,", cmd: CloseSessionPush, cost_time: ").concat(r))}32===s.reason&&(t.To=!1,t.Nn.To=!1,t.$h=performance.now()-t.tf),t.pl(e,n,s)})),this.il.registerPushCallback("SessionResetPush",(function(i,e,n){t.bl(i,e,n)})),this.il.registerPushCallback("StreamStatusNotifyPush",(function(i,e,n){t.Wd(i,n)})),this.il.registerPushCallback("PlayEventPush",(function(i,e,n){t.Fd(i,e,n)})),this.il.registerPushCallback("ClientInfoPush",(function(i,e,n){t.yl(i,e,n)})),this.il.registerPushCallback("NetQualityInfoPush",(function(i,e,n){t.Yd(i,e,n)})),this.il.registerPushCallback("net_quality_grade_push",(function(i,e,n){t.Zd(i,e,n)})),this.il.registerPushCallback("codec_error_notify",(function(i,e,n){t.rv(i,n.media_type,n.error_type)})),this.il.registerPushCallback("play_net_stat_notify",(function(i,e,n){t.onGwPlayNetState({audioTXBitrate:n.audio_tx_bitrate,videoTXBitrate:n.video_tx_bitrate,videoRedRate:n.video_red_rate,trafficControlStat:n.traffic_control_stat,trafficControlBW:n.traffic_control_bandwidth})}))},t.prototype.Xd=function(){this.il.unregisterPushCallback("CloseSessionPush"),this.il.unregisterPushCallback("SessionResetPush"),this.il.unregisterPushCallback("PlayEventPush"),this.il.unregisterPushCallback("ClientInfoPush"),this.il.unregisterPushCallback("NetQualityInfoPush"),this.il.unregisterPushCallback("StreamStatusNotifyPush")},t.prototype.rv=function(t,i,e){if(0!==e){var n=i?"video":"audio";this.In.warn(bv+" ".concat(this.Uo," ").concat(n," codec error: ").concat(e,",  codec: ").concat(this.pd)),1===e?(this.In.warn(bv+" ".concat(this.Uo," remove ").concat(n," track.")),this.isProbe||6!==this.state||this.onPlayStateUpdate&&this.onPlayStateUpdate(X,this.Uo,{code:Bi.code,message:"browser dose not support current ".concat(n," codec")},!0)):3===e&&((this.Ed.first||t>this.Ed.seq)&&(this.Ed.first=!1,this.Ed.seq=t),this.onPlayBFrameEvent&&this.onPlayBFrameEvent(!0),this.onPlayStateUpdate&&this.onPlayStateUpdate(X,this.Uo,{code:Vi,message:"B-frame is detected in the bitstream"},!0))}},t.prototype.sendBroadcasterStatus=function(t){this.il.sendBroadcasterStatus(t)},t.prototype.ActivatePlayAudioStream=function(t,i,e){this.il.ActivatePlayAudioStream(t,i,e)},t.prototype.ActivatePlayVideoStream=function(t,i,e){this.il.ActivatePlayVideoStream(t,i,e)},t.prototype.sendPlayStats=function(t){return this.il.sendPlayStats(t)},Object.defineProperty(t.prototype,"gwVersion",{get:function(){return this.il.gwVersion},enumerable:!1,configurable:!0}),t.prototype.getP2PNetStats=function(t,i){this.il.getP2PNetStats(t,i)},t.prototype.closeSession=function(t){var i,e;null===(i=this.sl)||void 0===i||i.off("uaConnected",this.Fo.onUaSocketConnected),this.resetPushCmdSeqMap(),this.cf&&(this.il.sendCloseSession(t),null===(e=this.sl)||void 0===e||e.removeSession(this.Yc),this.cf=!1)},t.prototype.dispatchGwNodes=function(t,i,e){var n,s,r,o=this.Uo;1==this.Ro.testEnvironment&&(o="zegotest-"+this.Ro.appid+"-"+this.Uo);var u=t;u===_t.IPv6Prefer&&!this.Hh&&this.nl&&(u=_t.IPv4Prefer);var a,c,h=(this.Nn.appConfig||{}).media_config;1===(null===(n=null==h?void 0:h.play_config)||void 0===n?void 0:n.enable_codec_template)&&void 0!==(null===(s=this.ld)||void 0===s?void 0:s.codecTemplateID)&&(o+=c=bi(this.ld.codecTemplateID,null===(r=h.play_config)||void 0===r?void 0:r.codec_template_postfix_pattern),a=this.ld.codecTemplateID),this.il.dispatchGwNodes({type:1,streamID:o,transCodecID:a,transCodecSuffix:c,geo:{type:this.Ro.geo.type,areaList:this.Ro.geo.areaList},ipV6Prefer:u},(function(t,e,n){sd(n),i&&i(n)}),(function(t,i){e&&e(t)}))},t.prototype.parseRemoteMiniSdp=function(t){return Ib(this,void 0,void 0,(function(){var i,e;return Nb(this,(function(n){switch(n.label){case 0:if(!(this.To&&Ft(t.mini_sdp)&&t.mini_sdp.byteLength>0))return[3,5];e=performance.now(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.tl.parseMiniSdp(t.mini_sdp)];case 2:return i=n.sent(),this.Kh=performance.now()-e,[3,4];case 3:throw n.sent(),this.To=!1,this.Nn.To=!1,this.Kh=performance.now()-e,this.$h=performance.now()-this.tf,this.Xh=3,this.Pd(en);case 4:return[3,6];case 5:qt(null==t?void 0:t.sdp)&&(null==t?void 0:t.sdp)&&(i=t.sdp),n.label=6;case 6:return[2,i]}}))}))},t.prototype.reportMiniSdpInfos=function(t){var i={};(this.To||this.Xh)&&(i.mini_error=this.Xh,i.code_sdp_consume=+this.Wh.toFixed(0),i.decode_sdp_consume=+this.Kh.toFixed(0),this.Xh=0,this.Wh=0,this.Kh=0),this.Mn.spanSetAttributes({key:t,par:this.Uo},Rb({},i))},t.prototype.resetMiniReportInfos=function(){this.$h=0,this.tf=0},t.prototype.setPlayStreamVideoType=function(t){return Ib(this,void 0,void 0,(function(){return Nb(this,(function(i){return[2,this.il.subscribeVideoStream(t)]}))}))},t}(),jb=An,Lb=Pn.event,qb=function(){function t(t,i,e,n,s){var r=this;this.Jl=t,this.Mn=e,this.Ro=n,this.Nn=s,this.ov=0,this.cdnPlayTime=0,this.state=7,this.sendTransCodecCmd=function(t,i){if(void 0===t&&(t=0),i=i||r.uv){var e=i.streamID,n=i.playAddr,s=i.codecTemplateID,o=i.codecSuffix;r.uv=i;var u=r.Jl.room.streamHandler.notifySdkNeedStream(e,{playAddr:n,transCodecID:s,transCodecSuffix:o,retry:t},(function(t,i){r.In.info("zsc.pc.1 notify trans codec success"),r.av=Date.now()}),(function(n,s){if(r.In.error("zsc.pc.1 notify trans codec err:"+n.code+" "+n.message),2===(null==s?void 0:s.action))return r.cv||(r.cv=setTimeout((function(){r.cv=void 0,r.sendTransCodecCmd(t+1,i)}),s.action_delay)),void r.Ro.onPlayStateUpdate(K,e,{code:n.code,message:n.message},{isCDN:!0});r.Ro.onPlayStateUpdate(W,e,se,{isCDN:!0})}));r.hv=u}},this.In=mm(i,this.streamID)}return Object.defineProperty(t.prototype,"zegoExpressPlayer",{get:function(){return this.fv(this.cdnPlayer)?this.cdnPlayer:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zegoCdnPlayer",{get:function(){return this.fv(this.cdnPlayer)?void 0:this.cdnPlayer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"streamID",{get:function(){return this.Jl.streamId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lv",{get:function(){return this.Jl.playMode==q.CDN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hd",{get:function(){return this.Jl.hd},enumerable:!1,configurable:!0}),t.prototype.playCDN=function(t,i){var e,n,s,r,o,u,c=this;this.setCdnState(0);var h=this.streamID,f=this.Jl,l=f.playOption;f.Ca&&(null===(e=f.Ca)||void 0===e||e.end()),f.Ca=mi(this.Mn,a.H,h,f.playStartEvent,Lb,void 0,!0);var d=function(t,e){var n;f.Ca&&(pi(f.Ca,{url:jb.url(c.cdnUrl),ip:jb.ip(f.ip),source_type:jb.source_type(f.playMode),net_protocol:jb.net_protocol("tcp"),tryidx:jb.tryidx(f.tryidx)}),f.Ca=void 0),null===(n=c.hd)||void 0===n||n.setAttributes({stop_reason:ks(t)}),i&&i(e)},v=this.cdnPlayer,m=this.fv(v);if(!m&&!l.CDNVideo)return this.In.error("zsc.pc.1 cdn video no found"),d("cdn video no found",re),!1;var p=null===(n=this.Ro.getPlayRoom(h))||void 0===n?void 0:n.streamList.find((function(t){return t.stream_id==h})),g=f.playOption.resourceMode;f.tryidx++,null===(s=this.hd)||void 0===s||s.setAttributes({tryidx:Is(f.tryidx),biz_product:Ns(g==U.DG?1:0)});var b=(this.Nn.appConfig||{}).media_config,_=1===(null===(r=null==b?void 0:b.play_config)||void 0===r?void 0:r.enable_codec_template)&&void 0!==(null==l?void 0:l.codecTemplateID),y=h,w="";_&&(y+=w=bi(l.codecTemplateID,null===(o=b.play_config)||void 0===o?void 0:o.codec_template_postfix_pattern));var S=p||{},E=S.urls_flv,O=S.urls_m3u8;if(!p||!E||!O){if(!this.Nn.appConfig)return this.In.error("zsc.pss.1 stream info no found"),d("stream info no found",oe),!1;var T=this.dv(h),k=T.flv,R=T.hls;E=k?[k]:[],O=R?[R]:[]}if(!f||!v)return d("no cdn player",re),!1;f.useResourceTypes.push(q.CDN),f.useResourceTypes=Array.from(new Set(f.useResourceTypes));var I=E,N=O,C=this.selectCDNSource(v,I,N);if(!C&&!this.cdnUrl)return this.In.error("zsc.pc.1 can not find cdn urls"),d("cdn protocol not support.",oe),!1;this.cdnUrl=C||this.cdnUrl;var z=this.cdnUrl;if(_){z=null==z?void 0:z.replace(h,y);var D=((null===(u=this.cdnUrl)||void 0===u?void 0:u.endsWith(".m3u8"))?N:I)[0].split(h)[0];this.sendTransCodecCmd(0,{streamID:h,playAddr:D,codecTemplateID:l.codecTemplateID,codecSuffix:w})}return!!this.lv&&(f.Ca&&(pi(f.Ca,{url:jb.url(this.cdnUrl),ip:jb.ip(f.ip),source_type:jb.source_type(f.playMode),net_protocol:jb.net_protocol("tcp"),tryidx:jb.tryidx(f.tryidx)}),f.Ca=void 0),this.Ro.onPlayStateUpdate(X,h,{code:0,message:"success"},{isCDN:!0}),!m&&l.CDNVideo?(v.play(z,l.CDNVideo),l.CDNVideo.srcObject=null,this.bindZegoCDNPlayerEvents(v,h,l)):(v.src=z,v.play(),this.bindZegoExpressPlayerEvents(v,h,l)),t&&t(),!0)},t.prototype.retrySendTransCodecCmd=function(){this.av&&Date.now()-this.av>9e4&&(this.av=void 0,this.sendTransCodecCmd(0))},t.prototype._clearTransCodecRetry=function(){var t,i;null===(t=this.hv)||void 0===t||t.invalid(),null===(i=this.hv)||void 0===i||i.stopMaxTime()},t.prototype.stopCDNPlayer=function(){this.cv&&(clearTimeout(this.cv),this.cv=void 0),this._clearTransCodecRetry(),this.av=void 0,this.cdnPlayer&&(this.In.info("zc.cph.stcp stop"),this.cdnPlayer.stop(),this.updateCDNValidTime(),this.setCdnState(7))},t.prototype.fv=function(t){return!(!t||!t._extApi)},t.prototype.bindZegoExpressPlayerEvents=function(t,i,e){var n=this,s=this.Jl,r=!1;t._extApi.off("canplay"),t._extApi.on("canplay",(function(){r||(n.In.info("zsc.pc.1 start playing cdn source"),r=!0,n.onCDNPlayerCanplay(i,e))}));var o=null,u=0;t._extApi.off("error"),t._extApi.on("error",(function(i){var e,r,a=i.code,c=i.msg;n.In.error("zsc.pc.1 error occur ".concat(a," ").concat(c)),[100003,100004,100005].includes(a)?(o&&(clearTimeout(o),o=null),u>3?(n.In.error("zsc.pc.1 retryCount ".concat(u," greater than ").concat(3,". end play cdn source")),n.updateCDNValidTime(),null===(e=n.hd)||void 0===e||e.setAttributes({stop_reason:ks(c)})):o=setTimeout((function(){u++,t.resume(),s.CDNBrokenCnt++}),3e3)):100006!==a&&(null===(r=n.hd)||void 0===r||r.setAttributes({stop_reason:ks(c)}),n.In.error("zsc.pc.1 stop play cdn source."))})),t._extApi.off("loaded"),t._extApi.on("loaded",(function(){n.lv&&6==s.state?s.CDNBrokenCnt++:(n.In.info("zsc.pc.1 ended play cdn"),n.updateCDNValidTime())})),t._extApi.off("netQualityScoreUpdate")},t.prototype.dv=function(t){var i,e,n,s=((i={})[U.RTC]=1,i[U.CDN]=0,i[U.L3]=2,i),r=this.Nn.appConfig.media_config.play_config.resource_info;if(r.length){var o=r.find((function(t){return t.resource_type==s[U.CDN]}));if(o)for(var u=0;u<o.service_info.length;u++){var a=o.service_info[u],c=a.protocol,h=a.url_template.replace("{STREAM_NAME}",t);switch(c){case g.FLV:e=h;break;case g.HLS:n=h}}}return{flv:e,hls:n}},t.prototype.onCDNPlayerCanplay=function(t,i){var e=this.Jl;if(6!=e.state&&(this.setCdnState(6),0==e.firstFrameTime)){e.firstFrameTime=Date.now()-e.beginTime;var n=this.Mn.createSpan(a.H,{key:Pn.event,par:t},{key:""},ls.event);n.setAttributes({fft_consumed:ls.fft_consumed(e.firstFrameTime),biz_product:ls.biz_product(i.resourceMode==U.DG?1:0)}),n.end()}0==this.cdnPlayTime&&this.lv&&(this.cdnPlayTime=Date.now())},t.prototype.bindZegoCDNPlayerEvents=function(t,i,e){var n=this,s=this.Jl;t.onComplete=function(){if(n.lv&&6==s.state)t.retry(),s.CDNBrokenCnt++;else var i=s.initPoster,e=s.initVideoStyle,r=s.playOption.CDNVideo,o=setTimeout((function(){clearTimeout(o),r&&r.setAttribute("style",e),r&&r.setAttribute("poster",i)}),1e3);n.updateCDNValidTime()},t.onError=function(i){var e;n.Nn.networkState==c.offline&&(t.canRetry=!1),null===(e=n.hd)||void 0===e||e.setAttributes({stop_reason:ks(i)}),n.updateCDNValidTime()},t.onCanplay=function(){n.onCDNPlayerCanplay(i,e)}},t.prototype.selectCDNSource=function(t,i,e){var n=this.fv(t),s="",r=this.hd;if(n)s=i[0],null==r||r.setAttributes({protocol:Ts("flv")});else if(t.isSupportFLV()&&(null==i?void 0:i.length)>0)s=i[0],null==r||r.setAttributes({protocol:Ts("flv")});else if(t.isSupportHLS()&&(null==e?void 0:e.length)>0)s=e[0],null==r||r.setAttributes({protocol:Ts("hls")});else if(!this.cdnUrl)return null;return s?s=s.replace("http://","https://"):null},t.prototype.updateCDNValidTime=function(){this.cdnPlayTime&&(this.ov+=Date.now()-this.cdnPlayTime,this.cdnPlayTime=0)},t.prototype.setCdnState=function(t){this.state=t},t.prototype.renderMediaStreamByCdnPlayer=function(t){var i=this,e="zc.cph.rbcp",n=this.Jl;this.In.info(e+" switch media webrtc success");var s=n.initPoster,r=n.initVideoStyle,o=n.playOption.CDNPlayer,u=n.playOption.CDNVideo,a=!!n.zegoExpressPlayer;if("safari"===this.Nn.browser&&!a&&u&&n._CDNPlayerClone){var c=u.parentElement;if(c){var h=Wt.createElement("style"),f=u.cloneNode(!0),l=Date.now().toString(16);h.innerText=".zego_cdn_video_".concat(l," .zego_clone_video_").concat(l,"{width:").concat(u.offsetWidth,"px;height:").concat(u.offsetHeight,"px;}")+".zego_cdn_video_".concat(l," .hide_").concat(l,"{display:none!important;width:0;height:0}"),Wt.head.append(h),f.classList.add("zego_clone_video_".concat(l)),f.id=n.streamId+"_clone",f.src="",f.srcObject=t,f.classList.add("hide_".concat(l)),u.before(f),c.classList.add("zego_cdn_video_".concat(l));var d=setTimeout((function(){clearTimeout(d),u.classList.add("hide_".concat(l)),f.classList.remove("hide_".concat(l))}),2e3),v=setTimeout((function(){clearTimeout(v),n.playOption.CDNVideo=f,i.stopCDNPlayer(),c.classList.remove("zego_cdn_video_".concat(l)),u.classList.remove("zego_cdn_video_".concat(l)),f.classList.remove("zego_clone_video_".concat(l)),f.id=u.id,h.remove(),u.remove()}),4e3)}}else if(this.stopCDNPlayer(),a&&t)this.In.info(e+" express player switch to play webrtc"),o._extApi.srcObject=t,o.play();else{var m=setTimeout((function(){clearTimeout(m),u&&u.setAttribute("style",r),u&&u.setAttribute("poster",s)}),1e3);t&&u&&(u.srcObject=t)}},t}(),Ub=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),Bb=function(){return Bb=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Bb.apply(this,arguments)},Jb=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},Vb=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},Hb=Pn,Gb=Pn.event,Fb=Pn.error,Yb=xn,Zb=An,Qb=jn.event,Xb=Rs,Wb=Os;!function(t){t.beforePublish="beforePublish",t.publishing="publishing",t.afterPublish="afterPublish"}(Mb||(Mb={}));var Kb=function(t){function i(i,e,n,s,r,o,u,c,h,f,l,d,v){var m,p=this;if((p=t.call(this,e,i)||this).In=e,p.Ro=u,p.ac=c,p.Nn=h,p.room=f,p.streamSid=d,p.isDataChannel=v,p.vv=void 0,p.mv=void 0,p.pv=void 0,p.Zh={state:"NO_PLAY",code:0},p.probedList=[],p.probeTime=0,p.probeTimer=null,p.probeNodeList=[],p.hasSucceed=!1,p.gv=0,p.bv=0,p.pulledTimeStamp=0,p.firstPulledTimeStamp=0,p._v=0,p.yv=0,p.CDNBrokenCnt=0,p.serverUrl=M_,p.isCenterNode=!0,p._state=7,p.lastState=7,p.broadcasterStatus=A.stop,p.isExternal=!1,p.reportPlayStateTime=0,p.streamInRoom=!0,p.playStartTime=0,p.wv=0,p.Af=0,p.Mf=0,p.poorQualityRetryCnt=0,p.xf=[],p.continuousFailCnt=0,p.Sv=0,p.remoteStream=null,p.playStream=null,p.rtcViewer=null,p.ld={},p.Ev={video:!0,audio:!0,expireTime:0},p.isServerMuteVideo=!1,p.isServerMuteAudio=!1,p.Ov=null,p.hl=null,p.vf=25e3,p.cameraStatus=0,p.micStatus=0,p.soundLevel=0,p.mic=null,p.beginTime=0,p.firstFrameTime=0,p.playMode=q.RTC,p.Df=!0,p.isProbe=!1,p.Pf=0,p.initPoster="",p.initVideoStyle="",p.firstPlay=!0,p.isProbeByDG=!1,p.useResourceTypes=[],p.tryidx=0,p._CDNPlayerClone=null,p.signalTime=0,p.stopReason="",p.Qh=!1,p.probeQuality=0,p.ip="",p.audioMuteState="0",p.videoMuteState="0",p.Tv=null,p.kv=0,p.Rv="",p.Iv=0,p.Nv=0,p.Cv=Mb.beforePublish,p.soundMeterWorklet=null,p.zv=!1,p.Dv={},p.isProbe||(p.Pv=mi(p.Mn,a.I,i,Gb,pa.event,void 0,!0)),p.id=Lo("".concat(u.appid,"_").concat(h.idName,"_").concat(i,"_").concat(Date.now(),"_").concat(N())),p.beginTime=Date.now(),p.Uo=i,n&&p.setSignal(n),p.dataReport=s,p.qualityHandler=new gb(r,o,p,p.In,p.dataReport,p.Nn),p.qualityHandler.onRecvMediaData=function(){var t;(null===(t=p.Av)||void 0===t?void 0:t.streamNotFoundTime)&&(p.Av.streamNotFoundTime=0,p.info("zc.p.ormd.1 reset streamNotFoundTime"))},p.qualityHandler.onPlayingError=function(t){p.playStateUpdateError(t)},p.playMediaStatus={video:!p.Ro.defaultVideoMuted,audio:!p.Ro.defaultAudioMuted},p.info("zc.p.1 set playMediaStatus ".concat(JSON.stringify(p.playMediaStatus))),p.Rd=p.Ur("resource_mode"),p.retryStreamHandler=new kb(p.streamId,p.In,p.Nn,p.Ro,!1),l){if(p.ld=l,l.CDNPlayer)p.getCDNHandler().cdnPlayer=l.CDNPlayer;p.initResourceMode(l.resourceMode)}p.initStreamReport();var g=Bb(Bb({},l),{CDNVideo:void 0,CDNPlayer:void 0});return null===(m=p.Pv)||void 0===m||m.setAttributes({stream_id:Hb.stream_id(i),stream_sid:Hb.stream_sid(d),play_option:Hb.play_option(g),video_codec_id:Hb.video_codec_id(null==l?void 0:l.videoCodec),use_na:Hb.use_na(1),biz_product:(null==l?void 0:l.resourceMode)==U.DG?1:0,resource_mode:Hb.resource_mode(p.resourceMode),src:Hb.src(p.playMode),room_id:Hb.room_id(null==f?void 0:f.roomID),room_sid_string:Hb.room_sid_string(null==f?void 0:f.roomSessionID),is_multi:Hb.is_multi(p.Nn.isMultiRoom)}),p}return Ub(i,t),Object.defineProperty(i.prototype,"zegoPeer",{get:function(){return this.Av},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Av",{get:function(){var t=void 0;switch(this.playMode){case q.RTC:t=this.vv;break;case q.L3:t=this.mv}return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"peerConnection",{get:function(){var t;return null===(t=this.Av)||void 0===t?void 0:t.peerConnection},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"signal",{get:function(){var t;return null===(t=this.Av)||void 0===t?void 0:t.signal},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"curCBState",{get:function(){return this.Zh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ov",{get:function(){var t;return(null===(t=this.pv)||void 0===t?void 0:t.ov)||0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"streamConnectIP",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.streamConnectIP)||""},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"zegoExpressPlayer",{get:function(){var t;return null===(t=this.pv)||void 0===t?void 0:t.zegoExpressPlayer},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"zegoCdnPlayer",{get:function(){var t;return null===(t=this.pv)||void 0===t?void 0:t.zegoCdnPlayer},enumerable:!1,configurable:!0}),i.prototype.updateCBState=function(t){var i=this,e=Object.keys(t).some((function(e){return t[e]!==i.Zh[e]}));return e&&(this.Zh=t),e},Object.defineProperty(i.prototype,"state",{get:function(){var t;return this.playMode==q.CDN?this.pv?this.pv.state:7:void 0===(null===(t=this.Av)||void 0===t?void 0:t._state)?7:this.Av._state},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"streamId",{get:function(){return this.Uo},set:function(t){this.Uo=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sessionId",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.sessionId)||0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"playOption",{get:function(){return this.ld},set:function(t){this.ld=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"stateNego",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.stateNego)||0},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"resourceMode",{get:function(){return this.Rd},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNode",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.gwNode)||""},set:function(t){this.Av&&(this.Av.gwNode=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNodeList",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.gwNodeList)||[]},set:function(t){this.Av&&(this.Av.gwNodeList=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gwNodesTTL",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.gwNodesTTL)||0},set:function(t){this.Av&&(this.Av.gwNodesTTL=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isNodesEmpty",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.isNodesEmpty)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipNodeType",{get:function(){var t;return this.Av?null===(t=this.Av)||void 0===t?void 0:t.ipNodeType:It.ZV4Priority},set:function(t){this.Av&&(this.Av.ipNodeType=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipV6Prefer",{get:function(){var t;return this.Av?null===(t=this.Av)||void 0===t?void 0:t.ipV6Prefer:1},set:function(t){this.Av&&(this.Av.ipV6Prefer=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isPeer",{get:function(){return this.Df},set:function(t){this.Df=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"peerID",{get:function(){return this.Pf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"retryFailGwNodes",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.retryFailGwNodes)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"retryFailIpV4Nodes",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.retryFailIpV4Nodes)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"retryFailIpV6Nodes",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.retryFailIpV6Nodes)||[]},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipV4NodeList",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.ipV4NodeList)||[]},set:function(t){this.Av&&(this.Av.ipV4NodeList=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipV6NodeList",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.ipV6NodeList)||[]},set:function(t){this.Av&&(this.Av.ipV6NodeList=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ipNode",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.ipNode)||null},set:function(t){this.Av&&t&&(this.Av.ipNode=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isStreaming",{get:function(){return 6===this.state},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"probeState",{get:function(){return this.qualityHandler.probeState},set:function(t){this.qualityHandler.probeState=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"netQuality",{get:function(){return this.qualityHandler.Ua},set:function(t){this.qualityHandler.Ua=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"lastPlayStats",{get:function(){return this.qualityHandler.Vl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isStateRetry",{get:function(){return[0,7,8].includes(this.stateNego)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"iceStateDisConnect",{get:function(){return[7,6,8].includes(this.stateNego)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isLastConnected",{get:function(){var t;return 6===(null===(t=this.Av)||void 0===t?void 0:t.lastState)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"playStat",{get:function(){return this.qualityHandler.playStat},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"webrtcProtocol",{get:function(){return this.qualityHandler.Va},enumerable:!1,configurable:!0}),i.prototype.changePlayMode=function(t){var i,e,n=this,s="zc.ply.cpm",r=this.playMode;if(t!==r){this.info(s+" change mode "+t),pi(mi(this.Mn,a.H,this.streamId,Cs,Pn.event),{src:Ds(t),last_src:zs(r)});var o=!1;t!==q.CDN&&r!==q.CDN||(o=!0),this.resetPlay(o,0),this.Ro.removeStreamFromSignal(!1,this.streamId,15e3);var u=this.retryStreamHandler;u.endRtcPlaySpan(this.streamId,void 0,this),this.playMode=t;var c=!0;this.playMode===q.L3?(this.serverUrl=x_,c=!1):(this.serverUrl=M_,c=!0),this.useResourceTypes.push(this.playMode),this.useResourceTypes=Array.from(new Set(this.useResourceTypes)),this.playMode===q.CDN?this.playCDN():(u.startMaxTime(),u.playStartSpan(this.streamId,this,!0),this.Ro.connectWebRTCCenterServer(!1,c,null===(i=this.room)||void 0===i?void 0:i.roomID,null===(e=this.room)||void 0===e?void 0:e.token,(function(t){n.Ro.rePlayStream(n.streamId,t)})))}else this.info(s+" no change.")},Object.defineProperty(i.prototype,"ipStack",{get:function(){return Sl(this.ip)?kt.IPv6:kt.IPv4},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dataChannel",{get:function(){var t;return null===(t=this.Av)||void 0===t?void 0:t.dataChannel},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onDataChannelList",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.onDataChannelList)||[]},set:function(t){this.Av&&(this.Av.onDataChannelList=t)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"netProtocol",{get:function(){var t,i;return(null===(t=this.Av)||void 0===t?void 0:t.turnToTcp)?"tcp":(null===(i=this.Av)||void 0===i?void 0:i.autoTcp)?this.webrtcProtocol:"udp"},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isMiniSdp",{get:function(){var t;return(null===(t=this.Av)||void 0===t?void 0:t.To)||!1},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"seiWorker",{get:function(){return this.Ro.seiWorker},enumerable:!1,configurable:!0}),i.prototype.Ur=function(t,i){return void 0===i&&(i=!1),this.Nn.settingConfig.getSetting(t,i)},Object.defineProperty(i.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"logger",{get:function(){return this.In},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"completePlaySpan",{get:function(){return this.Pv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"playingEvent",{get:function(){var t=Qb;switch(this.playMode){case q.L3:t=Xb;break;case q.RTC:t=Qb;break;case q.CDN:t=Wb}return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"playStartEvent",{get:function(){return this.hasSucceed?Mn:Zb.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isStreamNotFound",{get:function(){var t;return!!(null===(t=this.Av)||void 0===t?void 0:t.streamNotFoundTime)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"allowAutoSwitchResource",{get:function(){return[U.DG,U.CUSTOM].includes(this.Rd)},enumerable:!1,configurable:!0}),i.prototype.initResourceMode=function(t){if(Lt(t)&&[0,1,2,3,5].includes(t)){var i=Ul(t);if(this.Rd=t,t===U.DG)i=q.L3;else if(t===U.CUSTOM){var e=this.playOption.customResourceConfig||{},n=e.beforePublish,s=void 0;this.Ro.publishersLength>0?(s=e.publishing,this.Cv=Mb.publishing):(s=n,this.Cv=Mb.beforePublish),i=s===U.L3?q.L3:s===U.CDN?q.CDN:q.RTC}this.useResourceTypes.push(i),this.playMode=i,i===q.L3&&(this.serverUrl=x_),this.info("zc.ply.cpm init mode "+i)}return this.playMode},i.prototype.changePublishOccasion=function(t){var i=this.Cv,e=this.ld.resourceMode===U.CUSTOM,n=this.ld.customResourceConfig||{},s=n.afterPublish,r=n.publishing;if(t&&i!==Mb.publishing){if(this.Cv=Mb.publishing,e&&Lt(r))return this.changePlayMode(Ul(r))}else if(!t&&i!==Mb.afterPublish&&i===Mb.publishing&&(this.Cv=Mb.afterPublish,e&&Lt(s)))return this.changePlayMode(Ul(s))},i.prototype.setSignal=function(t){var i=this.Av;i?i.setSignal(t):i=this.Mv(this.playMode,t),this.info(Qd+" set signal "+t.server+" peer:"+(null==i?void 0:i.playMode))},i.prototype.netProbeToReDispatch=function(t,i){void 0===t&&(t=function(){}),void 0===i&&(i=function(){}),this.Qh=!0;var e=null==this?void 0:this.retryStreamHandler;e&&e.dispatchGwNodesBypass(this,t,i)},i.prototype.initStreamReport=function(){this.ol=this.Mn.createSpan(a.I,{key:Gb,par:this.Uo},{key:Yb.event,par:this.Uo},Yb.event,!0),this.playStartTime=(new Date).getTime()},i.prototype.startPlay=function(t,i){var e,n,s,r,o,u,a,c=this;this.info(Qd+" called ");var h=this.ld||{};if(t){var f=this.Av;if(f){this.getRemoteStreamSuc=i,this.playMediaStatus={video:this.playMediaStatus.video&&(void 0===this.ld.video||!!this.ld.video),audio:this.playMediaStatus.audio&&(void 0===this.ld.audio||!!this.ld.audio)},h&&h.videoCodec&&(this.ld.videoCodec=h.videoCodec),null===(e=this.Pv)||void 0===e||e.setAttributes({video_layer:Hb.video_layer(2===this.ld.streamType?-1:this.ld.streamType||1)});var l=this.Ur("play_video_codec",!0);l&&(this.info(Qd+" setting play_video_codec "+l),this.ld.videoCodec=l);var d=(null===(n=this.ld)||void 0===n?void 0:n.resourceMode)==U.DG?1:0;null===(s=this.Ca)||void 0===s||s.setAttributes({reason:Zb.reason("StartPlay"),is_peer:Zb.is_peer(this.Df),is_mini:Zb.is_mini(this.isMiniSdp)});var v={};(null===(r=this.Av)||void 0===r?void 0:r.tf)||(v.is_mini=this.isMiniSdp),null===(o=this.Pv)||void 0===o||o.setAttributes(Bb({audio_activate:Hb.audio_activate(1==this.ld.audio||0!=this.ld.audio),video_activate:Hb.video_activate(1==this.ld.video||0!=this.ld.video),biz_product:Hb.biz_product(d),is_peer:Hb.is_peer(this.Df)},v)),this.ol.setAttributes({room_id:Yb.room_id(null===(u=null==this?void 0:this.room)||void 0===u?void 0:u.roomID),room_sid_string:Yb.room_sid_string(null===(a=null==this?void 0:this.room)||void 0===a?void 0:a.roomSessionID)}),f.connectGW().then((function(t){i&&i(t)})),null!=this.hl&&(clearTimeout(this.hl),this.hl=null),this.hl=setTimeout((function(){c.error(Qd+" waiting timeout"),c.playStateUpdateError(Fb.hn)}),this.vf),this.isProbe&&this.qualityHandler.startProbeTimeout()}else this.error(Qd+" no peer")}else this.warn(Qd+" streamId is null")},i.prototype.Mv=function(t,i){var e=this;if([q.L3,q.RTC].includes(t)){var n=t===q.L3,s=this.Av;return s||(this.info(Qd+" create peer "+t),s=new xb(this,t,i,this.In,this.dataReport,this.ol,this.Ro,this.Nn,this.room,this.ld)),s.onCanStopNegaTimer=function(){null!=e.hl&&(clearTimeout(e.hl),e.hl=null)},s.onNeedReplay=function(){e.resetPlay(!0,0),e.startPlay(e.Uo,e.getRemoteStreamSuc)},s.onPlayStateUpdateError=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];e.playMode===(null==s?void 0:s.playMode)&&e.playStateUpdateError.apply(e,t)},s.onPlayBFrameEvent=function(t){e.qualityHandler.setHasBFrames(t)},s.onPlayStreamEnd=function(t){e.qualityHandler.setPlayStreamEnd(t)},s.onGwPlayNetState=function(t){e.qualityHandler.updateGwPlayNetState(t)},s.onPlayStateUpdate=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];e.playMode===(null==s?void 0:s.playMode)&&e.onPlayStateUpdate.apply(e,t)},s.onIceConnected=function(t,i){var n,r,o=null==e?void 0:e.retryStreamHandler;for(var u in null==o||o.getTryTime(e,!0),e.hasSucceed=!0,e.Sv++,e.continuousFailCnt=0,e.reportPlayStateTime=Date.now(),e.Qh=!1,e.Ca&&pi(e.Ca,{signal_consume:Zb.signal_consume(e.signalTime),is_peer:Zb.is_peer(e.Df),peer_id:Zb.peer_id(e.peerID),source_type:Zb.source_type(e.playMode),net_protocol:Zb.net_protocol(null==e?void 0:e.netProtocol),tryidx:Zb.tryidx(e.tryidx)},!1),e.isProbe||e.hd||(e.hd=mi(e.Mn,a.I,e.streamId,e.playingEvent,Pn.event,void 0,!0)),e.getConnectIP(),e.Ro.publisherList){if(6==e.Ro.publisherList[u].publisher.state&&e.broadcasterStatus==A.stop){null==s||s.sendBroadcasterStatus(1),e.broadcasterStatus=A.start;break}}if(!e.isProbe){e.qualityHandler.setPlayQualityTimer();var c=e.Ur("probe_started_num");!isNaN(c)&&(e.Ro.probeStartedNum=c)}var h,f,l;("firefox"===(l=e.Nn.browser)||"chrome"===l&&(h=0,(f=(th().toLowerCase().match(/chrome\/([\d.]+)/)||[])[1])&&(h=parseInt(f.split(",")[0])),h<72))&&e.xv(t,i);var d=e.Dv,v=d.v,m=d.a;Lt(v)&&e.onRemoteCameraStatusUpdate(v),Lt(m)&&e.onRemoteMicStatusUpdate(m),e.allowAutoSwitchResource&&(e.playMode===q.RTC?null===(n=e.mv)||void 0===n||n.close(0):e.playMode===q.L3&&(null===(r=e.vv)||void 0===r||r.close(0)))},s.onGetIP=function(){6===e.state&&e.getConnectIP()},s.onPeerConnected=this.xv.bind(this),s.onRecvRemoteStream=function(t){if(e.remoteStream=t,e.playStream){var i=e.rtcViewer;t.clone().getTracks().forEach((function(t){var n="video"===t.kind,s=[];(s=n?e.playStream.getVideoTracks():e.playStream.getAudioTracks()).includes(t)||(s.forEach((function(t){return e.playStream.removeTrack(t)})),(!n||e.playMediaStatus.video&&[0,20].includes(e.cameraStatus))&&(e.info(hv+" add track "+n),e.playStream.addTrack(t),i&&i.setTrack(n,t,"safari"===e.Nn.browser),e.Nn.actionListener(n?"playerVideoTrackUpdate":"playerAudioTrackUpdate",e.Uo,t)));n||e.jv()}))}else e.playStream=t.clone(),e.info(hv+" clone");e.pv&&e.pv.renderMediaStreamByCdnPlayer(e.playStream),e.Ro.soundLevelDelegate&&!e.isProbe&&e.startSoundLevel(),e.audioMuteState=t.getAudioTracks().length>0?"0":"1",e.videoMuteState=t.getVideoTracks().length>0?"0":"1"},s.onRecvStreamStatus=this.Lv.bind(this),s.onRecvMixSoundLevels=function(t){e.qv(t)},s.onRecvNetQuality=function(t,i,n){e.playMode===(null==s?void 0:s.playMode)&&(e.qualityHandler.stopProbeTimeout(),0==t&&Lt(i)&&Lt(n)?(e.isProbeByDG=!1,e.onCalNetQualityResult(0,zo(n,i))):e.onCalNetQualityResult(1))},s.onRecvNetQualityGrade=function(t){var i,n;if(e.playMode===(null==s?void 0:s.playMode)){var r=t;e.Rv=e.Rv||(null===(n=null===(i=e.Ro.playerList[e.Uo])||void 0===i?void 0:i.room.streamList.find((function(t){return t.stream_id==e.Uo})))||void 0===n?void 0:n.id_name),e.Rv&&(e.Nn.actionListener("networkQuality",e.Rv,null==r?void 0:r.tx_quality,null==r?void 0:r.rx_quality),!e.Tv&&e.startPollNetworkQuality(),e.kv=0)}},n?this.mv=s:this.vv=s,s}},i.prototype.resetGwNodes=function(){var t;null===(t=this.Av)||void 0===t||t.resetGwNodes()},i.prototype.setGwNodes=function(t,i,e,n){var s;null===(s=this.Av)||void 0===s||s.setGwNodes(t,i,e,n)},i.prototype.dispatchGwNodes=function(t,i,e){var n;null===(n=this.Av)||void 0===n||n.dispatchGwNodes(t,i,e)},i.prototype.resetPlay=function(t,i){var e,n,s;void 0===t&&(t=!0),this.info(nv+" call"),t&&(null===(e=this.vv)||void 0===e||e.close(i),null===(n=this.mv)||void 0===n||n.close(i),null===(s=this.pv)||void 0===s||s.stopCDNPlayer()),this.ip="",null!=this.hl&&(clearTimeout(this.hl),this.hl=null),this.qualityHandler.stopProbeTimeout(),this.qualityHandler.clearPlayQualityTimer(),this.stopSoundLevel(),this.Iv=0,this.Nv=0},i.prototype.playStateUpdateError=function(t,i,e,n){if(this.error(lv+" call "+JSON.stringify(t)),!this.isProbe){var s=this.Mn.createSpan(a.H,{key:Gb,par:this.Uo},{key:""},qn);s.setAttributes({error:null==t?void 0:t.code,message:null==t?void 0:t.message}),s.end()}this.isProbe?this.onCalNetQualityResult(1):this.Uo&&this.onPlayStateUpdate(W,this.Uo,t,i,e,n),this.info(lv+" ended")},i.prototype.getCameraMicStatus=function(t){return 0==t?"OPEN":"MUTE"},i.prototype.onPlayStateUpdate=function(t,i,e,n,s,r){((i&&this.Ro.playerList[i])===this?this.retryStreamHandler.playStateHandle(t,this.streamId,e,n,s,r):this.error("zsc.pss.1 cannot find play"),t===X&&0===(null==e?void 0:e.code))&&(this.Ro.playModule&&this.Uv(),this.Ro.supplementPlayingChargeTime())},i.prototype.onPlayQualityUpdate=function(t,i){},i.prototype.getStopReason=function(t){var i="StopPlay";if(t&&t.code)if(1104031===t.code)i="ReachMaxAVRetryTime";else i="StopPlay";return i},i.prototype.qv=function(t){var i=this,e=t.map((function(t){var e,n,s=(null===(n=null===(e=i.room.streamList)||void 0===e?void 0:e.find((function(i){return i.stream_nid===t.soundLevelID})))||void 0===n?void 0:n.stream_id)||"";return Bb(Bb({},t),{streamID:s})})),n=new Map(e.map((function(t){return[t.soundLevelID,t.value]}))),s=e.filter((function(t){return t.streamID})).map((function(t){return[t.streamID,t.value]})),r=new Map(s);this.Nn.actionListener("mixerSoundLevelUpdate",n,this.Uo),r.size&&this.Nn.actionListener("autoMixerSoundLevelUpdate",r,this.Uo)},i.prototype.stopPlay=function(t){var i,e,n,s,r,o;this.info("zc.p.1.sp.1 called");var u=this.getStopReason(t);for(var a in this.Ro.publisherList){if(6==this.Ro.publisherList[a].publisher.state&&this.broadcasterStatus==A.start){this.sendBroadcasterStatus(0),this.broadcasterStatus=A.stop;break}}var c=null===(e=this.Av)||void 0===e?void 0:e.To,h=this.isStreaming?0:this.lastFailTimeLen;if(!this.isProbe){var f=Date.now()-this.reportPlayStateTime;[0,2].includes(this.Rd)&&this.ol.setAttributes({play_state_time:Yb.play_state_time(f||0)}),this.hd&&this.endPlayingSpan({stop_reason:jn.stop_reason(u),try_time:jn.try_time(h)}),(null==t?void 0:t.code)==Fb.vn.code&&this.uploadPlayEvent(t),this.seiWorker&&this.seiWorker.postMessage({cmd:"clear",type:"pull",streamID:this.Uo})}if(this.stopPollNetworkQuality(),this.resetPlay(!0,0),this.Pu(),!this.isProbe){var l=this.qualityHandler,d=l.Yl,v=l.Zl,m=((i={}).l3_a_break_time=v.cumulativeBreakDurationL3,i.l3_a_decode_time=v.cumulativeDecodeDurationL3,i.l3_v_break_time=d.cumulativeBreakDurationL3,i.l3_v_decode_time=d.cumulativeDecodeDurationL3,i.rtc_a_break_time=v.cumulativeBreakDurationRtc,i.rtc_a_decode_time=v.cumulativeDecodeDurationRtc,i.rtc_v_break_time=d.cumulativeBreakDurationRtc,i.rtc_v_decode_time=d.cumulativeDecodeDurationRtc,i.audio_cumulative_break_time=v.cumulativeBreakDuration,i.audio_cumulative_decode_time=v.cumulativeDecodeDuration,i.video_cumulative_break_time=d.cumulativeBreakDuration,i.video_cumulative_decode_time=d.cumulativeDecodeDuration,i),p=Date.now(),g=this.firstPulledTimeStamp;this.updateValidTime(t);var b=0;t&&0!==t.code&&(b=t.code===me.code?this.latestPlayErrCode:t.code),this.ol.setAttributes(Bb(Bb({biz_product:(null===(n=this.ld)||void 0===n?void 0:n.resourceMode)==U.DG?1:0,webrtc_sid:Yb.webrtc_sid(this.sessionId),max_retry_interval:Yb.max_retry_interval(this.Nn.streamRetryTime),probe_ip_cnt:Yb.probe_ip_cnt(this.Af),valid_probe_ip_cnt:Yb.valid_probe_ip_cnt(this.Mf),poor_quality_retry_cnt:Yb.poor_quality_retry_cnt(this.poorQualityRetryCnt),probe_not_trigger_retry_info:Yb.probe_not_trigger_retry_info(this.xf.length>0?this.xf:void 0),fail_cnt:Yb.fail_cnt(Math.max(this.tryidx-1,0)),continuous_fail_cnt:Yb.continuous_fail_cnt(Math.max(this.continuousFailCnt-1,0)),try_time:Yb.try_time(h),use_resource_type:Yb.use_resource_type(this.useResourceTypes),use_na:xn.use_na(1),play_state_cnt:Yb.first_frame_time(this.Sv),protocol:Yb.protocol("webrtc"),dispatch_external_ip:Yb.dispatch_external_ip(this.Nn.clientIP),w:Yb.w(null===(s=this.playStat)||void 0===s?void 0:s.frameWidth),h:Yb.h(null===(r=this.playStat)||void 0===r?void 0:r.frameHeight),stop_reason:Yb.stop_reason(u),error:(null==t?void 0:t.code)||0,last_error:b,message:(null==t?void 0:t.message)||"",cdn_a_break_time:0,cdn_a_decode_time:0,cdn_v_break_time:0,cdn_v_decode_time:0},m),{total_d:g?p-g:0,valid_d:this.gv+this.bv+this.ov,tempbroken_cnt:this._v+this.yv+this.CDNBrokenCnt,is_mini:c})),this.ol.end()}this.Ro.stopToReport(1),this.Ro.stopNetProbe(this),null===(o=this.Av)||void 0===o||o.stopPlay(),this.Bv(),this.Jv(),this.hasSucceed=!1,this.tryidx=0,this.Qh=!1,this.Af=0,this.Mf=0,this.poorQualityRetryCnt=0,this.continuousFailCnt=0;var _=this.rtcViewer;_&&_.destroy()},i.prototype.uploadPlayEvent=function(t){var i,e;if(this.Pv){var n={};this.Av&&(null===(i=this.Av)||void 0===i?void 0:i.$h)&&(n.mini_retry_consume=+(null===(e=this.Av)||void 0===e?void 0:e.$h.toFixed(0)),this.Av.resetMiniReportInfos()),pi(this.Pv,Bb(Bb({},n),{error:t.code,message:t.message}))}this.Pv=void 0},i.prototype.onDisconnect=function(t){this.info("zc.p.od.1 call"),this.playStateUpdateError(t||Fb.Ce,!!t)},i.prototype.startSoundLevel=function(){var t,i=this;if(this.info(dv+" call"),!this.isProbe)if(this.remoteStream&&0!=this.remoteStream.getAudioTracks().length){null===(t=this.soundMeterWorklet)||void 0===t||t.destroy(),this.mic=null;var e=this.Ro.getCloudSoundInterval();try{var n=this,s=this.Ro.createSoundLevel(this.ac,this.remoteStream,this.Ro.soundLevelInterval,e,(function(t){n.soundLevel=0===i.micStatus?100*t:0})),r=s.mic;this.soundMeterWorklet=s.soundMeter,this.mic=r}catch(t){this.error(dv+" get sound level failed "+t)}}else this.info(dv+" remote stream no found")},i.prototype.stopSoundLevel=function(){var t;this.info("zc.p.ssl.1.1 call"),this.soundLevel=0,null===(t=this.soundMeterWorklet)||void 0===t||t.destroy(),this.mic=null},i.prototype.onCalNetQualityResult=function(t,i){},i.prototype.uploadRTCPlayStats=function(){var t,i,e,n,s,r,o,u,a,c,h,f,l,d,v,m;this.lastPlayStats.time&&(null===(t=this.hd)||void 0===t||t.setAttributes({lsttime:jn.lsttime(parseInt(this.lastPlayStats.time)),total_stat:Cn.total_stat({afc:null===(i=this.lastPlayStats)||void 0===i?void 0:i.audioPacketsReceived,vfc:null===(e=this.lastPlayStats)||void 0===e?void 0:e.framesReceived,tfc:(null===(n=this.lastPlayStats)||void 0===n?void 0:n.audioPacketsReceived)+(null===(s=this.lastPlayStats)||void 0===s?void 0:s.framesReceived),vb:null===(r=this.lastPlayStats)||void 0===r?void 0:r.videoBytesReceived,ab:null===(o=this.lastPlayStats)||void 0===o?void 0:o.audioBytesReceived,tb:(null===(u=this.lastPlayStats)||void 0===u?void 0:u.videoBytesReceived)+(null===(a=this.lastPlayStats)||void 0===a?void 0:a.audioBytesReceived),rtp_rtt:Math.round(1e3*(null===(c=this.playStat)||void 0===c?void 0:c.currentRoundTripTime))||0,w:null===(h=this.playStat)||void 0===h?void 0:h.frameWidth,rtp_plr:null===(f=this.playStat)||void 0===f?void 0:f.videoPacketsLostRate,h:null===(l=this.playStat)||void 0===l?void 0:l.frameHeight,rtp_bw:(null===(d=this.playStat)||void 0===d?void 0:d.googAvailableSendBandwidth)?null===(v=this.playStat)||void 0===v?void 0:v.googAvailableSendBandwidth:void 0,p2p_delay:null===(m=this.playStat)||void 0===m?void 0:m.peerToPeerDelay})}))},i.prototype.getViewer=function(){return this.playStream&&!this.rtcViewer&&(this.rtcViewer=new Em(this.playStream,this,{clearLastFrame:this.Nn.engineConfig.playClearLastFrame})),this.rtcViewer},i.prototype.xv=function(t,i){var e;this.isProbe||0!=this.firstFrameTime||(this.firstFrameTime=(new Date).getTime()-this.beginTime,this.ol.setAttributes({first_frame_time:Yb.first_frame_time(this.firstFrameTime),fft_video:Yb.fft_video(this.firstFrameTime),fft_audio:Yb.fft_audio(this.firstFrameTime),biz_product:ls.biz_product((null===(e=this.ld)||void 0===e?void 0:e.resourceMode)==U.DG?1:0)}),this.Vv=this.firstFrameSpan("video",t,i),this.Hv=this.firstFrameSpan("audio",t,i)),this.zv&&this.Gv(this.cameraStatus,this.micStatus)},i.prototype.Gv=function(t,i){0===t&&this.Vv&&(this.Vv.setAttributes({dev_changed:ls.dev_changed(0!==this.cameraStatus)}),this.Vv.spanReport(),this.Vv=null),0===i&&this.Hv&&(this.Hv.setAttributes({dev_changed:ds.dev_changed(0!==this.micStatus)}),this.Hv.spanReport(),this.Hv=null)},i.prototype.firstFrameSpan=function(t,i,e){var n,s="video"===t?ls:ds,r=mi(this.Mn,a.H,this.Uo,s.event,Gb),o=this.streamInRoom?2:0===this.wv?0:1;return r.setAttributes({webrtc_sid:s.webrtc_sid(i),resource_type:s.resource_type(this.playMode),fft_consumed:s.fft_consumed(this.firstFrameTime),protocol:s.protocol("webrtc"),push_consumed:s.push_consumed(this.wv),prepare_recv_consumed:s.prepare_recv_consumed(this.signalTime),connected_consumed:s.connected_consumed(e),reliability:s.reliability(o),biz_product:s.biz_product((null===(n=this.ld)||void 0===n?void 0:n.resourceMode)==U.DG?1:0),ip_stack:this.ipStack}),null==r||r.end(!1),r},i.prototype.isCustomCdn=function(){return!1},i.prototype.setStreamAdd=function(){this.streamInRoom||0!==this.wv||5===this.state||(this.wv=(new Date).getTime()-this.playStartTime),6===this.state&&this.pv&&this.pv.retrySendTransCodecCmd()},i.prototype.setStreamUpdate=function(t){this.qualityHandler.setStreamUpdate(t)},i.prototype.startPollNetworkQuality=function(){var t=this;clearTimeout(this.Tv),this.Tv=setTimeout((function(){t.kv++;var i=V.Unknown,e=V.Unknown;t.Rv&&t.kv>1&&(t.kv>3&&(i=V.Die,e=V.Die),t.Nn.actionListener("networkQuality",t.Rv,i,e)),t.startPollNetworkQuality()}),3e3)},i.prototype.stopPollNetworkQuality=function(){clearTimeout(this.Tv),this.kv=0},i.prototype.setAudioFrameCallback=function(t,i){(this.info("zc.p.safc.0 call"),this.playStream)?(this.Du||(this.Du=new Op(this.ac,this.In)),this.Du.setAudioFrameCallback(this.playStream,null!==t,(function(i){t&&t(i)}),i)):this.warn("zc.p.safc.0 no play stream")},i.prototype.Pu=function(){this.Du&&(this.Du.destroy(),this.Du=null)},i.prototype.jv=function(){var t;null===(t=this.Du)||void 0===t||t.replaceSource(this.playStream)},i.prototype.updateValidTime=function(t){if(this.pulledTimeStamp){var i=0;(null==t?void 0:t.code)&&t.code!==me.code&&(i=1);var e=Date.now(),n=this.playMode,s=e-this.pulledTimeStamp;n==q.RTC?(this.gv=s,this._v+=i):n===q.L3&&(this.bv=s,this.yv+=i),this.pulledTimeStamp=0}},i.prototype.updateCDNValidTime=function(){var t;null===(t=this.pv)||void 0===t||t.updateCDNValidTime()},i.prototype.setMuteStreamByPlayMode=function(t){this.info(_v+" call: ".concat(JSON.stringify(t)));var i,e=t.play_mode,n=void 0===e?0:e,s=t.forbid_play_expire_time,r=1e3*(jt.isLong(i=void 0===s?0:s)?i.toNumber():0),o=!Uo(n,0),u=!Uo(n,1);(this.info(_v+" mode: ".concat(u,",\n        ").concat(o,",\n        ").concat(r,",\n        ").concat(JSON.stringify(this.Ev))),u!==this.Ev.video||o!==this.Ev.audio||r!==this.Ev.expireTime)?(Ut(u)&&(this.Ev.lastVideo=this.Ev.video,this.Ev.video=u),Ut(o)&&(this.Ev.lastAudio=this.Ev.audio,this.Ev.audio=o),r&&(this.Ev.expireTime=r),this.Ro.playModule&&this.isStreaming&&this.Uv()):this.info(_v+" mode not change")},i.prototype.Uv=function(){var t=[void 0,!0].includes(this.ld.video),i=[void 0,!0].includes(this.ld.audio),e=this.Ev,n=e.video,s=e.audio,r=e.lastVideo,o=e.lastAudio,u=e.expireTime;this.info("".concat(yv," ").concat(JSON.stringify(this.Ev)));var a=this.playMediaStatus,c=a.video,h=a.audio,f=u-((new Date).getTime()+this.Nn.clientTimeOffset);this.info("".concat(yv," remainTime ").concat(f));var l=!1,d=!1,v=!1,m=!1;this.Fv();var p=!1;this.isServerMuteVideo||!1===r&&!0===n?(l=!0,d=!n,p=!0):(l=!c,d=!c),this.isServerMuteAudio||!1===o&&!0===s?(v=!0,m=!s,p=!0):(v=!h,m=!h),t&&l&&this.Yv("video",d,p),i&&v&&this.Yv("audio",m,p),this.Jv(),(!1===n||!1===s)&&f>0&&this.Zv(f)},i.prototype.Yv=function(t,i,e,n){var s=this;this.info("".concat(wv," ").concat(this.Uo," ").concat(t," ").concat(i));var r=this.Ro.playModule;r&&r.mutePlayStream(this.Uo,t,i,!1).then((function(i){s.info("".concat(wv," ").concat(s.Uo," mute ").concat(t,": ").concat(i));var r=function(t,i){s.Nn.onExperimentalAPICallback({method:t,content:{roomID:s.room.roomID,streamID:s.Uo,mute:i}})},o=!s.playMediaStatus.video,u=!s.playMediaStatus.audio;"video"===t&&e&&s.Qv!==o&&(r("onRecvRoomMuteVideoStream",o),s.Qv=o),"audio"===t&&e&&s.Xv!==u&&(r("onRecvRoomMuteAudioStream",u),s.Xv=u),n&&n()}))},i.prototype.Zv=function(t){var i=this;this.info("".concat(Sv," ").concat(this.Uo," ").concat(t)),this.Ov=setTimeout((function(){var t=i.Ro.playModule;if(i.info("".concat(Sv," ").concat(i.Uo," ").concat(!!t)),t){var e=i.Ev,n=e.audio;!1===e.video&&i.Yv("video",!1,!0,(function(){i.Fv()})),!1===n&&i.Yv("audio",!1,!0,(function(){i.Fv()})),i.Bv()}}),t)},i.prototype.Fv=function(){var t=this.Ev,i=t.video,e=t.audio,n=t.expireTime-((new Date).getTime()+this.Nn.clientTimeOffset);this.isServerMuteVideo=n>0&&!1===i,this.isServerMuteAudio=n>0&&!1===e},i.prototype.Jv=function(){this.Ov&&(clearTimeout(this.Ov),this.Ov=null)},i.prototype.Bv=function(){this.Ev={video:!0,audio:!0,expireTime:0,lastVideo:!0,lastAudio:!0}},i.prototype.Lv=function(t,i,e){this.info("".concat(cv," status camera_status: ").concat(t," mic_status: ").concat(i));var n=this.cameraStatus!==t;if((!this.zv||n)&&this.onRemoteCameraStatusUpdate(t),(!this.zv||this.micStatus!==i)&&this.onRemoteMicStatusUpdate(i),this.zv=!0,this.cameraStatus=t,this.micStatus=i,this.videoMuteState=0===t?"0":"1",this.audioMuteState=0===i?"0":"1",Ut(this.ld.video))this.info(cv+" has set video option, ignore stream status");else if(this.handleVideoTrackForPlaying(n),"safari"===this.Nn.browser&&e)for(var s=Wt.querySelectorAll("video, audio"),r=0;r<s.length;r++){var o=s[r];o.srcObject===this.playStream&&(this.info(cv+" track changed. rerender stream"),o.srcObject=this.playStream)}this.Gv(t,i)},i.prototype.handleVideoTrackForPlaying=function(t){var i=this;void 0===t&&(t=!1);var e=this.playStream;if(e){var n=this.rtcViewer,s=this.cameraStatus;if(0!==s&&20!==s||!this.playMediaStatus.video)n?t&&(this.info(cv+" viewer clear last frame"),n.checkIfClearLastFrame()):e.getVideoTracks().forEach((function(t){t.enabled=!1,i.Ro.trackUtils.stopTrack(t),e.removeTrack(t)}));else if(0===e.getVideoTracks().length){var r=this.remoteStream.clone().getVideoTracks()[0];e.addTrack(r),n&&n.setVideo(r,"safari"===this.Nn.browser),this.Nn.actionListener("playerVideoTrackUpdate",this.Uo,r)}}},i.prototype.onRemoteCameraStatusUpdate=function(t){6===this.state?(this.Dv.v=void 0,this.Ro.onRemoteCameraStatusUpdate(this.streamId,this.getCameraMicStatus(t),t)):(this.Dv.v=t,this.info(cv+" v not playing. "))},i.prototype.onRemoteMicStatusUpdate=function(t){6===this.state?(this.Dv.a=void 0,this.Ro.onRemoteMicStatusUpdate(this.streamId,this.getCameraMicStatus(t),t)):(this.Dv.a=t,this.info(cv+" a not playing. "))},i.prototype.playCDN=function(t,i){var e=this,n="zc.ply.pcdn";this.info(n+" call"),this.getCDNHandler().playCDN((function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];e.info(n+" success"),e.hd=mi(e.Mn,a.H,e.streamId,e.playingEvent,Pn.event,void 0,!0),i&&i.apply(void 0,t)}),(function(i){e.info(n+" fail. "+i),e.onPlayStateUpdate(W,e.Uo,i,!0),t&&t(i)}))},i.prototype.getCDNHandler=function(){return this.pv||(this.pv=new qb(this,this.In,this.Mn,this.Ro,this.Nn)),this.pv},i.prototype.endPlayingSpan=function(t){var i,e,n;if(void 0===t&&(t={}),this.hd){var s=this.room,r=this.playMode===q.CDN,o=(null==this?void 0:this.isStreaming)?0:null===(i=null==this?void 0:this.retryStreamHandler)||void 0===i?void 0:i.getTryTime(this);return r||null==this||this.uploadRTCPlayStats(),pi(this.hd,Bb(Bb({stream_id:jn.stream_id(this.streamId),room_id:jn.room_id(null==s?void 0:s.roomID),room_sid_string:jn.room_sid_string(null==s?void 0:s.roomSessionID),tryidx:jn.tryidx(this.tryidx),ip:jn.ip(null==this?void 0:this.ip),resource_type:jn.resource_type(this.playMode),dispatch_external_ip:jn.dispatch_external_ip(this.Nn.clientIP)},r?{url:jn.url(null===(e=this.pv)||void 0===e?void 0:e.cdnUrl),net_protocol:jn.net_protocol("tcp")}:{protocol:jn.protocol("webrtc"),url:jn.url(null===(n=this.signal)||void 0===n?void 0:n.server),try_time:jn.try_time(o),net_protocol:jn.net_protocol(this.netProtocol)}),t)),this.hd=void 0,!0}return!1},i.prototype.sendBroadcasterStatus=function(t){var i=this.Av;i&&i.sendBroadcasterStatus(t)},i.prototype.ActivatePlayAudioStream=function(t,i,e){var n=this.Av;n&&n.ActivatePlayAudioStream(t,i,e)},i.prototype.ActivatePlayVideoStream=function(t,i,e){var n=this.Av;n&&n.ActivatePlayVideoStream(t,i,e)},i.prototype.getP2PNetStats=function(t,i){var e=this.Av;e&&e.getP2PNetStats(t,i)},i.prototype.getConnectIP=function(){var t,i;if(this.streamConnectIP&&!this.ip){var e=El(this.streamConnectIP),n=this.getIPByGwNode(e);this.ip=n,this.info("zc.p.1.gci.0 ip: ".concat(n)),null===(t=this.Ca)||void 0===t||t.setAttributes({ip:Zb.ip(this.ip)}),null===(i=this.Ca)||void 0===i||i.spanReport(),this.Ca=void 0}},i.prototype.getIPByGwNode=function(t){var i;if(this.ipNode){var e=this.ipNode.vid.split("|"),n="";return e.forEach((function(i){var e=El(i);t===e&&(n=i)})),n}if(this.gwNode){var s=null===(i=this.gwNode)||void 0===i?void 0:i.split(":");return this.gwNode.replace(":"+s[s.length-1],"")}return""},i.prototype.reportMiniSdpInfos=function(){var t;null===(t=this.Av)||void 0===t||t.reportMiniSdpInfos(this.playStartEvent)},i.prototype.setPlayStreamVideoType=function(t){return Jb(this,void 0,void 0,(function(){var i;return Vb(this,(function(e){return(i=this.Av)?[2,i.setPlayStreamVideoType(t)]:[2,!1]}))}))},i.prototype.onStatsUpdated=function(t){t.audioJitterBufferDelayMs&&this.sendStats(t.audioJitterBufferDelayMs)},i.prototype.sendStats=function(t){var i=this.Av;if(i&&!(i.gwVersion<83886080)){var e=Date.now();if(0===this.Iv||e-(this.Iv+50)>=2e3){var n=this.dataChannel;if(n&&"open"===n.readyState){var s=new Uint8Array(5);s[0]=14,s[1]=this.Nv>>8&255,s[2]=255&this.Nv,s[3]=t>>8&255,s[4]=255&t,this.Nv++,this.Nv>=65536&&(this.Nv=0),n.send(s)}else i.sendPlayStats(t);this.Iv=e}}},i}(vm),$b=o(6361),t_=o.n($b),i_=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},e_=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},n_=function(){function t(t,i,e){this.name=t,this.In=i,this.Wv=e;var n=this.Kv();this.$v=t+":"+Ro(6),this.tm=t_().createInstance({name:this.$v}),this.In.info(Uv+" constructor ".concat(t," ").concat(this.$v," ").concat(n)),this.recordStoresInStorage(t,this.$v,n)}return Object.defineProperty(t.prototype,"deletedKeys",{get:function(){return this.name+"_d"},enumerable:!1,configurable:!0}),t.prototype.Kv=function(){return Math.ceil(this.Wv._now()/1e3)},t.prototype.recordStoresInStorage=function(t,i,e){try{var n=localStorage.getItem(t);this.In.info(Uv+" record storage storeNames ".concat(n));var s=n?n.split(","):[];s.push(i+"/"+e+"-1"),localStorage.setItem(t,null==s?void 0:s.join(","))}catch(t){}},t.prototype.getStoresFromStorage=function(){return this.refreshStores("1")},t.prototype.resetStorageStores=function(){this.In.info(Uv+" resetStorageStores"),this.refreshStores("0",this.$v)},t.prototype.removeStoreFromStorage=function(t){return i_(this,void 0,void 0,(function(){return e_(this,(function(i){switch(i.label){case 0:return t===this.$v?[3,2]:(this.In.info(Uv+" removeStore ".concat(t)),[4,this.dropInstance(t)]);case 1:return i.sent(),this.refreshStores("2",t),[3,3];case 2:this.In.info(Uv+" not remove self"),i.label=3;case 3:return[2]}}))}))},t.prototype.refreshStores=function(t,i){var e,n;if(this.In.info(Uv+" refreshStores ".concat(t," ").concat(i)),!localStorage)return[];var s=localStorage.getItem(this.name),r=s?s.split(","):[],o=[],u=[];if(r.length>0){for(var a=[],c=0;c<r.length;c++){var h=r[c].split("-"),f=h[0],l=h[1],d=null===(e=f.split("/"))||void 0===e?void 0:e[0];if(this.In.info(Uv+" refreshStores stores: ".concat(f," ").concat(l)),"2"==t)d!==i&&a.push(f+"-"+l);else if("0"==t)d!==i&&a.push(f+"-"+l),d===i&&a.push(f+"-"+t);else if("2"!==l){if(f.indexOf("/")>-1)this.Kv()-parseInt((null===(n=f.split("/"))||void 0===n?void 0:n[1])||"0")>86400&&u.push(d);var v=d+"/"+this.Kv();a.push(v+"-"+t)}-1===d.indexOf(this.$v)&&"0"==l&&o.push(d)}localStorage.setItem(this.name,a.join(","))}return[o,u]},t.prototype.dropInstance=function(t){return i_(this,void 0,void 0,(function(){var i;return e_(this,(function(e){switch(e.label){case 0:this.In.info(Uv+" dropInstance ".concat(t)),e.label=1;case 1:return e.trys.push([1,4,,5]),[4,t_().dropInstance({name:t})];case 2:return e.sent(),[4,this.manualDeleteDB(t)];case 3:return e.sent(),[3,5];case 4:return i=e.sent(),this.In.info(Uv+" dropInstance fail ".concat(null==i?void 0:i.message)),[3,5];case 5:return[2]}}))}))},t.prototype.manualDeleteDB=function(t){return new Promise((function(i,e){var n=window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB);if(n){var s=n.deleteDatabase(t);s.onsuccess=function(){return i()},s.onerror=function(t){return e(t)},s.onblocked=function(){return e(new Error("please close other connection"))}}else i()}))},t.prototype.getCacheStoreData=function(t,i){return i_(this,void 0,void 0,(function(){var e,n,s,r,o,u,a,c=this;return e_(this,(function(h){switch(h.label){case 0:return h.trys.push([0,12,,13]),e=this.getDeleteKey(),[4,(n=t_().createInstance({name:t})).keys()];case 1:return s=h.sent(),this.In.info(Uv+" ".concat(i," ").concat(t," get cache keys ").concat(s)),r=[],e.forEach((function(t){s.filter((function(i){return i.includes(t)})).length>0&&r.push(t),s=s.filter((function(i){return!i.includes(t)}))})),r.length>0&&(this.In.info(Uv+" ".concat(i," ").concat(t," get cache del keys ").concat(r)),r.forEach((function(t){c.setDeleteKey("remove",t)}))),o=s.filter((function(t){return t.indexOf("_head")>-1})),u=[],this.In.info(Uv+" ".concat(i," ").concat(t," get cache head keys ").concat(JSON.stringify(o))),o.length>0?[4,this.readStoreDatas(o,s,n)]:[3,7];case 2:return(null==(u=h.sent())?void 0:u.length)?[3,6]:(this.In.info(Uv+" ".concat(i," ").concat(t," get cache empty")),i?[4,this.removeOldStoreFromStorage(i,t)]:[3,4]);case 3:return h.sent(),[3,6];case 4:return[4,this.removeStoreFromStorage(t)];case 5:h.sent(),h.label=6;case 6:return[3,11];case 7:return this.In.info(Uv+" ".concat(i," ").concat(t," get cache head empty")),i?[4,this.removeOldStoreFromStorage(i,t)]:[3,9];case 8:return h.sent(),[3,11];case 9:return[4,this.removeStoreFromStorage(t)];case 10:h.sent(),h.label=11;case 11:return[2,u];case 12:return a=h.sent(),this.In.warn(Uv+" get cache failed ".concat(t," ").concat(a)),[3,13];case 13:return[2]}}))}))},t.prototype.readStoreDatas=function(t,i,e){return i_(this,void 0,void 0,(function(){var n,s,r,o;return e_(this,(function(u){switch(u.label){case 0:n=[],s=function(s){var o,u,a,c,h,f,l,d,v,m,p;return e_(this,(function(g){switch(g.label){case 0:u=(o=t[s]).replace("_head",""),a=i.filter((function(t){return t.indexOf(u)>-1})),c=null,h=[],f=[],l=void 0,d=0,g.label=1;case 1:return d<a.length?[4,e.getItem(v=a[d])]:[3,4];case 2:m=g.sent(),v.startsWith(u+"_head")?c=m:v.startsWith(u+"_publish")?h.push(m):v.startsWith(u+"_play")?f.push(m):v.startsWith("qec_"+u)&&(l=m),g.label=3;case 3:return d++,[3,1];case 4:return p=(new Date).getTime()-parseInt(u),c?h.length>0||f.length>0||l?(n.push({timestamp:parseInt(u),head:c,publishInfos:h,playInfos:f,chargeInfos:l}),[3,7]):[3,5]:[3,7];case 5:return 0===h.length&&0===f.length&&!l&&p>6e4?(r.In.info(Uv+" readStoreDatas remove ".concat(o)),[4,e.removeItem(o)]):[3,7];case 6:g.sent(),g.label=7;case 7:return[2]}}))},r=this,o=0,u.label=1;case 1:return o<t.length?[5,s(o)]:[3,4];case 2:u.sent(),u.label=3;case 3:return o++,[3,1];case 4:return[2,n]}}))}))},t.prototype.saveItem=function(t,i){return i_(this,void 0,void 0,(function(){var e;return e_(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.tm.setItem(t,i)];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),this.In.warn(Uv+" save "+JSON.stringify(e)),[3,3];case 3:return[2]}}))}))},t.prototype.getItem=function(t){return i_(this,void 0,void 0,(function(){var i;return e_(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.tm.getItem(t)];case 1:return[2,e.sent()];case 2:return i=e.sent(),this.In.warn(Uv+" get "+JSON.stringify(i)),[3,3];case 3:return[2]}}))}))},t.prototype.removeItem=function(t){return i_(this,void 0,void 0,(function(){var i;return e_(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.tm.removeItem(t)];case 1:return e.sent(),this.In.info(Uv+" removeItem ".concat(JSON.stringify(t))),[3,3];case 2:return i=e.sent(),this.In.warn(Uv+" remove "+JSON.stringify(i)),[3,3];case 3:return[2]}}))}))},t.prototype.clearItems=function(t){return i_(this,void 0,void 0,(function(){var i,e,n,s;return e_(this,(function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),this.In.info(Uv+" call clearItems ".concat(t)),[4,this.tm.keys()];case 1:i=r.sent(),this.In.info(Uv+" clearItems store ".concat(JSON.stringify(i))),e=i.filter((function(i){return i.indexOf(t)>-1})),this.In.info(Uv+" clearItems clear ".concat(JSON.stringify(e))),n=0,r.label=2;case 2:return n<e.length?[4,this.removeItem(e[n])]:[3,5];case 3:r.sent(),r.label=4;case 4:return n++,[3,2];case 5:return this.setDeleteKey("remove",t),[3,7];case 6:return s=r.sent(),this.In.warn(Uv+" clear "+s.toString()),[3,7];case 7:return[2]}}))}))},t.prototype.checkItemsIsClear=function(t){return i_(this,void 0,void 0,(function(){var i,e,n;return e_(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.In.info(Uv+" checkIsClear call ".concat(t)),[4,this.tm.keys()];case 1:return i=s.sent(),e=i.filter((function(i){return i.indexOf(t)>-1})),this.In.info(Uv+" checkIsClear filters ".concat(JSON.stringify(e))),[2,e.length>0];case 2:return n=s.sent(),this.In.warn(Uv+" checkIsClear err ".concat(JSON.stringify(n))),[2,!0];case 3:return[2]}}))}))},t.prototype.getUnReportCachedDatas=function(t){return i_(this,void 0,void 0,(function(){var i,e,n;return e_(this,(function(s){switch(s.label){case 0:return[4,this.filterItems(t)];case 1:return i=s.sent(),e=[],i&&i.length>0?(n=i.filter((function(t){return t.indexOf("_head")>-1})),[4,this.readStoreDatas(n,i,this.tm)]):[3,3];case 2:e=s.sent(),s.label=3;case 3:return[2,e]}}))}))},t.prototype.filterItems=function(t){return i_(this,void 0,void 0,(function(){var i,e;return e_(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.tm.keys()];case 1:return i=n.sent(),[2,""!==t?i.filter((function(i){return-1===i.indexOf(t)})):i];case 2:return e=n.sent(),this.In.warn(Uv+" filter "+JSON.stringify(e)),[3,3];case 3:return[2]}}))}))},t.prototype.getOldStores=function(t){return this.refreshOldStores(t,"1")},t.prototype.refreshOldStores=function(t,i,e){if(this.In.info(Uv+" refresh old ".concat(t," ").concat(i," ").concat(e)),!localStorage)return[];var n=localStorage.getItem(t);if(!(null==n?void 0:n.length))return this.In.info(Uv+" refresh old no storage ".concat(t)),localStorage.removeItem(t),[];var s=n?n.split(","):[],r=[];if(s.length>0){for(var o=[],u=0;u<s.length;u++){var a=s[u].split("-"),c=a[0],h=a[1];this.In.info(Uv+" refresh old stores: ".concat(c," ").concat(h)),"2"==i?c!==e&&o.push(c+"-"+h):"1"===i&&(r.push(c),o.push(c+"-"+i))}localStorage.setItem(t,o.join(","))}return r},t.prototype.removeOldStoreFromStorage=function(t,i){return i_(this,void 0,void 0,(function(){return e_(this,(function(e){switch(e.label){case 0:return i===this.$v?[3,2]:(this.In.info(Uv+" remove old store ".concat(i)),[4,this.dropInstance(i)]);case 1:return e.sent(),this.refreshOldStores(t,"2",i),[3,3];case 2:this.In.info(Uv+" not remove old self"),e.label=3;case 3:return[2]}}))}))},t.prototype.setDeleteKey=function(t,i){this.In.info(Uv+" set del ".concat(t," ").concat(i));var e=this.getDeleteKey(),n=e.findIndex((function(t){return t===i}));"add"===t?-1===n&&e.push(i):n>=0&&e.splice(n,1),this.In.info(Uv+" set del keys ".concat(JSON.stringify(e))),localStorage.setItem(this.deletedKeys,e.join(","))},t.prototype.getDeleteKey=function(){var t=localStorage.getItem(this.deletedKeys),i=t?t.split(","):[];return this.In.info(Uv+" get del keys ".concat(JSON.stringify(i))),i},t}(),s_=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},r_=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};var o_=zh.logreport,u_=function(){function t(t,i,e){var n=this;this.In=t,this.Nn=i,this.Ro=e,this.im=[],this.nm=[],this.sm=0,this.rm=0,this.om=0,this.um=[],this.am=6e4,this.hm=!1,this.fm={},this.lm=6e4,this.dm=20,this.vm=!1,this.beforeunloadListener=function(){n.In.info("".concat(Iv," beforeunload")),n.pm.resetStorageStores()},this.pm=new n_(this.CacheKey,t,this),this.bindListener(),this.bindDestroyListener()}return Object.defineProperty(t.prototype,"uploadCreateTime",{get:function(){return Math.round(this.rm/1e3)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"CacheKey",{get:function(){return"z_s_c2_"+this.Nn.appid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"oldCacheKey",{get:function(){return"z_s_c_"+this.Nn.appid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"billingTimer",{get:function(){return this.Nn.streamCenter.billingTimer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPublishingStream",{get:function(){var t,i=this.Ro.publisherList,e=!1;for(var n in i)if(null===(t=i[n].publisher)||void 0===t?void 0:t.Ia){e=!0;break}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gm",{get:function(){var t=this.Ro.playerList,i=!1;for(var e in t){var n=t[e];if(!(null==n?void 0:n.isProbe)&&(null==n?void 0:n.isStreaming)&&[q.L3,q.RTC].includes(n.playMode)){i=!0;break}}return i},enumerable:!1,configurable:!0}),t.prototype.checkIfSupportNTP=function(){var t,i=null===(t=this.Nn.rtm)||void 0===t?void 0:t.getNetworkInfo().timestamp;i&&(this.In.info("zc.sr.cisn use ntp. gap: "+(i-Date.now())),this.vm=!0)},t.prototype.bm=function(){var t=navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPhone/i),i=navigator.userAgent,e="micromessenger"==i.toLowerCase().match(/MicroMessenger/i),n=i.indexOf("Android")>-1||i.indexOf("Adr")>-1;return t||e&&n?"pagehide":"beforeunload"},t.prototype.bindListener=function(){var t=this.bm();window.addEventListener(t,this.beforeunloadListener)},t.prototype.offListener=function(){var t=this.bm();window.removeEventListener(t,this.beforeunloadListener)},t.prototype.bindDestroyListener=function(){var t=this;this.Nn.listenerList._engineDestroy.push((function(){t.In.info("".concat(Iv," _engineDestroy")),t.fm={},t.pm.resetStorageStores(),t.offListener()}))},t.prototype.updateQualityOrChargeInfo=function(t,i,e){var n;this.In.info(Ev+" update info ".concat(t," ").concat(!!i));var s=this._now();!i||0!==this.im.length||0!==this.nm.length||this._m&&0!==(null===(n=this._m)||void 0===n?void 0:n.infos.length)||(this.rm=s,this._saveSpeedLogHead(),0===this.sm&&(this.sm=s)),i&&(t==ht.publish_quality?this.handlePublishQualityData(i):t==ht.play_quality?this.handlePlayQualityData(i):t==ht.charge&&this.handleChargeInfoData(i));var r=this.ym(),o=r>0,u=e&&o,a=r>8e3,c=0!==this.sm&&s-this.sm>this.lm;(o&&c||a||u)&&(this.In.info(Ev+" start upload fire ".concat(a,",").concat(c,",").concat(u)),this.streamQualityUpload(this.rm,u),this.im=[],this.nm=[],this.resetCharges(),this.rm=0,this.sm=s,this.checkHasDataToReport())},t.prototype.ym=function(){var t,i,e;if(this.im.length>0||this.nm.length>0||(null===(i=null===(t=this._m)||void 0===t?void 0:t.infos)||void 0===i?void 0:i.length)>0){var n=this._getSpeedLogHead(),s={publish_quality_infos:this.im,play_quality_infos:this.nm,network_type:Wo(),client_type:2};return this._m&&(null===(e=this._m)||void 0===e?void 0:e.infos.length)>0&&(s.charge_infos=JSON.parse(JSON.stringify(this._m))),this._createStreamQualityPacket(n,s).byteLength}return 0},t.prototype.checkHasDataToReport=function(){this.In.info(Nv+" call"),this.Ro.publishersLength||0!==Object.keys(this.Ro.playerList).length||!1!==this.billingTimer.isReporting||(this.In.info(Nv+" no stream or charge to report"),this.sm=0),this.hasPublishingStream||this.gm||this.billingTimer.shouldSampleCharge()||(this.In.info(Nv+" no data to report"),this.sm=0)},t.prototype.streamQualityUpload=function(t,i){var e,n,s,r=(null===(n=null===(e=this._m)||void 0===e?void 0:e.infos)||void 0===n?void 0:n.length)>0;if(this.Ro.publishersLength>0||Object.keys(this.Ro.playerList).length>0||r||i){var o=this._getSpeedLogHead(),u={publish_quality_infos:this.im,play_quality_infos:this.nm,network_type:Wo(),client_type:2};if(this._m&&(null===(s=this._m)||void 0===s?void 0:s.infos.length)>0)this._m.timestamp_offset_begin===this._m.timestamp_offset_end&&0===this._m.timestamp_diff?this.In.info(Ev+" no charge time"):(u.charge_infos=JSON.parse(JSON.stringify(this._m)),this.In.info(Ev+" upload charges ".concat(JSON.stringify({timestamp:t,chargeInfos:u.charge_infos}))));this.uploadQuality(t,o,u)}},t.prototype._getStreamReportSocket=function(t){var i=this;return new Xt((function(e,n){var s,r,o,u,a=!1,c=function(){var t;i.In.info(Ev+" speed log socket open"),a=!0,i.wm&&e(i.wm),null===(t=i.wm)||void 0===t||t.removeEventListener("open",c)},h=function(){var t;i.In.info(Ev+" speed log socket close"),a||n("not open, socket closed"),null===(t=i.wm)||void 0===t||t.removeEventListener("close",h)},f=function(){var t;i.In.info(Ev+" speed log socket error"),a||n("not open, socket error"),null===(t=i.wm)||void 0===t||t.removeEventListener("error",f)},l=function(){!function(){var t;null===(t=i.wm)||void 0===t||t.addEventListener("open",c)}(),function(){var t,e;null===(t=i.wm)||void 0===t||t.addEventListener("close",h),null===(e=i.wm)||void 0===e||e.addEventListener("error",f)}()};if(i.wm&&2!=i.wm.readyState&&3!=i.wm.readyState)1==i.wm.readyState?(a=!0,e(i.wm)):l();else{var d=i.Nn.appid,v=i.Nn.idName,m=null===(s=i.Nn.roomList[0])||void 0===s?void 0:s.token;if(!d||!v||!m)return i.In.error(Ev+" appid userid token not exist"),void n("appid userid token not exist");var p="wss://".concat(t,"/ws/report/stream?appid=").concat(d,"&product=rtc&token=").concat(encodeURIComponent(m),"&id_name=").concat(v);i.In.info(Ev+" stream url "+p.split("?")[0]),i.wm=(r=p,void 0===(u=1)&&(u=1),(o=Qf.proxyCtrl)?o.createSocket(r,u):new WebSocket(r)),l()}setTimeout((function(){a||i.Nn.engineDestroy||n("not open, timeout, socket closed")}),1e4)}))},t.prototype._createStreamQualityPacket=function(t,i){var e=o_.SpeedLogHead.create(t),n=o_.QualityEvent.create(i),s=o_.SpeedLogHead.encode(e).finish(),r=o_.QualityEvent.encode(n).finish(),o=this.getQualityHead(s,r),u=new Uint8Array(12+s.length+r.length);return u.set(o),u.set(s,12),u.set(r,12+s.length),u},t.prototype._sendMessageWithCallback=function(t,i,e,n,s,r){var o=this,u=!1,a=!1;1!==t.readyState&&!a&&n&&n(),t.onmessage=function(i){var s=i.data;o.In.info(Ev+" onmessage ".concat(s)),(s+"").includes("success")?(o.In.info(Ev+" quality (".concat(r||"",") upload success")),!a&&e&&e(),u=!0):(!a&&n&&n(),u=!0),t.onmessage=null},t.send(i),setTimeout((function(){u||(s&&s(),a=!0)}),15e3)},t.prototype.uploadQuality=function(t,i,e,n){this.sendPacketReportData(t,i,e,n)},t.prototype.sendPacketReportData=function(t,i,e,n){var s,r=this,o=null===(s=this.In.url)||void 0===s?void 0:s.split("/")[2];if(o){if(this.checkNetworkIsAbnormal())return this.In.warn(Cv+" ".concat(t," network is abnormal")),void this.saveReportPacketsToCache(t,i,e,n);r._getStreamReportSocket(o).then((function(s){if(r.hm)return r.In.warn(Cv+" ".concat(t," is sending")),void r.saveReportPacketsToCache(t,i,e,n);var o=Date.now()%1e4;r.hm=!0;var u=r._createStreamQualityPacket(i,e);r.In.info(Cv+" ".concat(t," send message ").concat(o," ").concat(n," ").concat(null==u?void 0:u.byteLength)),r._sendMessageWithCallback(s,u,(function(){return s_(r,void 0,void 0,(function(){return r_(this,(function(i){switch(i.label){case 0:return this.In.info(Cv+" ".concat(t," send message suc ").concat(o)),this.hm=!1,this.delStreamData(t),n?[4,this.pm.removeStoreFromStorage(n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return this.checkCachePacketsToReport(!0),[2]}}))}))}),(function(){r.In.info(Cv+"".concat(t," send message error")),r.hm=!1,r.retryReportPackets(t,i,e,n)}),(function(){r.In.info(Cv+"".concat(t," send message timeout")),r.hm=!1,r.retryReportPackets(t,i,e,n)}),o),r.In.info(Cv+" ".concat(t," upload quality (").concat(o,"), length: ")+u.length+".")})).catch((function(s){"appid userid token not exist"!==s?(r.In.info(Cv+" open socket error, retry upload quality event"),r.retryReportPackets(t,i,e,n)):r.In.info(Cv+" stop retry upload quality event.")}))}},t.prototype.retryReportPackets=function(t,i,e,n){this.In.info("zc.sr.rrp.0 retry packets"),this.saveReportPacketsToCache(t,i,e,n),this.checkCachePacketsToReport(!1)},t.prototype.checkCachePacketsToReport=function(t){var i=this;this.Sm&&clearTimeout(this.Sm),this.am=t?5e3:6e4,this.Sm=setTimeout((function(){var t=i.um.shift();if(t){var e=t.timeStampKey,n=t._SpeedLogHead,s=t._QualityEvent,r=t.storeName;i.In.info("zc.sr.ccptr"+" ".concat(e," ").concat(r)),i.sendPacketReportData(e,n,s,r)}else i.checkStorageDataToReport()}),this.am)},t.prototype.saveReportPacketsToCache=function(t,i,e,n){(this.In.info(zv+" call ".concat(t)),this.um.length>=this.dm)?this.In.info(zv+" ".concat(this.um.length)):this.um.find((function(i){return i.timeStampKey===t}))||this.um.push({timeStampKey:t,_SpeedLogHead:i,_QualityEvent:e,storeName:n})},t.prototype.checkStorageDataToReport=function(){return s_(this,void 0,void 0,(function(){var t;return r_(this,(function(i){switch(i.label){case 0:return[4,this.pm.getUnReportCachedDatas(0===this.rm?"":this.rm+"")];case 1:return t=i.sent(),this.uploadUnReportDatas(t),[2]}}))}))},t.prototype.getQualityHead=function(t,i){var e=new Uint8Array(12);e[0]=0,e[1]=12,e[2]=t.length>>8,e[3]=t.length-(e[2]<<8),e[4]=i.length>>24,e[5]=i.length-(e[4]<<24)>>16,e[6]=i.length-(e[4]<<24)-(e[5]<<16)>>8,e[7]=i.length-(e[4]<<24)-(e[5]<<16)-(e[6]<<8);var n=Math.ceil(this._now()/1e3);return e[8]=n>>24,e[9]=n-(e[8]<<24)>>16,e[10]=n-(e[8]<<24)-(e[9]<<16)>>8,e[11]=n-(e[8]<<24)-(e[9]<<16)-(e[10]<<8),e},t.prototype.handlePublishQualityData=function(t){var i,e=this.Ro.getRoomByStreamID(t.stream_id),n=null===(i=this.Ro.publisherList[t.stream_id])||void 0===i?void 0:i.publisher;if(e&&n){var s=n.id,r=this.im.find((function(i){return i.stream_id==t.stream_id&&i.video_width==t.frameWidth&&i.video_height==t.frameHeight&&i.session_id==s}));r||(r={stream_id:t.stream_id,session_id:s,video_width:t.frameWidth,video_height:t.frameHeight,infos:[],room_id:e?e.roomID:"",evnvironment:1,room_session_id:e?Number(e.roomSessionID):0,resource_type:2},t.ipv4&&(r.ipv4=t.ipv4,this.In.info("".concat(kv," stream_id: ").concat(t.stream_id,", ip: ").concat(r.ipv4," "))),t.ipv6&&(r.ipv6=t.ipv6,this.In.info("".concat(kv," stream_id: ").concat(t.stream_id," ip: ").concat(r.ipv6," "))),this.im.push(r)),r.infos.push({audio_bitrate:Math.round(t.audioBitrate)||0,video_bitrate:Math.round(t.videoBitrate)||0,video_capture_fps:Math.round(10*t.videoFPS)||0,video_network_fps:Math.round(10*t.videoTransferFPS)||0,uplink_plr:t.audioPacketsLostRate,rtt:Math.round(1e3*t.currentRoundTripTime)||0,audio_network_fps:Math.round(10*t.audioFPS),captured_sound_level:Math.round(100*t.audioLevel),sample_time_offset:Math.round((this._now()-this.rm)/10)}),this.saveStreamInfo("publish",r)}else this.In.info("".concat(kv," room not exist. ").concat(!!e," "))},t.prototype.handlePlayQualityData=function(t){var i=this.Ro.getRoomByStreamID(t.stream_id),e=this.Ro.playerList[t.stream_id];if(e&&i){var n={l3:3,rtc:2,cdn:2}[e.playMode],s=e.id,r=this.nm.find((function(i){return i.stream_id==t.stream_id&&i.video_width==t.frameWidth&&i.video_height==t.frameHeight&&i.resource_type==n&&i.session_id==s}));r||(r={stream_id:t.stream_id,session_id:s,video_width:t.frameWidth,video_height:t.frameHeight,infos:[],room_id:i?i.roomID:"",room_session_id:i?Number(i.roomSessionID):0,resource_type:n},t.ipv4&&(r.ipv4=t.ipv4,this.In.info("".concat(Tv," ").concat(t.stream_id," ip ").concat(r.ipv4," "))),t.ipv6&&(r.ipv6=t.ipv6,this.In.info("".concat(Tv," ").concat(t.stream_id," ip ").concat(r.ipv6," "))),this.nm.push(r)),r.infos.push({audio_bitrate:Math.round(t.audioBitrate)||0,video_bitrate:Math.round(t.videoBitrate)||0,video_network_fps:Math.round(10*t.videoFPS)||0,downlink_plr:Math.round(t.audioPacketsLostRate)||0,audio_network_fps:Math.round(10*t.audioFPS)||0,audio_break_duration:Math.round(t.audio_break_duration/10),video_break_duration:Math.round(t.video_break_duration/10),rtt:Math.round(1e3*t.currentRoundTripTime)||0,rendered_sound_level:Math.round(100*t.audioLevel),audio_break_cancel_duration:Math.round(t.audio_break_cancel_duration/10),video_break_cancel_duration:Math.round(t.video_break_cancel_duration/10),audio_decode_time:Math.round(t.audio_decode_time/10),video_decode_time:Math.round(t.video_decode_time/10),real_sampling_interval:Math.round(t.real_sampling_interval/10),video_frames_decoded:Math.round(t.videoFramesDecoded)||0,video_frames_dropped:Math.round(t.videoFramesDropped)||0,sample_time_offset:Math.round((this._now()-this.rm)/10),peer_to_peer_plr:t.peerToPeerPacketLostRate,peer_to_peer_delay:t.peerToPeerDelay}),this.saveStreamInfo("play",r)}else this.In.info("".concat(Tv," player or room not exist. ").concat(!!e," ").concat(!!i," "))},t.prototype.handleChargeInfoData=function(t){var i,e;this._m||(this._m={room_id:"",timestamp_offset_begin:0,timestamp_offset_end:0,timestamp_diff_flag:0,timestamp_diff:0,infos:[]}),(null===(i=this.Nn.roomList[0])||void 0===i?void 0:i.roomID)&&(this._m.room_id=null===(e=this.Nn.roomList[0])||void 0===e?void 0:e.roomID);var n=this._now(),s=this.rm;this.In.info("".concat(Rv," charge ").concat(n," ").concat(s," ").concat(JSON.stringify(t))),0===this._m.infos.length&&(this._m.timestamp_offset_begin=Math.round((n-s)/1e3),0!==this.om&&(this._m.timestamp_diff=Math.round((n-this.om)/1e3),this._m.timestamp_diff_flag=1,this.In.info("".concat(Rv," charge time diff ").concat(this.om," ").concat(this._m.timestamp_diff)))),this.om=n,this._m.timestamp_offset_end=Math.round((n-s)/1e3),this._m.infos.push(t),this.saveChargeInfos(this._m)},t.prototype.supplementChargeTime=function(){0===this.om&&(this.om=this._now(),this.In.info("".concat("zc.sr.sct.0"," charge time ").concat(this.om," ")))},t.prototype.resetCharges=function(){this._m&&(this._m={room_id:"",timestamp_offset_begin:0,timestamp_offset_end:0,timestamp_diff_flag:0,timestamp_diff:0,infos:[]})},t.prototype.resetChargeTime=function(){this.om=0},t.prototype.stopSampleCharge=function(){this.resetChargeTime(),this.checkHasDataToReport()},t.prototype._saveSpeedLogHead=function(){if(0!==this.rm){var t=this._getSpeedLogHead();this.pm.saveItem(this.rm+"_head",t)}},t.prototype.saveStreamInfo=function(t,i){0!==this.rm&&this.pm.saveItem("".concat(this.rm,"_").concat(t).concat(i.stream_id),i)},t.prototype.saveChargeInfos=function(t){0!==this.rm&&this.pm.saveItem("qec_".concat(this.rm),t)},t.prototype.delStreamData=function(t){var i=this.um.findIndex((function(i){return i.timeStampKey===t}));i>-1&&(this.In.info("".concat(Iv," del cache ").concat(i," ").concat(t)),this.um.splice(i,1)),this.clearStoreItems(t+"")},t.prototype.clearStoreItems=function(t){var i=this;this.In.info("".concat("zc.sr.csi.0"," clearStoreItems ").concat(t)),this.pm.setDeleteKey("add",t),this.pm.clearItems(t),setTimeout((function(){return s_(i,void 0,void 0,(function(){return r_(this,(function(i){switch(i.label){case 0:return[4,this.checkClear(t)];case 1:return i.sent(),[2]}}))}))}),1e3)},t.prototype.checkClear=function(t){return s_(this,void 0,void 0,(function(){var i,e=this;return r_(this,(function(n){switch(n.label){case 0:return this.In.info("".concat(Dv," call ").concat(t)),[4,this.pm.checkItemsIsClear(t)];case 1:return i=n.sent(),this.fm[t]?this.fm[t]++:this.fm[t]=1,i?(this.In.info("".concat(Dv," count ").concat(t," ").concat(this.fm[t])),this.fm[t]&&this.fm[t]<=5&&(this.pm.clearItems(t),setTimeout((function(){return s_(e,void 0,void 0,(function(){return r_(this,(function(i){switch(i.label){case 0:return[4,this.checkClear(t)];case 1:return i.sent(),[2]}}))}))}),1e3))):delete this.fm[t],[2]}}))}))},t.prototype._getSpeedLogHead=function(i){var e={version:20,timestamp:i||Math.round(this.rm/1e3),event:0,app_id:this.Nn.appid,user_id:this.Nn.idName,biz_type:1,time_offset:jt.MAX_VALUE,os_type:lh(),scenario:100===this.Nn.scenario?void 0:this.Nn.scenario,sdk_version:v,report_version:this.Nn.sdkVerNum,customer_context:t.reportCustomerContext};return this.In.info("".concat(Iv," getSpeedLogHead ").concat(e.timestamp)),e},t.prototype.checkStreamReport=function(){var t=this;this.In.info("".concat(Iv," check un report call"));var i=this.pm.getStoresFromStorage(),e=i[0],n=i[1];this.In.info("".concat(Iv," store: ").concat(null==e?void 0:e.length,", old: ").concat(null==n?void 0:n.length));for(var s=function(i){var n=e[i];r.pm.getCacheStoreData(n).then((function(i){t.In.info("".concat(Iv," check un report ").concat(n," ").concat(null==i?void 0:i.length)),t.uploadUnReportDatas(i,n)})).catch((function(i){t.In.info("".concat(Iv," check un report fail ").concat(n," ").concat(null==i?void 0:i.message))}))},r=this,o=0;o<e.length;o++)s(o);for(var u=function(i){var e=n[i];a.In.info("".concat(Iv," old ").concat(e," check un report")),a.pm.getCacheStoreData(e).then((function(i){t.In.info("".concat(Iv," old check un report ").concat(e," ").concat(null==i?void 0:i.length)),t.uploadUnReportDatas(i,e)})).catch((function(i){t.In.info("".concat(Iv," old check un report fail ").concat(e," ").concat(null==i?void 0:i.message))}))},a=this,c=0;c<n.length;c++)u(c)},t.prototype.uploadUnReportDatas=function(t,i,e){return s_(this,void 0,void 0,(function(){var n=this;return r_(this,(function(s){switch(s.label){case 0:return this.Nn.roomList.length<=0?(this.In.warn(Ov+" no room"),[2]):(null==t?void 0:t.length)>0?(t.forEach((function(t){var e,s,r=t.timestamp,o=t.head,u=t.publishInfos,a=t.playInfos,c=t.chargeInfos;if(n.In.info("".concat(Ov," cacheData publish ").concat(r," ").concat(JSON.stringify(u))),n.In.info("".concat(Ov," cacheData play ").concat(r," ").concat(JSON.stringify(a))),n.In.info("".concat(Ov," cacheData charge ").concat(r," ").concat(JSON.stringify(c))),n.In.info("".concat(Ov," cacheData ").concat(r," ").concat(n.fm[r])),n.fm[r])n.In.info("".concat(Ov," the data ").concat(r," report"));else{var h={publish_quality_infos:u,play_quality_infos:a,network_type:Wo(),client_type:2};(null===(e=null==c?void 0:c.infos)||void 0===e?void 0:e.length)>0&&(h.charge_infos=JSON.parse(JSON.stringify(c))),i&&(n.In.info("".concat(Ov," save ").concat(r," ").concat(i)),n.pm.saveItem(r+"_head",o),u.forEach((function(t){n.pm.saveItem("".concat(r,"_publish").concat(t.stream_id),t)})),a.forEach((function(t){n.pm.saveItem("".concat(r,"_play").concat(t.stream_id),t)})),(null===(s=null==c?void 0:c.infos)||void 0===s?void 0:s.length)>0&&n.pm.saveItem("qec_".concat(r),c)),n.In.info(Ev+" start upload cache quality. ".concat(r)),n.saveReportPacketsToCache(r,o,h)}})),i?(this.In.info(Ev+" remove storage store ".concat(e," ").concat(i)),e?[4,this.pm.removeOldStoreFromStorage(e,i)]:[3,2]):[3,4]):[3,5];case 1:return s.sent(),[3,4];case 2:return[4,this.pm.removeStoreFromStorage(i)];case 3:s.sent(),s.label=4;case 4:this.checkCachePacketsToReport(!0),s.label=5;case 5:return[2]}}))}))},t.prototype.reportOldCacheData=function(){var t=this,i=this.pm.getOldStores(this.oldCacheKey),e="zc.sqrw.rlcd.0";this.In.info("".concat(e," old: ").concat(null==i?void 0:i.length));for(var n=function(n){var r=i[n];s.In.info("".concat(e," old ").concat(r," check un report")),s.pm.getCacheStoreData(r,s.oldCacheKey).then((function(i){t.In.info("".concat(e," old check un report ").concat(r," ").concat(null==i?void 0:i.length)),t.uploadUnReportDatas(i,r,t.oldCacheKey)})).catch((function(i){t.In.info("".concat(e," old check un report fail ").concat(r," ").concat(null==i?void 0:i.message))}))},s=this,r=0;r<i.length;r++)n(r)},t.prototype._now=function(t){var i;return void 0===t&&(t=0),i=this.vm?this.Nn.rtm.getNetworkInfo().timestamp:Date.now(),1===t&&(i=Math.round(i/1e3)),i},t.prototype.checkNetworkIsAbnormal=function(){var t;return(null===(t=this.Nn.rtm)||void 0===t?void 0:t.isDisConnect())&&this.Nn.networkState==B.offline?(this.In.warn(Pv+" offline. "),!0):!this.Ro.isNetAgentConnect()&&(this.In.warn(Pv+" netAgent disconnect. "),!0)},t.prototype.resetReport=function(){var t=this;this.im=[],this.nm=[],this.rm=0,this.sm=0,this.Sm&&(clearTimeout(this.Sm),this.Sm=null),setTimeout((function(){t.wm&&(t.wm.close(),t.wm=void 0,t.hm=!1)}),2e4)},t.reportCustomerContext=0,t}();function a_(){var t={},i=this,e=-10;var n={init:function(n,s){var r="",o=0;try{importScripts(n),i._ModuleFn(t),r="suc",o=0}catch(t){o=-1,r="fail "+(null==t?void 0:t.message)}i.postMessage({code:o,errMsg:r,eventId:s}),i.postMessage({code:e,msg:"init webassembly "+r})},parseToMiniSdp:function(n,s){var r=t._parseToMiniSdp,o=t.allocateUTF8,u=t._getBuffer,a=t.HEAPU8,c=t._free;i.postMessage({code:e,msg:"ptm call"});var h=o(n);i.postMessage({code:e,msg:"ptm allocate"});var f=r(h);if(i.postMessage({code:e,msg:"ptm bufLen "+f}),f<0)return i.postMessage({code:f,eventId:s});var l=u();i.postMessage({code:e,msg:"ptm getBuf "+l});var d=new Uint8Array(a.subarray(l,l+f-1))||new Uint8Array;i.postMessage({code:0,data:d,eventId:s});try{c(h),c(f),c(l)}catch(t){i.postMessage({code:e,msg:"ptm free e "+(null==t?void 0:t.message)||0})}},loadMiniSdpToOriginSdp:function(n,s){var r,o,u,a,c=t._loadMiniSdpToSdp,h=t.UTF8ToString,f=t._malloc,l=t.HEAPU8,d=t._free;i.postMessage({code:e,msg:"lmto call"});var v=f(n.length);i.postMessage({code:e,msg:"lmto malloc"}),l.set(n,v);var m=c(v,n.byteLength);i.postMessage({code:e,msg:"lmto s"});var p=h(m)||"";i.postMessage({code:e,msg:"lmto o "+p.length});for(var g=p.split("\r\n")||[],b=["ice-ufrag","ice-pwd","ice-options","fingerprint","setup","mid","extmap","sendrecv","sendonly","recvonly","inactive","rtpmap","rtcp-fb","fmtp","ssrc","candidate","msid"];g.length;){var _=g.length,y=null===(o=null===(r=g[_-1])||void 0===r?void 0:r.split("=")[1])||void 0===o?void 0:o.split(":")[0];if(-1!=(null===(u=g[_-1])||void 0===u?void 0:u.indexOf("="))&&b.includes(y)&&0!=(null===(a=g[_-1])||void 0===a?void 0:a.indexOf("="))&&!/[^\x20-\x7E]+/.test(g[_-1]))break;g.pop()}p=g.join("\r\n"),i.postMessage({code:0,data:p+="\r\n",eventId:s});try{d(v)}catch(t){i.postMessage({code:e,msg:"lmto free "+(null==t?void 0:t.message)})}}};onmessage=function(t){var s;n[t.data.command]?n[t.data.command](t.data.val,t.data.eventId):i.postMessage({code:e,msg:"om cmd invalid "+(null===(s=null==t?void 0:t.data)||void 0===s?void 0:s.command)})}}var c_,h_=o(8754).G,f_=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},l_=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},d_=function(){function t(t){var i=this;this.In=t,this.initOK=!1,this.Em={},this.seq=1;var e=a_.toString().trim().match(/\{([\s\S]*)\}/)[1],n=URL.createObjectURL(new window.Blob([e],{type:"text/javascript"}));this.Om=new Worker(n);var s=function(t){for(var i=(t+"=".repeat((4-t.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),e=window.atob(i),n=new Uint8Array(e.length),s=0;s<e.length;++s)n[s]=e.charCodeAt(s);return n}("XQAAgABWrAUAAAAAAAA7GEqmJp5C8XSHNxuPdDQkJ0d7U73umXLRdac5mrCaApq7MQGS8MrEnyRU9aV0+U4EFEHhVAzfk7w70byjKuOE/GE/J06CWMz5i4KNvRWM/oDJ+T8c547jzq9OeVOvXfWcjhZ/6HHpbdxYjuvwqQE1ugV0akj8lCdlWak747o0DFF3nkhZwLeWKMyF0KmL5+KGOThQmUVMRKI2wAsOZfBrnqDOqp7JXyT0TdOhV3Yc17gRpEAEK9Ae41EWVORrr1Zglw+hNv3gy/x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8mErpL28b4q2x+xdhMKYADKzMkpTcK/kF26fXvWnQMXfZ9STyTGel0s7gMUF1hd4+bKNK3cBsvejfe8Z2gPvZ04bC8+QSxgvlnIUNuxVXTnlhdZAGG4jotso/Vc6tEoPO3UM/ogzESuf03yUHa79ZGjPJXZHsZvSwv//gou/mMKog8KtanS6iA7QMkjrcjQuPIXI66+meL19SmqpZVn/r4szTG9QOGtWq6a0khCRBPIxut8SqBrPbqTMmdt99HV71/zB2ZErx8XNGxdN5QyprPJGGdPImHe3Z3w4197lqlLDkcAW7+WDkyDGMuneL1LZZ27Nw2YL+GzvPn5iA8m83pW7/bJ9nv8UyNN6QfY7PVb1+H86v8+HG6F28J7Y6rhw/K9yfB3vJ24CJ9hvSFTd0FZAVeoUzMBJOiATMV+wPgLbSOMd3V6rMm2ts46hcmsgsjEfmAmyvzQZ0YwqzXH4l7G0BUt885spmR8HTYhWN4MxpiiaYgDHFH8W5Oml0zIbs9CBROzbwg9//80fzl+9BFKzL7HE0Xf0NANoxSlazoki6bnn7JAJR2fz/jjgA23Y3F77nsEUHYgw2RmkrVEZT/yebA2NiJvYObqhp9Drmj2zmoH6ECCQ5rhc3Oe/PkdH/Md3j3COwFtG0lZjZ22UM4C9ODCE//K4LmnIMlQHwBH9fgCltk+4QZPK67i15tmYGB3ovsa9nYeVw37oNNtDAY6cIHwSfodApfrLhQidN1tBXiUwMOvosleLPpiMDyWeNT2LmBYBfp3X7M5c9EbTSalfkjAUooHy5Y0fO5QxlG15k+ossyp5auHI29rLyBJii2iMsQd4uRemeFE3/vL3gqA=="),r=h_.decompress(Array.from(s)),o=URL.createObjectURL(new window.Blob([r],{type:"text/javascript"}));this.Om.onmessage=function(t){var e=t.data;e.eventId&&Ht(i.Em[e.eventId])?(i.Em[e.eventId]({code:e.code,data:e.data}),delete i.Em[e.eventId]):-10===(null==e?void 0:e.code)&&i.In.info("zc.ms.0.w "+e.msg)},this.Om.onmessageerror=function(t){console.error("Error receiving message from worker: ".concat(t))},this.Om.onerror=function(t){i.initOK=!1,i.In.warn("zc.ms.0.c worker err "+(null==t?void 0:t.message)||0)},this.initWasm(o).then((function(){i.initOK=!0})).catch((function(t){i.initOK=!1}))}return t.prototype.messageHandler=function(t){var i=this;return new Xt((function(e){t.eventId="".concat(t.command,"_").concat(i.seq++),i.Om.postMessage(t),i.Em[t.eventId]=function(t){e(t)}}))},t.prototype.initWasm=function(t){return f_(this,void 0,void 0,(function(){var i=this;return l_(this,(function(e){return[2,new Promise((function(e,n){return f_(i,void 0,void 0,(function(){var i;return l_(this,(function(s){switch(s.label){case 0:return this.In.info("zc.ms.0.c init"),[4,this.messageHandler({command:"init",val:t})];case 1:return 0===(i=s.sent()).code?e(!0):(this.In.warn("zc.ms.0.c fail "+i.errMsg),n(!1)),[2]}}))}))}))]}))}))},t.prototype.parseToMiniSdp=function(t){return f_(this,void 0,void 0,(function(){var i=this;return l_(this,(function(e){return[2,new Xt((function(e,n){return f_(i,void 0,void 0,(function(){var i,s;return l_(this,(function(r){switch(r.label){case 0:return qt(t)&&t?this.initOK?[4,this.messageHandler({command:"parseToMiniSdp",val:t})]:(n(tn),[2]):(n(Ii),[2]);case 1:if(0===(i=r.sent()).code)e(i.data);else{switch(s=void 0,i.code){case-1:s=Re;break;case-2:s=Ie;break;case-3:s=Ne}n(s)}return[2]}}))}))}))]}))}))},t.prototype.loadMiniSdpToOriginSdp=function(t){return f_(this,void 0,void 0,(function(){var i=this;return l_(this,(function(e){return[2,new Xt((function(e,n){return f_(i,void 0,void 0,(function(){var i;return l_(this,(function(s){switch(s.label){case 0:return Ft(t)?this.initOK?[4,this.messageHandler({command:"loadMiniSdpToOriginSdp",val:t})]:(n(tn),[2]):(n(Ii),[2]);case 1:return 0==(i=s.sent()).code&&e(i.data),[2]}}))}))}))]}))}))},Object.defineProperty(t,"isSupported",{get:function(){return!(!window.WebAssembly||!window.Worker)},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.Om.terminate()},t}();!function(t){t.SAVED_CHARGEINFO_REPORT="zc.bill.scir",t.CHARGEINFO_SAVING_LOCALSTORAGE="zc.bill.cisl",t.CHARGEINFO_GET_AND_REMOVE_LOCALSTORAGE="zc.bill.cigrl",t.START_CHARGE_INFO_TIMER="zc.bill.tm.scit"}(c_||(c_={}));var v_,m_=function(){function t(t,i){this.In=t,this.Nn=i,this.Tm=5e3,this.km=!1}return Object.defineProperty(t.prototype,"Ro",{get:function(){return this.Nn.streamCenter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Rm",{get:function(){var t;return null===(t=this.Ro)||void 0===t?void 0:t.Rm},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Im",{get:function(){return Object.values(this.Ro.playerList).filter((function(t){return!1===(null==t?void 0:t.isProbe)})).length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPublishingStream",{get:function(){var t,i=this.Ro.publisherList,e=!1;for(var n in i)if(null===(t=i[n].publisher)||void 0===t?void 0:t.Ia){e=!0;break}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasPlayingRTCAndL3Stream",{get:function(){var t,i,e=this.Ro.playerList,n=!1;for(var s in e)if(!(null===(t=e[s])||void 0===t?void 0:t.isProbe)&&(null===(i=e[s])||void 0===i?void 0:i.isStreaming)&&[q.RTC,q.L3].includes(e[s].playMode)){n=!0;break}return n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldEndSampleCharge",{get:function(){var t,i;return!this.Ro||!!this.km&&(this.shouldReportRoomTime?0===(null===(t=this.Nn.rtm)||void 0===t?void 0:t.stateCenter.roomModulesList.filter((function(t){return!t.isLogout()||!t.isDisConnect()})).length):0===(null===(i=this.Nn.appConfig.speedlog_config)||void 0===i?void 0:i.charge_info_report_mode)?0===this.Ro.publishersLength:0===this.Im)},enumerable:!1,configurable:!0}),t.prototype.report=function(t){var i,e,n;if(void 0===t&&(t=!1),this.In.info("zc.bill.tm.r.0 call"),this.Ro){if(t)return this.In.info("zc.bill.tm.r.0 stop"),void(null===(i=this.Rm)||void 0===i||i.updateQualityOrChargeInfo(ht.charge,void 0,!0));if(!this.shouldSampleCharge())return this.In.info("zc.bill.tm.r.0 not sample charge"),null===(e=this.Rm)||void 0===e||e.updateQualityOrChargeInfo(ht.charge,void 0),void this.Rm.resetChargeTime();var s=this.samplingChargeInfos();null===(n=this.Rm)||void 0===n||n.updateQualityOrChargeInfo(ht.charge,s)}else this.In.info("zc.bill.tm.r.0 no stream center")},t.prototype.shouldStartReportCharge=function(){if(!this.Nn.appConfig)return this.In.info("zc.bill.ssrc.0 no app config"),!1;var t=this.Nn.appConfig.speedlog_config.charge_info_report_cycle;return this.In.info("zc.bill.ssrc.0 speedlog config ".concat(JSON.stringify(this.Nn.appConfig.speedlog_config))),!(!Lt(t)||0===t)&&(this.Tm=1e3*t,!0)},t.prototype.shouldSampleCharge=function(){var t,i=this;if(!this.Nn.appConfig)return this.In.info("zc.bill.ssc.0 no app config"),!1;var e=this.Nn.appConfig.speedlog_config,n=e.charge_info_report_mode,s=e.charge_info_report_no_playing,r=!1,o=null===(t=this.Nn.rtm)||void 0===t?void 0:t.stateCenter.roomModulesList.filter((function(t){return!t.isLogout()})),u=function(t){return 1===t||i.hasPublishingStream};return 1===s?0!==(null==o?void 0:o.length)&&(this.hasPlayingRTCAndL3Stream||0===this.Im)&&(r=u(n)):0!==s&&void 0!==s||!this.hasPlayingRTCAndL3Stream||(r=u(n)),r},Object.defineProperty(t.prototype,"shouldReportRoomTime",{get:function(){var t,i,e,n;return!(!(null===(t=this.Nn.rtm)||void 0===t?void 0:t.stateCenter.appConfig)||!(null===(i=this.Nn.rtm)||void 0===i?void 0:i.stateCenter.appConfig.speedlog_config)||0===(null===(e=this.Nn.rtm)||void 0===e?void 0:e.stateCenter.appConfig.speedlog_config.charge_info_report_cycle)||1!==(null===(n=this.Nn.rtm)||void 0===n?void 0:n.stateCenter.appConfig.speedlog_config.charge_info_report_no_playing))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReporting",{get:function(){return this.km},enumerable:!1,configurable:!0}),t.prototype.startChargeInfoTimer=function(){var t=this;if(this.Nm&&(clearTimeout(Number(this.Nm)),this.Nm=null,this.shouldEndSampleCharge))return this.In.info(c_.START_CHARGE_INFO_TIMER+" chargeinfos timer report ended"),void(this.km=!1);this.Nm=setTimeout((function(){t.report(),t.startChargeInfoTimer()}),this.Tm)},t.prototype.supplementPlayingChargeTime=function(){this.km&&this.Rm.supplementChargeTime()},t.prototype.startChargeInfosUpload=function(){this.shouldStartReportCharge()&&(this.km||(this.km=!0,this.shouldReportRoomTime&&this.report(),this.startChargeInfoTimer(),this.In.info("zsc.sciu.0 call")))},t.prototype.stopChargeInfosUpload=function(){this.In.info("zsc.sciu.1 call"),this.Nm&&this.shouldEndSampleCharge&&(this.In.info("zsc.sciu.1 stop"),clearTimeout(Number(this.Nm)),this.Nm=null,this.shouldReportRoomTime&&this.report(!0),this.km=!1,this.Rm.stopSampleCharge(),this.In.info("zsc.sciu.1 chargeinfos timer report ended"))},t.prototype.destroy=function(){this.In.info("zsc.ds.0 call"),this.Nm&&(clearTimeout(Number(this.Nm)),this.Nm=null),this.km=!1},t.prototype.samplingChargeInfos=function(){var t,i;this.In.info("zsc.cci.0 call");var e={is_publishing:0,no_playing:0},n=this.Ro,s=n.publisherList,r=n.playerList;for(var o in s){6===s[o].publisher.state&&(e.is_publishing=1);break}var u=function(t){var i=r[t];if(i.isProbe||!i.isStreaming||![q.RTC,q.L3].includes(i.playMode))return"continue";i.playMode===q.RTC?(void 0===e.play_max_audio_bitrate&&(e.play_max_audio_bitrate=0),void 0===e.play_stream_resolution_infos&&(e.play_stream_resolution_infos=[])):i.playMode===q.L3&&(void 0===e.play_l3_max_audio_bitrate&&(e.play_l3_max_audio_bitrate=0),void 0===e.play_l3_stream_resolution_infos&&(e.play_l3_stream_resolution_infos=[]));var n={width:i.qualityHandler.Vl.frameWidth,height:i.qualityHandler.Vl.frameHeight},s={video_width:n&&n.width?n.width:0,video_height:n&&n.height?n.height:0,count:1};!function(t){var n,r=t===q.L3,o=t===q.RTC;if(o?n=e.play_stream_resolution_infos:r&&(n=e.play_l3_stream_resolution_infos),!(null==n?void 0:n.find((function(t){return t.video_width==s.video_width&&t.video_height==s.video_height&&(t.count++,!0)})))&&(null==n||n.push(s)),0==s.video_width&&0==s.video_height){var u=i.qualityHandler.Vl.audioBitrate;o?u>e.play_max_audio_bitrate&&(e.play_max_audio_bitrate=Math.round(u)):r&&u>e.play_l3_max_audio_bitrate&&(e.play_l3_max_audio_bitrate=Math.round(u))}}(i.playMode)};for(var a in r)u(a);return!this.shouldReportRoomTime||e.play_stream_resolution_infos&&0!==(null===(t=e.play_stream_resolution_infos)||void 0===t?void 0:t.length)||e.play_l3_stream_resolution_infos&&0!==(null===(i=e.play_l3_stream_resolution_infos)||void 0===i?void 0:i.length)||(e.no_playing=1),e},t}(),p_=function(){function t(){this.Cm={},this.zm=500}return t.prototype.isTrackStopBySDK=function(t){return void 0!==this.Cm[t.id]&&performance.now()-this.Cm[t.id]<=this.zm},t.prototype.recordStopTrack=function(t){t&&(this.Cm[t.id]=performance.now())},t}(),g_=function(){function t(t){this.In=t,this.Dm=new p_}return t.prototype.isTrackStopBySDK=function(t){return this.Dm.isTrackStopBySDK(t)},t.prototype.stopTrack=function(t){t&&(this.In.info("zc.tk.ut track "+t.id+" stop"),this.Dm.recordStopTrack(t),t.stop())},t}();function b_(){var t=this,i=243,e=new Uint8Array([0,0,0,1,101,184,0,4,0,0,9,255,254,222,35,192,166,30,73,128]),n=new Uint8Array([0,0,0,1,103,77,64,51,140,141,78,64,60,34,17,168,0,0,0,1,104,238,60,128]),s={},r={},o={},u={},a=function(){function t(t){this.view=t,this.offset=0,this.current_start_code_size=0,this.current_nalu_start=0,this.current_nalu_size=0,this.start_code_size=0,this.nalu_start=0,this.left_size=0,this.nalu_size=0,this.left_size=t.byteLength}return t.prototype.FindStartCode=function(){var t=this.view.byteLength-this.offset;for(this.current_start_code_size=0,this.current_nalu_start=-1;t>=3;){if(0==this.view.getUint8(this.offset)&&0==this.view.getUint8(this.offset+1)&&1==this.view.getUint8(this.offset+2))return this.current_start_code_size=3,this.current_nalu_start=this.offset,this.offset-1>=0&&0==this.view.getUint8(this.offset-1)&&(++this.current_start_code_size,--this.current_nalu_start),this.offset+=3,!0;--t,++this.offset}return!1},t.prototype.FindNalu=function(){return this.start_code_size=0,this.nalu_start=0,this.nalu_size=0,!(this.offset>=this.view.byteLength)&&(!!this.FindStartCode()&&(this.start_code_size=this.current_start_code_size,this.nalu_start=this.current_nalu_start,!0))},t.prototype.NextNalu=function(t){if(this.start_code_size=0,this.nalu_start=0,this.nalu_size=0,this.offset>=this.view.byteLength)return!1;if(!this.FindStartCode())return!1;if((this.start_code_size=this.current_start_code_size,this.nalu_start=this.current_nalu_start,t)&&6!=(31&this.view.getUint8(this.nalu_start+this.start_code_size)))return!0;return this.FindStartCode()?(this.offset=this.current_nalu_start,this.nalu_size=this.current_nalu_start-this.nalu_start,!0):(this.nalu_size=this.view.byteLength-this.nalu_start,!0)},t}();function c(t,i){void 0===i&&(i=0);for(var e=t.length,n=[],s=0;s<e;)s>=i&&e-s>=3&&!t[s]&&!t[s+1]&&3==t[s+2]?(n.push(t[s++]),n.push(t[s++]),s++):n.push(t[s++]);var r=new Uint8Array(n);return{output:r,outLength:r.length}}function h(t){var i=0,e=0;return i=t[e++]<<24,i|=t[e++]<<16,i|=t[e++]<<8,i|=t[e++]}function f(t,e,n){var s=t.byteLength,r=parseInt(s/255),o=s%255,u=new ArrayBuffer(1+(r+1)+s+1),a=new DataView(u),c=0;a.setUint8(c++,1===e?5:i);for(var h=0;h<r;h++)a.setUint8(c++,255);a.setUint8(c++,o);var f=new DataView(t);for(h=0;h<(null==t?void 0:t.byteLength);h++)a.setInt8(c++,f.getInt8(h));a.setInt8(c++,128);var l=new Uint8Array(u),d=l;if(n){var v=function(t){for(var i=[],e=t.length,n=0,s=0;s<e;++s){var r=t[s];r<=3&&n>=2&&(i.push(3),n=0),i.push(t[s]),0==r?++n:n=0}var o=new Uint8Array(i);return{output:o,outLength:o.length}}(l).output;d=v}return{rbspView:d,ebspLength:d.length}}function l(o,u,l,d,v){var m=void 0,p=v[d],g=p.isLowStream,b=p.kind;if(b=b||"video",g=g||!1,"encode"===o?m=function(t,i){"audio"===b?i.enqueue(t):p.onlyAudio?function(t,i,r,o){var u=s[r];if(u){var a=o?u.lowStreamSideInfos:u.sideInfos,c=0,h="key"===t.type,l=performance.now(),d=0,v=[];if(a.length>0){for(var m=a.length>=9?9:a.length,p=0;p<m;p++){var g=f(a[p],u.type,u.emulationPreventionByte);d+=5+(T=g.ebspLength),v.push(g)}o?u.lowStreamSideInfos=[]:u.sideInfos=[],l-u.recvLastKeyFrameTime>2e3&&(h=!0)}h&&(c=n.length+e.length);var b=new ArrayBuffer(d+c),_=new DataView(b),y=0;if(h)for(var w=new DataView(n.buffer),S=0;S<n.length;S++)_.setInt8(y++,w.getInt8(S));for(p=0;p<v.length;p++){var E=v[p],O=E.rbspView,T=E.ebspLength;_.setUint8(y++,0),_.setUint8(y++,0),_.setUint8(y++,0),_.setUint8(y++,1),_.setUint8(y++,6);for(var k=0;k<T;k++)_.setInt8(y++,O[k-0])}if(h){var R=new DataView(e.buffer);for(S=0;S<e.length;S++)_.setInt8(y++,R.getInt8(S))}t.data=b,h&&(u.recvLastKeyFrameTime=l),i.enqueue(t)}else i.enqueue(t)}(t,i,d,g):function(t,i,e,n){var r=s[e];if(r){var o=n?r.lowStreamSideInfos:r.sideInfos;if(o.length>0){for(var u=new DataView(t.data),c=[],h=0,l=0;l<o.length;l++){var d=f(o[l],r.type,r.emulationPreventionByte);h+=5+(I=d.ebspLength),c.push(d)}n?r.lowStreamSideInfos=[]:r.sideInfos=[];for(var v=new ArrayBuffer(h+t.data.byteLength),m=new DataView(v),p=0,g=new a(u),b=0,_=!1,y=!1,w=0;g.NextNalu();){w++;var S=31&u.getUint8(g.nalu_start+g.start_code_size);if(7==S)_=!0,b+=g.nalu_size;else if(8==S)y=!0,b+=g.nalu_size;else if(9==S)continue;if(_&&y)break}for(var E=0;E<b;E++)m.setInt8(p++,u.getInt8(E));var O=10-w,T=c.length>=(O=O>0?O:0)?O:c.length;for(l=0;l<T;l++){var k=c[l],R=k.rbspView,I=k.ebspLength;m.setUint8(p++,0),m.setUint8(p++,0),m.setUint8(p++,0),m.setUint8(p++,1),m.setUint8(p++,6);for(var N=0;N<I;N++)m.setInt8(p++,R[N-0])}for(E=b;E<t.data.byteLength;E++)m.setInt8(p++,u.getInt8(E));new Uint8Array(v),t.data=v}i.enqueue(t)}else i.enqueue(t)}(t,i,d,g)}:"decode"===o&&(m=function(e,n){"audio"===b?n.enqueue(e):function(e,n,s){var o=r[s],u=o&&"VP8"!==o.codec;if(u){var f=o.firstFrame;if(f){if(f.buffer)if(e.timestamp-f.time<20){var l=function(t,i){if(t.byteLength!==i.byteLength)return!1;for(var e=0;e<t.byteLength;e++)if(t[e]!==i[e])return!1;return!0}(new Uint8Array(e.data),f.buffer);l&&(u=!1)}else f.buffer=void 0}else o.firstFrame={buffer:new Uint8Array(e.data),time:e.timestamp}}if(u){for(var d=new DataView(e.data),v=0,m=new a(d),p=0,g=!1;m.NextNalu(g);)if(7!=(p=31&d.getUint8(m.nalu_start+m.start_code_size))&&8!=p&&9!=p){if(6!=p)break;var b=new Uint8Array(e.data).slice(m.nalu_start+m.start_code_size,m.nalu_start+m.start_code_size+m.nalu_size);o.emulationPreventionByte&&(b=c(b).output),v=1,g=!0;for(var _=0;255===b[v];)_+=255,v++;if((_+=b[v++])===i||5===_||100===_){for(var y=0;255===b[v];)y+=255,v++;if(y+=b[v++],e.data.byteLength-v<y)break;var w=new Uint8Array(4+y);switch(w[0]=0,w[1]=0,_){case 100:w[2]=3,w[3]=235;break;case 5:w[2]=3,w[3]=236;break;case i:w[2]=3,w[3]=237}for(var S=0;S<y;S++)w[4+S-0]=b[v++];var E=!1;if(_===i)E=!0;else if(5===_){var O=o.unregisterSeiFilter;if(O){var T=w.slice(4,4+o.filterSize),k=void 0,R=!0;if(0===(k="string"==typeof O?Uint8Array.from(Array.from(unescape(encodeURIComponent(O))).map((function(t){return t.charCodeAt(0)}))):O).length)R=!1;else for(var I=0;I<k.length;I++)if(k[I]!==T[I]){R=!1;break}E=R}else E=!0}E&&t.postMessage({cmd:"recvSEI",streamID:s,buffer:Array.from(w)})}else if(244===_){for(y=0;255===b[v];)y+=255,v++;if(y+=b[v++],e.data.byteLength-v<y)break;var N=parseInt(y/5+""),C=b.slice(v,v+=y),z=[];for(I=0;I<N;I++){var D=5*I,P=C.slice(D,D+4),A=C.slice(D+4,D+5),M=h(P);z.push({soundLevelID:M,value:A[0]})}t.postMessage({cmd:"mixSoundLevel",soundLevelList:z,streamID:o.streamID})}}n.enqueue(e)}else n.enqueue(e)}(e,n,d)}),m){var _=new TransformStream({transform:m});u.pipeThrough(_).pipeTo(l)}}function d(t){var i=s[t];return i||(s[t]={streamID:t,sideInfos:[],lowStreamSideInfos:[],type:243,emulationPreventionByte:!1,recvLastKeyFrameTime:0},s[t])}function v(t){var i=r[t];return i||(r[t]={streamID:t,emulationPreventionByte:!1,codec:"",unregisterSeiFilter:"",filterSize:0},r[t])}function m(t){var i=t.cmd;if("encode"===i){var e=t.readable,n=t.writable,s=t.streamID,r=t.type,a=t.isLowStream,c=t.emulationPreventionByte,h=t.onlyAudio;if("audio"!==(m=t.kind)){var f=d(s);f.type=r,f.emulationPreventionByte=c}o[s]={isLowStream:a,kind:m,onlyAudio:h},l(i,e,n,s,o)}else if("decode"===i){e=t.readable,n=t.writable,s=t.streamID,c=t.emulationPreventionByte;var m,p=t.codec,g=t.unregisterSeiFilter,b=t.filterSize;if("audio"!==(m=t.kind)){var _=v(s);_.emulationPreventionByte=c,_.codec=p,_.unregisterSeiFilter=g,_.filterSize=b}u[s]={isLowStream:!1,kind:m},l(i,e,n,s,u)}}onmessage=function(i){var e=i.data,n=e.cmd;try{switch(n){case"encode":case"decode":m(e);break;case"updatePlayer":var a=e.codec;v(g=e.streamID).codec=a;break;case"pushSideInfo":var c=e.buffer,h=e.hasLowStream,f=e.maxLength,l=d(g=e.streamID);l.sideInfos.length>f?console.error("Send SEI Failed. The number of inserted sei exceeds the limit."):(l.sideInfos.push(c),h&&l.lowStreamSideInfos.push(c));break;case"publishStreamType":var p=o[g=e.streamID];p&&(p.onlyAudio=e.onlyAudio);break;case"clear":var g=e.streamID;"push"==e.type?(delete s[g],delete o[g]):(delete u[g],delete r[g])}}catch(i){t.postMessage({cmd:"error",error:i})}},t.RTCTransformEvent&&(t.onrtctransform=function(t){var i=t.transformer;m(Object.assign({readable:i.readable,writable:i.writable},i.options))})}!function(t){t[t.LoginReq=1]="LoginReq",t[t.LoginRsp=2]="LoginRsp",t[t.CreateSessionReq=3]="CreateSessionReq",t[t.CreateSessionRsp=4]="CreateSessionRsp",t[t.CreateSessionWithSdpReq=5]="CreateSessionWithSdpReq",t[t.CreateSessionWithSdpRsp=6]="CreateSessionWithSdpRsp",t[t.SessionResetPush=7]="SessionResetPush",t[t.SessionResetAck=8]="SessionResetAck",t[t.PublishEventPush=9]="PublishEventPush",t[t.PlayEventPush=10]="PlayEventPush",t[t.MediaDescReq=11]="MediaDescReq",t[t.MediaDescRsp=12]="MediaDescRsp",t[t.CandidateInfoReq=13]="CandidateInfoReq",t[t.CandidateInfoRsp=14]="CandidateInfoRsp",t[t.CloseSessionReq=15]="CloseSessionReq",t[t.CloseSessionRsp=16]="CloseSessionRsp",t[t.MediaDescPush=17]="MediaDescPush",t[t.MediaDescAck=18]="MediaDescAck",t[t.CandidateInfoPush=19]="CandidateInfoPush",t[t.CandidateInfoAck=20]="CandidateInfoAck",t[t.CloseSessionPush=21]="CloseSessionPush",t[t.CloseSessionAck=22]="CloseSessionAck",t[t.StreamStatusNotify=23]="StreamStatusNotify",t[t.StreamStatusNotifyAck=24]="StreamStatusNotifyAck",t[t.StreamStatusNotifyPush=25]="StreamStatusNotifyPush",t[t.StreamStatusNotifyPushAck=26]="StreamStatusNotifyPushAck",t[t.BroadcasterStatusNotify=27]="BroadcasterStatusNotify",t[t.BroadcasterStatusAck=28]="BroadcasterStatusAck",t[t.ActivateAudioPlayStreamReq=29]="ActivateAudioPlayStreamReq",t[t.ActivateAudioPlayStreamRsp=30]="ActivateAudioPlayStreamRsp",t[t.ActivateVideoPlayStreamReq=31]="ActivateVideoPlayStreamReq",t[t.ActivateVideoPlayStreamRsp=32]="ActivateVideoPlayStreamRsp",t[t.ClientInfoPush=33]="ClientInfoPush",t[t.ClientInfoAck=34]="ClientInfoAck",t[t.NetQualityProbeReq=35]="NetQualityProbeReq",t[t.NetQualityProbeRsp=36]="NetQualityProbeRsp",t[t.NetQualityInfoPush=37]="NetQualityInfoPush",t[t.NetQualityInfoAck=38]="NetQualityInfoAck",t[t.ActivateSEIInsertReq=39]="ActivateSEIInsertReq",t[t.ActivateSEIInsertRsp=40]="ActivateSEIInsertRsp",t[t.Peer2PeerNetStatsGetReq=41]="Peer2PeerNetStatsGetReq",t[t.Peer2PeerNetStatsGetRsp=42]="Peer2PeerNetStatsGetRsp",t[t.CmdReq=43]="CmdReq",t[t.CmdRsp=44]="CmdRsp",t[t.CmdPush=45]="CmdPush",t[t.CmdAck=46]="CmdAck",t[t.WebRTCDispatchReq=47]="WebRTCDispatchReq",t[t.WebRTCDispatchRsp=48]="WebRTCDispatchRsp"}(v_||(v_={}));var __={1:"LoginReq",2:"LoginRsp",3:"CreateSessionReq",4:"CreateSessionRsp",5:"CreateSessionWithSdpReq",6:"CreateSessionWithSdpRsp",7:"SessionResetPush",8:"SessionResetAck",9:"PublishEventPush",10:"PlayEventPush",11:"MediaDescReq",12:"MediaDescRsp",13:"CandidateInfoReq",14:"CandidateInfoRsp",15:"CloseSessionReq",16:"CloseSessionRsp",17:"MediaDescPush",18:"MediaDescAck",19:"CandidateInfoPush",20:"CandidateInfoAck",21:"CloseSessionPush",22:"CloseSessionAck",23:"StreamStatusNotify",24:"StreamStatusNotifyAck",25:"StreamStatusNotifyPush",26:"StreamStatusNotifyPushAck",27:"BroadcasterStatusNotify",28:"BroadcasterStatusAck",29:"ActivateAudioPlayStreamReq",30:"ActivateAudioPlayStreamRsp",31:"ActivateVideoPlayStreamReq",32:"ActivateVideoPlayStreamRsp",33:"ClientInfoPush",34:"ClientInfoAck",35:"NetQualityProbeReq",36:"NetQualityProbeRsp",37:"NetQualityInfoPush",38:"NetQualityInfoAck",39:"ActivateSEIInsertReq",40:"ActivateSEIInsertRsp",41:"Peer2PeerNetStatsGetReq",42:"Peer2PeerNetStatsGetRsp",43:"CmdReq",44:"CmdRsp",45:"CmdPush",46:"CmdAck",47:"WebRTCDispatchReq",48:"WebRTCDispatchRsp"},y_=function(){return y_=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},y_.apply(this,arguments)},w_=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},S_=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},E_=["LoginReq","CreateSessionWithSdpReq","CreateSessionReq"],O_=["Peer2PeerNetStatsGetReq","Peer2PeerNetStatsGetRsp","CmdRsp"];var T_,k_=zh.webrtc_proto_v2,R_=zh.webrtc_cmd,I_=zh.generalpclib,N_=function(){function t(t,i,e,n){this.Pm=t,this.In=i,this.Nn=e,this.Am=n,this.Mm=new hm,this.hh={},this.fh=new st,this.rr=100,this.mh={},this.xm={},this.dh=5e3,this.ur=1e4,this.Pr=null,this.ar=2e3,this.jm=null,this.Lm=6e3,this.qm=!0,this.Um={},this.Bm=["ActivateVideoPlayStreamReq","ActivateAudioPlayStreamReq","CreateSessionReq","CreateSessionWithSdpReq","ActivateSEIInsertReq","StreamStatusNotify"],this.gr=_,this.Jm=zt.LOGOUT,this.Vm=0,this.Hm=void 0,this.unCheckCmds=["LoginReq","CreateSessionReq","CreateSessionWithSdpReq"];var s=t===M_;this.Gm=s?"zc.wcss.0":"zc.wcss.1";this.Fm=n.getPCRequest(s?tu.BusinessService.SERVICE_WEBRTC_SIGNAL:tu.BusinessService.SERVICE_L3_WEBRTC_SIGNAL,{path:"wsv2",query:"",encode:!1,messageType:2,isMsgCache:!1}),this.Ym()}return Object.defineProperty(t.prototype,"isUaConnected",{get:function(){return this.Am.isConnect()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.gr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mediaState",{get:function(){return this.Jm},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"token",{get:function(){return this.Zm},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenType",{get:function(){return this.Vm},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"server",{get:function(){return this.Pm},enumerable:!1,configurable:!0}),t.prototype.Ym=function(){var t,i=this;this.Am.on("connected",(function(){i.In.info("".concat(i.Gm," netAgent connected ").concat(i.gr)),i.gr===y&&i.loginCenterSvr(),i.Mm.emit("uaConnected")})),this.Am.on("disconnected",(function(){i.In.info("".concat(i.Gm," netAgent disconnected"))})),this.Am.on("broken",(function(t){i.In.info("".concat(i.Gm," netAgent broken ").concat(t))})),this.Fm.on("connected",(function(t){i.In.info("".concat(i.Gm," pc connected ").concat(tu.ConnectedType[t])),i.gr=w,t===tu.ConnectedType.AUTO&&i.loginCenterSvr()})),this.Fm.on("disconnected",(function(t,e){i.In.info("".concat(i.Gm," pc disconnected ").concat(tu.DisconnectedType[t],", ua connect: ").concat(i.isUaConnected,", signal ").concat(i.qm?"closed":"connect")),i.gr=_,i.Jm=zt.LOGOUT,i.qm||(i.isUaConnected?i.loginCenterSvr():i.Am.connectUa())})),this.Fm.on("broken",(function(){i.In.info("".concat(i.Gm," pc broken")),i.gr=y,i.Jm=zt.LOGOUT})),this.Fm.on("downLoadMessage",(function(t,e){i.handleWsMessage({data:t,extras:e})})),null===(t=this.Fm)||void 0===t||t.on("exception",(function(t,e){i.In.info("".concat(i.Gm," pc exception ").concat(JSON.stringify(t)))})),this.Fm.off("pcBrokenEvent"),this.Fm.on("pcBrokenEvent",(function(t){var e=Tr,n=i.Mn.createSpan(a.H,{key:wr},{key:""},e.event);n.setAttributes({service_no:e.service_no(null==t?void 0:t.service_no),error:(null==t?void 0:t.code)||0}),n.end()})),this.Fm.off("pcDisconnectedEvent"),this.Fm.on("pcDisconnectedEvent",(function(t){var e=kr,n=i.Mn.createSpan(a.H,{key:wr},{key:""},e.event);n.setAttributes({service_no:e.service_no(null==t?void 0:t.service_no),error:(null==t?void 0:t.code)||0}),n.end()})),this.Fm.off("pcConnectedEvent"),this.Fm.on("pcConnectedEvent",(function(t){var e=Or,n=i.Mn.createSpan(a.H,{key:wr},{key:""},e.event);n.setAttributes({service_no:e.service_no(t.service_no),recv_time:e.recv_time((new Date).getTime()),proxy_link_sources:e.proxy_link_sources(t.proxy_link_sources),connect_stream:e.connect_stream(t.connect_stream)}),n.end()}))},t.prototype.setSessionInfo=function(t,i){this.In.info("".concat(this.Gm," set session info")),this.Qm=t+"",this.Xm=i},t.prototype.onReConnect=function(t){},t.prototype.onDisConnect=function(t,i){},Object.defineProperty(t.prototype,"kl",{get:function(){var t,i,e;if(this.Nn.appConfig){var n=this.Nn.appConfig.media_config.publish_config.resource_info.find((function(t){return t.resource_type===M.RTC}));if(n){var s=null===(t=null==n?void 0:n.service_info)||void 0===t?void 0:t.find((function(t){return t.protocol===g.WEBRTC}));if(s)return null===(e=(null===(i=s.url_template.split("{IP}")[1].split("?"))||void 0===i?void 0:i[1]).split("="))||void 0===e?void 0:e[1]}}},enumerable:!1,configurable:!0}),t.prototype.connectServer=function(t,i,e){var n,s;if(this.us=t||(null===(n=this.Nn.roomList[0])||void 0===n?void 0:n.roomID),this.Zm=i||(null===(s=this.Nn.roomList[0])||void 0===s?void 0:s.token),this.In.info("".concat(this.Gm," start connect server, roomID: ").concat(this.us)),this.In.remoteReport("".concat(this.Gm," token: ").concat(this.Zm)),this.Vm=0,this.qm=!1,this.Hm=e,this.Jm===zt.LOGOUT){if(!this.Nn.appConfig)return void this.In.info("".concat(this.Gm," no app config"));if(!this.kl)return void(e&&e(this.Pm,Ci.code));this.app=this.kl,this.isUaConnected?this.loginCenterSvr():(this.gr=y,this.In.info("".concat(this.Gm," ua is not connected")))}else this.In.info("".concat(this.Gm,this.Jm===zt.TRY_LOGIN?" server is connecting":" server is connected"))},t.prototype.disconnectServer=function(){this.In.info("".concat(this.Gm," disconnect server")),this.disconnectPcRequest(),this.resetCheckMessage(),this.resetLoginTimer(),this.gr=_,this.Jm=zt.LOGOUT,this.Hm=void 0,this.Zm="",this.xm={},this.Vm=0},t.prototype.disconnectPcRequest=function(){this.In.info("".concat(this.Gm," disconnect pc link ").concat(this.qm)),this.qm||(this.qm=!0,this.Fm.closeRequest())},t.prototype.resetLoginTimer=function(){this.In.info("".concat(this.Gm," reset login timer")),clearTimeout(this.jm),this.jm=null},t.prototype.handleWsPBMsg=function(t,i){var e=this.handlePushMsg(t,i);if((null==e?void 0:e.header)&&(null==e?void 0:e.body)){var n;if(e)e.header.cmd=__[e.header.cmd],ri(e.body),n={header:y_(y_({},e.header),{appid:this.Qm,user_id:this.Xm}),body:e.body};return n}this.In.error("".concat(this.Gm," no header or body"))},t.prototype.handleWsMessage=function(t){var i,e=this.handleWsPBMsg(t.data,t.extras);(null==e?void 0:e.header)&&e.header.appid==this.Qm&&e.header.user_id===this.Xm?(O_.includes(e.header.cmd)||this.In.info("".concat(this.Gm," signmsg=").concat(e.header.cmd," ").concat(null===(i=e.header)||void 0===i?void 0:i.seq)),this.handleServerPush(e)):this.In.error("".concat(this.Gm," check header failed"))},t.prototype.resetCheckMessage=function(){var t;this.In.info("".concat(this.Gm," reset check msg")),clearTimeout(this.Pr),this.Pr=null;for(var i=this.fh.getFirst();null!=i;)this.fh.remove(i),(null===(t=i._data)||void 0===t?void 0:t.error)&&i._data.error(2,i._data.seq),i=this.fh.getFirst();this.hh={}},t.prototype.handleServerPush=function(t){switch(t.header.cmd){case"LoginRsp":this.handleRespondData("LoginReq",t);break;case"CreateSessionRsp":this.handleRespondData("CreateSessionReq",t),0===t.body.result&&this.addSession(t.header.session_id,t.body.session_token);break;case"CreateSessionWithSdpRsp":this.handleRespondData("CreateSessionWithSdpReq",t),0===t.body.result&&this.addSession(t.header.session_id,t.body.session_token);break;case"WebRTCDispatchRsp":this.handleRespondData("WebRTCDispatchReq",t);break;case"SessionResetPush":this.sendResetSessionAck(t.header.seq,0,0),this.handlePushResetSessionData(t);break;case"CloseSessionPush":this.sendCloseSessionAck(t.header.seq,t.header.session_id,0),this.handleMsgWithSession(t,Dt.PUSH),this.removeSession(t.header.session_id);break;case"StreamStatusNotifyPush":this.sendStreamStatusNotifyAck(t.header.seq,t.header.session_id,0),this.handleMsgWithSession(t,Dt.PUSH);break;case"PublishEventPush":case"PlayEventPush":case"CmdPush":this.handleMsgWithSession(t,Dt.PUSH);break;case"ClientInfoPush":this.sendClientInfoAck(t.header.seq,t.header.session_id,0),this.handleMsgWithSession(t,Dt.PUSH);break;case"NetQualityInfoPush":this.sendNetQualityInfoPushAck(t.header.seq,t.header.session_id,t.body.peer_id,0),this.handleMsgWithSession(t,Dt.PUSH);break;case"MediaDescRsp":case"CandidateInfoRsp":case"NetQualityProbeRsp":case"ActivateSEIInsertRsp":case"ActivateVideoPlayStreamRsp":case"ActivateAudioPlayStreamRsp":case"StreamStatusNotifyAck":case"BroadcasterStatusAck":case"Peer2PeerNetStatsGetRsp":case"CmdRsp":case"CloseSessionRsp":this.handleMsgWithSession(t,Dt.RSP)}},t.prototype.registerPeerCallback=function(t,i){this.Um[t]=i},t.prototype.unregisterPeerCallback=function(t){delete this.Um[t]},t.prototype.handleMsgWithSession=function(t,i){var e,n;if(null===(e=null==t?void 0:t.header)||void 0===e?void 0:e.session_id){var s=this.Um[null===(n=null==t?void 0:t.header)||void 0===n?void 0:n.session_id];s&&s(t,i)}else this.In.error("".concat(this.Gm," rsp no session ").concat(t.header.cmd))},t.prototype.loginCenterSvr=function(){var t=this,i=[];if(0!=Object.keys(this.xm).length)for(var e in this.xm){var n=parseInt(e);i.push({session_id:n,session_token:this.xm[n].token})}var s={appid:this.Nn.appid,user_id:this.Nn.idName,token:this.Zm,tokenType:this.Vm,sessions:i,roomid:this.us,sdk_version:this.Nn.sdkVerNum,app:this.app,net_mode:this.Nn.netMode};this.In.info("".concat(this.Gm," LoginReq ").concat(JSON.stringify(y_(y_({},s),{token:void 0})))),this.In.remoteReport("".concat(this.Gm," LoginReq token ").concat(this.Zm));var r="LoginReq",o=this.encodePBBody(r,s);this.Jm=zt.TRY_LOGIN,this.sendMessageWithCallback(r,this.Nn.getSeq(),0,o,(function(i,e,n){t.resetLoginTimer(),0==n.result?(t.Jm=zt.LOGIN,t.Zm=n.token,t.Vm=n.tokenType,t.In.info("".concat(t.Gm," LoginReq suc, callback ").concat(!!t.Hm)),t.In.remoteReport("".concat(t.Gm," LoginRsp token ").concat(n.token)),null!=t.Hm?(t.Hm(t.Pm,0),t.Hm=void 0):t.onReConnect(t.Pm),t.checkMessageTimeout()):(t.In.warn("".concat(t.Gm," LoginReq fail, result: ").concat(n.result," callback ").concat(!!t.Hm)),t.disconnectPcRequest(),t.Jm=zt.LOGOUT,null!=t.Hm?(t.Hm(t.Pm,n.result),t.Hm=void 0):t.onDisConnect(t.Pm,n.result))}),(function(){t.resetLoginTimer(),t.Jm=zt.LOGOUT,t.In.info("".concat(t.Gm," LoginReq fail, callback ").concat(!!t.Hm,", is signal closed ").concat(t.qm)),null==t.Hm||t.qm||(t.Hm(t.Pm,-1),t.Hm=void 0)})),this.resetLoginTimer(),this.jm=setTimeout((function(){t.In.info("".concat(t.Gm," login timer triggered, callback ").concat(!!t.Hm)),t.Jm=zt.LOGOUT,null!=t.Hm&&(t.Hm(t.Pm,-1),t.Hm=void 0)}),this.Lm)},t.prototype.sendMessageWithCallback=function(t,i,e,n,s,r){var o=this;void 0===s&&(s=null),void 0===r&&(r=null),O_.includes(t)||this.In.info("".concat(this.Gm," send callback ").concat(t,", seq: ").concat(i," ").concat(this.gr));var u=performance.now();if(!this.unCheckCmds.includes(t)&&this.gr!==w)return this.In.error("".concat(this.Gm," send callback ").concat(t," connect not establish")),void(r&&r(1,i));var a={seq:i,deleted:!1,cmd:t,sendTime:(new Date).getTime(),success:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(E_.includes(t)){var r=(performance.now()-u).toFixed(0);o.In.info("".concat(o.Gm," send callback suc seq: ").concat(i,", cmd: ").concat(t,", cost_time: ").concat(r))}s&&s.apply(void 0,e)},error:r,timeout:this.dh},c=this.fh.push(a);this.hh[a.seq]=c;var h=this.getHeader(t,i,e),f=this.encodePBMsg(h,n),l=!1,d=!1;"LoginReq"===t&&(l=!0,d=!0),this.Fm.sendRequest({payload:f,ack:l,isInSendMap:d},(function(t){o.In.info("".concat(o.Gm," send callback fail ").concat(JSON.stringify(t)))}),(function(t){o.In.info("".concat(o.Gm," send callback ack"))}))},t.prototype.sendMessage=function(t,i,e,n,s){if(void 0===s&&(s=!0),this.Jm===zt.LOGIN){var r=this.getHeader(t,i,e),o=this.encodePBMsg(r,n);this.Fm.sendRequest({payload:o})}else this.In.error("".concat(this.Gm," send ").concat(t," connect not establish ").concat(zt[this.Jm]))},t.prototype.getHeader=function(t,i,e){return this.headerData({version:"1.0.1",cmd:t,appid:this.Qm+"",seq:i,user_id:this.Xm,session_id:e})},t.prototype.getParamsExt=function(t,i,e){return i&&(t.min_play_buf_level_ms=i),e&&(t.keyframe_intv=e),this.In.info("".concat(this.Gm," params ").concat(JSON.stringify(t))),R_.WebrtcCmdReqMsg.encode({peer_extend_param:t}).finish()},t.prototype.decodeParamsExt=function(t){return R_.WebrtcCmdReqMsg.decode(t).peer_ext_params_push},t.prototype.createSession=function(t,i,e,n){var s="CreateSessionReq",r=i.serverHost,o=i.strAuthParam,u=i.geo,a=i.roomID,c=i.transCodecID,h=i.transCodecSuffix,f=i.ipV6Prefer,l={type:i.type,stream_id:i.streamID,turn_server_host:qt(r)?r:"",strAuthParam:o,params:i,area_type:u.type,area_id_list:u.areaList,ipv6_prefer:f};void 0!==c&&(l.trans_codec_id=c,l.trans_codec_suffix=h),this.Nn.isMultiRoom&&(l.roomid=a),this.In.info("".concat(this.Gm," create session ").concat(JSON.stringify(l)),{streamid:i.streamID});var d=this.encodePBBody(s,l);this.sendMessageWithCallback(s,t,0,d,e,n)},t.prototype.createSessionWithSdp=function(t,i,e){var n,s=this,r=t.seq,o=t.type,u=t.streamId,a=t.strAuthParam,c=t.sdp,h=t.miniSdp,f=t.serverHost,l=t.playBufLevel,d=t.params,v=t.paramsExt,m=t.roomID,p=t.geo,g=t.transCodecID,b=t.transCodecSuffix,_=t.ipV6Prefer,y=mm(this.In,u),w="CreateSessionWithSdpReq",S=(null===(n=t.videoInfo)||void 0===n?void 0:n.keyFrameInterval)||2,E=this.getParamsExt(v,l,S),O={type:o,stream_id:u,media_server_host:qt(f)?f:"",strAuthParam:a,params:d,params_ext:E,area_type:p.type,area_id_list:p.areaList,ipv6_prefer:_};void 0!==g&&(O.trans_codec_id=g,O.trans_codec_suffix=b),h?O.mini_sdp=h:O.sdp=c,this.Nn.isMultiRoom&&(O.roomid=m),y.info("".concat(this.Gm," create session with sdp, params: ").concat(JSON.stringify(y_(y_({},O),{sdp:void 0,mini_sdp:void 0,params_ext:E.toString()}))));var T=this.encodePBBody(w,O);this.sendMessageWithCallback(w,r,0,T,(function(t,e,n){return w_(s,void 0,void 0,(function(){return S_(this,(function(s){return y.info("".concat(this.Gm," create session with sdp, decode rSDP ").concat(JSON.stringify(n))),n.params_ext&&(n.params_ext=this.decodeParamsExt(n.params_ext),ri(n.params_ext)),i&&i(t,e,n),[2]}))}))}),e)},t.prototype.dispatchGwNodes=function(t,i,e,n){var s="WebRTCDispatchReq",r=i.streamID,o=i.geo,u=i.transCodecID,a=i.transCodecSuffix,c={type:i.type,stream_id:r,area_type:o.type,area_id_list:o.areaList,ipv6_prefer:i.ipV6Prefer};void 0!==u&&(c.trans_codec_id=u,c.trans_codec_suffix=a),this.In.info("".concat(this.Gm," dispatch nodes ").concat(JSON.stringify(c)),{streamid:r});var h=this.encodePBBody(s,c);this.sendMessageWithCallback(s,t,0,h,e,n)},t.prototype.sendMediaDescUpdateReq=function(t,i,e){var n=e.sdp,s=e.miniSdp,r={type:e.type,update:1};s?r.mini_sdp=s:r.sdp=n,this.In.info("".concat(this.Gm," media desc ").concat(JSON.stringify(r)));var o=this.encodePBBody("MediaDescReq",r);this.sendMessage("MediaDescReq",t,i,o)},t.prototype.removeSession=function(t){this.In.info("".concat(this.Gm," remove session ").concat(t)),this.xm[t]&&delete this.xm[t]},t.prototype.sendCloseSession=function(t,i,e){var n="CloseSessionReq",s={reason:e},r=this.encodePBBody(n,s);this.In.info("".concat(this.Gm," close session ").concat(i,", ").concat(JSON.stringify(s))),this.removeSession(i),this.sendMessage(n,t,i,r)},t.prototype.handleRespondData=function(t,i){var e=i.header.seq;this.In.debug("".concat(this.Gm," rsp data"));var n=this.hh[e];if(null!=n){delete this.hh[e],this.fh.remove(n);var s=n._data;(null==s?void 0:s.cmd)!==t?this.In.error("".concat(this.Gm," command is not match")):s.success&&s.success(e,i.header.session_id,i.body)}else{if("CloseSessionRsp"==i.header.cmd||O_.includes(t))return;this.In.error("".concat(this.Gm," cannot find data ").concat(t," ").concat(e))}},t.prototype.addSession=function(t,i){this.In.info("".concat(this.Gm," add session ").concat(t)),this.xm[t]={token:i}},t.prototype.handlePushData=function(t){this.In.info("".concat(this.Gm," push data, cmd: ").concat(t.header.cmd,", session: ").concat(t.header.session_id));var i=this.mh[t.header.cmd+t.header.session_id];i?i.callback&&i.callback(t.header.seq,t.header.session_id,t.body):this.In.warn("".concat(this.Gm," no callbackData, cmd: ").concat(t.header.cmd,", session: ").concat(t.header.session_id))},t.prototype.handlePushResetSessionData=function(t){this.In.info("".concat(this.Gm," push reset session"));var i=[];if(0==t.body.cResetType)i=Object.keys(this.xm);else if(1==t.body.cResetType)for(var e=0;e<t.body.session_ids.length;e++)i.push(t.body.session_ids[e]);if(0!=i.length)for(var n=0;n<i.length;n++){var s=this.mh[t.header.cmd+i[n]];null==s?this.In.info("".concat(this.Gm," no callbackData ").concat(i[n])):s.callback&&s.callback(t.header.seq,i[n],t.body)}else this.In.info("".concat(this.Gm," no session to callback"))},t.prototype.sendMediaDesc=function(t,i,e,n){var s="MediaDescReq",r=n.sdp,o=n.miniSdp,u={type:e,update:0,params_ext:this.getParamsExt(n.paramsExt,n.min_play_buf_level_ms,n.keyframe_intv)};o?u.mini_sdp=o:u.sdp=r,this.In.info("".concat(this.Gm," media desc, session: ").concat(i,", ").concat(JSON.stringify(y_(y_({},u),{sdp:void 0,mini_sdp:void 0}))));var a=this.encodePBBody(s,u);this.sendMessage(s,t,i,a)},t.prototype.sendCandidateInfo=function(t,i,e){for(var n="CandidateInfoReq",s=[],r=0;r<e.length;r++){s.push({candidate:e[r].candidate,sdpMid:e[r].sdpMid,sdpMLineIndex:e[r].sdpMLineIndex})}var o={infos:s};this.In.info("".concat(this.Gm," candidate info, session: ").concat(i,", ").concat(JSON.stringify(o)));var u=this.encodePBBody(n,o);this.sendMessage(n,t,i,u)},t.prototype.sendCandidateInfoAck=function(t,i,e){var n="CandidateInfoAck",s={result:e};this.In.info("".concat(this.Gm," candidate info ack, session: ").concat(i,", ").concat(JSON.stringify(s)));var r=this.encodePBBody(n,s);this.sendMessage(n,t,i,r)},t.prototype.sendCloseSessionAck=function(t,i,e){var n="CloseSessionAck",s={result:e};this.In.info("".concat(this.Gm," close session ack, session: ").concat(i,", ").concat(JSON.stringify(s)));var r=this.encodePBBody(n,s);this.sendMessage(n,t,i,r)},t.prototype.sendResetSessionAck=function(t,i,e){var n="SessionResetAck",s={result:e};this.In.info("".concat(this.Gm," reset session ack, session: ").concat(i,", ").concat(JSON.stringify(s)));var r=this.encodePBBody(n,s);this.sendMessage(n,t,i,r)},t.prototype.sendStreamStatusNotifyAck=function(t,i,e){var n="StreamStatusNotifyPushAck",s={result:e};this.In.info("".concat(this.Gm," stream status notify ack, session: ").concat(i,", ").concat(JSON.stringify(s)));var r=this.encodePBBody(n,s);this.sendMessage(n,t,i,r)},t.prototype.sendClientInfoAck=function(t,i,e){var n="ClientInfoAck",s={result:e};this.In.info("".concat(this.Gm," client info ack, session: ").concat(i,", ").concat(JSON.stringify(s)));var r=this.encodePBBody(n,s);this.sendMessage(n,t,i,r)},t.prototype.sendNetQualityInfoPushAck=function(t,i,e,n){var s="NetQualityInfoAck",r={peer_id:e,result:n};this.In.info("".concat(this.Gm," net quality info, session: ").concat(i,", ").concat(JSON.stringify(r)));var o=this.encodePBBody(s,r);this.sendMessage(s,t,i,o)},t.prototype.registerPushCallback=function(t,i,e){e&&Ht(e)&&(this.In.info("".concat(this.Gm," set callback, session: ").concat(i,", ").concat(t)),this.mh[t+i]={callback:e})},t.prototype.unregisterPushCallback=function(t,i){delete this.mh[t+i]},t.prototype.checkMessageTimeout=function(){for(var t,i,e=this,n=this.fh.getFirst(),s=(new Date).getTime(),r=0,o=0,u=0;null!=n&&n._data&&!(n._data.sendTime+this.dh>s);)if(delete this.hh[n._data.seq],this.fh.remove(n),++o,n._data.cmd&&-1==this.Bm.indexOf(n._data.cmd))n=this.fh.getFirst();else{if(null==n._data.error||this.ur>0&&n._data.sendTime+this.ur<s?++u:(this.In.warn(_d+" error cmd = "+n._data.cmd+" seq ="+(null===(t=n._data)||void 0===t?void 0:t.seq)+" start time ="+(null===(i=n._data)||void 0===i?void 0:i.sendTime)),Ht(n._data.error)&&n._data.error(1,n._data.seq)),++r>=this.rr)break;n=this.fh.getFirst()}this.Pr=setTimeout((function(){e.checkMessageTimeout()}),this.ar),0==o&&0==u||this.In.info(_d+" call success, state: timeout="+o+" drop="+u)},t.prototype.sendStreamStatus=function(t,i,e,n,s){var r="StreamStatusNotify",o={mic_status:n,camera_status:e};mm(this.In,s).info("".concat(this.Gm," stream status, session: ").concat(i,", ").concat(JSON.stringify(o)));var u=this.encodePBBody(r,o);return this.sendMessage(r,t,i,u),t},t.prototype.ActivatePlayVideoStream=function(t,i,e){var n="ActivateVideoPlayStreamReq",s={active:e?0:1,layer:0};this.In.info("".concat(this.Gm," activate video, session: ").concat(i,", ").concat(JSON.stringify(s)));var r=this.encodePBBody(n,s);this.sendMessage(n,t,i,r)},t.prototype.ActivatePlayAudioStream=function(t,i,e){var n="ActivateAudioPlayStreamReq",s={active:e?0:1,layer:0};this.In.info("".concat(this.Gm," activate audio, session: ").concat(i,", ").concat(JSON.stringify(s)));var r=this.encodePBBody(n,s);this.sendMessage(n,t,i,r)},t.prototype.activateSEIInsert=function(t,i,e,n,s){var r="ActivateSEIInsertReq",o={peer_id:e,action:n,info_type:s};this.In.info("".concat(this.Gm," insert sei, session: ").concat(i,", ").concat(JSON.stringify(o)));var u=this.encodePBBody(r,o);this.sendMessage(r,t,i,u)},t.prototype.sendBroadcasterStatus=function(t,i,e){this.In.info("".concat(this.Gm," broadcast status, session: ").concat(i,", status: ").concat(e));var n="BroadcasterStatusNotify",s=this.encodePBBody(n,{status:e});this.sendMessage(n,t,i,s)},t.prototype.sendNetProbe=function(t,i,e){var n="NetQualityProbeReq",s={peer_id:e,action:1};this.In.info("".concat(this.Gm," net probe req, session: ").concat(i,", ").concat(JSON.stringify(s)));var r=this.encodePBBody(n,s);this.sendMessage(n,t,i,r)},t.prototype.getP2PNetStats=function(t,i,e){var n="Peer2PeerNetStatsGetReq",s=this.encodePBBody(n,{peer_id:e});this.sendMessage(n,t,i,s)},t.prototype.sendGWCmdReq=function(t,i,e){var n="CmdReq",s=this.encodePBBody(n,e);this.sendMessage(n,i,t,s,!1)},t.prototype.sendGWCmdAck=function(t,i,e,n){var s="CmdAck";i.body=e;var r=this.encodePBBody(s,i);this.sendMessage(s,(null==n?void 0:n.seq)||this.Nn.getSeq(),t,r,!1)},t.prototype.on=function(t,i){this.Mm.addEventHandler(t,i)},t.prototype.off=function(t,i){this.Mm.removeEventHandler(t,i)},t.prototype.headerData=function(t){var i=v_[t.cmd];if(void 0!==i){var e=k_.Head.create({cmd:i,seq:t.seq,session_id:t.session_id});return k_.Head.encode(e).finish()}this.In.error("".concat(this.Gm," cmd not exist"))},t.prototype.encodePBMsg=function(t,i,e){void 0===e&&(e=!0);var n=new Uint8Array(Array.from(this.getWebRTCHead(t.length,i.length)).concat(Array.from(t)).concat(Array.from(i))),s=I_.Header.create({cmd:e?100:101}),r=I_.Header.encode(s).finish(),o=new Uint8Array(8);o[0]=181,o[1]=0;var u=r.length,a=n.length;return o[2]=u>>8,o[3]=u-(o[2]<<8),o.set(new Uint8Array(Int32Array.from([a]).buffer).reverse(),4),new Uint8Array(Array.from(o).concat(Array.from(r)).concat(Array.from(n)))},t.prototype.getWebRTCHead=function(t,i){var e=new Uint8Array(7);return e[0]=17,e[1]=t>>8,e[2]=t-(e[1]<<8),e.set(new Uint8Array(Int32Array.from([i]).buffer).reverse(),3),e},t.prototype.encodePBBody=function(t,i){var e=k_[t].create(i);return k_[t].encode(e).finish()},t.prototype.decodePBBody=function(t,i){var e=__[t.cmd];if(e)return k_[e].decode(i);this.In.error("".concat(this.Gm," cmd is not rtc"))},t.prototype.handlePushMsg=function(t,i){var e=t[0];if(181===e){var n=(t[2]<<8)+t[3],s=I_.Header.decode(t.slice(8,8+n));if(101===s.cmd){var r=t.slice(8+n),o=r[0];if(17===o){var u=(r[1]<<8)+r[2],a=k_.Head.decode(r.slice(7,7+u)),c=r.slice(7+u);return{header:a,body:this.decodePBBody(a,c)}}this.In.error("".concat(this.Gm," webrtc tag error ").concat(o))}else this.In.error("".concat(this.Gm," cmd error ").concat(s.cmd))}else this.In.error("".concat(this.Gm," type error ").concat(e))},t}(),C_=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),z_=function(t){function i(i,e){var n=t.call(this)||this;return n.Wm=i,n.In=e,n.retryActiveCount=1,n.RETRY_MAX_TIME=90,n.Km=.3,n.tp=4.8,n.aborted=!1,n.Gm="zc.rssh "+i.server,n}return C_(i,t),i.prototype.ep=function(t){return!![Ci.code,20010,1008].includes(t)},i.prototype.startRetryTask=function(t,i,e,n,s){var r=i.roomID,o=i.token,u=i.firstInterval;this.init(t),this.startMaxTime(),this.onCompleteActive=e,this.onSucActive=n,this.onFailActive=s,this.active(u,{roomID:r,token:o})},i.prototype.active=function(t,i){var e=this;if(this.In.info("".concat(this.Gm," active ").concat(t)),this.retryTimer)return this.In.info("".concat(this.Gm," has actived, ignore")),!1;if(this.isOverTime)return this.In.info("".concat(this.Gm," retry over time, stop retry")),!1;this.retryActiveInterval=this.getRetryDelayByCount(this.retryActiveCount);var n=Lt(t)?t:this.retryActiveInterval,s=function(){e.In.info("".concat(e.Gm," connect timer triggered")),e.retryTimer&&clearTimeout(e.retryTimer),e.retryTimer=null,e.retryActiveCount++,e.Wm&&e.Wm.mediaState===zt.LOGOUT&&(e.Wm.connectServer(null==i?void 0:i.roomID,null==i?void 0:i.token,(function(t,i){e.In.info(e.Gm+" connect res "+i+" aborted "+e.aborted),e.aborted||(0!=i?e.ep(i)?(e.jn(),e.onFailActive&&e.onFailActive(e.Wm.server,i),e.resetCallback()):e.active():(e.In.info("".concat(e.Gm," connect suc ")),e.jn(),e.onSucActive&&e.onSucActive(t),e.resetCallback()))})),0===t&&(e.onCompleteActive&&e.onCompleteActive(e.Wm.server),e.onCompleteActive=void 0))},r="";return 0===n?(s(),r+="connect immediately"):(this.retryTimer=setTimeout(s,n),r+="connect timer start, delay ".concat(n)),this.In.info("".concat(this.Gm," ").concat(r)),!0},i.prototype.getRetryDelayByCount=function(t){var i=Math.min(this.tp,this.Km*Math.pow(2,t<2?0:t)),e=Math.random(),n=Math.floor(e*(1e3*i+1));return this.In.info("".concat(this.Gm," attempt ").concat(t," ").concat(i," ").concat(n)),n},i.prototype.startMaxTime=function(){var t=this;this.maxTimer||(this.maxTimer=setTimeout((function(){t.In.warn("".concat(t.Gm," connect over max time ").concat(t.RETRY_MAX_TIME,"s, stop retry, aborted ")+t.aborted),t.isOverTime=!0,t.aborted||(t.invalid(),t.aborted=!0,t.onFailActive&&t.onFailActive(t.Wm.server,101),t.resetCallback())}),1e3*this.RETRY_MAX_TIME))},i.prototype.stopMaxTime=function(){this.maxTimer&&clearTimeout(this.maxTimer),this.maxTimer=null},i.prototype.jn=function(){this.stopMaxTime(),this.invalid(),this.aborted=!0},i.prototype.onactive=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i]},i.prototype.invalid=function(){this.In.info("".concat(this.Gm," invalid")),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=null,this.startRetryTimer&&clearTimeout(this.startRetryTimer),this.startRetryTimer=null,this.retryStartTime=0,this.retryActiveCount=1},i.prototype.resetCallback=function(){this.onCompleteActive=void 0,this.onSucActive=void 0,this.onFailActive=void 0},i.prototype.reset=function(){this.In.info(this.Gm+" reset"),this.stopMaxTime(),this.invalid(),this.resetCallback()},i}(Rc),D_=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),P_=function(){return P_=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},P_.apply(this,arguments)},A_=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))};!function(t){t[t.NotReUse=0]="NotReUse",t[t.TheSameReUse=1]="TheSameReUse",t[t.DiffReUse=2]="DiffReUse",t[t.AllReUse=3]="AllReUse"}(T_||(T_={}));var M_="rtc",x_="l3",j_=bn,L_=j_.event,q_=j_.error,U_=Pn,B_=U_.error,J_=W,V_=Ot.frameRate,H_=Ot.bitRate,G_=function(){function t(t){this.In=t,this.lazyTimeout=9e4,this.taskMap={}}return t.prototype.startLazyEndTimer=function(t,i,e){var n=this;this.taskMap[t]&&clearTimeout(this.taskMap[t].timer);var s=setTimeout((function(){i(),delete n.taskMap[t]}),null!=e?e:this.lazyTimeout);this.taskMap[t]={callback:i,timer:s}},t.prototype.clearLazyEndTimer=function(t){this.taskMap[t]&&(clearTimeout(this.taskMap[t].timer),delete this.taskMap[t],this.In.info("zsc.rsfs.0 clearLazyEndTimer: "+t))},t.prototype.endAll=function(){for(var t in this.taskMap)clearTimeout(this.taskMap[t].timer),this.taskMap[t].callback(),delete this.taskMap[t]},t.prototype.hasEndTask=function(t){return!!this.taskMap[t]},t.prototype.end=function(t){this.taskMap[t]&&(clearTimeout(this.taskMap[t].timer),this.taskMap[t].callback(),delete this.taskMap[t])},t}(),F_=function(t){function i(i,e,n,s,r,o){var u,a,c,h=this;return(h=t.call(this)||this).In=i,h.Nn=e,h.dataReport=n,h.np=s,h.acMgr=r,h.geo=o,h.testEnvironment=!1,h.playModule=null,h.trackUtils=new g_(h.In),h.sp=3e3,h.rp=3e3,h.previewStreamList=[],h.op={},h.captureStreamElementMap=new Map,h.soundLevelDelegate=!1,h.soundLevelInterval=1e3,h.enableInBackground=!1,h.Df=!0,h.up={},h.ap={},h.streamIPStackMode=_t.IPv4Prefer,h.isMicEnabled=!0,h.isDataChannelEnabled=!1,h.targetQuality=J.MiddleMinQuality,h.probeInterval=6e4,h.cp=3e5,h.gwNode="",h.playerList={},h.publisherList={},h.playSuccessCallBackList={},h.playErrorCallBackList={},h.waitPublishList=[],h.waitPlayList=[],h.autoSwitchProtocol=!0,h.udpFailNum=0,h.maxUdpFailNum=2,h.probeStartedNum=3,h.cachedGwNodesList={},h.cachedGwNodesMode=T_.TheSameReUse,h.hp=-1,h.fp=-1,h.Tv=null,h.lp=3,h.useCopyMusic=!1,h.playEventKeys={},h.isCustomVC=!1,h.defaultVideoMuted=!1,h.defaultAudioMuted=!1,h.agentConnectIPStackType=-1,h._agentIpStackDetection={IPv4:Nt.unknown,IPv6:Nt.unknown},h.miniSdpWorker=null,h.ipV6Prefer=-1,h.ipNodeType=It.ZV4Priority,h.isCandidateHasIPv6=!1,h.referenceVideoBitrate=-1,h.referenceBitrateUpdateTs=0,h.onReconnectHandle=function(t){h.In.info("zsc.orh.0 call ".concat(t)),h.retryStreamList(t)},h.onDisconnectHandle=function(t,i){h.In.info("zsc.odh.0 call ".concat(t," connect fail ").concat(i)),h.openConnectServerTask(t)},h.eventHandler={visibilitychange:function(){!h.enableInBackground&&h.soundLevelDelegate&&(!Wt.hidden?(h.enableSoundLevelProcessor(!0),h.activeSoundLevel(),"suspended"===h.ac.state&&h.ac.resume()):(h.soundLevelTimer&&clearTimeout(h.soundLevelTimer),h.soundLevelTimer=null,h.enableSoundLevelProcessor(!1)))}},h.isNotSupportSeiWorker=!1,h.turnServers=void 0,h.checkDeviceChange=void 0,h.dp=new G_(i),h.np._on("_roomStateUpdate",(function(t,i,e,n,s,r){for(var o in h.playerList){var u=h.playerList[o];if(u.room.roomID==t&&6===u.state&&u.playMode==q.CDN)if("CONNECTED"==i){u.CDNBrokenCnt++;var a=u.zegoCdnPlayer,c=u.zegoExpressPlayer;c?c.resume():a&&(a.canRetry=!0,a.retry())}else"DISCONNECTED"===i&&!r&&h.stopPlayingStream(o)}})),Wt.addEventListener("visibilitychange",h.eventHandler.visibilitychange),h.Rm=new u_(i,e,h),null===(u=h.np.netAgent)||void 0===u||u.on("clientInfo",(function(t){var i;h.Nn.accessClientIp&&(null==t?void 0:t.clientIP)&&h.Nn.accessClientIp!==t.clientIP&&(h.In.info(Cd+" client ip changed "+h.Nn.accessClientIp+" "+t.clientIP),h.lastChangeIpTime=Date.now(),h.vp(h.publisherList,!0),h.vp(h.playerList,!1),h.up={}),h.Nn.accessClientIp=t.clientIP,Lt(null==t?void 0:t.timeOffset)&&(h.Nn.clientTimeOffset=null==t?void 0:t.timeOffset),h.updateTimeOffsetInterval(),h.Nn.accessClientIp=t.clientIP,null===(i=h.Rm)||void 0===i||i.checkIfSupportNTP()})),null===(a=h.np.netAgent)||void 0===a||a.on("connected",(function(t){var i=h.np.netAgent.connectIPStackType;h.In.info("zsc.cs.0 netAgent connect stack ".concat(kt[i])),h.agentConnectIPStackType=i})),null===(c=h.np.netAgent)||void 0===c||c.on("ipDetection",(function(t){h.In.info("zsc.cs.0 ip detection ".concat(JSON.stringify(t)));var i=t.linkConnectDetection;if(i&&(h._agentIpStackDetection.IPv4!==i.IPv4||h._agentIpStackDetection.IPv6!==(null==i?void 0:i.IPv6))){h._agentIpStackDetection=i;var e=h.getStreamIPNodesMode().ipNodeType;h.ipNodeType=e}})),h}return D_(i,t),Object.defineProperty(i.prototype,"signalList",{get:function(){return this.op},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"probeList",{get:function(){return this.up},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"agentIpStackDetection",{get:function(){return this._agentIpStackDetection},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ac",{get:function(){return this.acMgr.ac},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isProxy",{get:function(){return!!(Qf.proxyCtrl&&!0!==this.Nn.engineConfig.notProxyRTC||this.isLocalProxy)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isLocalProxy",{get:function(){var t=Qf.proxyCtrl;return t&&!(null==t?void 0:t.getTurnInfo)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"useingUdp",{get:function(){var t=this.playerList,i=Object.values(this.publisherList),e=Object.values(t);if(!i.length&&!e.length)return!1;var n=!!e.find((function(t){return 5===t.stateNego}));return!!n||!!(n=!!i.find((function(t){return 5===t.publisher.stateNego})))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rxQuality",{get:function(){return this.fp},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"txQuality",{get:function(){return this.hp},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxChannels",{get:function(){var t;return this.Nn.settingConfig.getSetting("max_channels",!0)?t=this.Nn.settingConfig.getSetting("max_channels",!0):Lt(this.Nn.engineConfig.maxChannels)?t=this.Nn.engineConfig.maxChannels:this.Nn.settingConfig.getSetting("max_channels")&&(t=this.Nn.settingConfig.getSetting("max_channels")),t},enumerable:!1,configurable:!0}),i.setCloseNetProbe=function(t){i.closeNetProbe=t},i.setReportCustomerContext=function(t){u_.reportCustomerContext=t},i.prototype.vp=function(t,i){var e=this,n="zc.rgnds";ti(this.In,n);var s=null;for(var r in t)s=i?t[r].publisher:t[r];s&&(this.clearCachedGwNodesList(s,i),Object.keys(this.ap).forEach((function(t){return e.ap[t].ipChange=!0})),this.stopNetProbe(s),ei(this.In,n))},Object.defineProperty(i.prototype,"billingTimer",{get:function(){return this._billingTimer||(this._billingTimer=new m_(this.In,this.Nn)),this._billingTimer},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cameraPreviewStream",{get:function(){return this.previewStreamList.find((function(t){return"camera"===t.previewType}))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"microphonePreviews",{get:function(){return this.previewStreamList.filter((function(t){return"camera"===t.previewType&&t.micTrack}))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"publishersLength",{get:function(){return Object.keys(this.publisherList).length},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"hasRTCStream",{get:function(){var t=Object.keys(this.publisherList).length,i=Object.values(this.playerList).filter((function(t){return t.playMode===q.RTC})).length;return!(!t&&!i)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"hasL3Stream",{get:function(){return 0!==Object.values(this.playerList).filter((function(t){return t.playMode===q.L3})).length},enumerable:!1,configurable:!0}),i.prototype.initMiniSdpWorker=function(t){var i,e=Jl(this.Nn.browserInfo,"chrome",78,0);t&&d_.isSupported&&!e?this.miniSdpWorker=this.miniSdpWorker||new d_(this.In):(this.Nn.To=!1,null===(i=this.miniSdpWorker)||void 0===i||i.destroy(),this.miniSdpWorker=null)},i.prototype.setSessionInfo=function(t,i,e){this.In.debug("zsc.ssi.0 called"),this.appid=t,this.userid=i,this.testEnvironment=e},i.prototype.onPlayStateUpdate=function(t,i,e,n){},i.prototype.onPlayQualityUpdate=function(t,i){},i.prototype.onPublishStateUpdate=function(t,i,e){},i.prototype.onPublishQualityUpdate=function(t,i){},i.prototype.setPublishStateStart=function(t,i,e,n,s,r){var o,u,a=this,c="zsc.pss.0",h=mm(this.In,i);h.info(c+" call");var f=this.checkPreview(e);if(!f)return h.error(c+" stream not found"),!1;if(this.publisherList[i])return h.error(c+"  publisher already exist"),this.Mn.spanSetAttributes({key:L_,par:i},{error:q_.Pe.code,message:q_.Pe.message}),!1;var l=new fb(i,this.In,this.dataReport,this.Nn.engineConfig.publishQualityInterval||this.sp,this.rp,this,this.Nn,f);this.isProxy&&this.Df&&this.setIsPeer(!1),l.isPeer=this.Df,l.isExternal=!0,l.parentSpanKey=_n.event;var d=null===(o=null==f?void 0:f.videoTrack)||void 0===o?void 0:o.label,v="",m="",p=e.getAudioTracks()[0]&&e.getAudioTracks()[0].label;try{v=null===(u=null==f?void 0:f.videoTrack)||void 0===u?void 0:u.getSettings().deviceId,m=e.getAudioTracks()[0]&&e.getAudioTracks()[0].getSettings().deviceId}catch(t){h.warn(c+" get device id failed. error: "+t)}var g=new kb(i,this.In,this.Nn,this,!0);return this.publisherList[i]={seq:0,room:t,localStream:e,publisher:l,streamID:i,publishOption:n,cameraLabel:d||"",microLabel:p||"",cameraDeviceId:v||"",microDeviceId:m||"",deviceStateCount:0,retryStreamHandler:g,isDataChannel:r,streamSid:s,isRetweetCDN:!1},1===this.publishersLength&&this.mp(!0),l.onPublishStateUpdate=function(t,i,e,n,s,r){var o=a.publisherList[i];o?o.retryStreamHandler.publishStateHandle(t,o.streamID,e,n,s,r):h.error("zsc.psuh.0 cannot find publish")},l.onPublishQualityUpdate=function(t,i){var e=a.publisherList[t];e?(a.Nn.deviceStateOut&&0===i.audio.audioBitrate?(e.deviceStateCount++,e.deviceStateCount>=2&&(e.deviceStateCount=0,a.Nn.deviceStateOut=!1,h.warn(c+" publish audio error by device"))):e.deviceStateCount=0,a.onPublishQualityUpdate(e.streamID,i)):h.error("zsc.psuh.0 cannot find publish")},!0},i.prototype.retweetCDN=function(t,i,e){var n=this,s=mm(this.In,i);return new Promise((function(r,o){s.info("zsc.rwc.0 call ".concat(t," ").concat(e));var u=n.getRoomByStreamID(i);u?u.streamHandler._publishTarget({type:"add"===t?"addpush":"delpush",streamID:i,pushUrl:e},(function(){s.info("zsc.rwc.0 suc "),r(void 0)}),(function(t){s.warn("zsc.rwc.0 fail  "+JSON.stringify(t)),o(t)})):s.info("zsc.rwc.0 no room")}))},i.prototype.startPublishingStream=function(t){var i,e=this,n=mm(this.In,t);n.info("zsc.sps.0 call");var s=this.publisherList[t];if(s){(null===(i=s.publishOption)||void 0===i?void 0:i.cdnUrl)&&!s.isRetweetCDN&&this.retweetCDN("add",t,s.publishOption.cdnUrl).then((function(){n.info("zsc.sps.0 add cdn suc"),s.isRetweetCDN=!0})).catch((function(t){n.warn("zsc.sps.0 add cdn fail "+JSON.stringify(t))}));var r=s.retryStreamHandler;r.invalid(),r.init(this.Nn.streamRetryTime),r.startMaxTime(),this.connectWebRTCCenterServer(!1,!0,null==s?void 0:s.room.roomID,null==s?void 0:s.room.token,(function(i){var n,s=null===(n=e.publisherList[t])||void 0===n?void 0:n.publisher;s&&(s.setSignal(i),e.publishStream(t)),e.billingTimer.startChargeInfosUpload(),e.activeSoundLevel()}))}else n.error("zsc.sps.0 publisher don't exist")},i.prototype.publishStream=function(t){var i=this,e=mm(this.In,t);e.info("zsc.ps.0 call");var n=this.publisherList[t].publisher;if(n)if(e.info("zsc.ps.0 state ".concat(n.state)),7===n.state){var s=null,r=this.publisherList[t].publishOption,o=this.checkPreview(this.publisherList[t].localStream);o?((s=o.localStream)&&s.getTracks().forEach((function(t){jo(t,i.In,"zsc.ps.0")})),this.Mn.spanSetAttributes({key:L_,par:t},{cap_w:j_.cap_w(o.videoInfo.width),cap_h:j_.cap_h(o.videoInfo.height),w:j_.w(o.videoInfo.width),h:j_.h(o.videoInfo.height),video_en_fps:j_.video_en_fps(o.videoInfo.frameRate),video_en_bps:j_.video_en_bps(1e3*o.videoInfo.bitRate),is_mini:j_.is_mini(n.To)}),s?(e.info("zsc.ps.0 call success"),this.setStreamGwNode(n,!0),n.getDispatchIPNodeMode(),n.startPublish(t,s,r,this.getReferredVideoBitrate())):e.error("zsc.ps.0 no localStream found")):e.error("zsc.ps.0 no preview found")}else e.warn("zsc.ps.0 publisher is progress");else e.info("zsc.ps.0 publisher don't exist")},i.prototype.stopPublishingStream=function(t,i){var e=mm(this.In,t);e.info("zsc.sps.0.1 call "+JSON.stringify(i));var n=this.publisherList[t];if(n){var s=n.retryStreamHandler;s&&(s.stopMaxTime(),s.invalid()),n.isRetweetCDN&&n.publishOption.cdnUrl&&this.retweetCDN("del",t,n.publishOption.cdnUrl).then((function(){n.isRetweetCDN=!1,e.info("zsc.sps.0.1 del cdn suc")})).catch((function(t){e.warn("zsc.sps.0.1 del cdn fail "+JSON.stringify(t))})),delete this.publisherList[t],this.resetNetworkData();var r=n.publisher;r&&(s.getTryTime(r),r.stopPublish(i),delete n.publisher),this.removeStreamFromSignal(!0,t),this.billingTimer.stopChargeInfosUpload(),this.stopSoundLevel(),0===this.publishersLength&&this.mp(!1),e.info("zsc.sps.0.1 call success")}else e.warn("zsc.sps.0.1 publisher don't exist")},i.prototype.createStreamSignal=function(t){var i=new N_(t,this.In,this.Nn,this.np.netAgent);return this.Nn.clientIP=this.np.netAgent.clientIP||"",i.setSessionInfo(this.appid,this.userid),i.onReConnect=this.onReconnectHandle,i.onDisConnect=this.onDisconnectHandle,i},i.prototype.connectWebRTCCenterServer=function(t,i,e,n,s){var r,o=this,u=this.In,a="zsc.cwrcs.0";u.info("".concat(a," call, isLogin: ").concat(t,", server: ").concat(i?"rtc":"l3"));var c=null,h=i?M_:x_;this.dp.clearLazyEndTimer(h),this.op[h]?(r=this.op[h].signal,this.op[h].retryServerSignalHandler=null):(r=this.createStreamSignal(h),this.op[h]={signal:r}),r&&(c=new z_(r,this.In),this.op[h].retryServerSignalHandler=c),r&&c&&(r.mediaState===zt.LOGOUT?(u.info("".concat(a," has not connect")),c.startRetryTask(this.Nn.serverRetryTime,{roomID:e,token:n,firstInterval:0},(function(t){var i=o.op[t].signal;i&&s&&s(i)}),(function(i){o.retryStreamList(i);var e=o.op[i].signal;t&&e&&(i===M_&&o.hasRTCStream||i===x_&&o.hasL3Stream||o.disconnectSignalURL(e,!0,15e3))}),(function(t,i){o.handleServerConnectFail(t,i)}))):r.mediaState===zt.TRY_LOGIN?(u.info("".concat(a," connecting")),s&&s(r)):(u.info("".concat(a,"  already connected")),s&&s(r)))},i.prototype.handleServerConnectFail=function(t,i){101===i?(t===M_&&this.hasRTCStream||t===x_&&this.hasL3Stream)&&this.openConnectServerTask(t):i&&this.handleConnectFailStream(t,i)},i.prototype.handleConnectFailStream=function(t,i){var e="zsc.rcsr.0";if(this.In.info("".concat(e," reconnect ").concat(t," ").concat(i)),this.Nn.engineConfig.keepRtcWhenSignalDisconnected){var n=function(t,e){var n,s=!1;return i===Ci.code?(n=P_({},Ci),s=!0):((n=P_({},ji)).message=n.message+" "+i,1008===i&&(n=Mi,s=!0),20010===i&&(s=!0,n=t?JSON.parse(JSON.stringify(Zi)):e?JSON.parse(JSON.stringify(ue)):JSON.parse(JSON.stringify(he)))),{error:n,stopRetry:s}};Object.values(this.publisherList).forEach((function(t){var i,e=n(!0);null===(i=t.retryStreamHandler)||void 0===i||i.publishStateHandle(Z,t.streamID,e.error,e.stopRetry)})),Object.values(this.playerList).forEach((function(t){var i,e=n(!1,t.playMode===q.RTC);null===(i=t.retryStreamHandler)||void 0===i||i.playStateHandle(J_,t.streamId,e.error,e.stopRetry)}))}else this.In.info("".concat(e," keep rtc when signal disconnect"))},i.prototype.disconnectAllSignal=function(){var t=this;this.In.info("zsc.dcas.0 call"),Object.values(this.op).forEach((function(i){var e=i.signal;e&&t.disconnectStreamSignal(e)}))},i.prototype.disconnectStreamSignal=function(t){!this.np.stateCenter.roomModulesList.some((function(t){return"DISCONNECTED"!==t.roomState}))&&this.disconnectSignalURL(t,!1)},i.prototype.disconnectSignalURL=function(t,i,e){var n=this;this.In.info("zsc.dcsu.0 "+t.server+" "+i+" call");var s=t.server;i?(this.In.info("zsc.dcsu.0 lazy end"),this.dp.startLazyEndTimer(s,(function(){var i=n.pp(s);n.In.info("zsc.dcsu.0 lazy end start "+i),i&&t.disconnectServer(),n.In.info("zsc.dcsu.0 lazy end signal")}),e)):this.dp.hasEndTask(s)?(this.In.info("zsc.dcsu.0 has task to end"),this.dp.end(s)):(this.In.info("zsc.dcsu.0 direct disconnect"),t.disconnectServer()),this.In.info("zsc.dcsu.0 call success")},i.prototype.reConnectSignals=function(){this.In.info("".concat("zsc.rcs.0"," call")),Object.values(this.op).forEach((function(t){var i=t.retryServerSignalHandler,e=t.signal;i&&(null==i||i.active(0,{roomID:null==e?void 0:e.us,token:null==e?void 0:e.token}))}))},i.prototype.isNetAgentConnect=function(){var t,i;return null===(i=null===(t=this.np)||void 0===t?void 0:t.netAgent)||void 0===i?void 0:i.isConnect()},i.prototype.setPlayStateStart=function(t,i,e,n){var s=this,r=mm(this.In,t);if(r.info("zsc.pss.1 call"),this.playerList[t])return r.error("zsc.pss.1 player already exist"),B_.Qe;var o=this.getPlayRoom(t)||this.Nn.roomList[0];if(!o)return r.error("zsc.pss.1 not login room"),B_.Ze;var u=new Kb(t,this.In,null,this.dataReport,this.Nn.engineConfig.playQualityInterval||this.sp,this.rp,this,this.ac,this.Nn,o,i,e,n);!this.getStream(o,t)&&(u.streamInRoom=!1),this.isProxy&&this.Df&&this.setIsPeer(!1),u.isExternal=!0,this.playerList[t]=u;var a=o.streamList.find((function(i){return i.stream_id==t}));if(a){var c=a.stream_attr_opts;c&&u.setMuteStreamByPlayMode(c)}return u.onPlayQualityUpdate=function(t,i){var e=s.playerList[t];e?s.onPlayQualityUpdate(e.streamId,i):r.error("zsc.pss.1 cannot find play")},!0},i.prototype.onRemoteMicStatusUpdate=function(t,i,e){},i.prototype.onRemoteCameraStatusUpdate=function(t,i,e){},i.prototype.startPlayingStream=function(t,i){var e,n,s=this,r=mm(this.In,t),o=this.playerList[t],u=o.playMode===q.CDN;if(r.info("zsc.sps.1 start play called "+o.playMode),i=i||this.playSuccessCallBackList[t],!o)return r.error("zsc.sps.1 player don't exist"),!1;if((null===(e=o.playOption)||void 0===e?void 0:e.CDNVideo)&&o.firstPlay){var a=o.playOption.CDNVideo;o._CDNPlayerClone=a.cloneNode(),o.initPoster=(null==a?void 0:a.getAttribute("poster"))||"",o.initVideoStyle=(null==a?void 0:a.getAttribute("style"))||"",o.firstPlay=!1}else o.zegoExpressPlayer&&o.firstPlay&&(o.firstPlay=!1);var c=o.retryStreamHandler;return c.invalid(),c.init(this.Nn.streamRetryTime),u?(o.playCDN((function(i){var e=s.playErrorCallBackList[t];e&&e({errorCode:i.code,extendedData:i.message})}),i),!0):(null===(n=o.completePlaySpan)||void 0===n||n.setAttributes({urls:U_.urls([o.serverUrl])}),c.startMaxTime(),c.playStartSpan(t,o,!0),this.connectWebRTCCenterServer(!1,(null==o?void 0:o.playMode)===q.RTC,null==o?void 0:o.room.roomID,null==o?void 0:o.room.token,(function(e){var n=s.playerList[t];n&&(n.setSignal(e),s.playStream(t,i)),s.billingTimer.startChargeInfosUpload(),s.activeSoundLevel()})),!0)},i.prototype.playStream=function(t,i){var e,n=mm(this.In,t);n.info("zsc.ps.1 call");var s=this.playerList[t];s?(n.info("zsc.ps.1 state ".concat(s.state)),7===s.state?(n.info("zsc.ps.1 call success"),this.setStreamGwNode(s,!1),null===(e=s.zegoPeer)||void 0===e||e.getDispatchIPNodeMode(),s.startPlay(t,i)):n.warn("zsc.ps.1 player is progress")):n.warn("zsc.ps.1 player don't exist")},i.prototype.rePlayStream=function(t,i){var e=this.playerList[t],n=this.playSuccessCallBackList[t];e&&(e.setSignal(i),this.playStream(t,n))},i.prototype.removeStreamFromSignal=function(t,i,e){var n,s,r=this,o=mm(this.In,i);o.info("zsc.rsfs.0 call "+t+" "+i);var u=function(t){o.info("zsc.rsfs.0 ".concat(t.server," lazy end by remove all stream")),r.dp.startLazyEndTimer(t.server,(function(){var i=r.pp(t.server);o.info("zsc.rsfs.0 "+t.server+"lazy end start, empty "+i),i&&t.disconnectServer()}),e)},a=null===(n=this.op[M_])||void 0===n?void 0:n.signal;a&&!this.hasRTCStream&&u(a);var c=null===(s=this.op[x_])||void 0===s?void 0:s.signal;c&&!this.hasL3Stream&&u(c)},i.prototype.pp=function(t){var i;if(null===(i=this.op[t])||void 0===i?void 0:i.signal){if(t===M_&&!this.hasRTCStream)return!0;if(t===x_&&!this.hasL3Stream)return!0}return!1},i.prototype.stopPlayingStream=function(t,i){var e=mm(this.In,t);e.info("zsc.sps.1.1 call "+JSON.stringify(i));var n=this.playerList[t];if(n){var s=n.retryStreamHandler;s&&(s.stopMaxTime(),s.invalid()),n.playStream&&Ep.sourceDisConnect(n.playStream),delete this.playerList[t],this.resetNetworkData(),s.getTryTime(n),n.stopPlay(i);var r=n.rtcViewer;r&&r.stop(),this.removeStreamFromSignal(!1,t),!n.isProbe&&this.billingTimer.stopChargeInfosUpload(),this.stopSoundLevel(),delete this.playSuccessCallBackList[t],delete this.playErrorCallBackList[t],e.debug("zsc.sps.1.1 call success")}else e.info("zsc.sps.1.1 player don't exist")},i.prototype.reset=function(t,i){var e,n,s;for(var r in this.In.info("zsc.rs call "+t+" "+i),this.publisherList){var o=this.publisherList[r];if((null===(e=o.room)||void 0===e?void 0:e.roomID)==t||!t){var u=o.publisher,a=!1;0===i?(a=!0,u.stopReason="Logout"):1002031==i&&(u.stopReason="ReachMaxAVRetryTime");var c=1002031==i?q_._e:{code:i||0,message:""};a&&!u.Ia&&(c=q_.Ue),null===(s=null===(n=o.room)||void 0===n?void 0:n.streamHandler)||void 0===s||s.onPublishStateUpdate(Z,r,c),this.stopPublishingStream(r,c),delete this.Nn.publishStreamList[r]}}for(var h in this.playerList){a=!1;var f=this.playerList[h],l=f,d=null==l?void 0:l.state;0===i?(a=!0,f.stopReason="Logout"):f.stopReason="ReachMaxAVRetryTime";var v=f.room,m=v&&v.roomID==t,p=this.Nn.roomList.length;c=1002031==i?B_.un:{code:i||0,message:""};if(a&&void 0!==d&&6!==d&&(c=B_.vn),m&&(this.getStream(v,h)||1==p))this.onPlayStateUpdate(J_,h,c),this.stopPlayingStream(h,c);else if(m&&p>1){var g=this.Nn.roomList.find((function(i){return i.roomID!==t}));g?this.playerList[h].room=g:(this.stopPlayingStream(h,c),this.onPlayStateUpdate(J_,h,c))}}0==this.publishersLength&&0==Object.keys(this.playerList).length&&(this.up={},this.destroySEIWorker()),this.waitPublishList=[],this.waitPlayList=[],this.Rm.resetReport(),this.In.info("zsc.rs call success")},i.prototype.openConnectServerTask=function(t){var i=this,e=this.op[t],n=e.signal,s=e.retryServerSignalHandler;if(null==s||s.reset(),n){var r=new z_(n,this.In);r.startRetryTask(this.Nn.serverRetryTime,{firstInterval:0},(function(t){}),(function(t){i.retryStreamList(t)}),(function(t,e){i.handleServerConnectFail(t,e)})),this.op[t].retryServerSignalHandler=r}},i.prototype.retryStreamList=function(t){var i;for(var e in this.publisherList){var n=this.publisherList[e].publisher,s=this.publisherList[e].retryStreamHandler;this.In.info("zsc.orh.0 reconnect "+e+" "+n.state+" "+n.stateNego),7==n.state||n.isStateRetry?!s.isOverTime&&s.publishStateHandle(Z,e,q_.ve):6==n.state&&(n.resendStreamStatus(2),s.stopMaxTime())}for(var e in this.playerList){var r=this.playerList[e],o=r,u=r.playMode;s=r.retryStreamHandler;this.In.info("zsc.orh.0 reconnect "+e+" "+o.state+" "+o.stateNego),(null===(i=o.signal)||void 0===i?void 0:i.server)===t&&(7==o.state||u!==q.CDN&&o.isStateRetry?!s.isOverTime&&s.playStateHandle(J_,e,B_.en):6==o.state&&s.stopMaxTime())}},i.prototype.getPublisher=function(t){var i=null;if(qt(t)&&this.publisherList[t]&&this.publisherList[t].publisher)i=this.publisherList[t].publisher;else if(Yt(t)){var e=this.checkPublish(t);e&&(i=null==e?void 0:e.publisher)}return i},i.prototype.getPreviewer=function(t){var i,e=null;return qt(t)&&this.publisherList[t]&&this.publisherList[t].publisher?e=null===(i=this.publisherList[t].publisher)||void 0===i?void 0:i.previewer:Yt(t)&&(e=this.checkPreview(t)),e},i.prototype.checkPlayer=function(t){return Object.values(this.playerList).find((function(i){return i.playStream===t}))||null},i.prototype.checkPreview=function(t){for(var i=0;i<this.previewStreamList.length;i++)if(this.previewStreamList[i].localStream===t||t&&!Yt(t)&&t.zegoStream&&this.previewStreamList[i].zegoCaptureStream==t.zegoStream)return this.previewStreamList[i];return null},i.prototype.checkPublish=function(t){for(var i in this.publisherList)if(this.publisherList[i].localStream==t)return this.publisherList[i];return null},i.prototype.getPublishList=function(t,i){var e;void 0===i&&(i=!0);var n=[],s=this.checkPreview(t);for(var r in i&&(null==s?void 0:s.zegoCaptureStream)&&(null===(e=s.zegoCaptureStream)||void 0===e?void 0:e.stream)&&(t=s.zegoCaptureStream.stream),this.publisherList)this.publisherList[r].localStream==t&&n.push(this.publisherList[r]);return n},i.prototype.removePreview=function(t){for(var i=0;i<this.previewStreamList.length;i++)if(this.previewStreamList[i]===t){this.previewStreamList.splice(i,1);break}},i.prototype.onPlayerStreamUrlUpdate=function(t,i,e){},i.prototype.getScreenConstrains=function(t){var i={};if(Ut(t)&&t)i={audio:!1,video:{frameRate:V_},bitRate:this.Nn.settingConfig.getSetting("screen_video_bitrate")||H_};else if(Jt(t)){switch(t.videoQuality){case 1:i={video:{frameRate:Et.frameRate},bitRate:Et.bitRate};break;case 3:i={video:{frameRate:Tt.frameRate},bitRate:Tt.bitRate};break;case 4:i={video:{frameRate:t.frameRate,width:t.width,height:t.height},bitRate:t.bitRate};break;case 2:i={video:{frameRate:V_},bitRate:H_};break;default:i={video:{frameRate:V_},bitRate:this.Nn.settingConfig.getSetting("screen_video_bitrate")||H_}}if(i.audio=!!Ut(t.audio)&&t.audio,i.audio){var e={noiseSuppression:!1,autoGainControl:!1,echoCancellation:!0},n=t.ANS,s=t.AGC,r=t.AEC;void 0!==n&&(e.noiseSuppression=n),void 0!==s&&(e.autoGainControl=s),void 0!==r&&(e.echoCancellation=r),i.audio=e}if(i.video)i.captureElement=t.captureElement;i=P_(P_({},t),i)}return i},i.prototype.createScreenPreviewer=function(t,i,e){var n=new zp(this.In,this.Nn,this,"screen"),s=t.getVideoTracks()[0].getSettings();return this.previewStreamList.push(n),Jt(e)&&(n.mediaStreamConfig=e),n.localStream=t,n.initMediaTrack(t),n.videoInfo={width:s.width||0,height:s.height||0,frameRate:s.frameRate||15,bitRate:(null==i?void 0:i.bitRate)||1e3,startBitrate:(null==i?void 0:i.startBitrate)||this.Nn.settingConfig.getSetting("bitrate_mode"),minBitrate:(null==i?void 0:i.minBitrate)||0,keyFrameInterval:(null==i?void 0:i.keyFrameInterval)||2,channelCount:(null==i?void 0:i.channelCount)||1,audioBitrate:1e3*((null==e?void 0:e.audioBitrate)||48),contentHint:""},i&&qt(i.videoOptimizationMode)&&(n.videoInfo.contentHint=i.videoOptimizationMode),n.previewSuc=!0,n.previewType="screen",n.videoPreviewType="screen",n.audioPreviewType="screen",(null==i?void 0:i.videoOptimizationMode)&&this.setVideoTrackContentHint(t,null==i?void 0:i.videoOptimizationMode),n},i.prototype.createCompositingPreviewer=function(t,i,e){var n=new zp(this.In,this.Nn,this,"compositing"),s=t.getVideoTracks()[0].getSettings();return this.previewStreamList.push(n),n.mediaStreamConfig=i,t.getAudioTracks().length>0&&(n.audioTrack=t.getAudioTracks()[0]),n.localStream=t,n.videoInfo=P_(P_({},n.videoInfo),{width:(null==i?void 0:i.width)||s.width||0,height:(null==i?void 0:i.height)||s.height||0,frameRate:(null==i?void 0:i.frameRate)||s.frameRate||15,bitRate:(null==i?void 0:i.bitrate)||2500}),n.previewSuc=!0,n.inputStreamOptions=e,n},i.prototype.setSoundLevelDelegate=function(t,i,e){void 0===e&&(e=!1),this.In.info("zsc.ssd.0 call"),this.soundLevelDelegate=t,this.enableInBackground=e,i&&this.setSoundLevelInterval(i),this.enableSoundLevelProcessor(t),t?(this.In.info("zsc.ssd.0 start getting sound"),this.activeSoundLevel()):(this.In.info("zsc.ssd.0 stop getting sound"),this.soundLevelTimer&&clearTimeout(this.soundLevelTimer),this.soundLevelTimer=null,this.soundLevelInterval=1e3)},i.prototype.setSoundLevelInterval=function(t){var i,e;if(t&&this.soundLevelDelegate){for(var n in this.soundLevelInterval=t,this.previewStreamList){null===(i=this.previewStreamList[n].soundMeterWorklet)||void 0===i||i.setInterval(t)}for(var n in this.playerList){null===(e=this.playerList[n].soundMeterWorklet)||void 0===e||e.setInterval(t)}}},i.prototype.enableSoundLevelProcessor=function(t){for(var i in this.previewStreamList){var e=this.previewStreamList[i];t?e.startSoundLevel():e.stopSoundLevel()}for(var i in this.playerList){var n=this.playerList[i];t?n.startSoundLevel():n.stopSoundLevel()}},Object.defineProperty(i.prototype,"hasRemoteStream",{get:function(){return Object.keys(this.playerList).length>0},enumerable:!1,configurable:!0}),i.prototype.activeSoundLevel=function(){!this.soundLevelTimer&&this.soundLevelDelegate&&this.startSoundLevel()},i.prototype.startSoundLevel=function(){var t=this;this.soundLevelTimer&&(clearTimeout(this.soundLevelTimer),this.soundLevelTimer=null),this.soundLevelDelegate&&(this.checkSoundLevel(),this.checkMicSoundLevel(),this.soundLevelTimer=setTimeout((function(){t.startSoundLevel()}),this.soundLevelInterval))},i.prototype.checkSoundLevel=function(){this.In.debug("zsc.csl.0 call");var t=[];for(var i in this.publisherList){var e=0,n=this.publisherList[i].publisher,s=n.previewer;s&&(e=s.soundLevel),t.push({streamID:this.getBackStreamId(n.streamId),soundLevel:e,type:"push"})}for(var i in this.playerList){var r=this.playerList[i];r.streamId&&!r.isProbe&&t.push({streamID:this.getBackStreamId(r.streamId),soundLevel:r.soundLevel,type:"pull"})}this.soundLevelDelegate&&t.length>0&&this.onSoundLevelUpdate(t)},i.prototype.checkMicSoundLevel=function(){if(this.microphonePreviews.length&&this.soundLevelDelegate){var t=this.microphonePreviews.reduce((function(t,i){return i.soundLevel>t?i.soundLevel:t}),0);this.onMicSoundLevelUpdate(t)}},i.prototype.getBackStreamId=function(t){return this.testEnvironment&&t?t.replace("zegotest-"+this.appid+"-",""):t},i.prototype.onSoundLevelUpdate=function(t){},i.prototype.onMicSoundLevelUpdate=function(t){},i.prototype.stopSoundLevel=function(){this.soundLevelTimer&&!this.hasRemoteStream&&0===this.previewStreamList.length&&(this.In.info("zsc.ssl.0 stop"),clearTimeout(this.soundLevelTimer),this.soundLevelTimer=null)},i.prototype.gp=function(){return this.Mn.createSpan(a.H,{key:fn},{key:""},bs)},i.prototype.startNetProbe=function(t,i,e){var n;(i&&(i.probeTime=Date.now()),i&&!i.isPeer||!this.Df)?this.Mn.setError(this.gp(),{code:-1,message:"not support peer"}):(n=e||this.getProbeNodeList(i),this.In.info("zc.stnp.1 nodes ".concat(JSON.stringify(n))),n.length>0&&this.bp(t,i,n))},i.prototype.stopNetProbe=function(t){var i=this;this.ap&&t&&t.probeState!=ot.probed&&(this.In.info("zc.stnp.0 call ".concat(t.streamId)),Object.keys(this.ap).forEach((function(t){var e;(null===(e=i.ap[t])||void 0===e?void 0:e.isProbed)||(i.stopPlayingStream(i.ap[t].streamID),delete i.ap[t])})),t.probeState=ot.probed,this._p(t))},i.prototype.getProbeNodeList=function(t){var i;switch(null==t?void 0:t.ipNodeType){case It.ZV4Only:i=t.gwNodeList;break;case It.ZV4Priority:i=this.sortIPNodesByPriority(t.ipV4NodeList).map((function(t){return Fl(t)}));break;case It.ZV6Priority:i=this.sortIPNodesByPriority(t.ipV6NodeList).map((function(t){return Fl(t)}));break;case It.ZV6AndV4Priority:i=this.getSortedIPV6AndV4Nodes(t,"v6").map((function(t){return Fl(t)}));break;default:i=[]}return i},i.prototype._p=function(t){t.probeTimer&&clearTimeout(t.probeTimer),t.probeTimer=null},i.prototype.yp=function(){var t="zegoprobe-"+(new Date).getTime();return this.setPlayStateStart(t),{prober:this.playerList[t]?this.playerList[t]:null,streamID:t}},i.prototype.wp=function(){var t=this,i="zc.sp.cdn";ti(this.In,i);var e=this.yp(),n=e.prober,s=e.streamID;n&&(n.isProbe=!0,this.playerList[s].serverUrl=x_,this.startPlayingStream(s,(function(){})),this.playerList[s].isProbeByDG=!0,n.onCalNetQualityResult=function(e,n){t.In.info("zc.ocnqr.0 l3 detect "+e+" "+n),t.stopPlayingStream(s),ei(t.In,i)})},i.prototype.Sp=function(t,i,e,n){void 0===n&&(n=-1);var s={result:e,probeQuality:n,timeStamp:(new Date).getTime()};this.ap[i]&&(this.ap[i].isProbed=!0),this.up[i]=s,t.probedList.push(P_(P_({},s),{gwNode:i}))},i.prototype.bp=function(t,i,e){var n=this,s="zc.psp.0";if(ti(this.In,s),i&&e){var r=i.streamId,o=this.gp();i.probeNodeList=e;var u=(new Date).getTime(),a=e.filter((function(t){return!(n.up[t]&&n.up[t].timeStamp+n.cp>u||i.probeState==ot.probed||n.ap[t]&&!n.ap[t].isProbed)&&(delete n.up[t],!0)})),c={};this.In.info("".concat(s," ").concat(r," probe nodes:").concat(JSON.stringify(a)));for(var h=a.length>this.lp?this.lp:a.length,f=function(r){var u=a[r];if(0==h)return"break";h--,l.up[u]={};var f=l.yp(),d=f.prober,v=f.streamID;if(l.ap[u]={ipChange:!1,isProbed:!1,streamID:v},c[u]=!0,!d)return{value:void 0};d.isProbe=!0,d.setSignal(i.signal),d.gwNode=u,d.ipV6Prefer=l.getIPv6PreferByGwNode(u),d.startPlay(v,(function(){})),d.onCalNetQualityResult=function(t,s){var r;void 0===s&&(s=-1);var a="zc.ocnqr.0";n.In.info(a+" "+d.gwNode+" "+t+" "+s),delete c[u];var h=0==Object.keys(c).length;if(null===(r=n.ap[u])||void 0===r?void 0:r.ipChange)return n.In.info("".concat(a," ipChange:").concat(u)),n.stopPlayingStream(n.ap[u].streamID),void delete n.ap[u];var f=ot.tryProbe;for(var l in n.publisherList){var v=n.publisherList[l].publisher;v.probeNodeList.includes(u)&&v.probeState==f&&n.handleProbeQuality(!0,v,u,t,s,h)}for(var l in n.playerList){var m=n.playerList[l];-1==l.indexOf("zegoprobe-")&&m.probeNodeList.includes(u)&&m.probeState==f&&n.handleProbeQuality(!1,m,u,t,s,h)}o.setAttributes({net_quality:_s(parseInt(i.netQuality+"")),node_list:ys(e)}),o.end()},i.probeTimer||(i.probeTimer=setTimeout((function(){n.In.info("zc.snp.0 call probeTimer"),n.handleProbedList(t,i,!1,e)}),6e3)),ei(l.In,s)},l=this,d=0;d<(null==a?void 0:a.length);d++){var v=f(d);if("object"==typeof v)return v.value;if("break"===v)break}}ii(this.In,s)},i.prototype.handleProbeQuality=function(t,i,e,n,s,r){var o;ti(this.In,"zc.hpq.0","".concat(i.streamId," ").concat(s," ").concat(e," ").concat(r," ")),this.Sp(i,e,n,s),i.gwNode!=e&&(null===(o=i.signal)||void 0===o?void 0:o.server)!=e||(i.probeQuality=s),r&&this.handleProbedList(t,i,r,i.probeNodeList)},i.prototype.handleProbedList=function(t,i,e,n){var s=this;this._p(i);var r,o=i.probedList,u=i.probeState==ot.probed,a="zc.hpl.0";(ti(this.In,a,"".concat(i.streamId," ").concat(JSON.stringify(o)," ").concat(u," ").concat(i.netQuality)),o.length&&!u)?(o.length>1&&o.forEach((function(t){if(r){if(r.probeQuality<=t.probeQuality-20){var e=s.gwNodeNetQuality(t.gwNode);if(s.In.info("".concat(a," 1: {netQuality} ").concat(t.gwNode," current:").concat(JSON.stringify(r))),-1==e||e>=r.probeQuality+20)r=t;else{var n=s.gwNodeNetQuality(r.gwNode);s.In.info("".concat(a," 2: {_netQuality} ").concat(r.gwNode)),-1!==n&&n<=Math.max(40,i.netQuality+20)&&(r=t)}}}else t.probeQuality>Math.max(40,i.netQuality+20)&&(r=t)})),r||(r=o[0]),o.forEach((function(t){var i,e=null===(i=s.ap[t.gwNode])||void 0===i?void 0:i.streamID;e&&(s.stopPlayingStream(e),delete s.ap[t.gwNode])})),this.handleCalNetQualityResult(t,r,i,e,n),i.probedList=[]):this.In.info("".concat(a," pbLength:").concat(o.length," probed:").concat(u))},i.prototype.gwNodeNetQuality=function(t){var i,e=-1;for(var n in this.publisherList){var s=this.publisherList[n].publisher;s.gwNode!=t&&s.signal.server!=t||(e=s.netQuality)}for(var n in this.playerList)if(!n.includes("zegoprobe")){var r=this.playerList[n];r.gwNode!=t&&(null===(i=r.signal)||void 0===i?void 0:i.server)!=t||(e=r.netQuality)}return e},i.prototype.handleCalNetQualityResult=function(t,i,e,n,s){var r=this,o=i.gwNode,u=i.result,c=i.probeQuality,h="zc.hcqr.0 ",f=!1,l=!0,d=mm(this.In,e.streamId);null==s||s.forEach((function(t){var i;(null===(i=r.up[t])||void 0===i?void 0:i.probeQuality)||(l=!1)})),d.info("".concat(h," t:").concat(e.netQuality," probe:").concat(c,", gw:").concat(o,",r:").concat(u,", last:").concat(l));var v=this.Mn.createSpan(a.H,{key:fn},{key:""},ws.event);if(0==u&&(c>Math.max(40,e.netQuality+20)?(d.info(h+" switch "+o),f=!0,this.retryStream(e,t,o),e.probeState=ot.probed):f=!1),!f)if(l){if(d.info(h+" last "),!e.Qh)for(var m in e.netProbeToReDispatch((function(){e.Qh=!1,d.info("".concat(h," gw redispatch success")),r.startNetProbe(t,e)}),(function(){d.info("".concat(h," gw redispatch fail")),e.Qh=!1})),this.up)-1===this.up[m].netQuality&&(this.up[m]={})}else n&&this.startNetProbe(t,e,s);var p=ws;v.setAttributes({is_switch:p.is_switch(f),is_publish:p.is_publish(t),stream_id:p.stream_id(e.streamId),result:p.result(u),node:p.node(o),net_quality:p.net_quality(parseInt(e.netQuality+"")),probe_net_quality:p.probe_net_quality(parseInt(c+""))}),v.end()},i.prototype.retryStream=function(t,i,e){if(i){var n=t,s=n.streamId,r=n.localStream,o=n.publishOption;n.resetPublish(1),n.gwNode=e,n.startPublish(s,r,o,this.getReferredVideoBitrate())}else{var u=t,a=(s=u.streamId,u.getRemoteStreamSuc);u.resetPlay(!0,1),this.onPlayStateUpdate(K,s,{code:de.code,message:de.message}),u.gwNode=e,u.startPlay(s,a)}},i.prototype.getRoomByStreamID=function(t){return this.publisherList[t]?this.publisherList[t].room:this.playerList[t]?this.playerList[t].room:void 0},i.prototype.setVideoTrackContentHint=function(t,i){if(qt(i)){var e=i.toLowerCase();if(["default","motion","detail","text"].includes(e)){var n=t.getVideoTracks()[0];n?"contentHint"in n?(this.In.info("zc.svtch "+e),n.contentHint="default"==e?"":e):this.In.warn("zc.svtch mediaStreamTrack contentHint attribute not supported"):this.In.warn("zc.svtch video track no found")}else this.In.warn("zc.svtch videoOptimizationMode wrong")}else this.In.warn("zc.svtch videoOptimizationMode type wrong")},i.prototype.getPlayRoom=function(t){var i=this;return this.Nn.roomList.find((function(e){return!!i.getStream(e,t)}))},i.prototype.getStream=function(t,i){return t.streamList.find((function(t){return t.stream_id==i}))},i.prototype.updateQuality=function(t,i){this.Rm.updateQualityOrChargeInfo(t,i)},i.prototype.checkStreamReport=function(){this.Rm.checkStreamReport(),this.Rm.reportOldCacheData()},i.prototype.stopToReport=function(t){this.Rm.updateQualityOrChargeInfo(t,void 0,!0)},i.prototype.setIsPeer=function(t){this.Df=t,Object.values(this.publisherList).forEach((function(i){i.publisher.isPeer=t})),Object.values(this.playerList).forEach((function(i){i.isPeer=t}))},i.prototype.setStreamGwNode=function(t,i){var e=mm(this.In,t.streamId);e.info(wd+" call"),this.checkCachedNodesUse(t,i),t.gwNodesTTL&&t.gwNodesTTL<(new Date).getTime()&&(e.info(wd+" ttl timeout, reset gw"),t.resetGwNodes()),this.gwNode&&(t.gwNode=this.gwNode),e.info(wd+" end "+t.gwNode)},i.prototype.getNodeIndex=function(t,i){var e="",n=i?"publish":"play",s="";switch(i||(t.playMode==q.RTC?s="_rtc":t.playMode===q.L3&&(s="_l3")),this.cachedGwNodesMode){case T_.NotReUse:break;case T_.TheSameReUse:e=n+"_"+t.streamId+s;break;case T_.DiffReUse:e=n;break;case T_.AllReUse:e="stream"}return e},i.prototype.checkCachedNodesUse=function(t,i){var e,n,s,r=mm(this.In,t.streamId);if(r.info(Sd+" call "+this.cachedGwNodesMode),t.isExternal)if(i&&t.isCustomCdn())r.info(Sd+" custom cdn");else if(t.hasSucceed&&this.Nn.isMultiOuter)r.info(Sd+" multi outer");else{var o=this.getNodeIndex(t,i);if(r.info(Sd+" "+o),o){var u=this.cachedGwNodesList[o];u&&u.gwNodesTTL&&u.gwNodesTTL>(new Date).getTime()&&((null==u?void 0:u.gwNodes)&&(null===(e=null==u?void 0:u.gwNodes)||void 0===e?void 0:e.length)>0||(null==u?void 0:u.ips)&&(null===(n=null==u?void 0:u.ips)||void 0===n?void 0:n.length)>0||(null==u?void 0:u.ipv6s)&&(null===(s=null==u?void 0:u.ipv6s)||void 0===s?void 0:s.length)>0)&&(r.info(Sd+" use cache gwnodes"),u.gwNodes&&(t.gwNodeList=u.gwNodes),t.gwNodesTTL=u.gwNodesTTL,u.ips&&(t.ipV4NodeList=u.ips),u.ipv6s&&(t.ipV6NodeList=u.ipv6s),t.ipNodeType===It.ZV4Only?(t.gwNode=t.gwNodeList[0],t.ipV6Prefer=Rt.kV4Only):(t.gwNode=this.getGwNode(t,this.ipNodeType,-1),t.ipV6Prefer=this.ipV6Prefer))}r.info(Sd+" end "+t.gwNode)}else r.info(Sd+" retry internal")},i.prototype.updateCachedGwNodesList=function(t,i,e,n,s,r){void 0===s&&(s=[]),void 0===r&&(r=[]);var o=mm(this.In,t);if(o.info(Ed+" call"),0===n)this.setCachedGwNodesMode(T_.NotReUse);else if(n>0){var u=i?this.getPublisher(t):this.playerList[t];if(u){var a=this.getNodeIndex(u,i);o.info(Ed+" nodeIndex "+a),a&&(this.cachedGwNodesList[a]||(this.cachedGwNodesList[a]={}),this.cachedGwNodesList[a].gwNodesTTL=(new Date).getTime()+1e3*n,(null==e?void 0:e.length)>0&&(this.cachedGwNodesList[a].gwNodes=e),(null==s?void 0:s.length)>0&&(this.cachedGwNodesList[a].ips=s),(null==r?void 0:r.length)>0&&(this.cachedGwNodesList[a].ipv6s=r))}else this.In.info(Ed+" player no found"+t)}},i.prototype.clearCachedGwNodesList=function(t,i){var e=this.getNodeIndex(t,i);this.In.info("zsc.ccgl nodeIndex "+e,{streamid:t.streamId}),e&&delete this.cachedGwNodesList[e]},i.prototype.setCachedGwNodesMode=function(t){this.cachedGwNodesMode=t},i.prototype.updateTimeOffsetInterval=function(){var t,i,e=this;Lt(null===(t=this.np)||void 0===t?void 0:t.netAgent.timeOffset)&&(this.Nn.clientTimeOffset=null===(i=this.np)||void 0===i?void 0:i.netAgent.timeOffset),this.ho=setTimeout((function(){e.updateTimeOffsetInterval()}),9e5)},i.prototype.changeRxQuality=function(t){this.fp=t,this.startPublishNetWorkQuality()},i.prototype.changeTxQuality=function(t){this.hp=t,this.startPublishNetWorkQuality()},i.prototype.startPublishNetWorkQuality=function(){var t=this;null===this.Tv&&(this.Tv=setInterval((function(){t.Nn.actionListener("networkQuality","",t.hp,t.fp)}),3e3))},i.prototype.resetNetworkData=function(){Object.keys(this.playerList).length<1&&(this.fp=-1),this.publishersLength<1&&(this.hp=-1),Object.keys(this.playerList).length<1&&this.publishersLength<1&&(clearInterval(this.Tv),this.Tv=null)},i.prototype.getCloudSoundInterval=function(){var t=this.Nn.settingConfig.getSetting("sound_sample_interval");return t&&(t<100&&(t=100),t>3e3&&(t=3e3),this.In.info("zc.gsl setting sound_sample_interval "+t)),t},i.prototype.createSoundLevel=function(t,i,e,n,s){void 0===e&&(e=this.soundLevelInterval),void 0===s&&(s=function(t){});var r=new Ep(this.In,this.Nn,e,n),o=r.getSrcSource(t,i);return r.initAudioWorklet(t,o),r.onSoundLevelUpdate=function(t){s(t)},{mic:o,soundMeter:r}},i.prototype.createSEIWorker=function(){if(this.isNotSupportSeiWorker)return null;var t=this.seiWorker;if(t)return t;var i=b_.toString().trim().match(/\{([\s\S]*)\}/)[1],e=URL.createObjectURL(new window.Blob([i],{type:"text/javascript"}));return t=this.seiWorker=new Worker(e),this.In.info("zsc.gseiw init sei"),t},i.prototype.handleSeiRollBack=function(){this.isNotSupportSeiWorker=!0,this.destroySEIWorker()},i.prototype.destroySEIWorker=function(){var t;null===(t=this.seiWorker)||void 0===t||t.terminate(),this.seiWorker=void 0},i.prototype.destroy=function(){var t;this.soundLevelTimer&&clearTimeout(this.soundLevelTimer),this.ho&&clearTimeout(this.ho),this.Tv&&clearInterval(this.Tv),null===(t=this._billingTimer)||void 0===t||t.destroy(),this.Ep(),this.checkDeviceChange=void 0,this.isCandidateHasIPv6=!1,this.captureStreamElementMap.clear(),Wt.removeEventListener("visibilitychange",this.eventHandler.visibilitychange)},i.prototype.Ep=function(){var t=this;Object.keys(this.op).forEach((function(i){var e,n;t.op[i].signal=null,null===(n=null===(e=t.op[i])||void 0===e?void 0:e.retryServerSignalHandler)||void 0===n||n.invalid(),t.op[i].retryServerSignalHandler=null,delete t.op[i]}))},i.prototype.supplementPlayingChargeTime=function(){this.billingTimer.supplementPlayingChargeTime()},i.prototype.getDataChannelOption=function(){var t={ordered:!0},i=this.Nn.engineConfig.datachannelOption;return Ut(i.ordered)&&!i.ordered&&(t.ordered=!1,Lt(i.maxPacketLifeTime)&&i.maxPacketLifeTime>0&&i.maxPacketLifeTime<5e3?t.maxPacketLifeTime=i.maxPacketLifeTime:Lt(i.maxRetransmits)&&i.maxRetransmits>0&&i.maxRetransmits<50&&(t.maxRetransmits=i.maxRetransmits)),t},i.prototype.getIPv6PreferByGwNode=function(t){return El(ql(t))===kt.IPv4?Rt.kV4AndV6:Rt.kV6AndV4},i.prototype.getGwNode=function(t,i,e){var n="",s=t.gwNodeList,r=t.ipV4NodeList,o=t.ipV6NodeList;if(i===It.ZV4Only)(null==s?void 0:s.length)>0&&(n=s[++e%s.length]);else if(i===It.ZV4Priority)(null==r?void 0:r.length)>0&&(t.ipNode=r[++e%r.length],n=Fl(t.ipNode));else if(i===It.ZV6Priority)(null==o?void 0:o.length)>0&&(t.ipNode=o[++e%o.length],n=Fl(t.ipNode));else if(i===It.ZV6AndV4Priority){var u=this.getSortedIPV6AndV4Nodes(t,"v6");if(u.length>0)if(-1===e)n=Fl(u[0]);else{var a=Yl(u,t.gwNode);n=Fl(u[++a%u.length])}}return this.In.info("zsc.gw get node ".concat(It[i]," ").concat(e," ").concat(n)),n},i.prototype.sortIPNodesByPriority=function(t){return t.sort((function(t,i){return t.priority>i.priority?-1:t.priority<i.priority?1:0}))},i.prototype.getSortedIPV6AndV4Nodes=function(t,i){var e=A_([],t.ipV6NodeList,!0);return t.ipV4NodeList.forEach((function(t){t.vid.split("|").every((function(t){return e.every((function(i){return i.ip===t}))}))||e.push(t)})),e.sort((function(t,e){return t.priority>e.priority?-1:t.priority<e.priority?1:Sl(t.ip)?"v6"===i?-1:1:"v6"===i?1:-1})),e},i.prototype.isNodeLast=function(t){var i=0,e=!1,n=t.gwNodeList,s=t.ipV4NodeList,r=t.ipV6NodeList,o=t.gwNode;if(t.ipNodeType===It.ZV4Only)e=(i=n.findIndex((function(t){return t==o})))===n.length-1;else{var u=Yl(s,o),a=Yl(r,o);if(t.ipNodeType===It.ZV4Priority)e=(i=u)===s.length-1;else if(t.ipNodeType===It.ZV6Priority)e=(i=a)===r.length-1;else{var c=this.getSortedIPV6AndV4Nodes(t,"v6");e=(i=Yl(c,o))===c.length-1}}return{lastTryNext:e,currentIdx:i}},i.prototype.getStreamIPNodesMode=function(){var t,i;if(this.In.info("zsc.gsinm call, proxy: ".concat(this.isProxy,", mode: ").concat(_t[this.Nn.selectIPStackMode]," ")),this.isProxy||this.Nn.selectIPStackMode===_t.IPv4Only)t=Rt.kV4Only,i=It.ZV4Only;else if(this.Nn.selectIPStackMode===_t.IPv4Prefer){var e=this.getIPV4PreferNodeType();i=e.ipNodeType,t=e.ipV6Prefer}else{var n=this.getIPV6PreferNodeType();i=n.ipNodeType,t=n.ipV6Prefer}return this.In.info("zsc.gsinm prefer: ".concat(t,", nodeType: ").concat(i)),this.ipV6Prefer=t,this.ipNodeType=i,{ipV6Prefer:t,ipNodeType:i}},i.prototype.getIPV4PreferNodeType=function(){var t=this.agentConnectIPStackType;this.In.info("zsc.gi4nt connected: ".concat(kt[t],", detection: ").concat(JSON.stringify(this.agentIpStackDetection)));var i,e,n=this.agentIpStackDetection,s=n.IPv4,r=n.IPv6;return t===kt.IPv4||s===Nt.reachable?(i=It.ZV4Only,e=Rt.kV4Only):[Nt.unknown,Nt.unreachable].includes(s)&&r===Nt.reachable?(i=It.ZV6Priority,e=Rt.kV6AndV4):(i=It.ZV4Priority,e=Rt.kV4AndV6),{ipNodeType:i,ipV6Prefer:e}},i.prototype.getIPV6PreferNodeType=function(){this.In.info("zsc.gi6nt detection: ".concat(JSON.stringify(this.agentIpStackDetection)));var t,i,e=this.agentIpStackDetection,n=e.IPv4-e.IPv6;return 0===n?(t=It.ZV6AndV4Priority,i=Rt.kV6AndV4):n>0?(t=It.ZV4Priority,i=Rt.kV4AndV6):(t=It.ZV6Priority,i=Rt.kV6AndV4),{ipNodeType:t,ipV6Prefer:i}},i.prototype.getRetryIPPreferNodeType=function(){var t,i;this.In.info("zsc.gripnt mode:".concat(_t[this.Nn.selectIPStackMode]," detection: ").concat(this.agentIpStackDetection));var e=this.agentIpStackDetection;if(this.Nn.selectIPStackMode===_t.IPv4Prefer)e.IPv4===Nt.reachable?(t=It.ZV4Priority,i=Rt.kV4AndV6):e.IPv6===Nt.reachable?(t=It.ZV6Priority,i=Rt.kV6AndV4):(t=It.ZV4Priority,i=Rt.kV4AndV6);else{var n=this.getIPV6PreferNodeType();t=n.ipNodeType,i=n.ipV6Prefer}return{ipNodeType:t,ipV6Prefer:i}},i.prototype.mp=function(t){var i=this;setTimeout((function(){Object.values(i.playerList).forEach((function(i){i.changePublishOccasion(t)}))}),0)},i.prototype.getReferredVideoBitrate=function(){var t=Date.now();return this.referenceBitrateUpdateTs>0&&t-this.referenceBitrateUpdateTs<3e4?this.referenceVideoBitrate:0},i.prototype.updateReferenceBitrate=function(t){this.referenceVideoBitrate=t,this.referenceBitrateUpdateTs=Date.now()},i.closeNetProbe=!1,i}(lb),Y_=o(6794),Z_=function(){function t(t){this.v=t}return t.prototype.takeStreamSnapshot=function(t){return this.v.takeStreamSnapshot(t)},t.prototype.play=function(t,i){return this.v.play(t,i)},t.prototype.stop=function(){return this.v.stop()},t.prototype.playVideo=function(t,i){this.v.playVideo(t,i)},t.prototype.stopVideo=function(){this.v.stopVideo()},t.prototype.playAudio=function(t){this.v.playAudio(t,!0)},t.prototype.stopAudio=function(){this.v.stopAudio()},t.prototype.resume=function(){this.v.resume()},t.prototype.setAudioMuted=function(t){return this.v.setAudioMuted(t)},t.prototype.setVideoMuted=function(t){return this.v.setVideoMuted(t)},t.prototype.useAudioOutputDevice=function(t){return this.v.useAudioOut(t)},t.prototype.setVolume=function(t){return this.v.setVolume(t)},t.prototype.getVideoHeight=function(){return this.v.getVideoHeight()},t.prototype.getVideoWidth=function(){return this.v.getVideoWidth()},t.prototype.on=function(t,i){return this.v.on(t,i)},t.prototype.off=function(t,i){return this.v.off(t,i)},t}(),Q_=function(){return Q_=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},Q_.apply(this,arguments)},X_=function(){function t(t,i,e){this.Op=t,this.Tp=i,this.Ro=e,this._initTime=Date.now()}return Object.defineProperty(t.prototype,"appid",{get:function(){return this.Tp.appid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"device_id",{get:function(){return this.Op.deviceID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"product",{get:function(){return this.Op.roomServer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sdk_version",{get:function(){return v},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sys_info",{get:function(){return navigator.userAgent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"report_version",{get:function(){return this.Tp.sdkVerNum},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"browser",{get:function(){return this.Tp.browser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id_name",{get:function(){return this.Op.idName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nick_name",{get:function(){return this.Op.nickName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"use_na",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userid",{get:function(){return this.Op.userid},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"network_state",{get:function(){return this.Tp.networkState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"init_time",{get:function(){return this._initTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"net_type",{get:function(){var t;return(null===(t=navigator.connection)||void 0===t?void 0:t.effectiveType)||"unknown"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"room_server",{get:function(){return this.Op.roomServer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"device_infos",{get:function(){return this.Tp.deviceInfos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"room_list",{get:function(){var t=this,i={};return this.Tp.roomList.forEach((function(e){var n,s,r,o=t.Op.roomModulesList.find((function(t){return t.roomID===e.roomID})),u={roomSessionID:e.roomSessionID,sessionID:e.sessionID,streamList:e.streamList,token:e.token,role:t.Op.role,roomCreateFlag:t.Op.roomCreateFlag,loginTime:null==o?void 0:o.loginTime,heartbeatInterval:null===(n=null==o?void 0:o.heartBeatHandler)||void 0===n?void 0:n.heartbeatInterval,roomExtraInfos:null===(s=null==o?void 0:o.messageHandler)||void 0===s?void 0:s.transSeqMap,roomRetryTime:null===(r=null==o?void 0:o.roomTryHandler)||void 0===r?void 0:r.RETRY_MAX_TIME};i[e.roomID]=u})),i},enumerable:!1,configurable:!0}),t.prototype.getRoomList=function(t,i){var e=this;return this.room_id_list.slice(t,i).map((function(t){return Q_({roomID:t},e.room_list[t])}))},Object.defineProperty(t.prototype,"room_id_list",{get:function(){return this.Tp.roomList.map((function(t){return t.roomID}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"roomListSize",{get:function(){return this.room_id_list.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userLoginState",{get:function(){var t,i=this.Op.roomModulesList[0],e=i.runState,n=i.lastRunState;return e===D.logout?t=P.logout:e===D.login?t=P.login:n===D.logout?t=P.trylogin:n===D.login&&(t=P.reconnect),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"publishStreamList",{get:function(){return Object.keys(this.Ro.publisherList)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"publishList",{get:function(){var t=this,i={};return this.publishStreamList.forEach((function(e){var n,s,r,o=t.Ro.publisherList[e],u=null==o?void 0:o.publisher,a=null==u?void 0:u.publishStat;i[e]={streamSid:null==o?void 0:o.streamSid,roomID:null===(n=null==o?void 0:o.room)||void 0===n?void 0:n.roomID,roomSessionID:null===(s=null==o?void 0:o.room)||void 0===s?void 0:s.roomSessionID,cameraLabel:null==o?void 0:o.cameraLabel,microLabel:null==o?void 0:o.microLabel,cameraStatus:null==u?void 0:u.camera_status,micStatus:null==u?void 0:u.mic_status,sessionId:null==u?void 0:u.sessionId,publishBeginTime:null==u?void 0:u.reportPublishStateTime,serverUrl:null===(r=null==u?void 0:u.signal)||void 0===r?void 0:r.server,gwNode:null==u?void 0:u.gwNode,proto:"webrtc",frameWidth:null==a?void 0:a.frameWidth,frameHeight:null==a?void 0:a.frameHeight,rtt:null==a?void 0:a.currentRoundTripTime,videoPacketsLostRate:null==a?void 0:a.videoPacketsLostRate,audioPacketsLostRate:null==a?void 0:a.audioPacketsLostRate,videoTargetBitrate:null==a?void 0:a.videoTargetBitrate,videoBitrate:null==a?void 0:a.videoBitrate,audioTargetBitrate:null==a?void 0:a.audioTargetBitrate,audioBitrate:null==a?void 0:a.audioBitrate,videoTargetFPS:null==a?void 0:a.videoTargetFPS,videoFPS:null==a?void 0:a.videoFPS,audioFPS:null==a?void 0:a.audioFPS,videoCodecName:null==a?void 0:a.videoCodecName,audioCodecName:null==a?void 0:a.audioCodecName}})),i},enumerable:!1,configurable:!0}),t.prototype.getPublishList=function(t,i){var e=this;return this.publishStreamList.slice(t,i).map((function(t){return Q_({streamID:t},e.publishList[t])}))},Object.defineProperty(t.prototype,"publishListSize",{get:function(){return this.publishStreamList.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playStreamList",{get:function(){return Object.keys(this.Ro.playerList)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playList",{get:function(){var t=this,i={};return this.playStreamList.forEach((function(e){var n,s,r,o=t.Ro.playerList[e],u=o,a=null==u?void 0:u.playStat;i[e]={streamSid:null==o?void 0:o.streamSid,roomID:null===(n=null==o?void 0:o.room)||void 0===n?void 0:n.roomID,roomSessionID:null===(s=null==o?void 0:o.room)||void 0===s?void 0:s.roomSessionID,cameraStatus:null==u?void 0:u.cameraStatus,micStatus:null==u?void 0:u.micStatus,sessionId:null==u?void 0:u.sessionId,playBeginTime:null==u?void 0:u.reportPlayStateTime,serverUrl:null===(r=null==u?void 0:u.signal)||void 0===r?void 0:r.server,gwNode:null==u?void 0:u.gwNode,proto:"webrtc",frameWidth:null==a?void 0:a.frameWidth,frameHeight:null==a?void 0:a.frameHeight,rtt:null==a?void 0:a.currentRoundTripTime,videoPacketsLostRate:null==a?void 0:a.videoPacketsLostRate,audioPacketsLostRate:null==a?void 0:a.audioPacketsLostRate,videoBitrate:null==a?void 0:a.videoBitrate,audioBitrate:null==a?void 0:a.audioBitrate,videoFPS:null==a?void 0:a.videoFPS,audioFPS:null==a?void 0:a.audioFPS,videoCodecName:null==a?void 0:a.videoCodecName,audioCodecName:null==a?void 0:a.audioCodecName,peerToPeerDelay:null==a?void 0:a.peerToPeerDelay,firstFrameTime:null==a?void 0:a.firstFrameTime,videoJitter:null==a?void 0:a.videoJitter,audioJitter:null==a?void 0:a.audioJitter}})),i},enumerable:!1,configurable:!0}),t.prototype.getPlayList=function(t,i){var e=this;return this.playStreamList.slice(t,i).map((function(t){return Q_({streamID:t},e.playList[t])}))},Object.defineProperty(t.prototype,"playListSize",{get:function(){return this.playStreamList.length},enumerable:!1,configurable:!0}),t}(),W_="zc.ac.mer",K_=function(){function t(t,i,e){var n=this;this.In=t,this.ac=i,this.Jo=e,this.error=!1,this.effectMode=1,this.eventHandler={volumechange:function(t){var i=t.target;i&&n.kp&&(i.muted||i.paused?(n.In.info(W_+" local audio muted disconnect"),n.kp.disconnect()):(n.In.info(W_+" local audio is connected"),n.kp.connect(n.ac.destination)))}},this.In.info(W_+" create audio renderer"),this.error=!this.init(),this.error||(e.addEventListener("volumechange",this.eventHandler.volumechange),e.addEventListener("pause",this.eventHandler.volumechange),e.addEventListener("play",this.eventHandler.volumechange))}return t.prototype.setGain=function(t){this.kp&&(this.kp.gain.value=t)},t.prototype.init=function(){var t=this.ac;try{var i=th().match(/iPhone\sOS\s(\d+)_(\d+)_?(\d+)?/);if(i&&17==+i[1]&&0==+i[2]&&+i[3]<4)throw" iOS 17 not suppot createMediaElementSource.";"anonymous"!==this.Jo.crossOrigin&&this.In.info(W_+" Media element does not support cross-origin. Maybe no sound can be played"),this.srcNode=t.createMediaElementSource(this.Jo);var e=this.kp=t.createGain();e.connect(t.destination),this.srcNode.connect(e),"suspended"===this.ac.state&&this.ac.resume()}catch(t){return this.In.warn(W_+" create src failed."+t),!1}return!0},t.prototype.getMixNode=function(){var t=this.mixOutputNode;return t||(t=this.mixOutputNode=this.ac.createGain()),this.setVoiceChangeNode(this.effectMode,this.voiceChangerNode,!0),{mixOutputNode:t}},Object.defineProperty(t.prototype,"effectOnLocal",{get:function(){return[np.Local,np.All].includes(this.effectMode)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"effectOnMix",{get:function(){return[np.Publish,np.All].includes(this.effectMode)},enumerable:!1,configurable:!0}),t.prototype.setVoiceChangeNode=function(t,i,e){if(void 0===e&&(e=!1),this.kp&&this.srcNode&&(e||this.voiceChangerNode!==i||this.effectMode!==t)){this.effectMode=t,this.srcNode.disconnect();var n=this,s=n.mixOutputNode,r=n.effectOnLocal,o=n.effectOnMix;if(this.In.info(W_+" set voice changer render. ".concat(JSON.stringify({mode:t,node:!!i,force:e,effectOnLocal:r,effectOnMix:o}))),i)i.disconnect(),this.srcNode.connect(i),r?i.connect(this.kp):this.srcNode.connect(this.kp),s&&(o?i.connect(s):this.srcNode.connect(s)),this.voiceChangerNode=i;else{var u=this.srcNode;u.connect(this.kp),this.mixOutputNode&&u.connect(this.mixOutputNode),this.voiceChangerNode=void 0}}},t.prototype.destroy=function(){var t;null===(t=this.kp)||void 0===t||t.connect(this.ac.destination),this.Jo.removeEventListener("volumechange",this.eventHandler.volumechange),this.Jo.removeEventListener("pause",this.eventHandler.volumechange),this.Jo.removeEventListener("play",this.eventHandler.volumechange)},t}(),$_=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},ty=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},iy=function(){function t(t){var i=this;this.In=t,this.isResuming=!1,this.Rp=new Map,this.Ip=new Map,this.eventHandler={resumeAudioContext:function(t){var e=i.ac.state;if("running"!==e){var n=null==t?void 0:t.type;i.In.info("zc.ac.rs call "+e+", "+n),i.ac.resume().then((function(){i.In.info("zc.ac.rs end "+i.ac.state+", "+n)}))}else i.offCheckAudioContextListener()}},this.id=Date.now();var e=window.AudioContext||window.webkitAudioContext;this.ac=new e,this.In.info("zc.ac.0 ".concat(this.id," ").concat(this.ac.state,", ").concat(this.ac.sampleRate)),this.ac.addEventListener("statechange",(function(){var t,e=null===(t=i.ac)||void 0===t?void 0:t.state;i.In.info("zc.ac.sc ".concat(i.id," ").concat(e)),"running"!==e&&i.checkAudioContext()})),this.checkAudioContext()}return t.create=function(i){return t.mgr?t.mgr.In=i:t.mgr=new t(i),t.mgr},t.prototype.getMediaElementRenderer=function(t){var i=this.Rp.get(t);return i||((i=new K_(this.In,this.ac,t)).error?null:(this.Rp.set(t,i),i))},t.prototype.checkAudioContext=function(){if(this.In.info("zc.ac.cac call"),this.ac&&"suspended"===this.ac.state){var t=this.eventHandler.resumeAudioContext;rh()&&t(),window.addEventListener("mousedown",t)}},t.prototype.offCheckAudioContextListener=function(){this.In.info("zc.ac.ocac call"),window.removeEventListener("mousedown",this.eventHandler.resumeAudioContext)},t.prototype.registerModule=function(t,i){return $_(this,void 0,void 0,(function(){var e,n,s;return ty(this,(function(r){switch(r.label){case 0:if(this.Ip.get(t))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),e=new Blob([i],{type:"text/javascript"}),n=URL.createObjectURL(e),[4,this.ac.audioWorklet.addModule(n)];case 2:return r.sent(),this.Ip.set(t,!0),[3,4];case 3:return s=r.sent(),this.Ip.set(t,!1),this.In.error("zc.ac.rm.0 ".concat(t," fail ").concat(s.toString())),[3,4];case 4:return[2]}}))}))},t.prototype.destroy=function(){this.offCheckAudioContextListener()},t}(),ey=function(){function t(t,i){var e=i.type,n=i.channels,s=void 0===n?1:n,r=i.bufferSize,o=void 0===r?0:r,u=i.sampleBit,a=void 0===u?16:u,c=i.sampleRate,h=void 0===c?44100:c,f=this;this.instant=0,this.slow=0,this.clip=0,this.context=t,this.type=e,this.channels=s,this.bufferSize=o,this.sampleBit=a,this.sampleRate=h,this.script=t.createScriptProcessor(o,s,s);(new Date).getTime();this.script.addEventListener("audioprocess",(function(t){var i,n=t.inputBuffer.getChannelData(0),s=0,r=0;for(i=0;i<n.length;++i)s+=n[i]*n[i],Math.abs(n[i])>.99&&(r+=1);if(f.instant=Math.sqrt(s/n.length),f.slow=.95*f.slow+.05*f.instant,f.clip=r/n.length,"pcm"===e||"wav"===e){for(var o=[],u=0;u<f.channels;u++)o.push(t.inputBuffer.getChannelData(u));f.recorderBuffer(o)}})),"pcm"!==e&&"wav"!==e||this.initRecorderBuffer(e)}return t.prototype.connectToSource=function(t,i){try{this.mic=this.context.createMediaStreamSource(t),this.mic.connect(this.script),this.script.connect(this.context.destination),Bt(i)||i(null)}catch(t){console.error(t),Bt(i)||i(t)}return this},t.prototype.recorderBuffer=function(t){this.worker.postMessage({command:"record",val:t})},t.prototype.initRecorderBuffer=function(t){var i=this;this.worker=this.inlineWorker((function(){var t,i,e,n,s,r,o=[];function u(t,i,e){for(var n=0;n<e.length;n++,i+=2){var s=Math.max(-1,Math.min(1,e[n]));t.setInt16(i,s<0?32768*s:32767*s,!0)}}function a(t,i,e){for(var n=0;n<e.length;n++,i++){var s=Math.max(-1,Math.min(1,e[n])),r=s<0?128*s:127*s;t.setInt8(i,r+=128)}}function c(t,i,e){for(var n=0;n<e.length;n++)t.setUint8(i+n,e.charCodeAt(n))}function h(t,i){for(var e=new Float32Array(i.length/t),n=0,s=0;n<e.length;)e[n]=i[s],s+=t,n++;return e}function f(t,i,e){for(var n=new Float32Array(i*t.length),s=0,r=0;r<e[0].length;r++)n.set(e[0][r],s),s+=e[0][r].length;return n}function l(t,i){for(var e=new Float32Array(t.length+i.length),n=0;n<t.length+i.length;n+=2)e[n]=t[n/2|0],e[n+1]=i[n/2|0];return e}function d(i){var e,n;if(1==t)e=f(o[0],s,o),1!=i&&(n=h(i,e));else if(2==t){var r=f(o[0],s,o),u=f(o[1],s,o);1!=i?n=l(h(i,r),h(i,u)):e=l(r,u)}return 1!=i?n:e}function v(t){var e=function(t,e){var n;8==e?n=t.length:16==e&&(n=t.length,n*=2);var s=new ArrayBuffer(n),r=new DataView(s);return 8==e?a(r,0,t):16==i&&u(r,0,t),r}(d(t),i);self.postMessage({command:"exportPcmLive",val:e})}function m(n){var s=function(n,s){var r;8==s?r=n.length:16==i&&(r=n.length,r*=2);var o=new ArrayBuffer(r+44),h=new DataView(o),f=e,l=i,d=t;return c(h,0,"RIFF"),h.setUint32(4,36+r,!0),c(h,8,"WAVE"),c(h,12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,1,!0),h.setUint16(22,d,!0),h.setUint32(24,f,!0),h.setUint32(28,f*d*(l/8),!0),h.setUint16(32,d*(l/8),!0),h.setUint16(34,l,!0),c(h,36,"data"),h.setUint32(40,r,!0),8==i?a(h,44,n):16==i&&u(h,44,n),h}(d(n),i);self.postMessage({command:"exportWav",val:s})}this.onmessage=function(u){switch(u.data.command){case"init":t=(a=u.data.val).sampleChannel,i=a.sampleBit,e=a.sampleRate,n=a.oldSampleRate,s=a.bufferSize,r=a.type;break;case"record":!function(i){for(var s=0;s<t;s++)o[s]||(o[s]=[]),o[s].push(i[s]);var u=Math.round(n/e);"pcm"===r?v(u):"wav"===r&&m(u),o=[]}(u.data.val)}var a}})),this.worker.postMessage({command:"init",val:{sampleChannel:this.channels,sampleBit:this.sampleBit,sampleRate:this.sampleRate,oldSampleRate:this.context.sampleRate,bufferSize:this.bufferSize,type:t}}),this.worker.onmessage=function(t){switch(t.data.command){case"exportPcmLive":i.onReceiveBuffer(t.data.val);break;case"exportWav":i.onReceiveWav(t.data.val)}}},t.prototype.onReceiveBuffer=function(t){},t.prototype.onReceiveWav=function(t){},t.prototype.writeString=function(t,i,e){for(var n=0;n<e.length;n++)t.setUint8(i+n,e.charCodeAt(n))},t.prototype.writeBuffer=function(t,i,e){for(var n=0;n<e.byteLength;n++)t.setUint8(i+n,e[n])},t.prototype.concatenation=function(t){for(var i=0,e=0;e<t.length;++e)i+=t[e].buffer.byteLength;var n=new Uint8Array(i),s=0;for(e=0;e<t.length;++e)n.set(new Uint8Array(t[e].buffer),s),s+=t[e].buffer.byteLength;return n},t.prototype.encodeWave=function(t){var i=this.concatenation(t),e=i.byteLength,n=new ArrayBuffer(e+44),s=new DataView(n),r=this.sampleRate,o=this.sampleBit,u=this.channels;return this.writeString(s,0,"RIFF"),s.setUint32(4,36+e,!0),this.writeString(s,8,"WAVE"),this.writeString(s,12,"fmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,u,!0),s.setUint32(24,r,!0),s.setUint32(28,r*u*(o/8),!0),s.setUint16(32,u*(o/8),!0),s.setUint16(34,o,!0),this.writeString(s,36,"data"),s.setUint32(40,e,!0),this.writeBuffer(s,44,i),s},t.prototype.stop=function(){this.mic.disconnect(),this.script.disconnect()},t.prototype.inlineWorker=function(t){if(Worker&&t){var i=t.toString().trim().match(/\{([\s\S]*)\}/)[1],e=URL.createObjectURL(new window.Blob([i],{type:"text/javascript"}));return new Worker(e)}return null},t}(),ny=function(){return ny=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},ny.apply(this,arguments)},sy=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},ry=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},oy=function(t,i,e){if(e||2===arguments.length)for(var n,s=0,r=i.length;s<r;s++)!n&&s in i||(n||(n=Array.prototype.slice.call(i,0,s)),n[s]=i[s]);return t.concat(n||Array.prototype.slice.call(i))};var uy=function(){function t(i,e,n,s,r,o){void 0===r&&(r=0),void 0===o&&(o=j.Default);var u,c,h=this;if(this.logger=i,this.reporter=n,this.recordedBlobs=[],this.mediaRecorder=null,t.isInstantiated=!0,this.In=i,this.dataReport=e,this.acMgr=iy.create(this.In),this.stateCenter=new sm(this.In,this.dataReport),this.Nn=this.stateCenter,this.Nn.clientType="webrtc",this.Nn.settingConfig=s.stateCenter.settingConfig,s._on("_experimentalAPICallback",(function(t){h.stateCenter.onExperimentalAPICallback(t)})),!0===(null===(u=t.engineOptions)||void 0===u?void 0:u.pri)){var f=t.engineOptions.netMode;f!==z.Extranet&&f!==z.Intranet||(this.Nn.netMode=t.engineOptions.netMode)}this.RTM=s,this.Nn.appid=s.getAppID(),this.streamCenter=new F_(this.In,this.Nn,this.dataReport,this.RTM,this.acMgr,{type:t.geoFenceType,areaList:t.geoFenceAreaList}),this.Ro=this.streamCenter,this.Nn.browser=Y_.browserDetails.browser,this.Nn.browserInfo=sh(),this.Nn.sdkVerNum=this.RTM.stateCenter.sdkVerNum,this.RTM.cloudSetting.setEnvVariable("sdk_version",v),this.initTracer(n),this.rtcModules=new Og(this.In,this.dataReport,this.Nn,this.Ro,this.RTM,this.ac,this),null===(c=this.RTM.cloudSetting)||void 0===c||c.getSettingCache(Hf).then((function(t){var i;h.In.info(rd+" streamConfig "+JSON.stringify(t));var e=h.Mn.createSpan(a.H,{key:pn},{key:""},Ss);e.setAttributes({files:Es([{name:Hf,content:JSON.stringify(null==t?void 0:t.setting),versions:JSON.stringify(null==t?void 0:t.versions),code:0,message:""}])}),e.end(),h.Nn.settingConfig.setSetting(null==t?void 0:t.setting);var n=h.Nn.settingConfig.getSetting("open_mini_sdp");null===(i=h.Ro)||void 0===i||i.initMiniSdpWorker(n)})).catch((function(t){h.In.warn(rd+" streamConfig "+JSON.stringify(t))})),this.Nn.rtm=this.RTM,this.Nn.streamCenter=this.Ro,[3,4,5,6,7,8,9].includes(o)?(this.Nn.scenario=o,this.In.info(qv+" "+o+" success")):100===o?(this.stateCenter.scenario=o,this.In.info(qv+" "+o+" liveroom set")):(this.Nn.scenario=j.Default,this.In.error(qv+" "+o+"  please use valid scenario")),this.RTM.stateCenter.onListener("_beforeSwitchRoom",(function(t){var i;if(h.rtcModules.publishModule.stopPublishingStreamInRoom(t),h.stateCenter.engineConfig.switchRoomNotStopPlay){var e=[];for(var n in h.streamCenter.playerList)(null===(i=h.streamCenter.playerList[n].room)||void 0===i?void 0:i.roomID)===t&&(e.push(n),h.streamCenter.playerList[n].room={});var s=function(t,i){h.RTM.stateCenter.offListener("_afterSwitchRoom",s);for(var n=h.stateCenter.getRoomByRoomID(t),r=0,o=e;r<o.length;r++){var u=o[r];i&&n?h.streamCenter.playerList[u].room=n:h.rtcModules.playModule.stopPlayingStream(u)}};h.RTM.stateCenter.onListener("_afterSwitchRoom",s)}else h.rtcModules.playModule.stopPlayingStreamInRoom(t)}))}return Object.defineProperty(t.prototype,"ac",{get:function(){return this.acMgr.ac},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),t.setGeoFence=function(i,e){if(t.isInstantiated)throw Ri;t.geoFenceType=i,t.geoFenceAreaList=e},t.setEngineOptions=function(i){t.engineOptions=ny(ny({},t.engineOptions||{}),i),i.geoFenceType&&(t.geoFenceType=i.geoFenceType),i.geoFenceAreaList&&(t.geoFenceAreaList=i.geoFenceAreaList),"boolean"==typeof i.closeNetProbe&&F_.setCloseNetProbe(i.closeNetProbe),ai(i.dataReportCustomerContext,!0)&&F_.setReportCustomerContext(i.dataReportCustomerContext),void 0!==i.ipStackMode&&[0,1,2].includes(i.ipStackMode)&&(t.ipStackMode=i.ipStackMode)},t.prototype.destroyEngineHandler=function(){var t=this;this.In.info(od+" call");var i=function(){return!t.RTM.stateCenter.roomModulesList.some((function(t){return!(t.isLogout()||"DISCONNECTED"===t.roomState)}))},e=function(){t.destroyCopyrightedMusic(),t.RTM.destroyRTM();for(var i=0,e=t.Ro.previewStreamList;i<e.length;i++){var n=e[i];n.localStream&&t.destroyStream(n.localStream)}t.Nn.actionListener("_engineDestroy"),t.acMgr.destroy(),t.rtcModules.publishModule.destroy(),t.Ro.destroy(),t.Nn.destroy(),t.RTM.netAgent.destroy(),t.In.info(od+" call success"),t.In.destroy()};i()?e():(this.RTM.off("roomStateUpdate"),this.off("playerStateUpdate"),this.off("publisherStateUpdate"),this.RTM.stateCenter.onListener("_roomStateUpdate",(function(t,n){"DISCONNECTED"===n&&i()&&e()})),this.RTM.logoutRoom())},t.prototype.mutePublishStreamVideo=function(t,i,e){return this.rtcModules.publishModule.mutePublishStreamVideo(t,i,e)},t.prototype.mutePublishStreamAudio=function(t,i){return this.rtcModules.publishModule.mutePublishStreamAudio(t,i)},t.prototype.mutePlayStreamVideo=function(t,i){return this.rtcModules.playModule.mutePlayStreamVideo(t,i)},t.prototype.mutePlayStreamAudio=function(t,i){return this.rtcModules.playModule.mutePlayStreamAudio(t,i)},t.prototype.muteMicrophone=function(t){return this.rtcModules.publishModule.muteMicrophone(t)},t.prototype.isMicrophoneMuted=function(){return!this.Ro.isMicEnabled},t.prototype.setAudioOutput=function(t,i){return this.In.info("zc.sao call"),qt(i)?this.rtcModules.playModule.setStreamAudioOutput(t,i):(this.In.error("audiooutput is not string"),!1)},t.prototype.setGWNode=function(t){qt(t)&&t.length>0&&(this.Ro.gwNode=t)},t.prototype.setQualityMonitorCycle=function(t){return this.In.warn("setQualityMonitorCycle method deprecated!!!"),!1},t.prototype.startPlayingStream=function(t,i,e){return this.In.info(hd+" call by user",{streamid:t+""}),this.rtcModules.playModule.startPlayingStream(t,i,e)},t.prototype.setPlayStreamVideoType=function(t,i){return this.rtcModules.playModule.setPlayStreamVideoType(t,i)},t.prototype.stopPlayingStream=function(t){this.In.info(ld+" call by user",{streamid:t+""}),this.rtcModules.playModule.stopPlayingStream(t,void 0,!0)},t.prototype.setPlayAccelerate=function(t){this.Nn.playAccelerate=t},t.prototype.setTurnOverTcpOnly=function(t){this.In.info("zc.stoto call "+t),Ut(t)?this.Nn.turnOverTcpOnly=t:this.In.error("zc.p.stoto.0 param must be param")},t.prototype.createStream=function(t){return this.rtcModules.publishModule.createStream(t,!0)},t.prototype.createZegoStream=function(t){return this.rtcModules.publishModule.createZegoStream(t)},t.prototype.setRoomScenario=function(t){return[3,4,5,6,7,8,9].includes(t)?(this.In.info(Lv+" "+t+" called"),this.Nn.roomList.length?(this.In.error(Lv+" "+JSON.stringify(ke)),!1):(this.Nn.scenario=t,this.In.info(Lv+" "+t+" called success"),!0)):(this.In.error(Lv+" "+t+" please use valid scenario"),!1)},t.prototype.destroyStream=function(t){this.In.info(ad+" call by user"),this.rtcModules.publishModule.destroyStream(t)},t.prototype.startPublishingStream=function(t,i,e,n){return this.In.info(cd+" call by user",{streamid:t+""}),this.rtcModules.publishModule.startPublishingStream(t,i,e?ny({},e):e,n)},t.prototype.updatePublishingStream=function(t,i){return this.In.info(Bv+" call by user"),this.rtcModules.publishModule.updatePublishingStream(t,i)},t.prototype.activateSEIInsert=function(t){return this.rtcModules.publishModule.activateSEIInsert(t)},t.prototype.setSEIConfig=function(t){this.In.info("zc.ssc "+JSON.stringify(t)),this.Nn.seiConfig=ny(ny({},this.Nn.seiConfig),t),this.Nn.player265ReceiverList.forEach((function(t){t.sendMsg({type:"SEIConfigUpdate"})}))},t.prototype.sendSEI=function(t,i){return this.rtcModules.publishModule.sendSEI(t,i)},t.prototype.stopPublishingStream=function(t){return this.In.info(fd+" call by user",{streamid:t+""}),this.rtcModules.publishModule.stopPublishingStream(t,void 0,!0)},t.prototype.setVideoConfig=function(t,i){return this.rtcModules.publishModule.setVideoConfig(t,i)},t.prototype.setAudioConfig=function(t,i){return this.rtcModules.publishModule.setAudioConfig(t,i)},t.prototype.replaceTrack=function(t,i){return this.rtcModules.publishModule.replaceTrack(t,i)},t.prototype.preloadEffect=function(t,i,e){if(void 0===this.rtcModules.audioMixModule)throw ni(["audio mix"]);this.rtcModules.audioMixModule.preloadEffect(t,i,e)},t.prototype.getEffectDuration=function(t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.getEffectDuration(t);throw ni(["audio mix"])},t.prototype.getEffectCurrentProgress=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.getEffectProgress(t,i);throw ni(["audio mix"])},t.prototype.seekAudioEffect=function(t,i,e){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.seekAudioEffect(t,i,e);throw ni(["audio mix"])},t.prototype.playEffect=function(t,i,e){if(void 0===this.rtcModules.audioMixModule)throw ni(["audio mix"]);this.rtcModules.audioMixModule.playEffect(t,i,e)},t.prototype.pauseEffect=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.pauseEffect(t,i);throw ni(["audio mix"])},t.prototype.resumeEffect=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.resumeEffect(t,i);throw ni(["audio mix"])},t.prototype.stopEffect=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.stopEffect(t,i);throw ni(["audio mix"])},t.prototype.unloadEffect=function(t){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.unloadEffect(t);throw ni(["audio mix"])},t.prototype.setEffectVolume=function(t,i,e,n){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.setEffectVolume(t,i,e,n);throw ni(["audio mix"])},t.prototype.startMixingAudio=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.startMixingAudio(t,i);throw ni(["audio mix"])},t.prototype.stopMixingAudio=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.stopMixingAudio(t,i);throw ni(["audio mix"])},t.prototype.mixingBuffer=function(t,i,e,n){if(void 0===this.rtcModules.audioMixModule)throw ni(["audio mix"]);this.rtcModules.audioMixModule.mixingBuffer(t,i,e,n)},t.prototype.stopMixingBuffer=function(t,i){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.stopMixingBuffer(t,i);throw ni(["audio mix"])},t.prototype.setMixingAudioVolume=function(t,i,e){if(void 0!==this.rtcModules.audioMixModule)return this.rtcModules.audioMixModule.setMixingAudioVolume(t,i,e);throw ni(["audio mix"])},t.prototype.checkSystemRequirements=function(i,e){var n=this,s=navigator&&navigator.mediaDevices&&(t.screenShotReady||"getDisplayMedia"in navigator.mediaDevices);return this.In.info("zc.csr call"+th()),new Xt((function(t){var r=n.Mn.createSpan(a.H,{key:pn},{key:""},Fn),o=e||"all",u=function(i){r.setAttributes({capability:Yn(i)}),r.end();var e=n.Nn.checkList.indexOf(o);n.Nn.checkList.splice(e,1),t(i)};return["webRTC","customCapture","camera","microphone","screenSharing","H264","VP8","all"].includes(o)&&[0,1].includes(i)?n.Nn.checkList.includes(o)||n.Nn.checkList.includes("all")?u({result:!1,errInfo:{extendedDate:"The last test of the same type has not returned a result "}}):(n.Nn.checkList.push(o),void Cl(s,u,i,e,n.Nn.customUa)):u({result:!1,errInfo:{extendedDate:"param error"}})}))},t.prototype.enumDevices=function(t,i){return sy(this,void 0,void 0,(function(){var e,n,s,r,o,u,c,h,f,l,d,v,m,p=this;return ry(this,(function(g){switch(g.label){case 0:return this.In.info("zc.ed.0 call"),e=function(){return new Xt((function(t,e){var n=p.Mn.createSpan(a.H,{key:fn},{key:""},Un);p.rtcModules.publishModule.recordDevices((function(e){var s=[],r=!0,o=!0;e.cameras.forEach((function(t){""===t.deviceID&&(r=!1),s.push({device:t.deviceID,device_name:t.deviceName,type:0})})),e.microphones.forEach((function(t){""===t.deviceID&&(o=!1),s.push({device:t.deviceID,device_name:t.deviceName,type:1})})),e.speakers.forEach((function(t){return s.push({device:t.deviceID,device_name:t.deviceName,type:2})})),n.setAttributes({dev_list:Jn(s),dev_kind:Vn(i||"all")}),n.end(),t({devices:e,enableCamera:r,enableMic:o})}),(function(t){p.Mn.setError(n,t),e(t)}))}))},[4,e()];case 1:return n=g.sent(),s=n.enableCamera,r=n.enableMic,o=n.devices,t?(this.In.info("zc.ed.0 check permission"),u={video:!0,audio:!0},"videoinput"===i?u.audio=!1:"audioinput"!==i&&"audiooutput"!==i||(u.video=!1),h=u.audio&&!r,(c=u.video&&!s)||h?(this.In.info("zc.ed.0 need to get device permission. needCamera: ".concat(c,", needMic: ").concat(h)),[4,Vl(u).catch((function(){}))]):[3,4]):[3,4];case 2:return(f=g.sent())&&f.getTracks().forEach((function(t){t.stop()})),[4,e()];case 3:l=g.sent(),d=l.devices,v=l.enableCamera,m=l.enableMic,u.video&&!v&&this.In.warn("zc.ed.0 get video device permission failed."),u.audio&&!m&&this.In.warn("zc.ed.0 get audio device permission failed."),o=d,g.label=4;case 4:return[2,o]}}))}))},t.prototype.getCameras=function(){return sy(this,void 0,void 0,(function(){return ry(this,(function(t){switch(t.label){case 0:return[4,this.enumDevices(!0,"videoinput")];case 1:return[2,t.sent().cameras]}}))}))},t.prototype.getMicrophones=function(){return sy(this,void 0,void 0,(function(){return ry(this,(function(t){switch(t.label){case 0:return[4,this.enumDevices(!0,"audioinput")];case 1:return[2,t.sent().microphones]}}))}))},t.prototype.getSpeakers=function(){return sy(this,void 0,void 0,(function(){return ry(this,(function(t){switch(t.label){case 0:return[4,this.enumDevices(!0,"audiooutput")];case 1:return[2,t.sent().speakers]}}))}))},t.prototype.getAudioInfo=function(t,i,e){if(!t)return this.In.error("localStream is empty!"),!1;var n=ny({},e);return new ey(this.ac,n).connectToSource(t,(function(t){i(t)}))},t.prototype.getSoundLevel=function(t,i,e){if(!this.rtcModules.audioMixModule)throw ni(["audio mix"]);this.rtcModules.audioMixModule.getSoundLevel(t,i,e)},t.prototype.stopSoundLevel=function(t){if(!this.rtcModules.audioMixModule)throw ni(["audio mix"]);this.rtcModules.audioMixModule.stopSoundLevel(t)},t.prototype.handleDataAvailable=function(i){i.data&&i.data.size>0&&t.recordedBlobs.push(i.data)},t.prototype.setAudioFrameCallback=function(t,i,e){var n=this;return new Promise((function(s,r){return sy(n,void 0,void 0,(function(){var n,o,u,a,c;return ry(this,(function(h){switch(h.label){case 0:if(n=function(t){r({errorCode:t.errorCode||t.code,extendedData:t.extendedData||t.message})},!(qt(t)||Yt(t)||(f=t,f instanceof Ap)))return this.In.error("zc.safc.0 streamID must be string or ZegoLocalStream or MediaStream"),n(Ii),[2];if((null==e?void 0:e.frameSize)&&![256,512,1024,2048,4096,8192,16384].includes(null==e?void 0:e.frameSize))return this.In.error("zc.safc.0 option frameSize invalid"),n(Ii),[2];if(qt(t)){if(!(u=this.Ro.playerList[t]))return this.In.error("zc.safc.0 player not found"),n(ge),[2];if(0===(null===(c=u.playStream)||void 0===c?void 0:c.getAudioTracks().length))return this.In.error("zc.safc.0 no stream or no audio"),n(ge),[2];o=u}else{if(!(a=this.Ro.checkPreview(t)))return this.In.error("zsc.sd.0 preview no found"),n(Xi),[2];if(0===t.getAudioTracks().length||a.isOriginEmptyTrack())return this.In.error("zsc.sd.0 preview no audio track"),n($e),[2];o=a}return[4,this.Ro.acMgr.registerModule("audioPCMExporter",'class AudioPcmDataProcessor extends AudioWorkletProcessor {\n  // 0. Determine the buffer size (this is the same as the 1st argument of ScriptProcessor)\n\n  constructor(options) {\n    super();\n    // console.error("AudioPcmDataProcessor");\n    this.bufferSize = 1024;\n    // 1. Track the current buffer fill level\n    this._bytesWritten = 0;\n\n    // 2. Create a buffer of fixed size\n    this.channelCount = 2;\n\n    this.inputChannels = [];\n    this.bufferSize = options.processorOptions.bufferSize || this.bufferSize;\n    this.initBuffer();\n    this.port.postMessage({\n      type: "msg",\n      msg: "init"\n    });\n  }\n\n  initBuffer() {\n    this._bytesWritten = 0;\n  }\n\n  process(inputList) {\n    // console.warn("process", inputList[0]);\n    this.port.postMessage({\n      type: "proces",\n      len: inputList[0].length\n    });\n    if (this.isBufferFull()) {\n      this.flush();\n    }\n\n    const _inputChannels = inputList[0];\n    this.channelCount = _inputChannels.length;\n    if (_inputChannels && _inputChannels.length) {\n      // 创建缓存输入\n      if (!this.inputChannels[0]) {\n        for (let i = 0; i < this.channelCount; i++) {\n          this.inputChannels[i] = new Float32Array(this.bufferSize);\n        }\n      }\n\n      const bufferLen = _inputChannels[0].length;\n      for (let j = 0; j < bufferLen; j++) {\n        for (let i = 0; i < _inputChannels.length; i++) {\n          this.inputChannels[i][this._bytesWritten] = _inputChannels[i][j];\n        }\n        this._bytesWritten++;\n      }\n    }\n    return true;\n  }\n\n  isBufferEmpty() {\n    return this._bytesWritten === 0;\n  }\n\n  isBufferFull() {\n    // console.warn(this._bytesWritten, this.bufferSize, this.channelCount);\n    return this._bytesWritten === this.bufferSize;\n  }\n\n  flush() {\n    this.port.postMessage({\n      type: "process",\n      channels: this.inputChannels,\n      channelCount: this.inputChannels.length,\n      sampleRate: sampleRate\n    });\n    this.initBuffer();\n  }\n}\n\ntry {\n  registerProcessor("audio-pcm-data-processor", AudioPcmDataProcessor);\n} catch (error) {\n  // console.warn("registerProcessor", error);\n}\n')];case 1:return h.sent(),o.setAudioFrameCallback(i,e),s({errorCode:0,extendedData:""}),[2]}var f}))}))}))},t.prototype.startRecord=function(t){var i=this,e=this.Ro.checkPreview(t);if(!e)throw"start record failed. streamNotFromZegoStr.";var n=t.clone(),s=n.getAudioTracks();s.length>0&&e.hasEmptyAudioTrack&&s.forEach((function(t){n.removeTrack(t)})),this.recordedBlobs=[];var r={mimeType:"video/webm;codecs=vp9"};console.log("MediaRecorder",MediaRecorder),MediaRecorder.isTypeSupported(r.mimeType)||(r={mimeType:"video/webm;codecs=vp8,opus"},MediaRecorder.isTypeSupported(r.mimeType)||(r={mimeType:"video/webm;codecs=vp8"},MediaRecorder.isTypeSupported(r.mimeType)||(r={mimeType:"video/webm"},MediaRecorder.isTypeSupported(r.mimeType)||(r={mimeType:""}))));try{this.mediaRecorder=new MediaRecorder(n,r)}catch(t){return void this.In.error("zc.mdrcd Exception while creating ZegoMediaRecorder:",t)}this.mediaRecorder.onstop=function(t){i.In.warn("zc.mdrcd Recorder stopped: "+t)},this.mediaRecorder.ondataavailable=this.handleDataAvailable.bind(this),this.mediaRecorder.start(10)},t.prototype.stopRecord=function(){this.mediaRecorder?this.mediaRecorder.stop():this.In.warn("zc.mdrcd please invoke startRecord first")},t.prototype.resumeRecord=function(){this.mediaRecorder?this.mediaRecorder.resume():this.In.warn("zc.mdrcd please invoke startRecord first")},t.prototype.pauseRecord=function(){this.mediaRecorder?this.mediaRecorder.pause():this.In.warn("zc.mdrcd please invoke startRecord first")},t.prototype.saveRecord=function(t){if(this.mediaRecorder&&this.recordedBlobs){var i=new Blob(this.recordedBlobs,{type:"video/webm"}),e=window.URL.createObjectURL(i),n=Wt.createElement("a");n.style.display="none",n.href=e,n.download=t+".webm",Wt.body.appendChild(n),n.click(),setTimeout((function(){Wt.body.removeChild(n),window.URL.revokeObjectURL(e)}),100)}else this.In.warn("please invoke startRecord first")},t.prototype.useVideoDevice=function(t,i){return this.rtcModules.publishModule.useVideoDevice(t,i)},t.prototype.useAudioDevice=function(t,i){return this.rtcModules.publishModule.useAudioDevice(t,i)},t.prototype.useFrontCamera=function(t,i){return this.rtcModules.publishModule.useFrontCamera(t,i)},t.prototype.getElectronScreenSources=function(){return this.rtcModules.publishModule.getElectronScreenSources()},t.prototype.setSoundLevelDelegate=function(t,i,e){this.In.info("zc.ssd.0 call"),Ut(t)?i&&(!ai(i)||i<100||i>3e3)?this.In.error("zc.ssd.0 soundLevel interval must be integer number which is between 100 and 3000"):this.Ro.setSoundLevelDelegate(t,i,e):this.In.error("zc.ssd.0 param 1 must be boolean")},t.prototype.on=function(t,i){return this.rtcModules.bindListener(t,i)},t.prototype.off=function(t,i){return this.rtcModules.deleteListener(t,i)},t.prototype.getVersion=function(){return v},t.prototype.setStreamExtraInfo=function(t,i){return this.rtcModules.streamCommon.setStreamExtraInfo(t,i)},t.prototype.addPublishCdnUrl=function(t,i){return this.In.info("zg.cm.apu call "+i,{streamid:t}),this.rtcModules.streamCDNModule?this.rtcModules.streamCDNModule.publishTarget({type:"addpush",streamID:t,pushUrl:i}):si(["stream CDN"])},t.prototype.removePublishCdnUrl=function(t,i){return this.In.info("zg.cm.apu call "+i,{streamid:t}),this.rtcModules.streamCDNModule?this.rtcModules.streamCDNModule.publishTarget({type:"delpush",streamID:t,pushUrl:i}):si(["stream CDN"])},t.prototype.startMixerTask=function(t){return si(["mix stream"])},t.prototype.startAutoMixerTask=function(t){return si(["mix stream"])},t.prototype.setMixerTaskConfig=function(t){return si(["mix stream"])},t.prototype.stopMixerTask=function(t){return si(["mix stream"])},t.prototype.stopAutoMixerTask=function(t){return si(["mix stream"])},t.prototype.setCaptureVolume=function(t,i){return this.rtcModules.publishModule.setCaptureVolume(t,i)},t.use=function(i){switch(i.type){case"AudioMix":i.install(Og,fb);break;case"MixStream":i.install(t,am,Og);break;case"StreamCDN":i.install(t,Og,am);break;case"Advance":i.install(t,Og,am,zp,mg,cg,fb,N_);break;case"BeautyEffect":case"VoiceChanger":i.install(t,zp);break;case"RangeAudio":case"DataChannel":case"AiDenoise":case"BackgroundProcess":case"CopyrightedMusic":case"StreamCompositor":i.install(t)}},t.prototype.createRangeAudioInstance=function(){throw ni(["range audio"])},t.prototype.createCopyrightedMusic=function(){throw ni(["copyrighted music"])},t.prototype.destroyCopyrightedMusic=function(){},t.prototype.createRealTimeSequentialDataManager=function(t){throw ni(["data channel"])},t.prototype.destroyRealTimeSequentialDataManager=function(t){throw ni(["data channel"])},t.prototype.enableDataChannel=function(t){Ut(t)&&(this.Ro.isDataChannelEnabled=t)},t.prototype.addTrack=function(t,i){var e=this;return new Xt((function(n,s){var r={id:i.id,muted:i.muted,enabled:i.enabled,kind:i.kind,readyState:i.readyState,label:i.label};e.In.info("zc.at"+" call. ".concat(null==t?void 0:t.id," track: ")+JSON.stringify(r)),e.rtcModules.publishModule.handleTrack("ADD",t,i,n,s)}))},t.prototype.removeTrack=function(t,i){var e=this;return new Xt((function(n,s){e.In.info("zc.rt call"),e.rtcModules.publishModule.handleTrack("REMOVE",t,i,n,s)}))},t.prototype.setBeautyEffect=function(t,i,e){return si(["beauty effect"])},t.prototype.setLowlightEnhance=function(t,i){return si(["beauty effect"])},t.prototype.getPublishingStreamQuality=function(t){return this.rtcModules.publishModule.getStreamStats(t)},t.prototype.getPlayingStreamQuality=function(t){return this.rtcModules.playModule.getStreamStats(t)},t.prototype.checkAudioTrackIsActive=function(t){var i=this;return this.In.info("zc.caia.0 call"),new Xt((function(e,n){if(t=Dp(t,i.In),!i.checkTrackParam(t,1))return i.In.info("zc.caia.0 param active: false"),e(!1);var s=0;try{var r=0,o=i.Ro.createSoundLevel(i.ac,t,50,50,(function(t){t*=100;var n=!1;r>=4?(u.destroy(),(t>0||s>0)&&(n=!0),i.In.info("zc.caia.0 active: "+n),e(n)):s=Math.max(t,s),r++})),u=o.soundMeter;u&&o.mic||(i.In.error("zc.cvia.1 checkVideoTrackIsActive not supported"),e(!1))}catch(t){i.In.error("zc.cvia.1 "+t),e(!1)}}))},t.prototype.checkVideoTrackIsActive=function(t){var i=this;this.In.info("zc.cvia.0 call");var e=this;return new Xt((function(n,s){if(t=Dp(t,i.In),!i.checkTrackParam(t,0))return i.In.info("zc.cvia.1 param active: false"),n(!1);var r=Kt(1,1),o=$t(160,120).getContext("2d");o&&(null==o?void 0:o.drawImage)&&(null==o?void 0:o.getImageData)||(e.In.error("zc.cvia.1 checkVideoTrackIsActive not supported"),n(!1)),r.style.position="fixed",r.style.left="-1000px",r.style.opacity="0.01",Wt.body.appendChild(r),r.srcObject=t;var u=null;function a(){o=null;try{r.pause(),r.remove(),r.srcObject=null}catch(t){}}function c(){r.play();var t=setTimeout((function(){clearTimeout(t),t=null,r.removeEventListener("canplay",c),null==o||o.drawImage(r,0,0,160,120);var i=setTimeout((function(){clearTimeout(i),i=null;var t=null==o?void 0:o.getImageData(0,0,160,120),s=(null==t?void 0:t.data)&&Math.floor(t.data.length/3);if(s){for(var r=3;r<s;r+=4)if(0!==t.data[r-1]||0!==t.data[r-2]||0!==t.data[r-3])return e.In.info("zc.cvia.0 active: true"),n(!0),void a();a(),e.In.info("zc.cvia.1 active: false"),n(!1)}}),20)}),200)}r.addEventListener("canplay",c),u=setTimeout((function(){clearTimeout(u),r.removeEventListener("canplay",c),a(),n(!1)}),1e3)}))},t.prototype.checkTrackParam=function(t,i){var e,n=this;if(this.In.info("zc.ctp.0 call type:"+i),!Yt(t))return this.In.error("zc.ctp.1 param 1 must be MediaStream"),!1;var s=this.Ro.checkPreview(t),r=Object.keys(this.Ro.playerList).find((function(i){var e;return(null===(e=n.Ro.playerList[i])||void 0===e?void 0:e.playStream)===t}));if(!s&&!r)return this.In.error("zc.ctp.1 "+fi),!1;var o=t[0==i?"getVideoTracks":"getAudioTracks"]()[0];return o?"live"!==o.readyState||!o.enabled||o.muted?(this.In.info("zc.ctp.0 type:".concat(i," state:").concat(o.readyState," enabled:").concat(o.enabled," muted:").concat(o.muted)),!1):!r||0===(null===(e=this.Ro.playerList[r])||void 0===e?void 0:e.micStatus):(this.In.error("zc.cvia.1 the stream has not track"),!1)},t.prototype.setDummyCaptureImagePath=function(t,i){return this.rtcModules.publishModule.setDummyCaptureImagePath(t,i)},t.prototype.setAccess=function(t){},t.prototype.setTestPackageSize=function(t){this.RTM.setTestPackageSize(!0)},t.prototype.setAudioOutputDevice=function(t,i){return sy(this,void 0,void 0,(function(){var e,n=this;return ry(this,(function(s){return e=null==t?void 0:t.setSinkId,this.In.info("zc.saopd call:"+i),[2,new Xt((function(s,r){return sy(n,void 0,void 0,(function(){var n,o,u,a=this;return ry(this,(function(c){switch(c.label){case 0:if(n=function(t){a.In.info("zc.saopd error"+JSON.stringify(t)),r({errorCode:t.code,extendedData:t.message})},!e)return[3,5];if(t.setsinkid&&(t.setsinkid.enabled=!0),!i||!qt(i))return[2,n({code:re.code,message:"the 'deviceID' is invalid"})];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,e.call(t,i)];case 2:return c.sent(),[3,4];case 3:return o=c.sent(),(u=t.srcObject)&&!u.getAudioTracks()[0]?[2,n($e)]:[2,n({code:ne,message:o})];case 4:return[2,s(!0)];case 5:throw Error("Browser not support set audio output.")}}))}))}))]}))}))},t.prototype.enableCameraCapturing=function(t,i){return void 0===i&&(i=!0),sy(this,void 0,void 0,(function(){return ry(this,(function(e){return[2,this.rtcModules.publishModule.enableCameraCapturing(t,i)]}))}))},t.prototype.enableDualStream=function(t){this.rtcModules.publishModule.enableDualStream(t)},t.prototype.setLowStreamParameter=function(t,i){this.rtcModules.publishModule.setLowStreamParameter(t,i)},t.prototype.enableVideoHardwareEncoder=function(t){if(Ut(t)){var i=this.Nn.settingConfig;i.setUserValue("hardware_encode",t),i.setUserValue("camera_hard_encode",t),i.setUserValue("custom_hard_encode",t)}},t.prototype.createLocalViewer=function(t){var i=this.Ro.checkPreview(t),e=null==i?void 0:i.getViewer();if(!e)throw Error("create viewer failed.");return new Z_(e)},t.prototype.createRemoteViewer=function(t){var i=this.Ro.checkPlayer(t),e=null==i?void 0:i.getViewer();if(!e)throw Error("create viewer failed.");return new Z_(e)},t.prototype.createStreamCompositor=function(){throw ni(["stream compositor"])},t.prototype._enableAiDenoise=function(t,i,e){return e==sp.AIBalanced||e==sp.AI||e==sp.AIAggressive?this.setVoiceChangerPreset(t,{ANS:{enable:i,mode:e}}):this.enableAiDenoise(t,i)},t.prototype.enableAiDenoise=function(t,i){return si(["ai denoise"])},t.prototype.setAiDenoiseMode=function(t,i){return si(["voice changer with AIBalance"])},t.prototype.muteAllPlayAudioStreams=function(t){return this.rtcModules.playModule.muteAllPlayAudioStreams(t)},t.prototype.muteAllPlayVideoStreams=function(t){return this.rtcModules.playModule.muteAllPlayVideoStreams(t)},t.prototype.setVoiceChangerPreset=function(t,i){return si(["voice changer","advanced"])},t.prototype.enableLiveAudioEffect=function(t,i,e){return si(["voice changer","advanced"])},t.prototype.loadBackgroundBlurModule=function(){return si(["blur background","advanced"],-1)},t.prototype.initBackgroundModule=function(t,i){return si(["blur background","advanced"],-1)},t.prototype.setBackgroundBlurOptions=function(t,i){throw ni(["blur background","advanced"])},t.prototype.setVirtualBackgroundOptions=function(t,i){throw ni(["blur background","advanced"])},t.prototype.setTransparentBackgroundOptions=function(t){throw ni(["blur background","advanced"])},t.prototype.enableBackgroundProcess=function(t,i,e){return si(["advanced"])},t.prototype.enableAutoSwitchDevice=function(t){this.rtcModules.publishModule.enableAutoSwitchDevice(t)},t.prototype.initTracer=function(t){this.Nn.reporter=t;var i=new X_(this.RTM.stateCenter,this.Nn,this.Ro);this.Mn.setCommonStates(i),this.Mn.setResource({sdk_version:v,report_version:this.Nn.sdkVerNum})},t.prototype.setEngineConfig=function(t){if(t&&this.In.info("zc.sec.0 "+JSON.stringify(t)),this.checkMaxChannels(t),this.checkRetryTime(t),this.Nn.engineConfig=ny(ny({},this.Nn.engineConfig),t),this.checkQualityInterval(),this.Nn.actionListener("_engineConfigUpdate",this.Nn.engineConfig),t.adaptCustomUA){var i=th();this.Nn.customUa=i.includes("iOS"),this.In.info("zc.sec.0 custom ua ".concat(i))}Jt(t.setUserInfo)&&this.Np(t.setUserInfo),Ut(t.enableMiniSDP)&&this.stateCenter.setIsMiniSdp(t.enableMiniSDP),this.RTM.setEngineConfig(t)},t.prototype.Np=function(t){this.logger.info("zc.sui "+JSON.stringify(t));var i=t.token,e=t.userID;this.logger.setTokenInfo(i||"",e),e&&i&&this.Nn.reporter.setReporterInfo(e,i)},t.prototype.checkQualityInterval=function(){var t=this.Nn.engineConfig,i=t.publishQualityInterval,e=t.playQualityInterval;Lt(i)&&0!==i&&i<S&&(this.Nn.engineConfig.publishQualityInterval=S),Lt(e)&&0!==e&&e<S&&(this.Nn.engineConfig.playQualityInterval=S)},t.prototype.checkMaxChannels=function(t){var i=t.maxChannels;Lt(i)&&(i<1&&(t.maxChannels=1),i>50&&(t.maxChannels=50))},t.prototype.checkRetryTime=function(t){var i=t.roomRetryTime,e=t.streamRetryTime;Lt(i)&&(i<1&&(t.roomRetryTime=1),i>E&&(t.roomRetryTime=E)),Lt(e)&&(e<1&&(t.streamRetryTime=1),e>E&&(t.streamRetryTime=E),this.Nn.streamRetryTime=t.streamRetryTime)},t.prototype.inject=function(t,i){var e=this;if("ZegoExpressPlayer"!==t)throw new Error("You are not authorized to use 'inject' method!");i({appid:this.Nn.appid,logger:this.In,validateToken:function(t,i){return sy(e,void 0,void 0,(function(){return ry(this,(function(e){switch(e.label){case 0:return this.Nn.player265Validated?[2,!0]:[4,this.RTM.fetchAppConfigByTargetToken(t,i)];case 1:return e.sent()&&(this.Nn.player265Validated=!0),[2,!!this.Nn.player265Validated]}}))}))},isLogin:function(){return e.Nn.rtm&&e.Nn.rtm.stateCenter.roomModulesList.some((function(t){return t.isLogin()}))},seiConfig:function(){return e.Nn.seiConfig},addReceiver:function(t){e.Nn.player265ReceiverList.push(t)},removeReceiver:function(t){e.Nn.player265ReceiverList=e.Nn.player265ReceiverList.filter((function(i){return i!=t}))}})},t.prototype.setStreamAlignmentProperty=function(t,i){return sy(this,void 0,void 0,(function(){var e,n,s,r;return ry(this,(function(o){switch(o.label){case 0:return e="zc.ssap",n=qt(t),this.In.info(e+" call. "+(n?t:null==t?void 0:t.id)+" alignment: ".concat(i)),s=null,(s=n?this.Ro.publisherList[t]:this.Ro.checkPublish(t))&&6===s.publisher.state?[4,s.publisher.setStreamAlignmentProperty(i)]:(this.In.error(e+" failed.  setStreamAlignmentProperty failed, stream not published."),[2,!1]);case 1:return r=o.sent(),this.In.info(e+" end. "+r),[2,r]}}))}))},t.prototype.setTurnServer=function(t){if(!Gt(t))throw"'setTurnServer' failed. param error.";this.streamCenter.turnServers=oy([],t,!0)},t.prototype.destroyEngine=function(){if(this.Nn.engineDestroy)throw new Error("ZegoExpressEngine has been destroyed.");this.destroyEngineHandler(),this.Nn.engineDestroy=!0},t.prototype.uploadLog=function(){return this.RTM.uploadLog()},t.prototype.callExperimentalAPI=function(t){var i=this;return new Promise((function(e,n){var s=t.method,r=t.params;if(["onRecvRoomMuteVideoStream","onRecvRoomMuteAudioStream","onRecvRoomChannelMessage"].includes(s))e({errorCode:0,extendedData:""});else if("sendRoomChannelMessage"===s){i.RTM.sendRoomChannelMessage(r.roomID,0,r.msgType,r.msgContent,r.toUserIDList).then((function(){e({errorCode:0,extendedData:""})})).catch((function(t){n(t)}))}else if("enableVolumeDucking"===s){i.Cp(r.localStream,r.enable).then((function(){e({errorCode:0,extendedData:""})})).catch((function(t){n(t)}))}else e("getAudioContext"===s?i.ac:void 0)}))},t.prototype.setTracerLevel=function(t){this.RTM.reporter.tracerHandler.tracer.setLogLevel(t)},t.prototype.getFlutterVideoConfig=function(){var t=rg(this.Nn,this.In,{});return{encodeWidth:t.width,encodeHeight:t.height,fps:t.frameRate,bitrate:t.bitRate,keyFrameInterval:t.keyFrameInterval}},t.prototype.getFlutterAudioConfig=function(){var t=rg(this.Nn,this.In,{});return{bitrate:t.audioBitrate,channel:t.channelCount}},t.prototype.Cp=function(t,i){return this.setVoiceChangerPreset(t,{volumeDucking:i})},t.screenShotReady=!1,t.isInstantiated=!1,t}();window.addEventListener("message",(function(t){"SS_PING"===t.data.type&&(uy.screenShotReady=!0)}));var ay,cy=function(){return cy=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},cy.apply(this,arguments)},hy=function(){function t(t,i){this.zp=t,this.Dp=i}return t.prototype.start=function(t,i,e,n){this.zp.playEffect(cy({stream:this.Dp,effectID:t},i||{}),e,n)},t.prototype.stop=function(t){return this.zp.stopEffect(this.Dp,t)},t.prototype.pause=function(t){return this.zp.pauseEffect(this.Dp,t)},t.prototype.resume=function(t){return this.zp.resumeEffect(this.Dp,t)},t.prototype.setVolume=function(t,i,e){return this.zp.setEffectVolume(this.Dp,i,t,e)},t.prototype.getTotalDuration=function(t){return this.zp.getEffectDuration(t)},t.prototype.getCurrentProgress=function(t){return this.zp.getEffectCurrentProgress(this.Dp,t)},t.prototype.seekTo=function(t,i){return this.zp.seekAudioEffect(this.Dp,t,i)},t}(),fy=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}(),ly=function(t){function i(i,e,n){var s=t.call(this,i,e,0,arguments[2])||this;return s.zegoWebRTC=new uy(s.logger,s.dataReport,s.reporter,s.zegoWebRTM,0,null==n?void 0:n.scenario),s}return fy(i,t),i.prototype.setEngineConfig=function(t){this.zegoWebRTC.setEngineConfig(t)},i.setEngineOptions=function(t){Xf.setEngineOptions(t),uy.setEngineOptions(t)},i.setGeoFence=function(t,i){uy.setGeoFence(t,i),Xf.setGeoFence(t,i)},i.prototype.setRoomScenario=function(t){return this.zegoWebRTC.setRoomScenario(t)},i.prototype.setSEIConfig=function(t){this.zegoWebRTC.setSEIConfig(t)},i.use=function(t){Xf.use(t),uy.use(t)},i.prototype.checkSystemRequirements=function(t,i){return void 0===i&&(i=0),this.zegoWebRTC.checkSystemRequirements(i,t)},i.prototype.off=function(t,i){return this.zegoWebRTM.stateCenter.listenerList[t]?this.zegoWebRTM.off(t,i):!!this.zegoWebRTC.stateCenter.listenerList[t]&&this.zegoWebRTC.off(t,i)},i.prototype.on=function(t,i){return this.zegoWebRTM.stateCenter.listenerList[t]?this.zegoWebRTM.on(t,i):!!this.zegoWebRTC.stateCenter.listenerList[t]&&this.zegoWebRTC.on(t,i)},i.prototype.createStream=function(t){return this.zegoWebRTC.createStream(t)},i.prototype.createZegoStream=function(t){return this.zegoWebRTC.createZegoStream(t)},i.prototype.getPublishingStreamQuality=function(t){return this.zegoWebRTC.getPublishingStreamQuality(t)},i.prototype.getElectronScreenSources=function(){return this.zegoWebRTC.getElectronScreenSources()},i.prototype.destroyStream=function(t){return this.zegoWebRTC.destroyStream(t)},i.prototype.startPublishingStream=function(t,i,e){return this.zegoWebRTC.startPublishingStream(t,i,e)},i.prototype.updatePublishingStream=function(t,i){return this.zegoWebRTC.updatePublishingStream(t,i)},i.prototype.stopPublishingStream=function(t){return this.zegoWebRTC.stopPublishingStream(t)},i.prototype.sendSEI=function(t,i){return this.zegoWebRTC.sendSEI(t,i)},i.prototype.setVideoConfig=function(t,i){return this.zegoWebRTC.setVideoConfig(t,i)},i.prototype.setAudioConfig=function(t,i){return this.zegoWebRTC.setAudioConfig(t,i)},i.prototype.replaceTrack=function(t,i){return this.zegoWebRTC.replaceTrack(t,i)},i.prototype.addTrack=function(t,i){return this.zegoWebRTC.addTrack(t,i)},i.prototype.removeTrack=function(t,i){return this.zegoWebRTC.removeTrack(t,i)},i.prototype.setCaptureVolume=function(t,i){return this.zegoWebRTC.setCaptureVolume(t,i)},i.prototype.setDummyCaptureImagePath=function(t,i){return this.zegoWebRTC.setDummyCaptureImagePath(t,i)},i.prototype.setStreamExtraInfo=function(t,i){return this.zegoWebRTC.setStreamExtraInfo(t,i)},i.prototype.enableVideoCaptureDevice=function(t,i){return this.zegoWebRTC.enableCameraCapturing(t,i)},i.prototype.addPublishCdnUrl=function(t,i){return 3===arguments.length?this.zegoWebRTC.addPublishCdnUrl(arguments[0],arguments[2]):this.zegoWebRTC.addPublishCdnUrl(t,i)},i.prototype.removePublishCdnUrl=function(t,i){return 3===arguments.length?this.zegoWebRTC.removePublishCdnUrl(arguments[0],arguments[2]):this.zegoWebRTC.removePublishCdnUrl(t,i)},i.prototype.mutePublishStreamVideo=function(t,i,e){return this.zegoWebRTC.mutePublishStreamVideo(t,i,e)},i.prototype.mutePublishStreamAudio=function(t,i){return this.zegoWebRTC.mutePublishStreamAudio(t,i)},i.prototype.setEffectsBeauty=function(t,i,e){return this.zegoWebRTC.setBeautyEffect(t,i,e)},i.prototype.setLowlightEnhancement=function(t,i){return this.zegoWebRTC.setLowlightEnhance(t,i)},i.prototype.enableDualStream=function(t){return this.zegoWebRTC.enableDualStream(t)},i.prototype.setLowStreamParameter=function(t,i){return this.zegoWebRTC.setLowStreamParameter(t,i)},i.prototype.enableHardwareEncoder=function(t){this.zegoWebRTC.enableVideoHardwareEncoder(t)},i.prototype.enableAutoSwitchDevice=function(t){return this.zegoWebRTC.enableAutoSwitchDevice(t)},i.prototype.initBackgroundModule=function(t,i){return this.zegoWebRTC.initBackgroundModule(t,i)},i.prototype.setBackgroundBlurOptions=function(t,i){return this.zegoWebRTC.setBackgroundBlurOptions(t,i)},i.prototype.setTransparentBackgroundOptions=function(t){return this.zegoWebRTC.setTransparentBackgroundOptions(t)},i.prototype.setVirtualBackgroundOptions=function(t,i){return this.zegoWebRTC.setVirtualBackgroundOptions(t,i)},i.prototype.enableBackgroundProcess=function(t,i,e){return this.zegoWebRTC.enableBackgroundProcess(t,i,e)},i.prototype.setVoiceChangerPreset=function(t,i){return this.zegoWebRTC.setVoiceChangerPreset(i,{voiceChanger:t})},i.prototype.setVoiceChangerParam=function(t,i){return this.zegoWebRTC.setVoiceChangerPreset(t,{voiceParam:i})},i.prototype.setReverbPreset=function(t,i){return this.zegoWebRTC.setVoiceChangerPreset(t,{reverb:i})},i.prototype.enableVirtualStereo=function(t,i,e){return this.zegoWebRTC.setVoiceChangerPreset(t,{stereo:{enable:i,angle:e}})},i.prototype.enableLiveAudioEffect=function(t,i,e){return this.zegoWebRTC.enableLiveAudioEffect(t,e,{liveEffect:i})},i.prototype.setAudioChangerParam=function(t,i,e){return this.zegoWebRTC.enableLiveAudioEffect(t,e,{pitch:i})},i.prototype.enableAiDenoise=function(t,i){return this.zegoWebRTC.enableAiDenoise(t,i)},i.prototype.setAiDenoiseMode=function(t,i){return this.zegoWebRTC.setAiDenoiseMode(t,i)},i.prototype.startPlayingStream=function(t,i){return this.zegoWebRTC.startPlayingStream(t,i)},i.prototype.setPlayStreamVideoType=function(t,i){return this.zegoWebRTC.setPlayStreamVideoType(t,i)},i.prototype.stopPlayingStream=function(t){return this.zegoWebRTC.stopPlayingStream(t)},i.prototype.mutePlayStreamVideo=function(t,i){return this.zegoWebRTC.mutePlayStreamVideo(t,i)},i.prototype.mutePlayStreamAudio=function(t,i){return this.zegoWebRTC.mutePlayStreamAudio(t,i)},i.prototype.setAudioFrameCallback=function(t,i,e){return this.zegoWebRTC.setAudioFrameCallback(t,i,e)},i.prototype.setCaptureAudioFrameCallback=function(t,i,e){return this.zegoWebRTC.setAudioFrameCallback(t,i,e)},i.prototype.getPlayingStreamQuality=function(t){return this.zegoWebRTC.getPlayingStreamQuality(t)},i.prototype.createLocalStreamView=function(t){return this.zegoWebRTC.createLocalViewer(t)},i.prototype.createRemoteStreamView=function(t){return this.zegoWebRTC.createRemoteViewer(t)},i.prototype.startMixerTask=function(t){return this.zegoWebRTC.startMixerTask(t)},i.prototype.stopMixerTask=function(t){return this.zegoWebRTC.stopMixerTask(t)},i.prototype.setMixerTaskConfig=function(t){return this.zegoWebRTC.setMixerTaskConfig(t)},i.prototype.startAutoMixerTask=function(t){return this.zegoWebRTC.startAutoMixerTask(t)},i.prototype.stopAutoMixerTask=function(t){return this.zegoWebRTC.stopAutoMixerTask(t)},i.prototype.startMixingAudio=function(t,i){return this.zegoWebRTC.startMixingAudio(t,i)},i.prototype.stopMixingAudio=function(t,i){return this.zegoWebRTC.stopMixingAudio(t,i)},i.prototype.setMixingAudioVolume=function(t,i,e){return this.zegoWebRTC.setMixingAudioVolume(t,i,e)},i.prototype.createAudioEffectPlayer=function(t){if(t instanceof MediaStream||t.getTracks)return new hy(this.zegoWebRTC,t);throw Error("Param localStream is not instance of MediaStream or ZegoLocalStream.")},i.prototype.loadAudioEffect=function(t,i){var e=this;return new Promise((function(n,s){e.zegoWebRTC.preloadEffect(t,i,(function(i){i&&s(i),n(t)}))}))},i.prototype.unloadAudioEffect=function(t){return this.zegoWebRTC.unloadEffect(t)},i.prototype.enumDevices=function(){return this.zegoWebRTC.enumDevices()},i.prototype.getCameras=function(){return this.zegoWebRTC.getCameras()},i.prototype.getMicrophones=function(){return this.zegoWebRTC.getMicrophones()},i.prototype.getSpeakers=function(){return this.zegoWebRTC.getSpeakers()},i.prototype.useVideoDevice=function(t,i){return this.zegoWebRTC.useVideoDevice(t,i)},i.prototype.useAudioDevice=function(t,i){return this.zegoWebRTC.useAudioDevice(t,i)},i.prototype.useAudioOutputDevice=function(t,i){return this.zegoWebRTC.setAudioOutputDevice(t,i)},i.prototype.useFrontCamera=function(t,i){return this.zegoWebRTC.useFrontCamera(t,i)},i.prototype.setSoundLevelDelegate=function(t,i,e){return this.zegoWebRTC.setSoundLevelDelegate(t,i,null==e?void 0:e.enableInBackground)},i.prototype.isMicrophoneMuted=function(){return this.zegoWebRTC.isMicrophoneMuted()},i.prototype.muteMicrophone=function(t){return this.zegoWebRTC.muteMicrophone(t)},i.prototype.createRangeAudioInstance=function(){return this.zegoWebRTC.createRangeAudioInstance()},i.prototype.createRealTimeSequentialDataManager=function(t){return this.zegoWebRTC.createRealTimeSequentialDataManager(t)},i.prototype.destroyRealTimeSequentialDataManager=function(t){this.zegoWebRTC.destroyRealTimeSequentialDataManager(t)},i.prototype.createCopyrightedMusic=function(){return this.zegoWebRTC.createCopyrightedMusic()},i.prototype.checkVideoTrackIsActive=function(t){return this.zegoWebRTC.checkVideoTrackIsActive(t)},i.prototype.checkAudioTrackIsActive=function(t){return this.zegoWebRTC.checkAudioTrackIsActive(t)},i.prototype.destroyCopyrightedMusic=function(){return this.zegoWebRTC.destroyCopyrightedMusic()},i.prototype.getNetworkTimeInfo=function(){var t=this.zegoWebRTC.RTM;return t.setNetAgentHBMode("periodic"),t.getNetworkInfo()},i.prototype.setStreamAlignmentProperty=function(t,i){return this.zegoWebRTC.setStreamAlignmentProperty(t,i)},i.prototype.destroyEngine=function(){return this.zegoWebRTC.destroyEngine()},i.prototype.uploadLog=function(){return this.zegoWebRTC.uploadLog()},i.prototype.createStreamCompositor=function(){return this.zegoWebRTC.createStreamCompositor()},i.prototype.setTurnServer=function(t){this.zegoWebRTC.setTurnServer(t)},i.prototype.muteAllPlayAudioStreams=function(t){return this.zegoWebRTC.muteAllPlayAudioStreams(t)},i.prototype.muteAllPlayVideoStreams=function(t){return this.zegoWebRTC.muteAllPlayVideoStreams(t)},i.prototype.callExperimentalAPI=function(t){return this.zegoWebRTC.callExperimentalAPI(t)},i.version="3.10.0",i}(Xf),dy="zm.scc",vy="zm.sbcm",my="zm.srlm",py="zm.sbrm",gy="zm.schm",by="zm.msg.sdr",_y="zm.msg.rlr",yy="zm.msg.rps",wy="zm.msg.srm",Sy="zm.msg.scm",Ey="zm.msg.schm",Oy="zm.msg.sbm",Ty="zm.msg.bps",ky="zm.sv.ps",Ry={code:1100001,msg:"input param error."},Iy={code:1100002,msg:"network timeout."},Ny={code:1100003,msg:"socket close"},Cy={code:1000002,msg:"not login"},zy={code:1009001,msg:"message content is empty"},Dy={code:1009002,msg:"content is too long"},Py={code:1009005,msg:"inconsistent room id"},Ay={code:1009010,msg:"failed to send message"},My={code:1009013,msg:"message is too long"},xy=1002017,jy={code:1002098,msg:"room channel type error"},Ly={code:1002099,msg:"room inner error"},qy={code:1102022,msg:"trans send frequently"},Uy={code:1009015,msg:"frequency limited."},By=function(t){return t},Jy=function(t){return t},Vy=function(t){return t},Hy="/sdk/login",Gy={event:"/liveroom/send_big_room_message",room_sid_string:By,error:{INPUT_PARAM:Ry,IM_MESSAGE_NULL:zy,IM_CONTENT_TOO_LONG:Dy,IM_MESSAGE_TOO_LONG:My,INCONSISTENT_ROOM_ID:Py,ROOM_NOT_EXIST:Cy}},Fy={event:"/liveroom/send_custom_command",room_sid_string:By,request_id:Jy,error:{INPUT_PARAM:Ry,IM_CONTENT_NULL:zy,IM_CONTENT_TOO_LONG:Dy,INCONSISTENT_ROOM_ID:Py,ROOM_NOT_EXIST:Cy}},Yy={event:"/liveroom/send_room_message",room_id:Jy,room_sid_string:Jy,msg_content_size:Vy,send_seq:Vy,msg_id:Vy,error:{INPUT_PARAM:Ry,IM_MESSAGE_NULL:zy,IM_MESSAGE_TOO_LONG:My,ROOM_NOT_EXIST:Cy,INCONSISTENT_ROOM_ID:Py}},Zy={event:"/liveroom/set_room_extrainfo",room_id:Jy,room_sid_string:By,key:Jy,value:Jy,error:{INPUT_PARAM:Ry,TRANS_FREQUENTLY:qy,ROOM_ROOMID_INCORRECT:Mt.ROOM_ROOMID_INCORRECT,KEY_EMPTY:{code:1002014,msg:"room extra info key empty"},KEY_TOO_LONG:{code:1002015,msg:"room extra info key too long"},VALUE_TOOL_LONG:{code:1002016,msg:"room extra info value too long"}}},Qy="/liveroom/get_room_extrainfo",Xy=By,Wy=By,Ky="/liveroom/recv_room_extrainfo",$y=Jy,tw=Vy,iw=1000001109,ew=1000001110,nw=10240;!function(t){t[t.I=0]="I",t[t.H=10]="H",t[t.M=100]="M",t[t.L=1e3]="L"}(ay||(ay={}));var sw=function(){return sw=Object.assign||function(t){for(var i,e=1,n=arguments.length;e<n;e++)for(var s in i=arguments[e])Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s]);return t},sw.apply(this,arguments)},rw=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},ow=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}};var uw=function(){function t(t,i,e,n,s,r){var o=this;this.In=t,this.Nn=i,this._dataReport=e,this.Un=n,this._rtm=s,this.Cn=r,this.Pp=0,this.Ap=500,this.Mp={},this.xp=0,this.jp=[],this.Lp=null,this.qp=null,this.qn=0,this.Up=0,this.Bp=!1,this.Jp={},this.Vp={},this.roomExtraInfo={},this.Hp=function(t,i){void 0===i&&(i=!1);var e=t.map((function(t){var i={key:t.trans_type,value:t.trans_data?t.trans_data:"",updateUser:{userID:t.id_name||t.trans_idname,userName:t.nick_name||t.trans_nickname},updateTime:jt.isLong(t.trans_send_time)?t.trans_send_time.toNumber():t.trans_send_time};return o.roomExtraInfo[t.trans_type]=i,i}));i?o.In.warn(yy+" id name same"):(e.length>0&&o.Nn.actionListener("roomExtraInfoUpdate",o.Cn.roomID,Object.values(o.roomExtraInfo)),t.forEach((function(t){o.Nn.actionListener("recvReliableMessage",t.trans_type,t.trans_seq,t.trans_data)})))}}return Object.defineProperty(t.prototype,"Mn",{get:function(){return this.Nn.reporter},enumerable:!1,configurable:!0}),t.prototype.loginRsp=function(t){var i,e,n=this,s=t.body,r=s.ret_timestamp,o=s.bigim_time_window,u=s.trans_seqs;if(null!=r&&qt(r)){var a=parseFloat(r);this.qn=0==a?0:+r-(new Date).getTime()}if(o&&Lt(o)&&(this.Up=o),u)for(var c=0;c<u.length;c++){var h=u[c].trans_channel,f=u[c].trans_seq_list||u[c].trans_seq_array;(f=(f=f.filter((function(t){var i=t.trans_type;return!n.Jp[i]||n.Jp[i].seq<t.trans_seq}))).map((function(t){return{trans_type:t.trans_type,trans_local_seq:t.trans_seq}}))).length>0&&this.Gp(h,f)}(null===(i=t.body)||void 0===i?void 0:i.user_trans_channel_list)&&this.userTransMessageHandler(null===(e=t.body)||void 0===e?void 0:e.user_trans_channel_list)},t.prototype.fetchUserTransMessage=function(t,i){var e=this;this.In.info("zb.mh.futm.0 call");var n=function(t){e.Fp(t)};this.Un.fetchUserTransInfo({trans_channel:t,fetch_array:i},n,n,this.Cn),this.In.info("zb.mh.futm.0 call success")},t.prototype.userTransMessageHandler=function(t){var i=this;if(t)for(var e=function(e){var s=t[e].trans_channel,r=t[e].trans_seq_list;r=r.filter((function(t){var e=t.trans_type,n=t.trans_seq;return i.Vp[s]||(i.Vp[s]={}),!i.Vp[s][e]||i.Vp[s][e].seq<n})),r.length>0&&n.fetchUserTransMessage(s,r)},n=this,s=0;s<t.length;s++)e(s)},t.prototype.Fp=function(t){if(t.body&&0!=t.body.err_code)this.In.error("zb.mh.hfutr user trans send error "+t.body.err_code);else if(t.header&&t.body){var i=t.body.user_trans_list,e=t.body.trans_channel,n=[];if(Array.isArray(i)&&i.length>0){for(var s=0;s<i.length;s++){var r=i[s],o=r.trans_type,u=r.trans_seq;this.Vp[e]||(this.Vp[e]={}),!this.Vp[e][o]||this.Vp[e][o].seq<u?(this.Vp[e][o]={seq:u},n.push(r)):this.In.warn("zb.mh.hfutr fetch trans seq wrong"),this.In.info("zb.mh.hfutr trans "+o+" seq "+u)}n.length>0&&this.Nn.actionListener("_userTransUpdate",this.Cn.roomID,e,n),this.In.info("zb.mh.hfutr call success")}}else this.In.error("zb.mh.hfutr user trans send error "+JSON.stringify(t))},t.prototype.sendReliableMessage=function(t,i,e,n){var s=this;if(this.In.info(by+" call"),!this.Cn.isLogin())return this.In.error(by+" state error"),void(n&&n(Cy));if(this.Bp)return this.In.error(by+" send too often"),void n(Zy.error.TRANS_FREQUENTLY);this.Jp[t]||(this.Jp[t]={seq:0});var r={trans_type:t,trans_data:i,trans_local_seq:this.Jp[t].seq,trans_channel:"clt"};this.Bp=!0;this.Un.sendReliableMessage(r,(function(n){s.Jp[t].seq=n.body.trans_seq,s.In.info(by+" trans "+t+" seq "+n.body.trans_seq),s.Bp=!1,s.roomExtraInfo[t]={key:t,value:i,updateUser:{userID:s.Cn.userID,userName:s.Cn.userName},updateTime:Date.now()},e({seq:n.header.seq,errorCode:0})}),(function(t){var i=Ly;s.In.error(by+" fail "+JSON.stringify(t)),t.body&&t.body.err_code?(i=s._rtm.getServerError(t.body.err_code),s.In.error(by+"  "+i.msg)):i=t,s.Bp=!1,n(i)}),this.Cn)},t.prototype.Gp=function(t,i){var e=this,n={trans_channel:t,fetch_array:i},s=this.Mn.createSpan(ay.H,{key:Hy,par:this.Cn.roomID},{key:""},Qy);s.setAttributes({fetch_array:Xy(i)});var r=function(t){e.Yp(t,s)};this.Un.fetchReliableMessage(n,r,r,this.Cn),this.In.info("zm.msg.frm call success")},t.prototype.Yp=function(t,i){if(t.body&&0!=t.body.err_code)return this.In.error(_y+" trans send error "+t.body.err_code),void this.Nn.reporter.setError(i,{code:t.body.err_code});if(!t.header||!t.body)return this.In.error(_y+" trans send error "+t),void this.Nn.reporter.setError(i,Iy);var e=t.body.trans_list||t.body.trans_fetch_results,n=[],s=[];if(Array.isArray(e)&&e.length>0){for(var r=0;r<e.length;r++){var o=e[r];if(o.err_code!==iw){var u=o.trans_type,a=o.trans_seq;s.push({trans_type:u,trans_seq:a}),o.err_code!==ew?!this.Jp[u]||this.Jp[u].seq<a?(this.Jp[u]={seq:a},n.push(o)):this.In.warn(_y+" fetch trans seq wrong"):(this.In.warn(_y+" fetch trans seq is wrong "+o.err_code),this.Jp[u]={seq:a})}else this.In.warn(_y+" fetch trans unknown type "+o.err_code)}this.roomExtraInfo={},n.length>0&&this.Hp(n)}i.setAttributes({result_array:Wy(s)}),i.end()},t.prototype.handlePushTransMsg=function(t){var i,e,n=t.body.trans_type,s=t.body.trans_seq;!this.Jp[n]||this.Jp[n].seq<s?(this.Jp[n]={seq:s},this.Hp([t.body],(null===(i=null==t?void 0:t.body)||void 0===i?void 0:i.trans_idname)===this.Nn.idName||(null===(e=null==t?void 0:t.body)||void 0===e?void 0:e.id_name)===this.Nn.idName)):this.In.warn(yy+" trans seq wrong"),this.In.info(yy+" trans "+n+" seq "+s)},t.prototype.handlePushUserTransMsg=function(t){this.In.info("zb.mh.hputr.0 call");var i=t.body.trans_seq_list,e=t.body.trans_channel,n=[];if(e&&Array.isArray(i)&&i.length>0){for(var s=0;s<i.length;s++){var r=i[s].trans_type,o=i[s].trans_seq;this.Vp[e]||(this.Vp[e]={}),(!this.Vp[e][r]||this.Vp[e][r].seq<o)&&(this.Vp[e][r]={seq:o},n.push(i[s]))}n.length>0?this.Nn.actionListener("_userTransUpdate",this.Cn.roomID,e,n):this.In.warn("zb.mh.hputr.0 no fetch user trans")}else this.In.warn("zb.mh.hputr.0 no push user trans")},t.prototype.sendRoomMsg=function(t,i,e,n,s,r){var o,u=this;if(!this.Cn.isLogin())return this.In.error(wy+" state error"),r(Cy),!1;var a=Date.parse(new Date+"");if(this.Pp>0&&this.Pp+this.Ap>a)return this.In.info(wy+" freq error"),r&&r(Uy,0,t,n),!1;this.Pp=a;var c=this.Un.sendRoomMsg({msg_category:t,msg_type:1,msg_priority:1,msg_content:n},(function(t){s({seq:t.header.seq,errorCode:0,messageID:t.body.msg_id})}),(function(t){var i,e,n=Ly;if(!t.header||!t.body)return t.code&&t.msg&&(n=t),void r({seq:0,errorCode:n.code,messageID:0});e=(i=[u._rtm.getServerError(t.body.err_code),t.body.msg_id])[1],u.In.error(wy+"  "+(n=i[0]).msg),n==Iy&&(n=Ay),r({seq:t.header.seq,errorCode:n.code,messageID:e})}),this.Cn);return this.Mn.spanSetAttributes({key:Yy.event,par:null===(o=this.Cn)||void 0===o?void 0:o.roomID},{send_seq:Yy.send_seq(c)}),this.In.info(wy+"  call success"),!0},t.prototype.handlePushRoomMsg=function(t){var i=[],e=t.body.msg_list;t.body.msg_list.forEach((function(t){var e={fromUser:{userID:t.id_name,userName:t.nick_name},message:t.msg_content,sendTime:t.send_time.toNumber(),messageID:t.msg_id.toNumber()};i.push(e)})),t.body.server_msg_id=t.body.server_msg_id.toNumber(),t.body.ret_msg_id=t.body.ret_msg_id.toNumber(),this.Nn.actionListener("IMRecvBroadcastMessage",this.Cn.roomID,i),this.Nn.actionListener("_recvRoomMsg",e,t.body.server_msg_id,t.body.ret_msg_id)},t.prototype.sendCustomCommand=function(t,i,e,n){var s,r=this;if(!this.Cn.isLogin())return this.In.error(Sy+" state error"),n(Cy),!1;var o={from_userid:this.Nn.idName,from_username:this.Nn.nickName,request_id:this.Nn.getRequestId(),custom_content:i||"",room_id:this.Cn.roomID};this.Mn.spanSetAttributes({key:Fy.event,par:null===(s=this.Cn)||void 0===s?void 0:s.roomID},{request_id:Fy.request_id(o.request_id)});var u={dest_id_name:t,custom_msg:JSON.stringify(o)};return this.Un.sendCustomCommand(u,(function(t){e({seq:t.header.seq,errorCode:0})}),(function(t){var i,e,s,o,u=Ly;u=t.body&&t.body.err_code?r._rtm.getServerError(t.body.err_code):t,r.In.error(Sy+" "+u.msg),o=2===(null===(i=t.body)||void 0===i?void 0:i.err_code)||1000000002===(null===(e=t.body)||void 0===e?void 0:e.err_code)?Ry:u==Iy?Ay:u,n({seq:(null===(s=t.header)||void 0===s?void 0:s.seq)||-1,errorCode:o.code,code:o.code})}),this.Cn),this.In.info(Sy+" call success"),!0},t.prototype.handlePushChannelMsg=function(t){var i=t.body;if(0===i.channel_type){this.Nn.actionListener("_experimentalAPICallback",{method:"onRecvRoomChannelMessage",content:{roomID:this.Cn.roomID,sendIDName:i.sender_idname,sendNickName:i.sender_nickname,msgType:i.msg_type,msgContent:i.msg_content}})}},t.prototype.handlePushCustomMsg=function(t){var i=JSON.parse(t.body.custommsg),e=[i.from_userid,i.from_username,i.room_id,i.custom_content];this.Nn.actionListener("IMRecvCustomCommand",e[2],{userID:e[0],userName:e[1]},e[3])},t.prototype.sendRoomChannelMessage=function(t,i,e,n,s,r){var o=this;if(!this.Cn.isLogin())return this.In.error(Ey+" state error"),r(Cy),!1;return this.Un.sendRoomChannelMessage({channelType:t,msgType:i,msgContent:e,toUserIDList:n},this.Cn.roomID,(function(t){s({seq:t.header.seq,errorCode:0})}),(function(t){var i={code:0,msg:""};t.body?(i.code=t.body.err_code||0,i.msg=t.body.err_message||""):i=t,o.In.error(Ey+" err:"+JSON.stringify(i)),[2].includes(i.code)?i.code=Ry.code:[3].includes(i.code)?i.code=Dy.code:i=i.code==Iy.code?sw({},Ay):i.code==Ny.code?sw({},Ny):{code:Ly.code,msg:"liveroom error ".concat(i.code," ").concat(i.msg)},r(i)})),this.In.info(Ey+" call success"),!0},t.prototype.sendBigRoomMessage=function(t,i,e,n,s,r){var o=this;if(!this.Cn.isLogin())return this.In.error(Oy+" state error"),void(r&&r(Cy));var u=this.Up,a=this.qn,c=(new Date).getTime()+a,h=this._rtm.getSeq().toString();if(this.Mp[h]={success:s,error:r},0==u){this.sendBigRoomMessageInternal([{msg_category:t,msg_type:1,msg_content:n,bigmsg_client_id:h}],(function(t){o.handleBigImMsgRsp(t)}),(function(t){r&&r(t)}))}else{var f=Math.floor(c/u);if(this.xp<f&&0==this.jp.length)this.xp=f,this.sendBigRoomMessageInternal([{msg_category:t,msg_type:1,msg_content:n,bigmsg_client_id:h}],(function(t){o.handleBigImMsgRsp(t)}),(function(t){r&&r(t)}));else this.jp.push({msg_category:t,msg_type:1,msg_content:n,bigmsg_client_id:h}),1==this.jp.length&&this.setBigImTimer(a,u)}},t.prototype.sendBigRoomMessageInternal=function(t,i,e){this.Un.sendBigRoomMessage({msgs:t},(function(t){i(t)}),(function(t){var i,n=Ly;t.header&&t.body?3===(null===(i=t.body)||void 0===i?void 0:i.err_code)&&(n=Dy):(t.code&&t.msg&&(n=t),e(n)),e(n)}),this.Cn),this.In.info(Oy+" sendBigRoomMessage called")},t.prototype.handleBigImMsgRsp=function(t){this.Up=t.body.bigim_time_window;for(var i=t.body.msg_list||t.body.msgs,e=0;e<i.length;e++){var n=i[e].msg_client_id||i[e].bigmsg_client_id;if(this.Mp[n]){var s=this.Mp[n].success;null!=s&&s({seq:t.header.seq,errorCode:0,messageID:i[e].msg_id||i[e].bigmsg_id}),delete this.Mp[n]}}},t.prototype.setBigImTimer=function(t,i){var e=this,n=(new Date).getTime()+t,s=i-n%i,r=function(t){e.Lp=setTimeout((function(){e.onBigImTimer()}),t)};(function(t){return rw(this,void 0,void 0,(function(){var i;return ow(this,(function(e){switch(e.label){case 0:return[4,gi()];case 1:return i=e.sent(),[2,parseInt(i*(t+1)+"",10)]}}))}))})(i).then((function(t){r(t+s)})).catch((function(t){r(.5*i+s)}))},t.prototype.onBigImTimer=function(){var t=this,i=(new Date).getTime()+this.qn;this.xp=Math.floor(i/this.Up);for(var e=[],n=[],s=0;s<this.jp.length&&!(s>=20);s++){var r=this.jp[s];e.push({msg_category:r.msg_category,msg_type:r.msg_type,msg_content:r.msg_content,bigmsg_client_id:r.bigmsg_client_id}),n.push(r.bigmsg_client_id)}this.jp.length>20?this.jp.splice(0,20):this.jp=[],this.sendBigRoomMessageInternal(e,(function(i){t.handleBigImMsgRsp(i)}),(function(i,e){for(var s=0;s<n.length;s++){var r=n[s],o=t.Mp[r];o&&(null!=o.error&&o.error(i,e),delete t.Mp[r])}})),this.Lp&&clearTimeout(this.Lp),this.Lp=null,this.jp.length>0&&this.setBigImTimer(this.qn,this.Up)},t.prototype.handlePushMergeMsg=function(t){for(var i=t.body.message_list||t.body.messages,e=0;e<i.length;e++)14001===i[e].sub_cmd&&this.handlePushBigRooMsg(i[e].msg_body)},t.prototype.handlePushBigRooMsg=function(t){var i;if(qt(t))try{i=JSON.parse(t)}catch(t){return void this.In.warn(Ty+"parse json error")}else i=t;if(i){for(var e=i.room_id||this.Cn.roomID,n=[],s=i.msg_list||i.msg_data,r=0;r<s.length;r++){var o=s[r];o.id_name!=this.Nn.idName?n.push({idName:o.id_name,nickName:o.nick_name,messageId:o.msg_id||o.bigmsg_id,category:o.msg_category,type:o.msg_type,content:o.msg_content,time:o.send_time||jt.isLong(o.msg_timestamp)&&o.msg_timestamp.toNumber()}):this.In.info(Ty+" self message")}0==n.length?this.In.info(Ty+" no other pushData except self"):this.onRecvBigRoomMessage(n,e),this.In.info(Ty+"call success")}else this.In.warn(Ty+" cann't find message body")},t.prototype.onRecvBigRoomMessage=function(t,i){var e=[];t.forEach((function(t){e.push({fromUser:{userID:t.idName,userName:t.nickName},message:t.content,sendTime:t.time,messageID:t.messageId})})),this.Nn.actionListener("IMRecvBarrageMessage",i,e),this.Nn.actionListener("_recvBigRoomMessage",t,i)},t.prototype.resetMessageInfo=function(){this.Jp={},this.qp&&(clearTimeout(this.qp),this.qp=null),this.xp=0,this.jp=[],this.Mp={},this.Lp&&(clearTimeout(this.Lp),this.Lp=null),this.qn=0,this.Up=0},t}();function aw(t,i,e,n){var s=this;return void 0===e&&(e=1),void 0===n&&(n=1),new Promise((function(r,o){var u=s.getMsgSpan(Yy.event,t,!0),a=s.stateCenter.proxyRes(u,(function(t){u.setAttributes({msg_id:Yy.msg_id(t.messageID)}),r(t)}),(function(t){3===t.errorCode&&(t.errorCode=My.code),o(t)})),c=a.interResolve,h=a.interReject;if(!qt(t))return s.logger.error(vy+" roomid must be string"),void h(Yy.error.INPUT_PARAM," param roomID error");if(!qt(i))return s.logger.error(vy+" message must be string"),void h(Yy.error.INPUT_PARAM," param message error");if(0===i.length)return s.logger.error(vy+" message is empty"),void h(Yy.error.IM_MESSAGE_NULL);if(Jc(i)>nw)return s.logger.error(vy+" message is too long"),void h(Yy.error.IM_MESSAGE_TOO_LONG);var f=s.getRoomModules(t);if(u.setAttributes({msg_content:i}),!f)return s.logger.error(vy+" room not exist, roomID: "+t),void h(s.isDisConnect()?Yy.error.ROOM_NOT_EXIST:Yy.error.INCONSISTENT_ROOM_ID);f.messageHandler.sendRoomMsg(e,n,t,i,(function(t){t.messageID&&u.setAttributes({msg_id:t.messageID}),c(t)}),h)}))}function cw(t,i,e){var n=this;return new Promise((function(s,r){var o=n.getMsgSpan(Fy.event,t,!0),u=n.stateCenter.proxyRes(o,s,(function(t){3===t.errorCode&&(t.errorCode=Dy.code),r(t)})),a=u.interResolve,c=u.interReject;if(!qt(t))return n.logger.error(dy+" roomID must be string"),void c(Fy.error.INCONSISTENT_ROOM_ID," roomID must be string");if(!Gt(e)||e.find((function(t){return!qt(t)})))return n.logger.error(dy+" toUserIDList must be string array"),void c(Fy.error.INPUT_PARAM," param toUserList error");if(!qt(i)&&!Jt(i))return n.logger.error(dy+" command must be a string or object"),void c(Fy.error.IM_CONTENT_NULL," command type error");var h=n.getRoomModules(t),f=qt(i)?i:JSON.stringify(i);return Jc(f)>nw?(n.logger.error(dy+" command too long"),void c(Fy.error.IM_CONTENT_TOO_LONG)):0===f.length?(n.logger.error(dy+" command empty"),void c(Fy.error.IM_CONTENT_NULL)):(o.setAttributes({msg_content:f}),h?void h.messageHandler.sendCustomCommand(e,i,a,c):(n.logger.error(dy+" room not exist, roomID: "+t),void c(n.isDisConnect()?Fy.error.ROOM_NOT_EXIST:Fy.error.INCONSISTENT_ROOM_ID)))}))}function hw(t,i,e,n){var s=this;return void 0===e&&(e=1),void 0===n&&(n=1),new Promise((function(r,o){var u=s.getMsgSpan(Gy.event,t),a=s.stateCenter.proxyRes(u,r,o),c=a.interResolve,h=a.interReject;if(!qt(t))return s.logger.error(py+" roomid must be string"),void h(Gy.error.ROOM_NOT_EXIST," param roomID error");if(!qt(i))return s.logger.error(py+" message must be string"),void h(Gy.error.IM_MESSAGE_NULL," message must be string");if(0===i.length)s.logger.error(py+" message is empty"),h(Gy.error.IM_MESSAGE_NULL);else if(Jc(i)>nw)return s.logger.error(py+" message is too long"),void h(s.stateCenter.isFlutter?Gy.error.IM_CONTENT_TOO_LONG:Gy.error.IM_MESSAGE_TOO_LONG);u.setAttributes({msg_content:i});var f=s.getRoomModules(t);if(!f)return s.logger.error(py+" room not exist, roomID: "+t),void h(s.isDisConnect()?Gy.error.ROOM_NOT_EXIST:Gy.error.INCONSISTENT_ROOM_ID);f.messageHandler.sendBigRoomMessage(e,n,t,i,c,h)}))}function fw(t,i,e){var n=this;return new Promise((function(s,r){var o=n.getMsgSpan(Zy.event,t),u=n.stateCenter.proxyRes(o,s,(function(t){1015===t.errorCode&&(t.errorCode=xy),r(t)})),a=u.interResolve,c=u.interReject;if(!qt(t))return n.logger.error(vy+" roomid must be string"),void c(Zy.error.ROOM_ROOMID_INCORRECT," roomID must be string");if(0===t.length)return n.logger.error(vy+" roomid is empty"),void c(Zy.error.ROOM_ROOMID_INCORRECT," roomid is empty");if(!qt(i))return n.logger.error(my+" key must be string"),void c(Zy.error.KEY_EMPTY," key must be string");if(0===i.length)return n.logger.error(my+" key is empty"),void c(Zy.error.KEY_EMPTY);if(i.length>128)return n.logger.error(my+" key is too long"),void c(Zy.error.KEY_TOO_LONG);if(!qt(e))return n.logger.error(my+" value must be string"),void c(Zy.error.INPUT_PARAM," value must be string");if(e.length>4096)return n.logger.error(my+" value is too long"),void c(Zy.error.VALUE_TOOL_LONG);o.setAttributes({key:Zy.key(i),value:Zy.value(e)});var h=n.getRoomModules(t);if(!h)return n.logger.error(my+" room not exist, roomID: "+t),void c(Zy.error.ROOM_ROOMID_INCORRECT);h.messageHandler.sendReliableMessage(i,e,a,c)}))}var lw={_sendBroadcastMessage:aw,sendBroadcastMessage:function(t,i){var e=this;return new Promise((function(n,s){aw.call(e,t,i).then((function(t){n({errorCode:t.errorCode,messageID:t.messageID,extendedData:t.extendedData})})).catch((function(t){s(t)}))}))},_sendCustomCommand:cw,sendCustomCommand:function(t,i,e){var n=this;return new Promise((function(s,r){cw.call(n,t,i,e).then((function(t){s({errorCode:t.errorCode,extendedData:t.extendedData})})).catch((function(t){r(t)}))}))},_sendBarrageMessage:hw,sendBarrageMessage:function(t,i){var e=this;return new Promise((function(n,s){hw.call(e,t,i).then((function(t){n({errorCode:t.errorCode,messageID:t.messageID,extendedData:t.extendedData})})).catch((function(t){s(t)}))}))},_setRoomExtraInfo:fw,setRoomExtraInfo:function(t,i,e){return fw.call(this,t,i,e)},sendRoomChannelMessage:function(t,i,e,n,s){var r=this;return new Promise((function(o,u){var a=function(t,i){void 0===i&&(i=""),i&&r.logger.error(gy+i),u({errorCode:t.code,extendedData:t.msg+i})};if(0===i)if(qt(t))if(ai(e))if(Gt(s)&&!s.find((function(t){return!qt(t)})))if(qt(n))if(Jc(n)>nw)a(Dy," msgContent too long");else if(0!==n.length){var c=r.getRoomModules(t);if(!c)return r.logger.error(gy+" room not exist, roomID: "+t),void a(r.isDisConnect()?Fy.error.ROOM_NOT_EXIST:Fy.error.INCONSISTENT_ROOM_ID);c.messageHandler.sendRoomChannelMessage(i,e,n,s,(function(){o({errorCode:0,extendedData:""})}),a)}else a(Ry," msgContent empty");else a(Ry," msgContent must be a string");else a(Ry," toUserIDList must be string array");else a(Ry," msgType must be integer number");else a(Ry," roomID must be string");else a(jy)}))}};var dw={handlePushRoomMsg:function(t){var i=this.handlePushMsg(t);i[0].messageHandler.handlePushRoomMsg(i[1])},handlePushCustomMsg:function(t){var i=this.handlePushMsg(t);i[0].messageHandler.handlePushCustomMsg(i[1])},handlePushMergeMsg:function(t){var i,e=null===(i=null==t?void 0:t.header)||void 0===i?void 0:i.room_id,n=this.rtm.getRoomModules(e);n?n.messageHandler.handlePushMergeMsg(t):this.logger.error(ky+" room no found ignore "+JSON.stringify(t))},handlePushTransMsg:function(t){var i,e,n,s=this.handlePushMsg(t),r=s[0],o=s[1],u=null===(i=null==t?void 0:t.header)||void 0===i?void 0:i.room_id,a=this.rtm.getMsgSpan(Ky,u);a.setAttributes({trans_type:$y(null===(e=null==t?void 0:t.body)||void 0===e?void 0:e.trans_type),trans_seq:tw(null===(n=null==t?void 0:t.body)||void 0===n?void 0:n.trans_seq)}),a.end(),r.messageHandler.handlePushTransMsg(o)},handlePushUserTransMsg:function(t){var i=this.handlePushMsg(t);i[0].messageHandler.handlePushUserTransMsg(i[1])},handleBigImMsgRsp:function(t){var i,e=null===(i=null==t?void 0:t.header)||void 0===i?void 0:i.room_id,n=this.rtm.getRoomModules(e);n?n.messageHandler.handleBigImMsgRsp(t):this.logger.error(ky+" room no found ignore "+JSON.stringify(t))},handlePushMsg:function(t){var i,e=null===(i=null==t?void 0:t.header)||void 0===i?void 0:i.room_id,n=this.rtm.getRoomModules(e);if(n)return[n,t];this.logger.error(ky+" room no found ignore "+JSON.stringify(t))},handlePushChannelMsg:function(t){var i=this.handlePushMsg(t);i[0].messageHandler.handlePushChannelMsg(i[1])}};var vw={initMessageHandler:function(){this.messageHandler=new uw(this.logger,this.stateCenter,this.dataReport,this.liveRoomHandler,this.rtm,this)}},mw={type:"Message",install:function(t,i,e){for(var n in lw)Object.defineProperty(t.prototype,n,{value:lw[n],writable:!1});for(var n in dw)Object.defineProperty(e.prototype,n,{value:dw[n],writable:!1});for(var n in vw)Object.defineProperty(i.prototype,n,{value:vw[n],writable:!1})}},pw=function(t,i,e,n){return new(e||(e=Promise))((function(s,r){function o(t){try{a(n.next(t))}catch(t){r(t)}}function u(t){try{a(n.throw(t))}catch(t){r(t)}}function a(t){var i;t.done?s(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,u)}a((n=n.apply(t,i||[])).next())}))},gw=function(t,i){var e,n,s,r,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function u(u){return function(a){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;r&&(r=0,u[0]&&(o=0)),o;)try{if(e=1,n&&(s=2&u[0]?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[2&u[0],s.value]),u[0]){case 0:case 1:s=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!s||u[1]>s[0]&&u[1]<s[3])){o.label=u[1];break}if(6===u[0]&&o.label<s[1]){o.label=s[1],s=u;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(u);break}s[2]&&o.ops.pop(),o.trys.pop();continue}u=i.call(t,o)}catch(t){u=[6,t],n=0}finally{e=s=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}},bw=function(){function t(t,i){this.zegoWebRTC=t,this.roomID=i,this.pubDataChannelList=[],this.subDataChannelList=[],this.listenerList={receiveRealTimeSequentialData:[]},this.In=t.logger}return t.prototype.startBroadcasting=function(t,i){return pw(this,void 0,void 0,(function(){var i,e,n,s,r,o;return gw(this,(function(u){switch(u.label){case 0:if(ti(this.In,i="dc.sb.0"),this.pubDataChannelList.includes(t))return this.In.error(i+" datachannel already exist"),[2,!1];if((e=this.zegoWebRTC.streamCenter.publisherList[t])&&e.publisher.dataChannel)return this.pubDataChannelList.push(t),[2,!0];if(e&&!e.publisher.dataChannel)return this.In.error(i+" publish datachannel no exist, try other stream ID"),[2,!1];if(this.broadcastStream)return[3,2];n=Wt.createElement("canvas"),s=void 0;try{s=n.captureStream()}catch(t){return this.In.error(i+" publish datachannel, canvas captureStream error"),[2,!1]}return r=this,[4,this.zegoWebRTC.createStream({custom:{source:s}})];case 1:r.broadcastStream=u.sent(),u.label=2;case 2:return(o=this.zegoWebRTC.startPublishingStream(t,this.broadcastStream,{roomID:this.roomID},!0))&&this.pubDataChannelList.push(t),ii(this.In,i),[2,o]}}))}))},t.prototype.stopBroadcasting=function(t){var i="dc.sb.1";ti(this.In,i),this.pubDataChannelList=this.pubDataChannelList.filter((function(i){return i!==t}));var e=this.zegoWebRTC.streamCenter.publisherList[t];return e?(e.room.roomID==this.roomID&&e.isDataChannel&&this.zegoWebRTC.stopPublishingStream(t),ii(this.In,i),!0):(this.In.error(i+" datachannel no found"),!1)},t.prototype.sendRealTimeSequentialData=function(t,i){if(!(i instanceof ArrayBuffer))return this.In.error("dc.srsd data type wrong"),!1;var e=this.zegoWebRTC.streamCenter.publisherList[t];return e&&this.pubDataChannelList.includes(t)?this.sendBCMessage(e.publisher,i):(this.In.error("dc.srsd datachannel no found"),!1)},t.prototype.sendBCMessage=function(t,i){var e;if(!t.dataChannelState)return!1;for(var n=new Uint8Array(i),s=0,r=i.byteLength,o=t.send_seq,u=0,a=(new Date).getTime(),c=0;r>0;){r>1151?c=1141:(c=r,u=1);var h=new Uint8Array(c+10);h[0]=1,h[1]=u,h[2]=t.send_seq>>8&255,h[3]=255&t.send_seq,h[4]=o>>8&255,h[5]=255&o,h[6]=a>>24&255,h[7]=a>>16&255,h[8]=a>>8&255,h[9]=255&a;for(var f=0;f<c;f++)h[f+10]=n[f+s];r-=c,s+=c,t.send_seq++,t.send_seq>=65536&&(t.send_seq=0),null===(e=t.dataChannel)||void 0===e||e.send(h)}return!0},t.prototype.startSubscribing=function(t,i){var e,n;return pw(this,void 0,void 0,(function(){var i,s,r;return gw(this,(function(o){switch(o.label){case 0:return ti(this.In,i="dc.ss.0"),this.subDataChannelList.includes(t)?(this.In.error(i+" datachannel already exist"),[2,!1]):(s=this.zegoWebRTC.streamCenter.playerList[t])?[3,2]:[4,this.zegoWebRTC.startPlayingStream(t,void 0,!0)];case 1:o.sent(),s=this.zegoWebRTC.streamCenter.playerList[t],o.label=2;case 2:return(r=s).dataChannel?(!(null===(e=r.onDataChannelList)||void 0===e?void 0:e.includes(this.onReceivedDataChannel.bind(this)))&&(null===(n=r.onDataChannelList)||void 0===n||n.push(this.onReceivedDataChannel.bind(this))),this.subDataChannelList.push(t),ii(this.In,i),[2,!0]):(this.In.error(i+" datachannel no exist, try other stream ID"),[2,!1])}}))}))},t.prototype.stopSubscribing=function(t){var i="dc.ss.1";ti(this.In,i),this.subDataChannelList=this.subDataChannelList.filter((function(i){return i!==t}));var e=this.zegoWebRTC.streamCenter.playerList[t];return e?(e.room.roomID==this.roomID&&e.isDataChannel&&this.zegoWebRTC.stopPlayingStream(t),ii(this.In,i),!0):(this.In.error(i+" datachannel no subscribe"),!1)},t.prototype.on=function(t,i){this.bindListener(t,i)},t.prototype.off=function(t,i){this.deleteListener(t,i)},t.prototype.bindListener=function(t,i){return this.listenerList[t]?Ht(i)?(-1==this.listenerList[t].indexOf(i)&&this.listenerList[t].push(i),!0):(this.In.error("zc.o.0 listener callBack must be funciton"),!1):(this.In.error("dc.o.0 event "+t+" no found"),!1)},t.prototype.deleteListener=function(t,i){if(!this.listenerList[t])return this.In.error("dc.o.1 listener no found"),!1;var e=this.listenerList[t];return i?e.splice(e.indexOf(i),1):this.listenerList[t]=[],!0},t.prototype.actionListener=function(t){for(var i=this,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.listenerList[t]&&this.listenerList[t].forEach((function(n){try{setTimeout((function(){n.apply(void 0,e)}),0)}catch(e){i.In.error("dc.al "+t+" "+e)}}))},t.prototype.onReceivedDataChannel=function(t,i,e){this.actionListener("receiveRealTimeSequentialData",t,i,e)},t.prototype.reset=function(){var t=this,i="dc.rs";for(var e in ti(this.In,i),this.pubDataChannelList.forEach((function(i){var e=t.zegoWebRTC.streamCenter.publisherList[i];e&&e.room.roomID==t.roomID&&e.isDataChannel&&t.zegoWebRTC.stopPublishingStream(i)})),this.subDataChannelList.forEach((function(i){var e=t.zegoWebRTC.streamCenter.playerList[i];e&&e.room.roomID==t.roomID&&e.isDataChannel&&t.zegoWebRTC.stopPlayingStream(i)})),this.listenerList)this.listenerList[e]=[];this.broadcastStream&&this.zegoWebRTC.destroyStream(this.broadcastStream),this.broadcastStream=void 0,ii(this.In,i)},t}(),_w=function(){function t(t,i){this._roomID=i,this.Zp=new bw(t,i)}return t.prototype.reset=function(){this.Zp.reset()},Object.defineProperty(t.prototype,"roomID",{get:function(){return this._roomID},enumerable:!1,configurable:!0}),t.prototype.startBroadcasting=function(t){return this.Zp.startBroadcasting(t)},t.prototype.stopBroadcasting=function(t){return this.Zp.stopBroadcasting(t)},t.prototype.sendRealTimeSequentialData=function(t,i){return this.Zp.sendRealTimeSequentialData(t,i)},t.prototype.startSubscribing=function(t){return this.Zp.startSubscribing(t)},t.prototype.stopSubscribing=function(t){return this.Zp.stopSubscribing(t)},t.prototype.on=function(t,i){this.Zp.on(t,i)},t.prototype.off=function(t,i){this.Zp.off(t,i)},t}(),yw={type:"DataChannel",install:function(t){Object.defineProperty(t.prototype,"createRealTimeSequentialDataManager",{value:function(t){this.logger.info("dc.cr room call"),this.enableDataChannel(!0);var i=this.stateCenter.getRoomByRoomID(t);return i?i.dataChannelManager?null:(i.dataChannelManager=new _w(this,t),i.dataChannelManager):(this.logger.error("dc.cr room ".concat(t," no exist")),null)},writable:!1}),Object.defineProperty(t.prototype,"destroyRealTimeSequentialDataManager",{value:function(t){this.logger.info("dc.ds call");var i=this.stateCenter.roomList.find((function(i){return i.dataChannelManager==t}));i?(t.reset(),i.dataChannelManager=null):this.logger.error("dc.ds not match, room: ".concat(t.roomID))},writable:!1})}},ww=function(){var t=function(i,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])},t(i,e)};return function(i,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}();ly.use(mw),ly.use(yw);var Sw=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return ww(i,t),i}(ly)}(),u}()}));